[cfe-commits] r107463 - /cfe/trunk/examples/wpa/clang-wpa.cpp

Zhongxing Xu xuzhongxing at gmail.com
Fri Jul 2 00:03:03 PDT 2010


Author: zhongxingxu
Date: Fri Jul  2 02:03:03 2010
New Revision: 107463

URL: http://llvm.org/viewvc/llvm-project?rev=107463&view=rev
Log:
add -analyze-function option.

Modified:
    cfe/trunk/examples/wpa/clang-wpa.cpp

Modified: cfe/trunk/examples/wpa/clang-wpa.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/examples/wpa/clang-wpa.cpp?rev=107463&r1=107462&r2=107463&view=diff
==============================================================================
--- cfe/trunk/examples/wpa/clang-wpa.cpp (original)
+++ cfe/trunk/examples/wpa/clang-wpa.cpp Fri Jul  2 02:03:03 2010
@@ -26,8 +26,12 @@
 static llvm::cl::list<std::string>
 InputFilenames(llvm::cl::Positional, llvm::cl::desc("<input AST files>"));
 
-static llvm::cl::opt<bool> ViewCallGraph("view-call-graph", 
-                                     llvm::cl::desc("Display the call graph."));
+static llvm::cl::opt<bool> 
+ViewCallGraph("view-call-graph", llvm::cl::desc("Display the call graph."));
+
+static llvm::cl::opt<std::string>
+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 @@
     CG->ViewCallGraph();
     return 0;
   }
+
+  if (AnalyzeFunction.empty())
+    return 0;
+
+  llvm::outs() << "Analyze function: " << AnalyzeFunction << '\n';
+  return 0;
 }





More information about the cfe-commits mailing list