[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.

llvm-svn: 258982
This commit is contained in:
Davide Italiano 2016-01-27 20:27:44 +00:00
parent 15b01116d9
commit 905b8627bb
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -1240,9 +1240,7 @@ static void dumpSymbolNamesFromFile(std::string &Filename) {
if (!checkMachOAndArchFlags(O, Filename))
return;
dumpSymbolNamesFromObject(*O, true);
return;
}
error("unrecognizable file type", Filename);
}
int main(int argc, char **argv) {