From bc6d0ccf9251b8aabef6d4a12c41929fc6e2eea7 Mon Sep 17 00:00:00 2001 From: Anna Zaks Date: Thu, 9 Aug 2012 02:57:02 +0000 Subject: [PATCH] Unbreak the build. Declaring "const Decl *Decl" is not a good idea. llvm-svn: 161567 --- .../clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h | 15 +++++++++------ clang/lib/StaticAnalyzer/Core/CallEvent.cpp | 4 ++-- clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp | 4 ++-- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h index ab1bcf1..67bc142 100644 --- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h +++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h @@ -68,12 +68,15 @@ public: } }; -struct RuntimeDefinition { - const Decl *Decl; - const MemRegion *Reg; - RuntimeDefinition(): Decl(0), Reg(0) {} - RuntimeDefinition(const class Decl *D): Decl(D), Reg(0) {} - RuntimeDefinition(const class Decl *D, const MemRegion *R): Decl(D), Reg(R){} +class RuntimeDefinition { + const Decl *D; + const MemRegion *R; +public: + RuntimeDefinition(): D(0), R(0) {} + RuntimeDefinition(const Decl *InD): D(InD), R(0) {} + RuntimeDefinition(const Decl *InD, const MemRegion *InR): D(InD), R(InR) {} + const Decl *getDecl() { return D;} + const MemRegion *getReg() {return R;} }; /// \brief Represents an abstract call to a function or method along a diff --git a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp index 2d96a1e..8b96035 100644 --- a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp +++ b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp @@ -383,7 +383,7 @@ static const CXXMethodDecl *devirtualize(const CXXMethodDecl *MD, SVal ThisVal){ RuntimeDefinition CXXInstanceCall::getRuntimeDefinition() const { - const Decl *D = SimpleCall::getRuntimeDefinition().Decl; + const Decl *D = SimpleCall::getRuntimeDefinition().getDecl(); if (!D) return RuntimeDefinition(); @@ -513,7 +513,7 @@ void CXXDestructorCall::getExtraInvalidatedRegions(RegionList &Regions) const { } RuntimeDefinition CXXDestructorCall::getRuntimeDefinition() const { - const Decl *D = AnyFunctionCall::getRuntimeDefinition().Decl; + const Decl *D = AnyFunctionCall::getRuntimeDefinition().getDecl(); if (!D) return RuntimeDefinition(); diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp index 9dd100a..d3d097c 100644 --- a/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp +++ b/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp @@ -545,10 +545,10 @@ void ExprEngine::defaultEvalCall(NodeBuilder &Bldr, ExplodedNode *Pred, State = InlinedFailedState; } else if (getAnalysisManager().shouldInlineCall()) { RuntimeDefinition RD = Call->getRuntimeDefinition(); - const Decl *D = RD.Decl; + const Decl *D = RD.getDecl(); if (D) { // Explore with and without inlining the call. - const MemRegion *BifurReg = RD.Reg; + const MemRegion *BifurReg = RD.getReg(); if (BifurReg && getAnalysisManager().IPAMode == DynamicDispatchBifurcate) { BifurcateCall(BifurReg, *Call, D, Bldr, Pred); -- 2.7.4