This repository was archived by the owner on Mar 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Upgrade to LLVM 13, 14, 15 + CI improvements #18
Open
jmarrec
wants to merge
16
commits into
trailofbits:master
Choose a base branch
from
jmarrec:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
43c09b3
`clang-tidy -p build --checks=-*,readability-braces-around-statements…
jmarrec bd2cbfb
clang format
jmarrec 41ace23
upgrade for clang 13 14 And 15
jmarrec 89a69b0
update clang format for ubuntu-latest (22.04 LTS currently)
jmarrec cf1ff37
don't fail fast on GHA
jmarrec f7d4f2a
Add a clang format and clang tidy file
jmarrec 1aea5b4
improve clang format job (upload patch when failed), upload exes as a…
jmarrec dcac89a
unused (I guess I added it before I deleted another unused one?)
jmarrec 3719210
Not sure which one of the two to pick
jmarrec d84e425
tweak ci names
jmarrec 6b6a598
Update main.cpp
jmarrec abd163c
Merge branch 'clin99-llvm13'
jmarrec 1f080f5
Add a test to CI: run the binary on main.cpp
jmarrec 0faa8a8
Avoid redefinition error on Ubuntu by linking to LLVM not independent…
jmarrec 00ab93e
bump actions/checkout
jmarrec b6429d8
Update main.cpp
woodruffw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| --- | ||
| Language: Cpp | ||
| AccessModifierOffset: -1 | ||
| AlignAfterOpenBracket: Align | ||
| AlignConsecutiveAssignments: false | ||
| AlignConsecutiveDeclarations: false | ||
| AlignEscapedNewlines: Left | ||
| AlignOperands: true | ||
| AlignTrailingComments: true | ||
| AllowAllParametersOfDeclarationOnNextLine: true | ||
| AllowShortBlocksOnASingleLine: false | ||
| AllowShortCaseLabelsOnASingleLine: false | ||
| AllowShortFunctionsOnASingleLine: Empty | ||
| AllowShortIfStatementsOnASingleLine: true | ||
| AllowShortLoopsOnASingleLine: false | ||
| AlwaysBreakAfterDefinitionReturnType: None | ||
| AlwaysBreakAfterReturnType: None | ||
| AlwaysBreakBeforeMultilineStrings: false | ||
| AlwaysBreakTemplateDeclarations: true | ||
| BinPackArguments: true | ||
| BinPackParameters: true | ||
| BraceWrapping: | ||
| AfterClass: true | ||
| AfterControlStatement: false | ||
| AfterEnum: true | ||
| AfterFunction: false | ||
| AfterNamespace: false | ||
| AfterObjCDeclaration: false | ||
| AfterStruct: true | ||
| AfterUnion: true | ||
| AfterExternBlock: true | ||
| BeforeCatch: false | ||
| BeforeElse: false | ||
| IndentBraces: false | ||
| SplitEmptyFunction: true | ||
| SplitEmptyRecord: true | ||
| SplitEmptyNamespace: true | ||
| BreakBeforeBinaryOperators: NonAssignment | ||
| BreakBeforeBraces: Custom | ||
| BreakBeforeInheritanceComma: true | ||
| BreakBeforeTernaryOperators: true | ||
| BreakConstructorInitializers: BeforeColon | ||
| BreakConstructorInitializersBeforeComma: false | ||
| BreakStringLiterals: true | ||
| ColumnLimit: 150 | ||
| CommentPragmas: '^ IWYU pragma:' | ||
| CompactNamespaces: false | ||
| ConstructorInitializerAllOnOneLineOrOnePerLine: true | ||
| ConstructorInitializerIndentWidth: 2 | ||
| ContinuationIndentWidth: 2 | ||
| Cpp11BracedListStyle: true | ||
| DerivePointerAlignment: false | ||
| DisableFormat: false | ||
| ExperimentalAutoDetectBinPacking: false | ||
| FixNamespaceComments: true | ||
| IncludeBlocks: Preserve | ||
| IndentCaseLabels: true | ||
| IndentWidth: 2 | ||
| IndentPPDirectives: AfterHash | ||
| IndentWrappedFunctionNames: true | ||
| NamespaceIndentation: None # Could consider Inner | ||
| PenaltyBreakAssignment: 2 | ||
| PenaltyBreakBeforeFirstCallParameter: 19 | ||
| PenaltyBreakComment: 300 | ||
| PenaltyBreakFirstLessLess: 120 | ||
| PenaltyBreakString: 1000 | ||
| PenaltyExcessCharacter: 1000000 | ||
| PenaltyReturnTypeOnItsOwnLine: 60 | ||
| PointerAlignment: Left | ||
| ReflowComments: false | ||
| SpaceAfterCStyleCast: false | ||
| # SpaceAfterLogicalNot: false # No longer available in clang-format 6.0 | ||
| SpaceAfterTemplateKeyword: true | ||
| SpaceBeforeAssignmentOperators: true | ||
| # SpaceBeforeCpp11BracedList: true # No longer available in clang-format 6.0 | ||
| # SpaceBeforeCtorInitializerColon: true # No longer available in clang-format 6.0 | ||
| # SpaceBeforeInheritanceColon: true # No longer available in clang-format 6.0 | ||
| SpaceBeforeParens: ControlStatements | ||
| # SpaceBeforeRangeBasedForLoopColon: true # No longer available in clang-format 6.0 | ||
| SpaceInEmptyParentheses: false | ||
| SpacesBeforeTrailingComments: 2 | ||
| SpacesInAngles: false | ||
| SpacesInContainerLiterals: true | ||
| SpacesInCStyleCastParentheses: false | ||
| SpacesInParentheses: false | ||
| SpacesInSquareBrackets: false | ||
| SortIncludes: false | ||
| SortUsingDeclarations: true | ||
| Standard: c++17 | ||
| TabWidth: 2 | ||
| UseTab: Never | ||
| --- | ||
| Language: JavaScript | ||
| BasedOnStyle: Mozilla | ||
| # Use 100 columns for JS. | ||
| ColumnLimit: 180 | ||
| JavaScriptQuotes: Single | ||
| SpacesInContainerLiterals: false | ||
| ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| --- | ||
|
|
||
| # magic numbers are useful to layout stuff in Qt... | ||
| # -readability-magic-numbers and its alias cppcoreguidelines-avoid-magic-numbers | ||
|
|
||
| # `protected`: followed by `protected slots:` would trigger it | ||
| # -readability-redundant-access-specifiers, | ||
|
|
||
| # Problem with OS_ASSERT macro | ||
| # -cppcoreguidelines-pro-bounds-array-to-pointer-decay, | ||
|
|
||
| # We use raw pointers for Qt, since usually the memory is then owned by the parent | ||
| # -cppcoreguidelines-owning-memory | ||
|
|
||
| # Because of Google Tests | ||
| # -cppcoreguidelines-avoid-non-const-global-variables | ||
|
|
||
| # I don't think this really helps clarify the intent | ||
| # -readability-else-after-return | ||
| # -modernize-concat-nested-namespaces | ||
|
|
||
| # Aliases | ||
| # - cppcoreguidelines-avoid-c-arrays => modernize-avoid-c-arrays | ||
| # - cppcoreguidelines-non-private-member-variables-in-classes => misc-non-private-member-variables-in-classes | ||
| # - cppcoreguidelines-explicit-virtual-functions, hicpp-use-override => modernize-use-override | ||
| # - bugprone-narrowing-conversions => cppcoreguidelines-narrowing-conversions | ||
|
|
||
| # Annoying: some config options exist only in later versions... | ||
| # cppcoreguidelines-narrowing-conversions.WarnOnEquivalentBitWidth was added in clang-tidy 13, and that would allow avoiding uint->int narrowing conversions | ||
| # Instead I have to disable the entire check... | ||
|
|
||
| Checks: | | ||
| *, | ||
| -fuchsia-*, | ||
| -google-*, | ||
| -zircon-*, | ||
| -abseil-*, | ||
| -llvm*, | ||
| -altera*, | ||
| -modernize-use-trailing-return-type, | ||
| -cppcoreguidelines-avoid-magic-numbers, | ||
| -readability-magic-numbers, | ||
| -cppcoreguidelines-pro-bounds-array-to-pointer-decay, | ||
| -cppcoreguidelines-owning-memory, | ||
| -cppcoreguidelines-pro-bounds-constant-array-index, | ||
| -readability-redundant-access-specifiers, | ||
| -cppcoreguidelines-explicit-virtual-functions, | ||
| -readability-else-after-return, | ||
| -modernize-concat-nested-namespaces, | ||
| -hicpp-*, | ||
| -hicpp-avoid-goto, | ||
| hicpp-exception-baseclass, | ||
| hicpp-multiway-paths-covered, | ||
| hicpp-no-assembler, | ||
| hicpp-signed-bitwise, | ||
| -cppcoreguidelines-avoid-c-arrays, | ||
| -cppcoreguidelines-non-private-member-variables-in-classes, | ||
| -bugprone-narrowing-conversions, | ||
| -cppcoreguidelines-narrowing-conversions, | ||
| -readability-function-cognitive-complexity, | ||
| -cppcoreguidelines-avoid-non-const-global-variables, | ||
| -modernize-use-override, | ||
| -readability-uppercase-literal-suffix, | ||
| -readability-identifier-length, | ||
| -bugprone-easily-swappable-parameters, | ||
| -modernize-use-nodiscard, | ||
| -cert-err58-cpp, | ||
|
|
||
| WarningsAsErrors: '*' | ||
| HeaderFilterRegex: '*' | ||
| FormatStyle: 'file' | ||
| UseColor: 'true' | ||
| CheckOptions: | ||
| - key: modernize-use-override.AllowOverrideAndFinal | ||
| value: 'true' | ||
| - key: modernize-use-override.IgnoreDestructors | ||
| value: 'true' | ||
| - key: performance-for-range-copy.WarnOnAllAutoCopies | ||
| value: 'true' | ||
| - key: cppcoreguidelines-narrowing-conversions.WarnOnEquivalentBitWidth | ||
| value: 'false' | ||
| - key: readability-implicit-bool-conversion.AllowPointerConditions | ||
| value: 'true' | ||
| - key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic | ||
| value: 'true' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| cmake_minimum_required(VERSION 3.8) | ||
| project(constexpr-everything CXX) | ||
| project(constexpr-everything CXX C) | ||
woodruffw marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| set(CMAKE_CXX_STANDARD 14) | ||
| set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
|
@@ -42,8 +42,8 @@ message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}") | |
| message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}") | ||
|
|
||
| if((${LLVM_PACKAGE_VERSION} VERSION_LESS "9.0.0") | ||
| OR (${LLVM_PACKAGE_VERSION} VERSION_GREATER_EQUAL "12")) | ||
| message(FATAL_ERROR "Only LLVM 9 through 11 are supported.") | ||
| OR (${LLVM_PACKAGE_VERSION} VERSION_GREATER_EQUAL "16")) | ||
| message(FATAL_ERROR "Only LLVM 9 through 15 are supported.") | ||
woodruffw marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| endif() | ||
|
|
||
| # The clang package doesn't appear to provide a version | ||
|
|
@@ -65,11 +65,4 @@ target_link_libraries(${PROJECT_NAME} ${LIBRARY_LIST}) | |
|
|
||
| target_link_libraries( | ||
| ${PROJECT_NAME} | ||
| LLVMTransformUtils | ||
| LLVMAnalysis | ||
| LLVMTarget | ||
| LLVMOption # Support | ||
| LLVMObject # BitReader, Core, Support | ||
| LLVMBitReader # Core, Support | ||
| LLVMCore # Support | ||
| LLVMSupport) | ||
| LLVM) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for trimming this -- IIRC we had to specify all of these manually for a much earlier version of LLVM. |
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.