| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
so that they visually look like an AST dump.
llvm-svn: 164401
|
| |
|
|
| |
llvm-svn: 164400
|
| |
|
|
| |
llvm-svn: 164399
|
| |
|
|
| |
llvm-svn: 164397
|
| |
|
|
| |
llvm-svn: 164396
|
| |
|
|
|
|
|
| |
where a call to function marked 'noreturn' is followed by unreachable
implicit destructor calls.
llvm-svn: 164394
|
| |
|
|
|
|
| |
them being correctly constructed.
llvm-svn: 164392
|
| |
|
|
| |
llvm-svn: 164391
|
| |
|
|
| |
llvm-svn: 164348
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
when
their implementations are unavailable. Start by simulating dispatch_sync().
This change is largely a bunch of plumbing around something very simple. We
use AnalysisDeclContext to conjure up a fake function body (using the
current ASTContext) when one does not exist. This is controlled
under the analyzer-config option "faux-bodies", which is off by default.
The plumbing in this patch is largely to pass the necessary machinery
around. CallEvent needs the AnalysisDeclContextManager to get
the function definition, as one may get conjured up lazily.
BugReporter and PathDiagnosticLocation needed to be relaxed to handle
invalid locations, as the conjured body has no real source locations.
We do some primitive recovery in diagnostic generation to generate
some reasonable locations (for arrows and events), but it can be
improved.
llvm-svn: 164339
|
| |
|
|
|
|
| |
as exclusive.
llvm-svn: 164332
|
| |
|
|
|
|
| |
lock expressions.
llvm-svn: 164324
|
| |
|
|
|
|
| |
is placed on a function that has no path to the exit block.
llvm-svn: 164244
|
| |
|
|
|
|
|
| |
LOCKS_EXCLUDED is used on a method with a name that is is not a simple
identifier.
llvm-svn: 164242
|
| |
|
|
| |
llvm-svn: 163775
|
| |
|
|
|
|
| |
<rdar://problem/12061922>
llvm-svn: 163772
|
| |
|
|
|
|
|
|
|
| |
These will warn under -Wformat-non-iso, and will still be rejected
outright on other platforms.
<rdar://problem/12061922>
llvm-svn: 163771
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Objective-C related to NSException.
Fixes <rdar://problem/12287498>
I debated whether or not this logic should be sunk into the CFG
itself. It's not clear if we should, as different analyses may
wish to have different policies. We can re-evaluate this in the
future.
llvm-svn: 163760
|
| |
|
|
|
|
|
|
|
|
| |
in NSException to a helper object in libAnalysis that can also
be used by Sema. Not sure if the predicate name 'isImplicitNoReturn'
is the best one, but we can massage that later.
No functionality change.
llvm-svn: 163759
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
for halting the propagation of uninitialized value tracking along
a path. Unlike __attribute__((noreturn)), this attribute (which
is used by clients of the static analyzer) can be used to annotate
functions that essentially never return, but in rare cares may be
allowed to return for (special) debugging purposes. This attribute
has been shown in reducing false positives in the static analyzer
by pruning false postives, and is equally applicable here.
Handling this attribute in the CFG itself is another option, but
this is not something all clients (e.g., possibly -Wunreachable-code)
would want to see.
Addresses <rdar://problem/12281583>.
llvm-svn: 163681
|
| |
|
|
| |
llvm-svn: 163656
|
| |
|
|
| |
llvm-svn: 163546
|
| |
|
|
|
|
|
|
|
| |
analysis that may give false positives because it is confused by aliasing, and
a less precise analysis that has fewer false positives, but may have false
negatives. The more precise warnings are enabled by -Wthread-safety-precise.
An additional note clarify the warnings in the precise case.
llvm-svn: 163537
|
| |
|
|
|
|
|
| |
As a corollary to the previous commit, even when an extension is
available, we can still offer a fixit to the standard modifier.
llvm-svn: 163453
|
| |
|
|
|
|
|
|
|
| |
This seems to be a GNU libc extension; we offer a fixit to %lld on
these platforms.
<rdar://problem/11518237>
llvm-svn: 163452
|
| |
|
|
| |
llvm-svn: 163410
|
| |
|
|
| |
llvm-svn: 163403
|
| |
|
|
|
|
| |
within part of a particular method.
llvm-svn: 163397
|
| |
|
|
| |
llvm-svn: 163325
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While destructors will continue to not be inlined (unless the analyzer
config option 'c++-inlining' is set to 'destructors'), leaving them out
of the CFG is an incomplete model of the behavior of an object, and
can cause false positive warnings (like PR13751, now working).
Destructors for temporaries are still not on by default, since
(a) we haven't actually checked this code to be sure it's fully correct
(in particular, we probably need to be very careful with regard to
lifetime-extension when a temporary is bound to a reference,
C++11 [class.temporary]p5), and
(b) ExprEngine doesn't actually do anything when it sees a temporary
destructor in the CFG -- not even invalidate the object region.
To enable temporary destructors, set the 'cfg-temporary-dtors' analyzer
config option to '1'. The old -cfg-add-implicit-dtors cc1 option, which
controlled all implicit destructors, has been removed.
llvm-svn: 163264
|
| |
|
|
|
|
| |
expression involving temporaries.
llvm-svn: 163237
|
| |
|
|
|
|
| |
latest definition of a function is always used when computing lock expressions.
llvm-svn: 163028
|
| |
|
|
|
|
| |
expressions, which should be ignored right now.
llvm-svn: 163026
|
| |
|
|
|
|
| |
Fixes <rdar://problem/11005770>.
llvm-svn: 162545
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A CXXDefaultArgExpr wraps an Expr owned by a ParmVarDecl belonging to the
called function. In general, ExprEngine and Environment ought to treat this
like a ParenExpr or other transparent wrapper expression, with the inside
expression evaluated first.
However, if we call the same function twice, we'd produce a CFG that contains
the same wrapped expression twice, and we're not set up to handle that. I've
added a FIXME to the CFG builder to come back to that, but meanwhile we can
at least handle expressions that don't need to be explicitly evaluated:
literals. This probably handles many common uses of default parameters:
true/false, null, etc.
Part of PR13385 / <rdar://problem/12156507>
llvm-svn: 162453
|
| |
|
|
| |
llvm-svn: 162412
|
| |
|
|
|
|
|
|
|
| |
Also rename 'getCurrentBlockCounter()' to 'blockCount()'.
This ripples a bunch of code simplifications; mostly aesthetic,
but makes the code a bit tighter.
llvm-svn: 162349
|
| |
|
|
| |
llvm-svn: 161822
|
| |
|
|
|
|
|
| |
expressions. The syntax &MyClass::mutex is interpreted as a
pattern that matches m->mutex for any object m of type MyClass.
llvm-svn: 161691
|
| |
|
|
|
|
| |
of expressions, and better error messages.
llvm-svn: 161690
|
| |
|
|
|
|
| |
to track locksets. This is in preparation for further changes.
llvm-svn: 161680
|
| |
|
|
| |
llvm-svn: 161660
|
| |
|
|
| |
llvm-svn: 161408
|
| |
|
|
|
|
|
|
| |
This is useful for example for %n in printf, which expects
a pointer to int with the same logic for checking as %d
would have in scanf.
llvm-svn: 161407
|
| |
|
|
|
|
| |
Also remove redundant constructors and unused member functions.
llvm-svn: 161403
|
| |
|
|
|
|
|
| |
Warn about using pointers to const-qualified types as arguments to
scanf. Ignore the volatile qualifier when checking if types match.
llvm-svn: 161052
|
| |
|
|
|
|
|
| |
This makes Clang check that the corresponding argument for "%n" in a
format string is a pointer to int.
llvm-svn: 160966
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Clang's -Wformat fix-its currently suggest using "%zu" for values of
type size_t (in C99 or C++11 mode). However, for a type such as
std::vector<T>::size_type, it does not notice that type is actually
typedeffed to size_t, and instead suggests a format for the underlying
type, such as "%lu" or "%u".
This commit makes the format string fix mechanism walk the typedef chain
so that it notices if the type is size_t, even if that isn't "at the
top".
llvm-svn: 160886
|
| |
|
|
| |
llvm-svn: 160851
|
| |
|
|
| |
llvm-svn: 160850
|