aboutsummaryrefslogtreecommitdiffstats
path: root/include/clang/Analysis/AnalysisDeclContext.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2019-01-19 10:04:05 +0000
committerDimitry Andric <dim@FreeBSD.org>2019-01-19 10:04:05 +0000
commit676fbe8105eeb6ff4bb2ed261cb212fcfdbe7b63 (patch)
tree02a1ac369cb734d0abfa5000dd86e5b7797e6a74 /include/clang/Analysis/AnalysisDeclContext.h
parentc7e70c433efc6953dc3888b9fbf9f3512d7da2b0 (diff)
downloadsrc-676fbe8105eeb6ff4bb2ed261cb212fcfdbe7b63.tar.gz
src-676fbe8105eeb6ff4bb2ed261cb212fcfdbe7b63.zip
Vendor import of clang trunk r351319 (just before the release_80 branchvendor/clang/clang-trunk-r351319
Notes
Notes: svn path=/vendor/clang/dist/; revision=343173 svn path=/vendor/clang/clang-trunk-r351319/; revision=343174; tag=vendor/clang/clang-trunk-r351319
Diffstat (limited to 'include/clang/Analysis/AnalysisDeclContext.h')
-rw-r--r--include/clang/Analysis/AnalysisDeclContext.h32
1 files changed, 20 insertions, 12 deletions
diff --git a/include/clang/Analysis/AnalysisDeclContext.h b/include/clang/Analysis/AnalysisDeclContext.h
index 19531d92e645..490d2ce346be 100644
--- a/include/clang/Analysis/AnalysisDeclContext.h
+++ b/include/clang/Analysis/AnalysisDeclContext.h
@@ -40,7 +40,6 @@ class ImplicitParamDecl;
class LocationContext;
class LocationContextManager;
class ParentMap;
-class PseudoConstantAnalysis;
class StackFrameContext;
class Stmt;
class VarDecl;
@@ -84,7 +83,6 @@ class AnalysisDeclContext {
bool builtCFG = false;
bool builtCompleteCFG = false;
std::unique_ptr<ParentMap> PM;
- std::unique_ptr<PseudoConstantAnalysis> PCA;
std::unique_ptr<CFGReverseBlockReachabilityAnalysis> CFA;
llvm::BumpPtrAllocator A;
@@ -175,7 +173,6 @@ public:
bool isCFGBuilt() const { return builtCFG; }
ParentMap &getParentMap();
- PseudoConstantAnalysis *getPseudoConstantAnalysis();
using referenced_decls_iterator = const VarDecl * const *;
@@ -230,17 +227,23 @@ private:
AnalysisDeclContext *Ctx;
const LocationContext *Parent;
+ int64_t ID;
protected:
LocationContext(ContextKind k, AnalysisDeclContext *ctx,
- const LocationContext *parent)
- : Kind(k), Ctx(ctx), Parent(parent) {}
+ const LocationContext *parent,
+ int64_t ID)
+ : Kind(k), Ctx(ctx), Parent(parent), ID(ID) {}
public:
virtual ~LocationContext();
ContextKind getKind() const { return Kind; }
+ int64_t getID() const {
+ return ID;
+ }
+
AnalysisDeclContext *getAnalysisDeclContext() const { return Ctx; }
const LocationContext *getParent() const { return Parent; }
@@ -300,8 +303,9 @@ class StackFrameContext : public LocationContext {
StackFrameContext(AnalysisDeclContext *ctx, const LocationContext *parent,
const Stmt *s, const CFGBlock *blk,
- unsigned idx)
- : LocationContext(StackFrame, ctx, parent), CallSite(s),
+ unsigned idx,
+ int64_t ID)
+ : LocationContext(StackFrame, ctx, parent, ID), CallSite(s),
Block(blk), Index(idx) {}
public:
@@ -337,8 +341,8 @@ class ScopeContext : public LocationContext {
const Stmt *Enter;
ScopeContext(AnalysisDeclContext *ctx, const LocationContext *parent,
- const Stmt *s)
- : LocationContext(Scope, ctx, parent), Enter(s) {}
+ const Stmt *s, int64_t ID)
+ : LocationContext(Scope, ctx, parent, ID), Enter(s) {}
public:
~ScopeContext() override = default;
@@ -364,9 +368,10 @@ class BlockInvocationContext : public LocationContext {
const void *ContextData;
BlockInvocationContext(AnalysisDeclContext *ctx,
- const LocationContext *parent,
- const BlockDecl *bd, const void *contextData)
- : LocationContext(Block, ctx, parent), BD(bd), ContextData(contextData) {}
+ const LocationContext *parent, const BlockDecl *bd,
+ const void *contextData, int64_t ID)
+ : LocationContext(Block, ctx, parent, ID), BD(bd),
+ ContextData(contextData) {}
public:
~BlockInvocationContext() override = default;
@@ -392,6 +397,9 @@ public:
class LocationContextManager {
llvm::FoldingSet<LocationContext> Contexts;
+ /// ID used for generating a new location context.
+ int64_t NewID = 0;
+
public:
~LocationContextManager();