[analyzer] refactor: access IPAMode through the accessor.

llvm-svn: 173384
This commit is contained in:
Anna Zaks 2013-01-24 23:15:25 +00:00
parent b18179da33
commit c7f5e69e50
3 changed files with 12 additions and 5 deletions

View File

@ -210,6 +210,10 @@ private:
int getOptionAsInteger(StringRef Name, int DefaultVal);
public:
AnalysisIPAMode getIPAMode() const {
return IPAMode;
}
/// Returns the option controlling which C++ member functions will be
/// considered for inlining.
///

View File

@ -22,7 +22,7 @@ using namespace llvm;
bool
AnalyzerOptions::mayInlineCXXMemberFunction(CXXInlineableMemberKind K) {
if (IPAMode < Inlining)
if (getIPAMode() < Inlining)
return false;
if (!CXXMemberInliningMode) {

View File

@ -558,8 +558,9 @@ bool ExprEngine::inlineCall(const CallEvent &Call, const Decl *D,
case CE_ObjCMessage:
if (!Opts.mayInlineObjCMethod())
return false;
if (!(getAnalysisManager().options.IPAMode == DynamicDispatch ||
getAnalysisManager().options.IPAMode == DynamicDispatchBifurcate))
AnalyzerOptions &Options = getAnalysisManager().options;
if (!(Options.getIPAMode() == DynamicDispatch ||
Options.getIPAMode() == DynamicDispatchBifurcate))
return false;
break;
}
@ -737,14 +738,16 @@ void ExprEngine::defaultEvalCall(NodeBuilder &Bldr, ExplodedNode *Pred,
const Decl *D = RD.getDecl();
if (D) {
if (RD.mayHaveOtherDefinitions()) {
AnalyzerOptions &Options = getAnalysisManager().options;
// Explore with and without inlining the call.
if (getAnalysisManager().options.IPAMode == DynamicDispatchBifurcate) {
if (Options.getIPAMode() == DynamicDispatchBifurcate) {
BifurcateCall(RD.getDispatchRegion(), *Call, D, Bldr, Pred);
return;
}
// Don't inline if we're not in any dynamic dispatch mode.
if (getAnalysisManager().options.IPAMode != DynamicDispatch) {
if (Options.getIPAMode() != DynamicDispatch) {
conservativeEvalCall(*Call, Bldr, Pred, State);
return;
}