private:
ContextKind Kind;
AnalysisContext *Ctx;
- LocationContext *Parent;
+ const LocationContext *Parent;
protected:
- LocationContext(ContextKind k, AnalysisContext *ctx, LocationContext *parent)
+ LocationContext(ContextKind k, AnalysisContext *ctx,
+ const LocationContext *parent)
: Kind(k), Ctx(ctx), Parent(parent) {}
public:
AnalysisContext *getAnalysisContext() const { return Ctx; }
- LocationContext *getParent() const { return Parent; }
+ const LocationContext *getParent() const { return Parent; }
const Decl *getDecl() const { return getAnalysisContext()->getDecl(); }
}
static void Profile(llvm::FoldingSetNodeID &ID, ContextKind k,
- AnalysisContext *ctx, LocationContext *parent);
+ AnalysisContext *ctx, const LocationContext *parent);
static bool classof(const LocationContext*) { return true; }
};
class StackFrameContext : public LocationContext {
- Stmt *CallSite;
+ const Stmt *CallSite;
public:
- StackFrameContext(AnalysisContext *ctx, LocationContext *parent, Stmt *s)
+ StackFrameContext(AnalysisContext *ctx, const LocationContext *parent,
+ const Stmt *s)
: LocationContext(StackFrame, ctx, parent), CallSite(s) {}
void Profile(llvm::FoldingSetNodeID &ID) {
}
static void Profile(llvm::FoldingSetNodeID &ID, AnalysisContext *ctx,
- LocationContext *parent, Stmt *s);
+ const LocationContext *parent, const Stmt *s);
static bool classof(const LocationContext* Ctx) {
return Ctx->getKind() == StackFrame;
};
class ScopeContext : public LocationContext {
- Stmt *Enter;
+ const Stmt *Enter;
public:
- ScopeContext(AnalysisContext *ctx, LocationContext *parent, Stmt *s)
+ ScopeContext(AnalysisContext *ctx, const LocationContext *parent,
+ const Stmt *s)
: LocationContext(Scope, ctx, parent), Enter(s) {}
void Profile(llvm::FoldingSetNodeID &ID) {
}
static void Profile(llvm::FoldingSetNodeID &ID, AnalysisContext *ctx,
- LocationContext *parent, Stmt *s);
+ const LocationContext *parent, const Stmt *s);
static bool classof(const LocationContext* Ctx) {
return Ctx->getKind() == Scope;
llvm::FoldingSet<LocationContext> Contexts;
public:
- StackFrameContext *getStackFrame(AnalysisContext *ctx,LocationContext *parent,
- Stmt *s);
-
- ScopeContext *getScope(AnalysisContext *ctx,LocationContext *parent, Stmt *s);
+ StackFrameContext *getStackFrame(AnalysisContext *ctx,
+ const LocationContext *parent,
+ const Stmt *s);
+ ScopeContext *getScope(AnalysisContext *ctx, const LocationContext *parent,
+ const Stmt *s);
};
-
-}
-
+
+} // end clang namespace
#endif
}
void LocationContext::Profile(llvm::FoldingSetNodeID &ID, ContextKind k,
- AnalysisContext *ctx, LocationContext *parent) {
+ AnalysisContext *ctx,
+ const LocationContext *parent) {
ID.AddInteger(k);
ID.AddPointer(ctx);
ID.AddPointer(parent);
}
void StackFrameContext::Profile(llvm::FoldingSetNodeID &ID,AnalysisContext *ctx,
- LocationContext *parent, Stmt *s) {
+ const LocationContext *parent, const Stmt *s) {
LocationContext::Profile(ID, StackFrame, ctx, parent);
ID.AddPointer(s);
}
void ScopeContext::Profile(llvm::FoldingSetNodeID &ID, AnalysisContext *ctx,
- LocationContext *parent, Stmt *s) {
+ const LocationContext *parent, const Stmt *s) {
LocationContext::Profile(ID, Scope, ctx, parent);
ID.AddPointer(s);
}
-StackFrameContext *LocationContextManager::getStackFrame(AnalysisContext *ctx,
- LocationContext *parent, Stmt *s) {
+StackFrameContext*
+LocationContextManager::getStackFrame(AnalysisContext *ctx,
+ const LocationContext *parent,
+ const Stmt *s) {
llvm::FoldingSetNodeID ID;
StackFrameContext::Profile(ID, ctx, parent, s);
void *InsertPos;
}
ScopeContext *LocationContextManager::getScope(AnalysisContext *ctx,
- LocationContext *parent, Stmt *s) {
+ const LocationContext *parent,
+ const Stmt *s) {
llvm::FoldingSetNodeID ID;
ScopeContext::Profile(ID, ctx, parent, s);
void *InsertPos;