aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Analysis/ProgramPoint.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/Analysis/ProgramPoint.h')
-rw-r--r--include/clang/Analysis/ProgramPoint.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/clang/Analysis/ProgramPoint.h b/include/clang/Analysis/ProgramPoint.h
index 8e6d5ec831..d2b536ca1c 100644
--- a/include/clang/Analysis/ProgramPoint.h
+++ b/include/clang/Analysis/ProgramPoint.h
@@ -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();