[cfe-commits] r41324 - /cfe/trunk/include/clang/AST/CFG.h

Ted Kremenek kremenek at apple.com
Thu Aug 23 09:51:53 PDT 2007


Author: kremenek
Date: Thu Aug 23 11:51:52 2007
New Revision: 41324

URL: http://llvm.org/viewvc/llvm-project?rev=41324&view=rev
Log:
Modified CFG to have explicit "Exit" pointer for exit block.  This should
have been committed with my previous patch.

Modified:
    cfe/trunk/include/clang/AST/CFG.h

Modified: cfe/trunk/include/clang/AST/CFG.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/CFG.h?rev=41324&r1=41323&r2=41324&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/CFG.h (original)
+++ cfe/trunk/include/clang/AST/CFG.h Thu Aug 23 11:51:52 2007
@@ -154,17 +154,13 @@
 class CFG {
   typedef std::list<CFGBlock> CFGBlockListTy;
   CFGBlock* Entry;
+  CFGBlock* Exit;
   CFGBlockListTy Blocks;
   
 public:
-  CFG() : Entry(NULL) {};
+  CFG() : Entry(NULL), Exit(NULL) {};
   ~CFG() {};
   
-  CFGBlock* createBlock(unsigned blockID) { 
-    Blocks.push_front(CFGBlock(blockID));
-    return &front();
-  }
-  
   // Block iterators
   typedef CFGBlockListTy::iterator                                    iterator;
   typedef CFGBlockListTy::const_iterator                        const_iterator;
@@ -184,12 +180,13 @@
   const_reverse_iterator       rbegin()      const { return Blocks.rbegin();   }
   const_reverse_iterator       rend()        const { return Blocks.rend();     }
   
-  CFGBlock&                    getEntry()   { return Entry ? *Entry : front(); }
-  CFGBlock&                    getExit()           { return back();            }
+  CFGBlock&                    getEntry()          { return *Entry;            }
+  CFGBlock&                    getExit()           { return *Exit;             }
   
   // Utility
   
-  static CFG* BuildCFG(Stmt* AST);
+  CFGBlock* createBlock(unsigned blockID);
+  static CFG* buildCFG(Stmt* AST);
   void print(std::ostream& OS);
   void dump();
   void setEntry(CFGBlock *B) { Entry = B; }      





More information about the cfe-commits mailing list