aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2010-07-02 07:03:03 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2010-07-02 07:03:03 +0000
commit81cc955f12c4ea44e43c56e9d1416a15ed64df99 (patch)
tree646fd69f4697db5cb1803f222de676f49893c778 /examples
parent9b80ceba0f930f84731c2b8c1df43f66cba762d0 (diff)
add -analyze-function option.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107463 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'examples')
-rw-r--r--examples/wpa/clang-wpa.cpp14
1 files changed, 12 insertions, 2 deletions
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<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 @@ int main(int argc, char **argv) {
CG->ViewCallGraph();
return 0;
}
+
+ if (AnalyzeFunction.empty())
+ return 0;
+
+ llvm::outs() << "Analyze function: " << AnalyzeFunction << '\n';
+ return 0;
}