[llvm] r258982 - [llvm-nm] Remove redundant check for file validity.
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 27 12:27:45 PST 2016
Author: davide
Date: Wed Jan 27 14:27:44 2016
New Revision: 258982
URL: http://llvm.org/viewvc/llvm-project?rev=258982&view=rev
Log:
[llvm-nm] Remove redundant check for file validity.
We already perform it at the beginning of the function so we can't
arrive here with an invalid object. Also, add a test so that bugs
won't sneak in the future.
Added:
llvm/trunk/test/tools/llvm-nm/invalid-input.test
Modified:
llvm/trunk/tools/llvm-nm/llvm-nm.cpp
Added: llvm/trunk/test/tools/llvm-nm/invalid-input.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-nm/invalid-input.test?rev=258982&view=auto
==============================================================================
--- llvm/trunk/test/tools/llvm-nm/invalid-input.test (added)
+++ llvm/trunk/test/tools/llvm-nm/invalid-input.test Wed Jan 27 14:27:44 2016
@@ -0,0 +1,2 @@
+RUN: not llvm-nm %s 2>&1 | FileCheck %s -check-prefix=UNKNOWN_FILE_TYPE
+UNKNOWN_FILE_TYPE: {{.*}}invalid-input.test: The file was not recognized as a valid object file
Modified: llvm/trunk/tools/llvm-nm/llvm-nm.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-nm/llvm-nm.cpp?rev=258982&r1=258981&r2=258982&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-nm/llvm-nm.cpp (original)
+++ llvm/trunk/tools/llvm-nm/llvm-nm.cpp Wed Jan 27 14:27:44 2016
@@ -1240,9 +1240,7 @@ static void dumpSymbolNamesFromFile(std:
if (!checkMachOAndArchFlags(O, Filename))
return;
dumpSymbolNamesFromObject(*O, true);
- return;
}
- error("unrecognizable file type", Filename);
}
int main(int argc, char **argv) {
More information about the llvm-commits
mailing list