| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Changes to the original patch:
- model the CFG for temporary destructors in conditional operators so that
the destructors of the true and false branch are always exclusive. This
is necessary because we must not have impossible paths for the path
based analysis to work.
- add multiple regression tests with ternary operators
Original description:
Fix modelling of non-lifetime-extended temporary destructors in the
analyzer.
Changes to the CFG:
When creating the CFG for temporary destructors, we create a structure
that mirrors the branch structure of the conditionally executed
temporary constructors in a full expression.
The branches we create use a CXXBindTemporaryExpr as terminator which
corresponds to the temporary constructor which must have been executed
to enter the destruction branch.
2. Changes to the Analyzer:
When we visit a CXXBindTemporaryExpr we mark the CXXBindTemporaryExpr as
executed in the state; when we reach a branch that contains the
corresponding CXXBindTemporaryExpr as terminator, we branch out
depending on whether the corresponding CXXBindTemporaryExpr was marked
as executed.
llvm-svn: 215096
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
analyzer."
This reverts commit r214962 because after the change the
following code doesn't compile with -Wreturn-type -Werror.
#include <cstdlib>
class NoReturn {
public:
~NoReturn() __attribute__((noreturn)) { exit(1); }
};
int check() {
true ? NoReturn() : NoReturn();
}
llvm-svn: 214998
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. Changes to the CFG:
When creating the CFG for temporary destructors, we create a structure
that mirrors the branch structure of the conditionally executed
temporary constructors in a full expression.
The branches we create use a CXXBindTemporaryExpr as terminator which
corresponds to the temporary constructor which must have been executed
to enter the destruction branch.
2. Changes to the Analyzer:
When we visit a CXXBindTemporaryExpr we mark the CXXBindTemporaryExpr as
executed in the state; when we reach a branch that contains the
corresponding CXXBindTemporaryExpr as terminator, we branch out
depending on whether the corresponding CXXBindTemporaryExpr was marked
as executed.
llvm-svn: 214962
|
|
|
|
| |
llvm-svn: 214796
|
|
|
|
| |
llvm-svn: 214795
|
|
|
|
|
|
|
| |
a mutex is acquired, but corresponding mutex is not provably not-held. This
is based on the earlier negative requirements patch.
llvm-svn: 214789
|
|
|
|
|
|
|
| |
capability expressions of the form !expr, and denote a capability that must
not be held.
llvm-svn: 214725
|
|
|
|
|
|
|
|
| |
MaterializeTemporaryExpr already contains information about the lifetime
of the temporary; if the lifetime is not the full statement, we do not
want to emit a destructor at the end of the full statement for it.
llvm-svn: 214292
|
|
|
|
|
|
|
|
| |
til::SExpr. This is a large patch, with many small changes to pretty printing
and expression lowering to make the new SExpr representation equivalent in
functionality to the old.
llvm-svn: 214089
|
|
|
|
| |
llvm-svn: 214064
|
|
|
|
|
|
|
|
|
|
| |
lambda expressions (other than their capture initializers) nor blocks. Do walk
into default argument expressions and default initializer expressions.
These bugs were causing us to produce broken CFGs whenever a lambda expression
was used to initialize a libstdc++ std::function object!
llvm-svn: 214050
|
|
|
|
|
|
| |
I checked this with Release+Asserts on x86_64-mingw32. Please restore partially if this were overkill.
llvm-svn: 213064
|
|
|
|
| |
llvm-svn: 212920
|
|
|
|
| |
llvm-svn: 212919
|
|
|
|
|
|
|
|
|
| |
Fixes a crash in Retain Count checker error reporting logic by handing
the allocation statement retrieval from a BlockEdge program point.
Also added a simple CFG dump routine for debugging.
llvm-svn: 210960
|
|
|
|
| |
llvm-svn: 210615
|
|
|
|
|
|
|
| |
will never be true in a well-defined context. The checking for null pointers
has been moved into the caller logic so it does not rely on undefined behavior.
llvm-svn: 210498
|
|
|
|
| |
llvm-svn: 209847
|
|
|
|
|
|
| |
local contexts. Also includes some minor refactoring.
llvm-svn: 209774
|
|
|
|
| |
llvm-svn: 209727
|
|
|
|
|
|
| |
be performed by using Decl::isInStdNamespace or DeclContext::isStdNamespace
llvm-svn: 209708
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change is a precondition to the proposed change to handle temporary
dtors correctly.
The idea is to explicitly search for the next return that doesn't have other
paths into it (that is, if the current block is dead, the block containing the
return must be dead, too). Thus, introducing non-control-flow block
transitions will not break the logic.
llvm-svn: 209531
|
|
|
|
|
|
|
|
|
|
|
| |
This catches issues like:
if ((x & 8) == 4) { ... }
if ((x | 4) != 3) { ... }
Patch by Anders Rönnholm!
llvm-svn: 209221
|
|
|
|
| |
llvm-svn: 209191
|
|
|
|
|
|
| |
This fills in a few missing gaps in functionality.
llvm-svn: 208830
|
|
|
|
|
|
| |
changes intended.
llvm-svn: 208810
|
|
|
|
| |
llvm-svn: 208800
|
|
|
|
|
|
| |
changes intended.
llvm-svn: 208783
|
|
|
|
| |
llvm-svn: 208774
|
|
|
|
|
|
| |
yet, and fixes a dead code warning.
llvm-svn: 208440
|
|
|
|
|
|
|
|
|
|
| |
is to allow requirements to be expressed not just in terms of lists, but in terms of logical expressions. Eg)
void foo(void) __attribute__((requires_capability((FlightControl || Worker) && !Logger)));
This is WIP code.
llvm-svn: 208439
|
|
|
|
|
|
|
|
|
|
|
| |
The thread safety analysis isn't very useful in ObjC (you can't annotate
ObjC classes or methods) but we can still analyze the actual code and
show violations in usage of C/C++ functions.
Fixes PR19541, which does not use thread safety attributes but crashes
with -Weverything.
llvm-svn: 208436
|
|
|
|
|
|
|
| |
This makes the consumed analysis less dependent on the CFG layout and fixes
a bug where we wouldn't warn on an unconsumed value.
llvm-svn: 208300
|
|
|
|
|
|
|
|
| |
The assignment needs to be before the destruction of the temporary.
This patch calls out to addStmt, which invokes VisitDeclStmt, which has
all the correct logic for handling temporaries.
llvm-svn: 207985
|
|
|
|
| |
llvm-svn: 207870
|
|
|
|
| |
llvm-svn: 207854
|
|
|
|
|
|
| |
range accessor in addition to the iterators. Updated code using iterators to use range-based for loops.
llvm-svn: 207837
|
|
|
|
|
|
| |
No functional changes intended.
llvm-svn: 207836
|
|
|
|
| |
llvm-svn: 207573
|
|
|
|
| |
llvm-svn: 207422
|
|
|
|
| |
llvm-svn: 207416
|
|
|
|
| |
llvm-svn: 206986
|
|
|
|
|
|
| |
static since this function is file-local. No functional changes intended.
llvm-svn: 206982
|
|
|
|
| |
llvm-svn: 206907
|
|
|
|
| |
llvm-svn: 206899
|
|
|
|
|
|
|
|
|
|
| |
definition below all of the header #include lines, clang edition.
If you want more details about this, you can see some of the commits to
Debug.h in LLVM recently. This is just the clang section of a cleanup
I've done for all uses of DEBUG_TYPE in LLVM.
llvm-svn: 206849
|
|
|
|
|
|
| |
function parameters, and compound assignment.
llvm-svn: 206827
|
|
|
|
| |
llvm-svn: 206681
|
|
|
|
| |
llvm-svn: 206676
|
|
|
|
|
|
| |
changes.
llvm-svn: 206590
|