[llvm-branch-commits] [cfe-branch] r71712 - /cfe/branches/Apple/Dib/include/clang/Analysis/ProgramPoint.h

Mike Stump mrs at apple.com
Wed May 13 13:12:31 PDT 2009


Author: mrs
Date: Wed May 13 15:12:26 2009
New Revision: 71712

URL: http://llvm.org/viewvc/llvm-project?rev=71712&view=rev
Log:
Merge in 71701:

Add PostStmt::getStmtAs().  This unbreaks the build.

Modified:
    cfe/branches/Apple/Dib/include/clang/Analysis/ProgramPoint.h

Modified: cfe/branches/Apple/Dib/include/clang/Analysis/ProgramPoint.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/Dib/include/clang/Analysis/ProgramPoint.h?rev=71712&r1=71711&r2=71712&view=diff

==============================================================================
--- cfe/branches/Apple/Dib/include/clang/Analysis/ProgramPoint.h (original)
+++ cfe/branches/Apple/Dib/include/clang/Analysis/ProgramPoint.h Wed May 13 15:12:26 2009
@@ -19,6 +19,7 @@
 #include "llvm/Support/DataTypes.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/FoldingSet.h"
+#include "llvm/Support/Casting.h"
 #include <cassert>
 #include <utility>
 
@@ -182,8 +183,10 @@
   PostStmt(const Stmt* S, const void *tag = 0)
     : ProgramPoint(S, PostStmtKind, tag) {}
 
-      
   Stmt* getStmt() const { return (Stmt*) getData1(); }
+  
+  template<typename T>
+  T* getStmtAs() const { return llvm::dyn_cast<T>(getStmt()); }
 
   static bool classof(const ProgramPoint* Location) {
     unsigned k = Location->getKind();





More information about the llvm-branch-commits mailing list