diff options
author | Anna Zaks <ganna@apple.com> | 2011-10-07 21:01:38 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2011-10-07 21:01:38 +0000 |
commit | 63d3201619fdac284adfd3b9328562fa20a01c40 (patch) | |
tree | b5b9131a4262a87332a66dce8bb450c5ecc160c8 /lib/Analysis/ProgramPoint.cpp | |
parent | 8828ee7faa42f889ade3bb635dc5f1338be671b1 (diff) |
ProgramPoint cleanup after the previous commit r141408 (remove the copy constructor, mark withTag const).
Move getProgramPoint() utility from CoreEngine.cpp into ProgramPoint.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141414 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ProgramPoint.cpp')
-rw-r--r-- | lib/Analysis/ProgramPoint.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/Analysis/ProgramPoint.cpp b/lib/Analysis/ProgramPoint.cpp index 9b7df2c042..3a0bbd5640 100644 --- a/lib/Analysis/ProgramPoint.cpp +++ b/lib/Analysis/ProgramPoint.cpp @@ -18,6 +18,31 @@ using namespace clang; ProgramPointTag::~ProgramPointTag() {} +ProgramPoint ProgramPoint::getProgramPoint(const Stmt *S, ProgramPoint::Kind K, + const LocationContext *LC, + const ProgramPointTag *tag){ + switch (K) { + default: + llvm_unreachable("Unhandled ProgramPoint kind"); + case ProgramPoint::PreStmtKind: + return PreStmt(S, LC, tag); + case ProgramPoint::PostStmtKind: + return PostStmt(S, LC, tag); + case ProgramPoint::PreLoadKind: + return PreLoad(S, LC, tag); + case ProgramPoint::PostLoadKind: + return PostLoad(S, LC, tag); + case ProgramPoint::PreStoreKind: + return PreStore(S, LC, tag); + case ProgramPoint::PostStoreKind: + return PostStore(S, LC, tag); + case ProgramPoint::PostLValueKind: + return PostLValue(S, LC, tag); + case ProgramPoint::PostPurgeDeadSymbolsKind: + return PostPurgeDeadSymbols(S, LC, tag); + } +} + SimpleProgramPointTag::SimpleProgramPointTag(StringRef description) : desc(description) {} |