diff options
| author | Pavel Labath <labath@google.com> | 2013-09-02 09:09:15 +0000 |
|---|---|---|
| committer | Pavel Labath <labath@google.com> | 2013-09-02 09:09:15 +0000 |
| commit | d527cf89e66af87e2fdf31fe51236b1375783f10 (patch) | |
| tree | daf3b9d5bd9c230f885d391ba87c5c0b27f676b5 /clang/lib/Analysis | |
| parent | d95129060cc12152470ce560d468fa52e406521f (diff) | |
| download | bcm5719-llvm-d527cf89e66af87e2fdf31fe51236b1375783f10.tar.gz bcm5719-llvm-d527cf89e66af87e2fdf31fe51236b1375783f10.zip | |
[analyzer] Add very limited support for temporary destructors
This is an improved version of r186498. It enables ExprEngine to reason about
temporary object destructors. However, these destructor calls are never
inlined, since this feature is still broken. Still, this is sufficient to
properly handle noreturn temporary destructors.
Now, the analyzer correctly handles expressions like "a || A()", and executes the
destructor of "A" only on the paths where "a" evaluted to false.
Temporary destructor processing is still off by default and one has to
explicitly request it by setting cfg-temporary-dtors=true.
Reviewers: jordan_rose
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1259
llvm-svn: 189746
Diffstat (limited to 'clang/lib/Analysis')
| -rw-r--r-- | clang/lib/Analysis/CFG.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Analysis/CFG.cpp b/clang/lib/Analysis/CFG.cpp index 52706b01263..ad0acb7abe5 100644 --- a/clang/lib/Analysis/CFG.cpp +++ b/clang/lib/Analysis/CFG.cpp @@ -3765,8 +3765,9 @@ static void print_elem(raw_ostream &OS, StmtPrinterHelper* Helper, } else if (Optional<CFGTemporaryDtor> TE = E.getAs<CFGTemporaryDtor>()) { const CXXBindTemporaryExpr *BT = TE->getBindTemporaryExpr(); - OS << "~" << BT->getType()->getAsCXXRecordDecl()->getName() << "()"; - OS << " (Temporary object destructor)\n"; + OS << "~"; + BT->getType().print(OS, PrintingPolicy(Helper->getLangOpts())); + OS << "() (Temporary object destructor)\n"; } } |

