| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
| |
Patch by Artem Dergachev!
Differential Revision: http://reviews.llvm.org/D12725
llvm-svn: 248021
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D12916
llvm-svn: 248002
|
|
|
|
|
|
|
|
| |
specialized object, track it properly.
Differential Revision: http://reviews.llvm.org/D12889
llvm-svn: 247861
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The analyzer trims unnecessary nodes from the exploded graph before reporting
path diagnostics. However, in some cases it can trim all nodes (including the
error node), leading to an assertion failure (see
https://llvm.org/bugs/show_bug.cgi?id=24184).
This commit addresses the issue by adding two new APIs to CheckerContext to
explicitly create error nodes. Unless the client provides a custom tag, these
APIs tag the node with the checker's tag -- preventing it from being trimmed.
The generateErrorNode() method creates a sink error node, while
generateNonFatalErrorNode() creates an error node for a path that should
continue being explored.
The intent is that one of these two methods should be used whenever a checker
creates an error node.
This commit updates the checkers to use these APIs. These APIs
(unlike addTransition() and generateSink()) do not take an explicit Pred node.
This is because there are not any error nodes in the checkers that were created
with an explicit different than the default (the CheckerContext's Pred node).
It also changes generateSink() to require state and pred nodes (previously
these were optional) to reduce confusion.
Additionally, there were several cases where checkers did check whether a
generated node could be null; we now explicitly check for null in these places.
This commit also includes a test case written by Ying Yi as part of
http://reviews.llvm.org/D12163 (that patch originally addressed this issue but
was reverted because it introduced false positive regressions).
Differential Revision: http://reviews.llvm.org/D12780
llvm-svn: 247859
|
|
|
|
| |
llvm-svn: 247693
|
|
|
|
|
|
|
|
| |
r247657 fixed warnings about unused variables when compiling without asserts
but changed behavior. This commit restores the old behavior but still suppresses
the warnings.
llvm-svn: 247660
|
|
|
|
| |
llvm-svn: 247657
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In Objective-C, method calls with nil receivers are essentially no-ops. They
do not fault (although the returned value may be garbage depending on the
declared return type and architecture). Programmers are aware of this
behavior and will complain about a false alarm when the analyzer
diagnoses API violations for method calls when the receiver is known to
be nil.
Rather than require each individual checker to be aware of this behavior
and suppress a warning when the receiver is nil, this commit
changes ExprEngineObjC so that VisitObjCMessage skips calling checker
pre/post handlers when the receiver is definitely nil. Instead, it adds a
new event, ObjCMessageNil, that is only called in that case.
The CallAndMessageChecker explicitly cares about this case, so I've changed it
to add a callback for ObjCMessageNil and moved the logic in PreObjCMessage
that handles nil receivers to the new callback.
rdar://problem/18092611
Differential Revision: http://reviews.llvm.org/D12123
llvm-svn: 247653
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D12848
llvm-svn: 247612
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D12818
llvm-svn: 247598
|
|
|
|
| |
llvm-svn: 247595
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D12852
llvm-svn: 247590
|
|
|
|
| |
llvm-svn: 247533
|
|
|
|
|
|
|
|
| |
Propagation checker.
Differential Revision: http://reviews.llvm.org/D12381
llvm-svn: 247532
|
|
|
|
| |
llvm-svn: 247476
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
considers as large
Add an option (-analyzer-config min-blocks-for-inline-large=14) to control the function
size the inliner considers as large, in relation to "max-times-inline-large". The option
defaults to the original hard coded behaviour, which I believe should be adjustable with
the other inlining settings.
The analyzer-config test has been modified so that the analyzer will reach the
getMinBlocksForInlineLarge() method and store the result in the ConfigTable, to ensure it
is dumped by the debug checker.
A patch by Sean Eveson!
Differential Revision: http://reviews.llvm.org/D12406
llvm-svn: 247463
|
|
|
|
| |
llvm-svn: 247444
|
|
|
|
|
|
|
|
| |
regions.
Differential Revision: http://reviews.llvm.org/D12767
llvm-svn: 247430
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D12652
llvm-svn: 247426
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D12619
llvm-svn: 247423
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D12701
llvm-svn: 247071
|
|
|
|
| |
llvm-svn: 246978
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D12445
llvm-svn: 246818
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch depends on r246688 (D12341).
The goal is to make LLVM generate different code for these functions for a target that
has cheap branches (see PR23827 for more details):
int foo();
int normal(int x, int y, int z) {
if (x != 0 && y != 0) return foo();
return 1;
}
int crazy(int x, int y) {
if (__builtin_unpredictable(x != 0 && y != 0)) return foo();
return 1;
}
Differential Revision: http://reviews.llvm.org/D12458
llvm-svn: 246699
|
|
|
|
| |
llvm-svn: 246479
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
region.
Change the analyzer's modeling of memcpy to be more precise when copying into fixed-size
array fields. With this change, instead of invalidating the entire containing region the
analyzer now invalidates only offsets for the array itself when it can show that the
memcpy stays within the bounds of the array.
This addresses false positive memory leak warnings of the kind reported by
krzysztof in https://llvm.org/bugs/show_bug.cgi?id=22954
A patch by Pierre Gousseau!
Differential Revision: http://reviews.llvm.org/D11832
llvm-svn: 246345
|
|
|
|
|
|
|
|
| |
events.
Differential Revision: http://reviews.llvm.org/D11433
llvm-svn: 246182
|
|
|
|
|
|
| |
Differential Revision: http://reviews.llvm.org/D11468
llvm-svn: 246105
|
|
|
|
| |
llvm-svn: 246003
|
|
|
|
| |
llvm-svn: 245949
|
|
|
|
|
|
|
|
| |
Adds parsing/sema analysis/serialization/deserialization for array sections in OpenMP constructs (introduced in OpenMP 4.0).
Currently it is allowed to use array sections only in OpenMP clauses that accepts list of expressions.
Differential Revision: http://reviews.llvm.org/D10732
llvm-svn: 245937
|
|
|
|
|
|
|
|
| |
errors in Objective-C.
Differential Revision: http://reviews.llvm.org/D11427
llvm-svn: 245646
|
|
|
|
|
|
| |
delayed template parse of its body.
llvm-svn: 245616
|
|
|
|
| |
llvm-svn: 245145
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add checkers that detect code-level localizability issues for OS X / iOS:
- A path sensitive checker that warns about uses of non-localized
NSStrings passed to UI methods expecting localized strings.
- A syntax checker that warns against not including a comment in
NSLocalizedString macros.
A patch by Kulpreet Chilana!
(This is the second attempt with the compilation issue on Windows and
the random test failures resolved.)
llvm-svn: 245093
|
|
|
|
|
|
|
|
|
| |
in the CRTP base) my removing the user-declared dtor
The implicit dtor is just as good, and avoid suppressing implicit
copy/move ops.
llvm-svn: 244981
|
|
|
|
|
|
|
|
|
|
| |
(BugReporterVisitorImpl), make sure such copies are safe
Make the copy/move ctors defaulted in the base class and make the
derived classes final to avoid any intermediate hierarchy slicing if
these types were further derived.
llvm-svn: 244979
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
by value, so make sure they're copy/moveable
(return by value is in ExprEngine::processPointerEscapedOnBind and any
other call to the scanReachableSymbols function template used there)
Protect the special members in the base class to avoid slicing, and make
derived classes final so these special members don't accidentally become
public on an intermediate base which would open up the possibility of
slicing again.
llvm-svn: 244975
|
|
|
|
|
|
|
|
|
|
|
|
| |
by removing the unnecessary user-declared copy assignment operator
The user-defined copy assignment looks like it was working around the
presence of a reference member (that probably doesn't change in the copy
assignment cases present in the program). Rather than continuing this - just
change the reference to a pointer and let all the special members be
defined implicitly.
llvm-svn: 244974
|
|
|
|
|
|
| |
removing the unnecessary user declared dtor.
llvm-svn: 244973
|
|
|
|
|
|
|
|
|
|
| |
After r244870 flush() will only compare two null pointers and return,
doing nothing but wasting run time. The call is not required any more
as the stream and its SmallString are always in sync.
Thanks to David Blaikie for reviewing.
llvm-svn: 244928
|
|
|
|
|
|
|
|
| |
inner condition is always true.
Reviewed in http://reviews.llvm.org/D10892.
llvm-svn: 244435
|
|
|
|
|
|
|
|
| |
This reverts commit fc885033a30b6e30ccf82398ae7c30e646727b10.
Revert all localization checker commits until the proper fix is implemented.
llvm-svn: 244394
|
|
|
|
|
|
|
|
| |
This reverts commit 57a46a75b408245cf4154a838fe13ad702065745.
Revert all localization checker commits until the proper fix is implemented.
llvm-svn: 244393
|
|
|
|
| |
llvm-svn: 244390
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add checkers that detect code-level localizability issues for OS X / iOS:
- A path sensitive checker that warns about uses of non-localized
NSStrings passed to UI methods expecting localized strings.
- A syntax checker that warns against not including a comment in
NSLocalizedString macros.
A patch by Kulpreet Chilana!
llvm-svn: 244389
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The ObjCSuperCallChecker issues alarms for various Objective-C APIs that require
a subclass to call to its superclass's version of a method when overriding it.
So, for example, it raises an alarm when the -viewDidLoad method in a subclass
of UIViewController does not call [super viewDidLoad].
This patch fixes a false alarm where the analyzer erroneously required the
implementation of the superclass itself (e.g., UIViewController) to call
super.
rdar://problem/18416944
Differential Revision: http://reviews.llvm.org/D11842
llvm-svn: 244386
|
|
|
|
|
|
| |
to match the rest of their brethren and reformat the bits that need it.
llvm-svn: 244186
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In llvm commit r243581, a reverse range adapter was added which allows
us to change code such as
for (auto I = Fields.rbegin(), E = Fields.rend(); I != E; ++I) {
in to
for (const FieldDecl *I : llvm::reverse(Fields))
This commit changes a few of the places in clang which are eligible to use
this new adapter.
llvm-svn: 243663
|
|
|
|
|
|
|
|
|
| |
This lets us pass functors (and lambdas) without void * tricks. On the
downside we can't pass CXXRecordDecl's Find* members (which are now type
safe) to lookupInBases directly, but a lambda trampoline is a small
price to pay. No functionality change intended.
llvm-svn: 243217
|