aboutsummaryrefslogtreecommitdiff
path: root/tools/llvm-extract/llvm-extract.cpp
diff options
context:
space:
mode:
authorAndrew Lenharth <andrewl@lenharth.org>2008-03-07 20:10:54 +0000
committerAndrew Lenharth <andrewl@lenharth.org>2008-03-07 20:10:54 +0000
commitc77e4d1569ab66f735a9d508bfa46985f2046c60 (patch)
tree6004f67d375b4c2fe058a59ed5283414c8c0dadd /tools/llvm-extract/llvm-extract.cpp
parent22a8a734e941762ae67c3bb7cfa385bf02395ba9 (diff)
only extract main if the user didn't specify anything to extract
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48023 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-extract/llvm-extract.cpp')
-rw-r--r--tools/llvm-extract/llvm-extract.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/llvm-extract/llvm-extract.cpp b/tools/llvm-extract/llvm-extract.cpp
index 1950f53972..360630b41d 100644
--- a/tools/llvm-extract/llvm-extract.cpp
+++ b/tools/llvm-extract/llvm-extract.cpp
@@ -81,7 +81,7 @@ int main(int argc, char **argv) {
M.get()->getNamedGlobal(ExtractGlobal) : 0;
// Figure out which function we should extract
- if (!ExtractFunc.size()) ExtractFunc = "main";
+ if (!ExtractFunc.size() && !ExtractGlobal.size()) ExtractFunc = "main";
Function *F = M.get()->getFunction(ExtractFunc);
if (F == 0 && G == 0) {