aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/BasicStore.cpp2
-rw-r--r--lib/Analysis/BugReporter.cpp6
-rw-r--r--lib/Analysis/CFRefCount.cpp3
-rw-r--r--lib/Analysis/CheckObjCDealloc.cpp4
-rw-r--r--lib/Analysis/CheckObjCUnusedIVars.cpp2
-rw-r--r--lib/Analysis/PathDiagnostic.cpp9
6 files changed, 16 insertions, 10 deletions
diff --git a/lib/Analysis/BasicStore.cpp b/lib/Analysis/BasicStore.cpp
index 566c1971b7..9047d9d8a9 100644
--- a/lib/Analysis/BasicStore.cpp
+++ b/lib/Analysis/BasicStore.cpp
@@ -525,7 +525,7 @@ Store BasicStoreManager::getInitialStore() {
// Scan the method for ivar references. While this requires an
// entire AST scan, the cost should not be high in practice.
- St = scanForIvars(MD->getBody(), PD, St);
+ St = scanForIvars(MD->getBody(getContext()), PD, St);
}
}
}
diff --git a/lib/Analysis/BugReporter.cpp b/lib/Analysis/BugReporter.cpp
index 01f5e81bf5..7e7132aaab 100644
--- a/lib/Analysis/BugReporter.cpp
+++ b/lib/Analysis/BugReporter.cpp
@@ -140,7 +140,7 @@ public:
const ExplodedNode<GRState>* N);
ParentMap& getParentMap() {
- if (PM.get() == 0) PM.reset(new ParentMap(CodeDecl.getBody()));
+ if (PM.get() == 0) PM.reset(new ParentMap(CodeDecl.getBody(getContext())));
return *PM.get();
}
@@ -163,7 +163,7 @@ public:
BugReport& getReport() { return *R; }
GRBugReporter& getBugReporter() { return BR; }
GRStateManager& getStateManager() { return BR.getStateManager(); }
-
+
PathDiagnosticLocation getEnclosingStmtLocation(const Stmt *S);
PathDiagnosticLocation
@@ -189,7 +189,7 @@ PathDiagnosticBuilder::ExecutionContinues(const ExplodedNode<GRState>* N) {
if (Stmt *S = GetNextStmt(N))
return PathDiagnosticLocation(S, SMgr);
- return FullSourceLoc(CodeDecl.getBody()->getRBracLoc(), SMgr);
+ return FullSourceLoc(CodeDecl.getBody(getContext())->getRBracLoc(), SMgr);
}
PathDiagnosticLocation
diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp
index cfeabd0cb1..7443c521b3 100644
--- a/lib/Analysis/CFRefCount.cpp
+++ b/lib/Analysis/CFRefCount.cpp
@@ -2903,7 +2903,8 @@ CFRefLeakReport::getEndPath(BugReporter& br, const ExplodedNode<GRState>* EndN){
}
if (!L.isValid()) {
- CompoundStmt *CS = BR.getStateManager().getCodeDecl().getBody();
+ CompoundStmt *CS
+ = BR.getStateManager().getCodeDecl().getBody(BR.getContext());
L = PathDiagnosticLocation(CS->getRBracLoc(), SMgr);
}
diff --git a/lib/Analysis/CheckObjCDealloc.cpp b/lib/Analysis/CheckObjCDealloc.cpp
index a14ae26512..0d6e7e46a0 100644
--- a/lib/Analysis/CheckObjCDealloc.cpp
+++ b/lib/Analysis/CheckObjCDealloc.cpp
@@ -172,7 +172,7 @@ void clang::CheckObjCDealloc(ObjCImplementationDecl* D,
}
// dealloc found. Scan for missing [super dealloc].
- if (MD->getBody() && !scan_dealloc(MD->getBody(), S)) {
+ if (MD->getBody(Ctx) && !scan_dealloc(MD->getBody(Ctx), S)) {
const char* name = LOpts.getGCMode() == LangOptions::NonGC
? "missing [super dealloc]"
@@ -223,7 +223,7 @@ void clang::CheckObjCDealloc(ObjCImplementationDecl* D,
// ivar must be released if and only if the kind of setter was not 'assign'
bool requiresRelease = PD->getSetterKind() != ObjCPropertyDecl::Assign;
- if(scan_ivar_release(MD->getBody(), ID, PD, RS, SelfII, Ctx)
+ if(scan_ivar_release(MD->getBody(Ctx), ID, PD, RS, SelfII, Ctx)
!= requiresRelease) {
const char *name;
const char* category = "Memory (Core Foundation/Objective-C)";
diff --git a/lib/Analysis/CheckObjCUnusedIVars.cpp b/lib/Analysis/CheckObjCUnusedIVars.cpp
index 658a6b189a..57fad8d86b 100644
--- a/lib/Analysis/CheckObjCUnusedIVars.cpp
+++ b/lib/Analysis/CheckObjCUnusedIVars.cpp
@@ -85,7 +85,7 @@ void clang::CheckObjCUnusedIvar(ObjCImplementationDecl* D, BugReporter& BR) {
// Now scan the methods for accesses.
for (ObjCImplementationDecl::instmeth_iterator I = D->instmeth_begin(),
E = D->instmeth_end(); I!=E; ++I)
- Scan(M, (*I)->getBody());
+ Scan(M, (*I)->getBody(BR.getContext()));
// Scan for @synthesized property methods that act as setters/getters
// to an ivar.
diff --git a/lib/Analysis/PathDiagnostic.cpp b/lib/Analysis/PathDiagnostic.cpp
index da007c16ec..1d00727d0a 100644
--- a/lib/Analysis/PathDiagnostic.cpp
+++ b/lib/Analysis/PathDiagnostic.cpp
@@ -171,8 +171,13 @@ SourceRange PathDiagnosticLocation::asRange() const {
case DeclK:
if (const ObjCMethodDecl *MD = dyn_cast<ObjCMethodDecl>(D))
return MD->getSourceRange();
- if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D))
- return FD->getBody()->getSourceRange();
+ if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
+ // FIXME: We would like to always get the function body, even
+ // when it needs to be de-serialized, but getting the
+ // ASTContext here requires significant changes.
+ if (CompoundStmt *Body = FD->getBodyIfAvailable())
+ return Body->getSourceRange();
+ }
else {
SourceLocation L = D->getLocation();
return SourceRange(L, L);