Ted Kremenek | ca80453 | 2011-08-12 23:04:46 +0000 | [diff] [blame] | 1 | //==- ProgramPoint.cpp - Program Points for Path-Sensitive Analysis -*- C++ -*-/ |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file defines the interface ProgramPoint, which identifies a |
| 11 | // distinct location in a function. |
| 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
| 15 | #include "clang/Analysis/ProgramPoint.h" |
| 16 | |
| 17 | using namespace clang; |
| 18 | |
| 19 | ProgramPointTag::~ProgramPointTag() {} |
| 20 | |
Anna Zaks | 63d3201 | 2011-10-07 21:01:38 +0000 | [diff] [blame] | 21 | ProgramPoint ProgramPoint::getProgramPoint(const Stmt *S, ProgramPoint::Kind K, |
| 22 | const LocationContext *LC, |
| 23 | const ProgramPointTag *tag){ |
| 24 | switch (K) { |
| 25 | default: |
| 26 | llvm_unreachable("Unhandled ProgramPoint kind"); |
| 27 | case ProgramPoint::PreStmtKind: |
| 28 | return PreStmt(S, LC, tag); |
| 29 | case ProgramPoint::PostStmtKind: |
| 30 | return PostStmt(S, LC, tag); |
| 31 | case ProgramPoint::PreLoadKind: |
| 32 | return PreLoad(S, LC, tag); |
| 33 | case ProgramPoint::PostLoadKind: |
| 34 | return PostLoad(S, LC, tag); |
| 35 | case ProgramPoint::PreStoreKind: |
| 36 | return PreStore(S, LC, tag); |
| 37 | case ProgramPoint::PostStoreKind: |
| 38 | return PostStore(S, LC, tag); |
| 39 | case ProgramPoint::PostLValueKind: |
| 40 | return PostLValue(S, LC, tag); |
| 41 | case ProgramPoint::PostPurgeDeadSymbolsKind: |
| 42 | return PostPurgeDeadSymbols(S, LC, tag); |
| 43 | } |
| 44 | } |
| 45 | |
Ted Kremenek | ca80453 | 2011-08-12 23:04:46 +0000 | [diff] [blame] | 46 | SimpleProgramPointTag::SimpleProgramPointTag(StringRef description) |
| 47 | : desc(description) {} |
| 48 | |
| 49 | StringRef SimpleProgramPointTag::getTagDescription() const { |
| 50 | return desc; |
| 51 | } |