[cfe-commits] r71701 - /cfe/trunk/include/clang/Analysis/ProgramPoint.h
Ted Kremenek
kremenek at apple.com
Wed May 13 12:23:56 PDT 2009
Author: kremenek
Date: Wed May 13 14:23:41 2009
New Revision: 71701
URL: http://llvm.org/viewvc/llvm-project?rev=71701&view=rev
Log:
Add PostStmt::getStmtAs(). This unbreaks the build.
Modified:
cfe/trunk/include/clang/Analysis/ProgramPoint.h
Modified: cfe/trunk/include/clang/Analysis/ProgramPoint.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/ProgramPoint.h?rev=71701&r1=71700&r2=71701&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/ProgramPoint.h (original)
+++ cfe/trunk/include/clang/Analysis/ProgramPoint.h Wed May 13 14:23:41 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 cfe-commits
mailing list