From: Zhongxing Xu Date: Fri, 2 Jul 2010 07:03:03 +0000 (+0000) Subject: add -analyze-function option. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=81cc955f12c4ea44e43c56e9d1416a15ed64df99;p=clang add -analyze-function option. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107463 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/examples/wpa/clang-wpa.cpp b/examples/wpa/clang-wpa.cpp index 04a706e0a0..aa78a7721d 100644 --- a/examples/wpa/clang-wpa.cpp +++ b/examples/wpa/clang-wpa.cpp @@ -26,8 +26,12 @@ using namespace idx; static llvm::cl::list InputFilenames(llvm::cl::Positional, llvm::cl::desc("")); -static llvm::cl::opt ViewCallGraph("view-call-graph", - llvm::cl::desc("Display the call graph.")); +static llvm::cl::opt +ViewCallGraph("view-call-graph", llvm::cl::desc("Display the call graph.")); + +static llvm::cl::opt +AnalyzeFunction("analyze-function", + llvm::cl::desc("Specify the entry function.")); int main(int argc, char **argv) { llvm::cl::ParseCommandLineOptions(argc, argv, "clang-wpa"); @@ -61,4 +65,10 @@ int main(int argc, char **argv) { CG->ViewCallGraph(); return 0; } + + if (AnalyzeFunction.empty()) + return 0; + + llvm::outs() << "Analyze function: " << AnalyzeFunction << '\n'; + return 0; }