Running -grsimple now emits diagnostics about the time spent analyzing each function. Will
probably make this a separate command line option later.
Added "--analyze-function" option to the driver to (gradually) allow different
analyses to only be run on specific functions. Currently only --grsimple uses
this option.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47285 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/clang.cpp b/Driver/clang.cpp
index 4c6a47c..08eef52 100644
--- a/Driver/clang.cpp
+++ b/Driver/clang.cpp
@@ -449,6 +449,14 @@
}
//===----------------------------------------------------------------------===//
+// Analysis-specific options.
+//===----------------------------------------------------------------------===//
+
+static llvm::cl::opt<std::string>
+AnalyzeSpecificFunction("analyze-function",
+ llvm::cl::desc("Run analysis on specific function."));
+
+//===----------------------------------------------------------------------===//
// Target Triple Processing.
//===----------------------------------------------------------------------===//
@@ -982,10 +990,10 @@
return CreateUnitValsChecker(Diag);
case AnalysisGRSimpleVals:
- return CreateGRSimpleVals(Diag);
+ return CreateGRSimpleVals(Diag, AnalyzeSpecificFunction);
case AnalysisGRSimpleValsView:
- return CreateGRSimpleVals(Diag, true);
+ return CreateGRSimpleVals(Diag, AnalyzeSpecificFunction, true);
case TestSerialization:
return CreateSerializationTest(Diag, FileMgr, LangOpts);