]> granicus.if.org Git - clang/commitdiff
Add PostStmt::getStmtAs(). This unbreaks the build.
authorTed Kremenek <kremenek@apple.com>
Wed, 13 May 2009 19:23:41 +0000 (19:23 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 13 May 2009 19:23:41 +0000 (19:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71701 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Analysis/ProgramPoint.h

index 8e6d5ec8316c157666ceac2bbdbea97e90b6d0c6..d2b536ca1cb2f1cd9f16a6d5ea56c633e92db92b 100644 (file)
@@ -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 @@ public:
   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();