mirror of
https://github.com/intel/llvm.git
synced 2026-01-20 01:58:44 +08:00
Add configuration plumbing to enable static initializer branching in the CFG for the analyzer.
This setting still isn't enabled yet in the analyzer. This is just prep work. llvm-svn: 178317
This commit is contained in:
@@ -410,7 +410,8 @@ public:
|
||||
bool addImplicitDtors = false,
|
||||
bool addInitializers = false,
|
||||
bool addTemporaryDtors = false,
|
||||
bool synthesizeBodies = false);
|
||||
bool synthesizeBodies = false,
|
||||
bool addStaticInitBranches = false);
|
||||
|
||||
~AnalysisDeclContextManager();
|
||||
|
||||
|
||||
@@ -313,6 +313,10 @@ public:
|
||||
/// values "true" and "false".
|
||||
bool shouldPrunePaths();
|
||||
|
||||
/// Returns true if 'static' initializers should be in conditional logic
|
||||
/// in the CFG.
|
||||
bool shouldConditionalizeStaticInitializers();
|
||||
|
||||
// Returns the size of the functions (in basic blocks), which should be
|
||||
// considered to be small enough to always inline.
|
||||
//
|
||||
|
||||
@@ -66,13 +66,15 @@ AnalysisDeclContextManager::AnalysisDeclContextManager(bool useUnoptimizedCFG,
|
||||
bool addImplicitDtors,
|
||||
bool addInitializers,
|
||||
bool addTemporaryDtors,
|
||||
bool synthesizeBodies)
|
||||
bool synthesizeBodies,
|
||||
bool addStaticInitBranch)
|
||||
: SynthesizeBodies(synthesizeBodies)
|
||||
{
|
||||
cfgBuildOptions.PruneTriviallyFalseEdges = !useUnoptimizedCFG;
|
||||
cfgBuildOptions.AddImplicitDtors = addImplicitDtors;
|
||||
cfgBuildOptions.AddInitializers = addInitializers;
|
||||
cfgBuildOptions.AddTemporaryDtors = addTemporaryDtors;
|
||||
cfgBuildOptions.AddStaticInitBranches = addStaticInitBranch;
|
||||
}
|
||||
|
||||
void AnalysisDeclContextManager::clear() {
|
||||
|
||||
@@ -25,7 +25,8 @@ AnalysisManager::AnalysisManager(ASTContext &ctx, DiagnosticsEngine &diags,
|
||||
/*AddImplicitDtors=*/true,
|
||||
/*AddInitializers=*/true,
|
||||
Options.includeTemporaryDtorsInCFG(),
|
||||
Options.shouldSynthesizeBodies()),
|
||||
Options.shouldSynthesizeBodies(),
|
||||
Options.shouldConditionalizeStaticInitializers()),
|
||||
Ctx(ctx),
|
||||
Diags(diags),
|
||||
LangOpts(lang),
|
||||
|
||||
@@ -236,3 +236,8 @@ bool AnalyzerOptions::shouldSynthesizeBodies() {
|
||||
bool AnalyzerOptions::shouldPrunePaths() {
|
||||
return getBooleanOption("prune-paths", true);
|
||||
}
|
||||
|
||||
bool AnalyzerOptions::shouldConditionalizeStaticInitializers() {
|
||||
return getBooleanOption("conditional-static-initializers", false);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user