make error message reflect default search function name
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48021 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/llvm-extract/llvm-extract.cpp b/tools/llvm-extract/llvm-extract.cpp
index 7a16acf..1950f53 100644
--- a/tools/llvm-extract/llvm-extract.cpp
+++ b/tools/llvm-extract/llvm-extract.cpp
@@ -81,9 +81,8 @@
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 '"