forked from OSchip/llvm-project
[analyzer] refactor: access IPAMode through the accessor.
llvm-svn: 173384
This commit is contained in:
parent
b18179da33
commit
c7f5e69e50
|
@ -210,6 +210,10 @@ private:
|
||||||
int getOptionAsInteger(StringRef Name, int DefaultVal);
|
int getOptionAsInteger(StringRef Name, int DefaultVal);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
AnalysisIPAMode getIPAMode() const {
|
||||||
|
return IPAMode;
|
||||||
|
}
|
||||||
|
|
||||||
/// Returns the option controlling which C++ member functions will be
|
/// Returns the option controlling which C++ member functions will be
|
||||||
/// considered for inlining.
|
/// considered for inlining.
|
||||||
///
|
///
|
||||||
|
|
|
@ -22,7 +22,7 @@ using namespace llvm;
|
||||||
|
|
||||||
bool
|
bool
|
||||||
AnalyzerOptions::mayInlineCXXMemberFunction(CXXInlineableMemberKind K) {
|
AnalyzerOptions::mayInlineCXXMemberFunction(CXXInlineableMemberKind K) {
|
||||||
if (IPAMode < Inlining)
|
if (getIPAMode() < Inlining)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!CXXMemberInliningMode) {
|
if (!CXXMemberInliningMode) {
|
||||||
|
|
|
@ -558,8 +558,9 @@ bool ExprEngine::inlineCall(const CallEvent &Call, const Decl *D,
|
||||||
case CE_ObjCMessage:
|
case CE_ObjCMessage:
|
||||||
if (!Opts.mayInlineObjCMethod())
|
if (!Opts.mayInlineObjCMethod())
|
||||||
return false;
|
return false;
|
||||||
if (!(getAnalysisManager().options.IPAMode == DynamicDispatch ||
|
AnalyzerOptions &Options = getAnalysisManager().options;
|
||||||
getAnalysisManager().options.IPAMode == DynamicDispatchBifurcate))
|
if (!(Options.getIPAMode() == DynamicDispatch ||
|
||||||
|
Options.getIPAMode() == DynamicDispatchBifurcate))
|
||||||
return false;
|
return false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -737,14 +738,16 @@ void ExprEngine::defaultEvalCall(NodeBuilder &Bldr, ExplodedNode *Pred,
|
||||||
const Decl *D = RD.getDecl();
|
const Decl *D = RD.getDecl();
|
||||||
if (D) {
|
if (D) {
|
||||||
if (RD.mayHaveOtherDefinitions()) {
|
if (RD.mayHaveOtherDefinitions()) {
|
||||||
|
AnalyzerOptions &Options = getAnalysisManager().options;
|
||||||
|
|
||||||
// Explore with and without inlining the call.
|
// Explore with and without inlining the call.
|
||||||
if (getAnalysisManager().options.IPAMode == DynamicDispatchBifurcate) {
|
if (Options.getIPAMode() == DynamicDispatchBifurcate) {
|
||||||
BifurcateCall(RD.getDispatchRegion(), *Call, D, Bldr, Pred);
|
BifurcateCall(RD.getDispatchRegion(), *Call, D, Bldr, Pred);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't inline if we're not in any dynamic dispatch mode.
|
// 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);
|
conservativeEvalCall(*Call, Bldr, Pred, State);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue