From 6a021a4ddab1ef7eae07065861e833f3ca3c0ad7 Mon Sep 17 00:00:00 2001 From: Andrew Lenharth Date: Fri, 7 Mar 2008 20:07:24 +0000 Subject: 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 --- tools/llvm-extract/llvm-extract.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'tools/llvm-extract/llvm-extract.cpp') diff --git a/tools/llvm-extract/llvm-extract.cpp b/tools/llvm-extract/llvm-extract.cpp index 7a16acfc07..1950f53972 100644 --- a/tools/llvm-extract/llvm-extract.cpp +++ b/tools/llvm-extract/llvm-extract.cpp @@ -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 '" -- cgit v1.2.3