1 //==- ProgramPoint.cpp - Program Points for Path-Sensitive Analysis -*- C++ -*-/
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines the interface ProgramPoint, which identifies a
11 // distinct location in a function.
13 //===----------------------------------------------------------------------===//
15 #include "clang/Analysis/ProgramPoint.h"
17 using namespace clang;
19 ProgramPointTag::~ProgramPointTag() {}
21 ProgramPoint ProgramPoint::getProgramPoint(const Stmt *S, ProgramPoint::Kind K,
22 const LocationContext *LC,
23 const ProgramPointTag *tag){
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::PostLValueKind:
38 return PostLValue(S, LC, tag);
39 case ProgramPoint::PostStmtPurgeDeadSymbolsKind:
40 return PostStmtPurgeDeadSymbols(S, LC, tag);
41 case ProgramPoint::PreStmtPurgeDeadSymbolsKind:
42 return PreStmtPurgeDeadSymbols(S, LC, tag);
46 SimpleProgramPointTag::SimpleProgramPointTag(StringRef description)
47 : desc(description) {}
49 StringRef SimpleProgramPointTag::getTagDescription() const {