-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nonblocking/nonallocating attributes: 2nd pass caller/callee analysis #99656
Merged
Merged
Changes from 1 commit
Commits
Show all changes
71 commits
Select commit
Hold shift + click to select a range
8c5f854
nonblocking/nonallocating attributes: 2nd pass caller/callee analysis…
95b7a00
- Sema.h: Move function decls to be in the correct per-source-file se…
21c780a
clang-format
ff10413
- Detect ObjC @throw and @catch, diagnose identically to their C++ co…
d472964
FunctionEffect constructors: cast Kind to uint8_t
f1142db
New file: EFfectAnalysis.cpp.
efe1b93
CallableInfo doesn't need to cache the name.
d4f8dd5
Merge branch 'main' into nonblocking-part2
7ffdbef
Simpler bitmap implementation of FunctionEffectKindSet
c39e28e
- function does not permit inference of '%0': include the name of the…
dec1a61
Merge remote-tracking branch 'llvm-origin/main' into nonblocking-part2
06ca4c5
Add tests around lambda traversal and contexts like decltype, sizeof,…
9e45e6f
Inline checks preceding maybeAddDeclWithEffects
b99f784
Remove dead code in EffectAnalysis.cpp. Add comment about AST travers…
dbdd8f8
Merge remote-tracking branch 'llvm-origin/main' into nonblocking-part2
1b9874f
patch what the bot's clang-format wishes clang-format on my system wo…
b8818a3
Merge branch 'main' into nonblocking-part2
8390e69
"function cannot be inferred" -> "declaration cannot be inferred"
7acda8c
No need to override VisitCXXDefaultInitExpr.
bffacc5
Begin a list of unsafe builtin functions, starting with malloc and fr…
c718b5a
Apply suggestions from code review
dougsonos 8b225f4
- FunctionEffect and FunctionEffectKindSet are tiny, pass by value wh…
2cb4539
- Comments begin with capital letters and end with full stops.
0e07315
Implement FunctionEffectKindSet with std::bitset.
47dfce8
Merge remote-tracking branch 'llvm-origin/main' into nonblocking-part2
fddd9d2
- Diagnose __builtin_operator_new and delete
eb536ab
EffectAnalysis.cpp => SemaFunctionEffects.cpp (minimal first step; mo…
15b399f
Move most Sema methods involving effects into SemaFunctionEffects.cpp.
dfebc1a
Move FunctionEffectDiff/Differences into SemaFunctionEffects.cpp.
82cb07d
Combine the diagnostics for 5 violations into one using %select{}
a7060ad
Merge branch 'main' into nonblocking-part2
f93ee01
Violation constructor: use optional instead of pointer.
6cc0a62
clang-format
69e1ae6
emitDiagnostics doesn't need to receive another S
076302e
VisitVarDecl can reuse followTypeDtor().
7b891c6
Add a test for a delegating initializer.
d1fcceb
Fix typo in comment for TraverseLambdaExpr.
abcf022
Fix test broken by rewording of diagnostics.
47ebf27
Diagnostics are now more specific about where a construct was found, …
6650c1f
Two fixes for default arguments:
250b80b
Type.cpp: remove asserts preceding llvm_unreachable().
e8bcd9f
Fix pre-C++20 compile error.
ea7f3fc
Review feedback: ViolationSite can use a PointerIntPair. Expand list …
d1a39e2
Fix: was traversing virtual base class destructors twice, exposed by …
75365ef
More builtin functions.
6aadec0
Apply suggestions from code review
dougsonos 9b123a6
Review feedback:
ba57bfb
Fix: Don't try to follow a deleted destructor. (Happens with a std::o…
54feb05
Fix test broken by rewording of warnings.
93cb74e
Fix: need to ignore concept requirements.
d583c85
clang-format
cda1a9c
Make the FunctionEffects and PerfConstraintImpliesNoexcept diagnostic…
9c971c6
Add a release note.
b23e942
Merge branch 'main' into nonblocking-part2
9bfbe12
Fix botched format string in warn_func_effect_calls_expr_without_effect
f06909b
Fix test failures introduced by last commit.
adcfd14
If a function is noexcept and noreturn, exempt it from effect analysis.
17320b8
Remove the new diagnostics from `-Wall`. Fix a couple of sentences in…
909d7ff
Apply suggestions from code review
dougsonos 9367103
Review feedback:
eb782e0
- Add constraint tests for plain C.
eccc7cf
-Wperf-constraint-implies-noexcept is part of -Wall again
220a1bf
Remove FunctionEffect::Kind::None as a sentinel; use optionals instead.
a8fef93
Ensure that setjmp() is not included in the special treatment of `nor…
092bc16
Update clang/lib/Sema/SemaFunctionEffects.cpp
dougsonos ca3f44a
Merge branch 'main' into nonblocking-part2
424a74b
Builtins with effects don't get the noexcept/noreturn special treatment.
273871a
warning-wall test was broken a few commits ago; fix it now.
a77d4e3
- FunctionEffect::Kind: no need to be specific with enum values. Same…
f8d9189
Tweak release note, fix typo in comment.
da725c1
Tweak: "function with 'nonblocking' attribute should be declared noex…
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 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 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 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 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 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would there be a value to an
EndList
sort of element, so you could use that to auto-generateKindCount
?Also, is there some meaning to the values of the enums besides just wanting the default behavior of enums?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I'll add and use
EndList
. Being explicit with enum values is an ancient habit from the days when debugging sometimes involved looking at memory in hex. I'd agree they're superfluous here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we get around that in a few places I think... perhaps you can find what we do in other enums? Not at a computer at the moment, else I'd help search.
EDIT TO ADD: It might be "EndList = LastEntry" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last
seems to be the most common name for that last value...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yes, we do use it quite a bit, you can also see the = , so just do that and use it kinda thing IMO.