diff options
| author | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-08-03 02:52:14 +0000 |
|---|---|---|
| committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-08-03 02:52:14 +0000 |
| commit | 4f4b643afa2edc0821cd09b0d0337964283115d8 (patch) | |
| tree | 4a5e777d6746f8cdaca913843805256bcbc6ca72 /clang | |
| parent | 18ba271a79e5ca2d60ec98ea55451c70d51d4c99 (diff) | |
| download | bcm5719-llvm-4f4b643afa2edc0821cd09b0d0337964283115d8.tar.gz bcm5719-llvm-4f4b643afa2edc0821cd09b0d0337964283115d8.zip | |
Add LocationContext classes to enable creation of cross function
ProgramPoints. ProgramPoints will refer to them in the furture.
llvm-svn: 77941
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/include/clang/Analysis/PathSensitive/AnalysisContext.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/clang/include/clang/Analysis/PathSensitive/AnalysisContext.h b/clang/include/clang/Analysis/PathSensitive/AnalysisContext.h index 2d3f15933c6..13331fa0008 100644 --- a/clang/include/clang/Analysis/PathSensitive/AnalysisContext.h +++ b/clang/include/clang/Analysis/PathSensitive/AnalysisContext.h @@ -16,6 +16,7 @@ #define LLVM_CLANG_ANALYSIS_ANALYSISCONTEXT_H #include "llvm/ADT/OwningPtr.h" +#include "llvm/ADT/FoldingSet.h" #include <map> namespace clang { @@ -58,6 +59,40 @@ public: AnalysisContext *getContext(Decl *D); }; +class LocationContext : public llvm::FoldingSetNode { +public: + enum ContextKind { StackFrame, Scope }; + +private: + ContextKind Kind; + LocationContext *Parent; + AnalysisContext *Ctx; + +protected: + LocationContext(ContextKind k, LocationContext *parent, AnalysisContext *ctx) + : Kind(k), Parent(parent), Ctx(ctx) {} +}; + +class StackFrameContext : public LocationContext { + Stmt *CallSite; + +public: + StackFrameContext(Stmt *s, LocationContext *parent, AnalysisContext *ctx) + : LocationContext(StackFrame, parent, ctx), CallSite(s) {} +}; + +class ScopeContext : public LocationContext { + Stmt *Enter; + +public: + ScopeContext(Stmt *s, LocationContext *parent, AnalysisContext *ctx) + : LocationContext(Scope, parent, ctx), Enter(s) {} +}; + +class LocationContextManager { + llvm::FoldingSet<LocationContext> Contexts; +}; + } #endif |

