OSDN Git Service

make error message reflect default search function name
authorAndrew Lenharth <andrewl@lenharth.org>
Fri, 7 Mar 2008 20:07:24 +0000 (20:07 +0000)
committerAndrew Lenharth <andrewl@lenharth.org>
Fri, 7 Mar 2008 20:07:24 +0000 (20:07 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48021 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-extract/llvm-extract.cpp

index 7a16acf..1950f53 100644 (file)
@@ -81,9 +81,8 @@ int main(int argc, char **argv) {
     M.get()->getNamedGlobal(ExtractGlobal) : 0;
 
   // Figure out which function we should extract
-  Function *F = ExtractFunc.size() ? 
-    M.get()->getFunction(ExtractFunc) :
-    M.get()->getFunction("main");
+  if (!ExtractFunc.size()) ExtractFunc = "main";
+  Function *F = M.get()->getFunction(ExtractFunc);
 
   if (F == 0 && G == 0) {
     cerr << argv[0] << ": program doesn't contain function named '"