diff options
-rw-r--r-- | include/clang/Analysis/AnalysisContext.h | 2 | ||||
-rw-r--r-- | include/clang/Analysis/CFG.h | 9 | ||||
-rw-r--r-- | lib/Analysis/AnalysisDeclContext.cpp | 4 | ||||
-rw-r--r-- | lib/Analysis/CFG.cpp | 137 | ||||
-rw-r--r-- | lib/StaticAnalyzer/Checkers/DebugCheckers.cpp | 4 | ||||
-rw-r--r-- | test/Analysis/auto-obj-dtors-cfg-output.cpp | 1406 | ||||
-rw-r--r-- | test/Analysis/dtors-in-dtor-cfg-output.cpp | 42 | ||||
-rw-r--r-- | test/Analysis/initializers-cfg-output.cpp | 109 | ||||
-rw-r--r-- | test/Analysis/temp-obj-dtors-cfg-output.cpp | 1309 |
9 files changed, 1499 insertions, 1523 deletions
diff --git a/include/clang/Analysis/AnalysisContext.h b/include/clang/Analysis/AnalysisContext.h index f4ece34286..468fff5f23 100644 --- a/include/clang/Analysis/AnalysisContext.h +++ b/include/clang/Analysis/AnalysisContext.h @@ -146,7 +146,7 @@ public: /// Return a version of the CFG without any edges pruned. CFG *getUnoptimizedCFG(); - void dumpCFG(); + void dumpCFG(bool ShowColors); /// \brief Returns true if we have built a CFG for this analysis context. /// Note that this doesn't correspond to whether or not a valid CFG exists, it diff --git a/include/clang/Analysis/CFG.h b/include/clang/Analysis/CFG.h index ad23d42f42..27b22b8c62 100644 --- a/include/clang/Analysis/CFG.h +++ b/include/clang/Analysis/CFG.h @@ -495,8 +495,9 @@ public: CFG *getParent() const { return Parent; } - void dump(const CFG *cfg, const LangOptions &LO) const; - void print(raw_ostream &OS, const CFG* cfg, const LangOptions &LO) const; + void dump(const CFG *cfg, const LangOptions &LO, bool ShowColors = false) const; + void print(raw_ostream &OS, const CFG* cfg, const LangOptions &LO, + bool ShowColors) const; void printTerminator(raw_ostream &OS, const LangOptions &LO) const; void addSuccessor(CFGBlock *Block, BumpVectorContext &C) { @@ -755,8 +756,8 @@ public: //===--------------------------------------------------------------------===// void viewCFG(const LangOptions &LO) const; - void print(raw_ostream &OS, const LangOptions &LO) const; - void dump(const LangOptions &LO) const; + void print(raw_ostream &OS, const LangOptions &LO, bool ShowColors) const; + void dump(const LangOptions &LO, bool ShowColors) const; //===--------------------------------------------------------------------===// // Internal: constructors and data. diff --git a/lib/Analysis/AnalysisDeclContext.cpp b/lib/Analysis/AnalysisDeclContext.cpp index 96a92b4b5b..5740e64d26 100644 --- a/lib/Analysis/AnalysisDeclContext.cpp +++ b/lib/Analysis/AnalysisDeclContext.cpp @@ -179,8 +179,8 @@ CFGReverseBlockReachabilityAnalysis *AnalysisDeclContext::getCFGReachablityAnaly return 0; } -void AnalysisDeclContext::dumpCFG() { - getCFG()->dump(getASTContext().getLangOptions()); +void AnalysisDeclContext::dumpCFG(bool ShowColors) { + getCFG()->dump(getASTContext().getLangOptions(), ShowColors); } ParentMap &AnalysisDeclContext::getParentMap() { diff --git a/lib/Analysis/CFG.cpp b/lib/Analysis/CFG.cpp index 8d7aff19ca..5bbccf53c5 100644 --- a/lib/Analysis/CFG.cpp +++ b/lib/Analysis/CFG.cpp @@ -3554,27 +3554,35 @@ static void print_elem(raw_ostream &OS, StmtPrinterHelper* Helper, static void print_block(raw_ostream &OS, const CFG* cfg, const CFGBlock &B, - StmtPrinterHelper* Helper, bool print_edges) { + StmtPrinterHelper* Helper, bool print_edges, + bool ShowColors) { - if (Helper) Helper->setBlockID(B.getBlockID()); + if (Helper) + Helper->setBlockID(B.getBlockID()); // Print the header. - OS << "\n [ B" << B.getBlockID(); + if (ShowColors) + OS.changeColor(raw_ostream::YELLOW, true); + + OS << "\n [B" << B.getBlockID(); if (&B == &cfg->getEntry()) - OS << " (ENTRY) ]\n"; + OS << " (ENTRY)]\n"; else if (&B == &cfg->getExit()) - OS << " (EXIT) ]\n"; + OS << " (EXIT)]\n"; else if (&B == cfg->getIndirectGotoBlock()) - OS << " (INDIRECT GOTO DISPATCH) ]\n"; + OS << " (INDIRECT GOTO DISPATCH)]\n"; else - OS << " ]\n"; + OS << "]\n"; + + if (ShowColors) + OS.resetColor(); // Print the label of this block. if (Stmt *Label = const_cast<Stmt*>(B.getLabel())) { if (print_edges) - OS << " "; + OS << " "; if (LabelStmt *L = dyn_cast<LabelStmt>(Label)) OS << L->getName(); @@ -3612,22 +3620,22 @@ static void print_block(raw_ostream &OS, const CFG* cfg, // Print the statement # in the basic block and the statement itself. if (print_edges) - OS << " "; + OS << " "; OS << llvm::format("%3d", j) << ": "; if (Helper) Helper->setStmtID(j); - print_elem(OS,Helper,*I); + print_elem(OS, Helper, *I); } // Print the terminator of this block. if (B.getTerminator()) { - if (print_edges) - OS << " "; + if (ShowColors) + OS.changeColor(raw_ostream::GREEN); - OS << " T: "; + OS << " T: "; if (Helper) Helper->setBlockID(-1); @@ -3635,54 +3643,86 @@ static void print_block(raw_ostream &OS, const CFG* cfg, PrintingPolicy(Helper->getLangOpts())); TPrinter.Visit(const_cast<Stmt*>(B.getTerminator().getStmt())); OS << '\n'; + + if (ShowColors) + OS.resetColor(); } if (print_edges) { // Print the predecessors of this block. - OS << " Predecessors (" << B.pred_size() << "):"; - unsigned i = 0; + if (!B.pred_empty()) { + const raw_ostream::Colors Color = raw_ostream::BLUE; + if (ShowColors) + OS.changeColor(Color); + OS << " Preds " ; + if (ShowColors) + OS.resetColor(); + OS << '(' << B.pred_size() << "):"; + unsigned i = 0; + + if (ShowColors) + OS.changeColor(Color); + + for (CFGBlock::const_pred_iterator I = B.pred_begin(), E = B.pred_end(); + I != E; ++I, ++i) { - for (CFGBlock::const_pred_iterator I = B.pred_begin(), E = B.pred_end(); - I != E; ++I, ++i) { + if (i == 8 || (i-8) == 0) + OS << "\n "; - if (i == 8 || (i-8) == 0) - OS << "\n "; + OS << " B" << (*I)->getBlockID(); + } + + if (ShowColors) + OS.resetColor(); - OS << " B" << (*I)->getBlockID(); + OS << '\n'; } - OS << '\n'; - // Print the successors of this block. - OS << " Successors (" << B.succ_size() << "):"; - i = 0; - - for (CFGBlock::const_succ_iterator I = B.succ_begin(), E = B.succ_end(); - I != E; ++I, ++i) { - - if (i == 8 || (i-8) % 10 == 0) - OS << "\n "; - - if (*I) - OS << " B" << (*I)->getBlockID(); - else - OS << " NULL"; + if (!B.succ_empty()) { + const raw_ostream::Colors Color = raw_ostream::MAGENTA; + if (ShowColors) + OS.changeColor(Color); + OS << " Succs "; + if (ShowColors) + OS.resetColor(); + OS << '(' << B.succ_size() << "):"; + unsigned i = 0; + + if (ShowColors) + OS.changeColor(Color); + + for (CFGBlock::const_succ_iterator I = B.succ_begin(), E = B.succ_end(); + I != E; ++I, ++i) { + + if (i == 8 || (i-8) % 10 == 0) + OS << "\n "; + + if (*I) + OS << " B" << (*I)->getBlockID(); + else + OS << " NULL"; + } + + if (ShowColors) + OS.resetColor(); + OS << '\n'; } - - OS << '\n'; } } /// dump - A simple pretty printer of a CFG that outputs to stderr. -void CFG::dump(const LangOptions &LO) const { print(llvm::errs(), LO); } +void CFG::dump(const LangOptions &LO, bool ShowColors) const { + print(llvm::errs(), LO, ShowColors); +} /// print - A simple pretty printer of a CFG that outputs to an ostream. -void CFG::print(raw_ostream &OS, const LangOptions &LO) const { +void CFG::print(raw_ostream &OS, const LangOptions &LO, bool ShowColors) const { StmtPrinterHelper Helper(this, LO); // Print the entry block. - print_block(OS, this, getEntry(), &Helper, true); + print_block(OS, this, getEntry(), &Helper, true, ShowColors); // Iterate through the CFGBlocks and print them one by one. for (const_iterator I = Blocks.begin(), E = Blocks.end() ; I != E ; ++I) { @@ -3690,25 +3730,28 @@ void CFG::print(raw_ostream &OS, const LangOptions &LO) const { if (&(**I) == &getEntry() || &(**I) == &getExit()) continue; - print_block(OS, this, **I, &Helper, true); + print_block(OS, this, **I, &Helper, true, ShowColors); } // Print the exit block. - print_block(OS, this, getExit(), &Helper, true); + print_block(OS, this, getExit(), &Helper, true, ShowColors); + OS << '\n'; OS.flush(); } /// dump - A simply pretty printer of a CFGBlock that outputs to stderr. -void CFGBlock::dump(const CFG* cfg, const LangOptions &LO) const { - print(llvm::errs(), cfg, LO); +void CFGBlock::dump(const CFG* cfg, const LangOptions &LO, + bool ShowColors) const { + print(llvm::errs(), cfg, LO, ShowColors); } /// print - A simple pretty printer of a CFGBlock that outputs to an ostream. /// Generally this will only be called from CFG::print. void CFGBlock::print(raw_ostream &OS, const CFG* cfg, - const LangOptions &LO) const { + const LangOptions &LO, bool ShowColors) const { StmtPrinterHelper Helper(cfg, LO); - print_block(OS, cfg, *this, &Helper, true); + print_block(OS, cfg, *this, &Helper, true, ShowColors); + OS << '\n'; } /// printTerminator - A simple pretty printer of the terminator of a CFGBlock. @@ -3805,7 +3848,7 @@ struct DOTGraphTraits<const CFG*> : public DefaultDOTGraphTraits { #ifndef NDEBUG std::string OutSStr; llvm::raw_string_ostream Out(OutSStr); - print_block(Out,Graph, *Node, GraphHelper, false); + print_block(Out,Graph, *Node, GraphHelper, false, false); std::string& OutStr = Out.str(); if (OutStr[0] == '\n') OutStr.erase(OutStr.begin()); diff --git a/lib/StaticAnalyzer/Checkers/DebugCheckers.cpp b/lib/StaticAnalyzer/Checkers/DebugCheckers.cpp index bd1b8542f6..d7e7af1c8e 100644 --- a/lib/StaticAnalyzer/Checkers/DebugCheckers.cpp +++ b/lib/StaticAnalyzer/Checkers/DebugCheckers.cpp @@ -16,6 +16,7 @@ #include "clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h" #include "clang/Analysis/Analyses/LiveVariables.h" #include "clang/Analysis/Analyses/Dominators.h" +#include "llvm/Support/Process.h" using namespace clang; using namespace ento; @@ -92,7 +93,8 @@ public: void checkASTCodeBody(const Decl *D, AnalysisManager& mgr, BugReporter &BR) const { if (CFG *cfg = mgr.getCFG(D)) { - cfg->dump(mgr.getLangOptions()); + cfg->dump(mgr.getLangOptions(), + llvm::sys::Process::StandardErrHasColors()); } } }; diff --git a/test/Analysis/auto-obj-dtors-cfg-output.cpp b/test/Analysis/auto-obj-dtors-cfg-output.cpp index e489b9e63f..2402e0072e 100644 --- a/test/Analysis/auto-obj-dtors-cfg-output.cpp +++ b/test/Analysis/auto-obj-dtors-cfg-output.cpp @@ -155,726 +155,690 @@ void test_catch_copy() { } } -// CHECK: [ B2 (ENTRY) ] -// CHECK: Predecessors (0): -// CHECK: Successors (1): B1 -// CHECK: [ B1 ] -// CHECK: 1: -// CHECK: 2: A a; -// CHECK: 3: a -// CHECK: 4: [B1.3] -// CHECK: 5: const A &b = a; -// CHECK: 6: A() -// CHECK: 7: [B1.6] (BindTemporary) -// CHECK: 8: [B1.7] -// CHECK: 9: [B1.8] -// CHECK: 10: const A &c = A(); -// CHECK: 11: [B1.10].~A() (Implicit destructor) -// CHECK: 12: [B1.2].~A() (Implicit destructor) -// CHECK: Predecessors (1): B2 -// CHECK: Successors (1): B0 -// CHECK: [ B0 (EXIT) ] -// CHECK: Predecessors (1): B1 -// CHECK: Successors (0): -// CHECK: [ B2 (ENTRY) ] -// CHECK: Predecessors (0): -// CHECK: Successors (1): B1 -// CHECK: [ B1 ] -// CHECK: 1: -// CHECK: 2: A a[2]; -// CHECK: 3: -// CHECK: 4: A b[0]; -// CHECK: 5: [B1.2].~A() (Implicit destructor) -// CHECK: Predecessors (1): B2 -// CHECK: Successors (1): B0 -// CHECK: [ B0 (EXIT) ] -// CHECK: Predecessors (1): B1 -// CHECK: Successors (0): -// CHECK: [ B2 (ENTRY) ] -// CHECK: Predecessors (0): -// CHECK: Successors (1): B1 -// CHECK: [ B1 ] -// CHECK: 1: -// CHECK: 2: A a; -// CHECK: 3: -// CHECK: 4: A c; -// CHECK: 5: -// CHECK: 6: A d; -// CHECK: 7: [B1.6].~A() (Implicit destructor) -// CHECK: 8: [B1.4].~A() (Implicit destructor) -// CHECK: 9: -// CHECK: 10: A b; -// CHECK: 11: [B1.10].~A() (Implicit destructor) -// CHECK: 12: [B1.2].~A() (Implicit destructor) -// CHECK: Predecessors (1): B2 -// CHECK: Successors (1): B0 -// CHECK: [ B0 (EXIT) ] -// CHECK: Predecessors (1): B1 -// CHECK: Successors (0): -// CHECK: [ B4 (ENTRY) ] -// CHECK: Predecessors (0): -// CHECK: Successors (1): B3 -// CHECK: [ B1 ] -// CHECK: 1: -// CHECK: 2: A c; -// CHECK: 3: [B1.2].~A() (Implicit destructor) -// CHECK: 4: [B3.4].~A() (Implicit destructor) -// CHECK: 5: [B3.2].~A() (Implicit destructor) -// CHECK: Predecessors (1): B3 -// CHECK: Successors (1): B0 -// CHECK: [ B2 ] -// CHECK: 1: return; -// CHECK: 2: [B3.4].~A() (Implicit destructor) -// CHECK: 3: [B3.2].~A() (Implicit destructor) -// CHECK: Predecessors (1): B3 -// CHECK: Successors (1): B0 -// CHECK: [ B3 ] -// CHECK: 1: -// CHECK: 2: A a; -// CHECK: 3: -// CHECK: 4: A b; -// CHECK: 5: UV -// CHECK: 6: [B3.5] -// CHECK: T: if [B3.6] -// CHECK: Predecessors (1): B4 -// CHECK: Successors (2): B2 B1 -// CHECK: [ B0 (EXIT) ] -// CHECK: Predecessors (2): B1 B2 -// CHECK: Successors (0): -// CHECK: [ B8 (ENTRY) ] -// CHECK: Predecessors (0): -// CHECK: Successors (1): B7 -// CHECK: [ B1 ] -// CHECK: l1: -// CHECK: 1: -// CHECK: 2: A c; -// CHECK: 3: [B1.2].~A() (Implicit destructor) -// CHECK: 4: [B6.2].~A() (Implicit destructor) -// CHECK: 5: [B7.2].~A() (Implicit destructor) -// CHECK: Predecessors (2): B2 B3 -// CHECK: Successors (1): B0 -// CHECK: [ B2 ] -// CHECK: 1: -// CHECK: 2: A b; -// CHECK: 3: [B2.2].~A() (Implicit destructor) -// CHECK: 4: [B6.4].~A() (Implicit destructor) -// CHECK: Predecessors (1): B4 -// CHECK: Successors (1): B1 -// CHECK: [ B3 ] -// CHECK: 1: [B6.4].~A() (Implicit destructor) -// CHECK: T: goto l1; -// CHECK: Predecessors (1): B4 -// CHECK: Successors (1): B1 -// CHECK: [ B4 ] -// CHECK: 1: UV -// CHECK: 2: [B4.1] -// CHECK: T: if [B4.2] -// CHECK: Predecessors (1): B6 -// CHECK: Successors (2): B3 B2 -// CHECK: [ B5 ] -// CHECK: 1: [B6.4].~A() (Implicit destructor) -// CHECK: 2: [B6.2].~A() (Implicit destructor) -// CHECK: T: goto l0; -// CHECK: Predecessors (1): B6 -// CHECK: Successors (1): B6 -// CHECK: [ B6 ] -// CHECK: l0: -// CHECK: 1: -// CHECK: 2: A b; -// CHECK: 3: -// CHECK: 4: A a; -// CHECK: 5: UV -// CHECK: 6: [B6.5] -// CHECK: T: if [B6.6] -// CHECK: Predecessors (2): B7 B5 -// CHECK: Successors (2): B5 B4 -// CHECK: [ B7 ] -// CHECK: 1: -// CHECK: 2: A a; -// CHECK: Predecessors (1): B8 -// CHECK: Successors (1): B6 -// CHECK: [ B0 (EXIT) ] -// CHECK: Predecessors (1): B1 -// CHECK: Successors (0): -// CHECK: [ B5 (ENTRY) ] -// CHECK: Predecessors (0): -// CHECK: Successors (1): B4 -// CHECK: [ B1 ] -// CHECK: 1: [B4.6].~A() (Implicit destructor) -// CHECK: 2: [B4.2].~A() (Implicit destructor) -// CHECK: Predecessors (2): B2 B3 -// CHECK: Successors (1): B0 -// CHECK: [ B2 ] -// CHECK: 1: -// CHECK: 2: A c; -// CHECK: 3: [B2.2].~A() (Implicit destructor) -// CHECK: Predecessors (1): B4 -// CHECK: Successors (1): B1 -// CHECK: [ B3 ] -// CHECK: 1: -// CHECK: 2: A c; -// CHECK: 3: [B3.2].~A() (Implicit destructor) -// CHECK: Predecessors (1): B4 -// CHECK: Successors (1): B1 -// CHECK: [ B4 ] -// CHECK: 1: -// CHECK: 2: A a; -// CHECK: 3: a -// CHECK: 4: [B4.3] -// CHECK: 5: [B4.4] -// CHECK: 6: A b = a; -// CHECK: 7: b -// CHECK: 8: [B4.7] -// CHECK: 9: [B4.8].operator int -// CHECK: 10: [B4.9]() -// CHECK: 11: [B4.10] -// CHECK: 12: [B4.11] -// CHECK: T: if [B4.12] -// CHECK: Predecessors (1): B5 -// CHECK: Successors (2): B3 B2 -// CHECK: [ B0 (EXIT) ] -// CHECK: Predecessors (1): B1 -// CHECK: Successors (0): -// CHECK: [ B9 (ENTRY) ] -// CHECK: Predecessors (0): -// CHECK: Successors (1): B8 -// CHECK: [ B1 ] -// CHECK: 1: [B8.6].~A() (Implicit destructor) -// CHECK: 2: -// CHECK: 3: A e; -// CHECK: 4: [B1.3].~A() (Implicit destructor) -// CHECK: 5: [B8.2].~A() (Implicit destructor) -// CHECK: Predecessors (2): B2 B5 -// CHECK: Successors (1): B0 -// CHECK: [ B2 ] -// CHECK: 1: -// CHECK: 2: A d; -// CHECK: 3: [B2.2].~A() (Implicit destructor) -// CHECK: 4: [B4.2].~A() (Implicit destructor) -// CHECK: Predecessors (1): B4 -// CHECK: Successors (1): B1 -// CHECK: [ B3 ] -// CHECK: 1: return; -// CHECK: 2: [B4.2].~A() (Implicit destructor) -// CHECK: 3: [B8.6].~A() (Implicit destructor) -// CHECK: 4: [B8.2].~A() (Implicit destructor) -// CHECK: Predecessors (1): B4 -// CHECK: Successors (1): B0 -// CHECK: [ B4 ] -// CHECK: 1: -// CHECK: 2: A c; -// CHECK: 3: UV -// CHECK: 4: [B4.3] -// CHECK: T: if [B4.4] -// CHECK: Predecessors (1): B8 -// CHECK: Successors (2): B3 B2 -// CHECK: [ B5 ] -// CHECK: 1: -// CHECK: 2: A d; -// CHECK: 3: [B5.2].~A() (Implicit destructor) -// CHECK: 4: [B7.2].~A() (Implicit destructor) -// CHECK: Predecessors (1): B7 -// CHECK: Successors (1): B1 -// CHECK: [ B6 ] -// CHECK: 1: return; -// CHECK: 2: [B7.2].~A() (Implicit destructor) -// CHECK: 3: [B8.6].~A() (Implicit destructor) -// CHECK: 4: [B8.2].~A() (Implicit destructor) -// CHECK: Predecessors (1): B7 -// CHECK: Successors (1): B0 -// CHECK: [ B7 ] -// CHECK: 1: -// CHECK: 2: A c; -// CHECK: 3: UV -// CHECK: 4: [B7.3] -// CHECK: T: if [B7.4] -// CHECK: Predecessors (1): B8 -// CHECK: Successors (2): B6 B5 -// CHECK: [ B8 ] -// CHECK: 1: -// CHECK: 2: A a; -// CHECK: 3: a -// CHECK: 4: [B8.3] -// CHECK: 5: [B8.4] -// CHECK: 6: A b = a; -// CHECK: 7: b -// CHECK: 8: [B8.7] -// CHECK: 9: [B8.8].operator int -// CHECK: 10: [B8.9]() -// CHECK: 11: [B8.10] -// CHECK: 12: [B8.11] -// CHECK: T: if [B8.12] -// CHECK: Predecessors (1): B9 -// CHECK: Successors (2): B7 B4 -// CHECK: [ B0 (EXIT) ] -// CHECK: Predecessors (3): B1 B3 B6 -// CHECK: Successors (0): -// CHECK: [ B6 (ENTRY) ] -// CHECK: Predecessors (0): -// CHECK: Successors (1): B5 -// CHECK: [ B1 ] -// CHECK: 1: [B2.4].~A() (Implicit destructor) -// CHECK: 2: [B5.2].~A() (Implicit destructor) -// CHECK: Predecessors (1): B2 -// CHECK: Successors (1): B0 -// CHECK: [ B2 ] -// CHECK: 1: a -// CHECK: 2: [B2.1] -// CHECK: 3: [B2.2] -// CHECK: 4: A b = a; -// CHECK: 5: b -// CHECK: 6: [B2.5] -// CHECK: 7: [B2.6].operator int -// CHECK: 8: [B2.7]() -// CHECK: 9: [B2.8] -// CHECK: 10: [B2.9] -// CHECK: T: while [B2.10] -// CHECK: Predecessors (2): B3 B5 -// CHECK: Successors (2): B4 B1 -// CHECK: [ B3 ] -// CHECK: Predecessors (1): B4 -// CHECK: Successors (1): B2 -// CHECK: [ B4 ] -// CHECK: 1: -// CHECK: 2: A c; -// CHECK: 3: [B4.2].~A() (Implicit destructor) -// CHECK: 4: [B2.4].~A() (Implicit destructor) -// CHECK: Predecessors (1): B2 -// CHECK: Successors (1): B3 -// CHECK: [ B5 ] -// CHECK: 1: -// CHECK: 2: A a; -// CHECK: Predecessors (1): B6 -// CHECK: Successors (1): B2 -// CHECK: [ B0 (EXIT) ] -// CHECK: Predecessors (1): B1 -// CHECK: Successors (0): -// CHECK: [ B12 (ENTRY) ] -// CHECK: Predecessors (0): -// CHECK: Successors (1): B11 -// CHECK: [ B1 ] -// CHECK: 1: [B2.4].~A() (Implicit destructor) -// CHECK: 2: -// CHECK: 3: A e; -// CHECK: 4: [B1.3].~A() (Implicit destructor) -// CHECK: 5: [B11.2].~A() (Implicit destructor) -// CHECK: Predecessors (2): B9 B2 -// CHECK: Successors (1): B0 -// CHECK: [ B2 ] -// CHECK: 1: a -// CHECK: 2: [B2.1] -// CHECK: 3: [B2.2] -// CHECK: 4: A b = a; -// CHECK: 5: b -// CHECK: 6: [B2.5] -// CHECK: 7: [B2.6].operator int -// CHECK: 8: [B2.7]() -// CHECK: 9: [B2.8] -// CHECK: 10: [B2.9] -// CHECK: T: while [B2.10] -// CHECK: Predecessors (2): B3 B11 -// CHECK: Successors (2): B10 B1 -// CHECK: [ B3 ] -// CHECK: Predecessors (2): B4 B7 -// CHECK: Successors (1): B2 -// CHECK: [ B4 ] -// CHECK: 1: -// CHECK: 2: A d; -// CHECK: 3: [B4.2].~A() (Implicit destructor) -// CHECK: 4: [B10.2].~A() (Implicit destructor) -// CHECK: 5: [B2.4].~A() (Implicit destructor) -// CHECK: Predecessors (1): B6 -// CHECK: Successors (1): B3 -// CHECK: [ B5 ] -// CHECK: 1: return; -// CHECK: 2: [B10.2].~A() (Implicit destructor) -// CHECK: 3: [B2.4].~A() (Implicit destructor) -// CHECK: 4: [B11.2].~A() (Implicit destructor) -// CHECK: Predecessors (1): B6 -// CHECK: Successors (1): B0 -// CHECK: [ B6 ] -// CHECK: 1: UV -// CHECK: 2: [B6.1] -// CHECK: T: if [B6.2] -// CHECK: Predecessors (1): B8 -// CHECK: Successors (2): B5 B4 -// CHECK: [ B7 ] -// CHECK: 1: [B10.2].~A() (Implicit destructor) -// CHECK: 2: [B2.4].~A() (Implicit destructor) -// CHECK: T: continue; -// CHECK: Predecessors (1): B8 -// CHECK: Successors (1): B3 -// CHECK: [ B8 ] -// CHECK: 1: UV -// CHECK: 2: [B8.1] -// CHECK: T: if [B8.2] -// CHECK: Predecessors (1): B10 -// CHECK: Successors (2): B7 B6 -// CHECK: [ B9 ] -// CHECK: 1: [B10.2].~A() (Implicit destructor) -// CHECK: T: break; -// CHECK: Predecessors (1): B10 -// CHECK: Successors (1): B1 -// CHECK: [ B10 ] -// CHECK: 1: -// CHECK: 2: A c; -// CHECK: 3: UV -// CHECK: 4: [B10.3] -// CHECK: T: if [B10.4] -// CHECK: Predecessors (1): B2 -// CHECK: Successors (2): B9 B8 -// CHECK: [ B11 ] -// CHECK: 1: -// CHECK: 2: A a; -// CHECK: Predecessors (1): B12 -// CHECK: Successors (1): B2 -// CHECK: [ B0 (EXIT) ] -// CHECK: Predecessors (2): B1 B5 -// CHECK: Successors (0): -// CHECK: [ B4 (ENTRY) ] -// CHECK: Predecessors (0): -// CHECK: Successors (1): B2 -// CHECK: [ B1 ] -// CHECK: 1: UV -// CHECK: 2: [B1.1] -// CHECK: T: do ... while [B1.2] -// CHECK: Predecessors (1): B2 -// CHECK: Successors (2): B3 B0 -// CHECK: [ B2 ] -// CHECK: 1: -// CHECK: 2: A a; -// CHECK: 3: [B2.2].~A() (Implicit destructor) -// CHECK: Predecessors (2): B3 B4 -// CHECK: Successors (1): B1 -// CHECK: [ B3 ] -// CHECK: Predecessors (1): B1 -// CHECK: Successors (1): B2 -// CHECK: [ B0 (EXIT) ] -// CHECK: Predecessors (1): B1 -// CHECK: Successors (0): -// CHECK: [ B12 (ENTRY) ] -// CHECK: Predecessors (0): -// CHECK: Successors (1): B11 -// CHECK: [ B1 ] -// CHECK: 1: -// CHECK: 2: A d; -// CHECK: 3: [B1.2].~A() (Implicit destructor) -// CHECK: 4: [B11.2].~A() (Implicit destructor) -// CHECK: Predecessors (2): B8 B2 -// CHECK: Successors (1): B0 -// CHECK: [ B2 ] -// CHECK: 1: UV -// CHECK: 2: [B2.1] -// CHECK: T: do ... while [B2.2] -// CHECK: Predecessors (2): B3 B6 -// CHECK: Successors (2): B10 B1 -// CHECK: [ B3 ] -// CHECK: 1: -// CHECK: 2: A c; -// CHECK: 3: [B3.2].~A() (Implicit destructor) -// CHECK: 4: [B9.2].~A() (Implicit destructor) -// CHECK: Predecessors (1): B5 -// CHECK: Successors (1): B2 -// CHECK: [ B4 ] -// CHECK: 1: return; -// CHECK: 2: [B9.2].~A() (Implicit destructor) -// CHECK: 3: [B11.2].~A() (Implicit destructor) -// CHECK: Predecessors (1): B5 -// CHECK: Successors (1): B0 -// CHECK: [ B5 ] -// CHECK: 1: UV -// CHECK: 2: [B5.1] -// CHECK: T: if [B5.2] -// CHECK: Predecessors (1): B7 -// CHECK: Successors (2): B4 B3 -// CHECK: [ B6 ] -// CHECK: 1: [B9.2].~A() (Implicit destructor) -// CHECK: T: continue; -// CHECK: Predecessors (1): B7 -// CHECK: Successors (1): B2 -// CHECK: [ B7 ] -// CHECK: 1: UV -// CHECK: 2: [B7.1] -// CHECK: T: if [B7.2] -// CHECK: Predecessors (1): B9 -// CHECK: Successors (2): B6 B5 -// CHECK: [ B8 ] -// CHECK: 1: [B9.2].~A() (Implicit destructor) -// CHECK: T: break; -// CHECK: Predecessors (1): B9 -// CHECK: Successors (1): B1 -// CHECK: [ B9 ] -// CHECK: 1: -// CHECK: 2: A b; -// CHECK: 3: UV -// CHECK: 4: [B9.3] -// CHECK: T: if [B9.4] -// CHECK: Predecessors (2): B10 B11 -// CHECK: Successors (2): B8 B7 -// CHECK: [ B10 ] -// CHECK: Predecessors (1): B2 -// CHECK: Successors (1): B9 -// CHECK: [ B11 ] -// CHECK: 1: -// CHECK: 2: A a; -// CHECK: Predecessors (1): B12 -// CHECK: Successors (1): B9 -// CHECK: [ B0 (EXIT) ] -// CHECK: Predecessors (2): B1 B4 -// CHECK: Successors (0): -// CHECK: [ B4 (ENTRY) ] -// CHECK: Predecessors (0): -// CHECK: Successors (1): B2 -// CHECK: [ B1 ] -// CHECK: 1: [B2.6].~A() (Implicit destructor) -// CHECK: 2: [B2.2].~A() (Implicit destructor) -// CHECK: Predecessors (2): B3 B2 -// CHECK: Successors (1): B0 -// CHECK: [ B2 ] -// CHECK: 1: -// CHECK: 2: A a; -// CHECK: 3: a -// CHECK: 4: [B2.3] -// CHECK: 5: [B2.4] -// CHECK: 6: A b = a; -// CHECK: 7: b -// CHECK: 8: [B2.7] -// CHECK: 9: [B2.8].operator int -// CHECK: 10: [B2.9]() -// CHECK: 11: [B2.10] -// CHECK: T: switch [B2.11] -// CHECK: Predecessors (1): B4 -// CHECK: Successors (1): B1 -// CHECK: [ B3 ] -// CHECK: 1: -// CHECK: 2: A c; -// CHECK: 3: [B3.2].~A() (Implicit destructor) -// CHECK: Predecessors (0): -// CHECK: Successors (1): B1 -// CHECK: [ B0 (EXIT) ] -// CHECK: Predecessors (1): B1 -// CHECK: Successors (0): -// CHECK: [ B9 (ENTRY) ] -// CHECK: Predecessors (0): -// CHECK: Successors (1): B2 -// CHECK: [ B1 ] -// CHECK: 1: [B2.6].~A() (Implicit destructor) -// CHECK: 2: -// CHECK: 3: A g; -// CHECK: 4: [B1.3].~A() (Implicit destructor) -// CHECK: 5: [B2.2].~A() (Implicit destructor) -// CHECK: Predecessors (3): B3 B7 B2 -// CHECK: Successors (1): B0 -// CHECK: [ B2 ] -// CHECK: 1: -// CHECK: 2: A a; -// CHECK: 3: a -// CHECK: 4: [B2.3] -// CHECK: 5: [B2.4] -// CHECK: 6: A b = a; -// CHECK: 7: b -// CHECK: 8: [B2.7] -// CHECK: 9: [B2.8].operator int -// CHECK: 10: [B2.9]() -// CHECK: 11: [B2.10] -// CHECK: T: switch [B2.11] -// CHECK: Predecessors (1): B9 -// CHECK: Successors (3): B3 B8 +// CHECK: [B2 (ENTRY)] +// CHECK: Succs (1): B1 +// CHECK: [B1] +// CHECK: 1: (CXXConstructExpr, class A) +// CHECK: 2: A a; +// CHECK: 3: a +// CHECK: 4: [B1.3] (ImplicitCastExpr, NoOp, const class A) +// CHECK: 5: const A &b = a; +// CHECK: 6: A() (CXXConstructExpr, class A) +// CHECK: 7: [B1.6] (BindTemporary) +// CHECK: 8: [B1.7] (ImplicitCastExpr, NoOp, const class A) +// CHECK: 9: [B1.8] +// CHECK: 10: const A &c = A(); +// CHECK: 11: [B1.10].~A() (Implicit destructor) +// CHECK: 12: [B1.2].~A() (Implicit destructor) +// CHECK: Preds (1): B2 +// CHECK: Succs (1): B0 +// CHECK: [B0 (EXIT)] +// CHECK: Preds (1): B1 +// CHECK: [B2 (ENTRY)] +// CHECK: Succs (1): B1 +// CHECK: [B1] +// CHECK: 1: (CXXConstructExpr, class A [2]) +// CHECK: 2: A a[2]; +// CHECK: 3: (CXXConstructExpr, class A [0]) +// CHECK: 4: A b[0]; +// CHECK: 5: [B1.2].~A() (Implicit destructor) +// CHECK: Preds (1): B2 +// CHECK: Succs (1): B0 +// CHECK: [B0 (EXIT)] +// CHECK: Preds (1): B1 +// CHECK: [B2 (ENTRY)] +// CHECK: Succs (1): B1 +// CHECK: [B1] +// CHECK: 1: (CXXConstructExpr, class A) +// CHECK: 2: A a; +// CHECK: 3: (CXXConstructExpr, class A) +// CHECK: 4: A c; +// CHECK: 5: (CXXConstructExpr, class A) +// CHECK: 6: A d; +// CHECK: 7: [B1.6].~A() (Implicit destructor) +// CHECK: 8: [B1.4].~A() (Implicit destructor) +// CHECK: 9: (CXXConstructExpr, class A) +// CHECK: 10: A b; +// CHECK: 11: [B1.10].~A() (Implicit destructor) +// CHECK: 12: [B1.2].~A() (Implicit destructor) +// CHECK: Preds (1): B2 +// CHECK: Succs (1): B0 +// CHECK: [B0 (EXIT)] +// CHECK: Preds (1): B1 +// CHECK: [B4 (ENTRY)] +// CHECK: Succs (1): B3 +// CHECK: [B1] +// CHECK: 1: (CXXConstructExpr, class A) +// CHECK: 2: A c; +// CHECK: 3: [B1.2].~A() (Implicit destructor) +// CHECK: 4: [B3.4].~A() (Implicit destructor) +// CHECK: 5: [B3.2].~A() (Implicit destructor) +// CHECK: Preds (1): B3 +// CHECK: Succs (1): B0 +// CHECK: [B2] +// CHECK: 1: return; +// CHECK: 2: [B3.4].~A() (Implicit destructor) +// CHECK: 3: [B3.2].~A() (Implicit destructor) +// CHECK: Preds (1): B3 +// CHECK: Succs (1): B0 +// CHECK: [B3] +// CHECK: 1: (CXXConstructExpr, class A) +// CHECK: 2: A a; +// CHECK: 3: (CXXConstructExpr, class A) +// CHECK: 4: A b; +// CHECK: 5: UV +// CHECK: 6: [B3.5] (ImplicitCastExpr, LValueToRValue, _Bool) +// CHECK: T: if [B3.6] +// CHECK: Preds (1): B4 +// CHECK: Succs (2): B2 B1 +// CHECK: [B0 (EXIT)] +// CHECK: Preds (2): B1 B2 +// CHECK: [B8 (ENTRY)] +// CHECK: Succs (1): B7 +// CHECK: [B1] +// CHECK: l1: +// CHECK: 1: (CXXConstructExpr, class A) +// CHECK: 2: A c; +// CHECK: 3: [B1.2].~A() (Implicit destructor) +// CHECK: 4: [B6.2].~A() (Implicit destructor) +// CHECK: 5: [B7.2].~A() (Implicit destructor) +// CHECK: Preds (2): B2 B3 +// CHECK: Succs (1): B0 +// CHECK: [B2] +// CHECK: 1: (CXXConstructExpr, class A) +// CHECK: 2: A b; +// CHECK: 3: [B2.2].~A() (Implicit destructor) +// CHECK: 4: [B6.4].~A() (Implicit destructor) +// CHECK: Preds (1): B4 +// CHECK: Succs (1): B1 +// CHECK: [B3] +// CHECK: 1: [B6.4].~A() (Implicit destructor) +// CHECK: T: goto l1; +// CHECK: Preds (1): B4 +// CHECK: Succs (1): B1 +// CHECK: [B4] +// CHECK: 1: UV +// CHECK: 2: [B4.1] (ImplicitCastExpr, LValueToRValue, _Bool) +// CHECK: T: if [B4.2] +// CHECK: Preds (1): B6 +// CHECK: Succs (2): B3 B2 +// CHECK: [B5] +// CHECK: 1: [B6.4].~A() (Implicit destructor) +// CHECK: 2: [B6.2].~A() (Implicit destructor) +// CHECK: T: goto l0; +// CHECK: Preds (1): B6 +// CHECK: Succs (1): B6 +// CHECK: [B6] +// CHECK: l0: +// CHECK: 1: (CXXConstructExpr, class A) +// CHECK: 2: A b; +// CHECK: 3: (CXXConstructExpr, class A) +// CHECK: 4: A a; +// CHECK: 5: UV +// CHECK: 6: [B6.5] (ImplicitCastExpr, LValueToRValue, _Bool) +// CHECK: T: if [B6.6] +// CHECK: Preds (2): B7 B5 +// CHECK: Succs (2): B5 B4 +// CHECK: [B7] +// CHECK: 1: (CXXConstructExpr, class A) +// CHECK: 2: A a; +// CHECK: Preds (1): B8 +// CHECK: Succs (1): B6 +// CHECK: [B0 (EXIT)] +// CHECK: Preds (1): B1 +// CHECK: [B5 (ENTRY)] +// CHECK: Succs (1): B4 +// CHECK: [B1] +// CHECK: 1: [B4.6].~A() (Implicit destructor) +// CHECK: 2: [B4.2].~A() (Implicit destructor) +// CHECK: Preds (2): B2 B3 +// CHECK: Succs (1): B0 +// CHECK: [B2] +// CHECK: 1: (CXXConstructExpr, class A) +// CHECK: 2: A c; +// CHECK: 3: [B2.2].~A() (Implicit destructor) +// CHECK: Preds (1): B4 +// CHECK: Succs (1): B1 +// CHECK: [B3] +// CHECK: 1: (CXXConstructExpr, class A) +// CHECK: 2: A c; +// CHECK: 3: [B3.2].~A() (Implicit destructor) +// CHECK: Preds (1): B4 +// CHECK: Succs (1): B1 +// CHECK: [B4] +// CHECK: 1: (CXXConstructExpr, class A) +// CHECK: 2: A a; +// CHECK: 3: a +// CHECK: 4: [B4.3] (ImplicitCastExpr, NoOp, const class A) +// CHECK: 5: [B4.4] (CXXConstructExpr, class A) +// CHECK: 6: A b = a; +// CHECK: 7: b +// CHECK: 8: [B4.7] (ImplicitCastExpr, NoOp, const class A) +// CHECK: 9: [B4.8].operator int +// CHECK: 10: [B4.9]() +// CHECK: 11: [B4.10] (ImplicitCastExpr, UserDefinedConversion, int) +// CHECK: 12: [B4.11] (ImplicitCastExpr, IntegralToBoo |