diff options
author | Chris Lattner <sabre@nondot.org> | 2003-10-16 18:45:23 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-10-16 18:45:23 +0000 |
commit | fc046d52e442324fe238e572c314f86dbc894f92 (patch) | |
tree | 8bd51b208b521925234afd27d2d4b076f76da75b /tools/llvm-nm | |
parent | 72ac148d4964fbff950fe11a0eeeda73973b849b (diff) | |
download | external_llvm-fc046d52e442324fe238e572c314f86dbc894f92.zip external_llvm-fc046d52e442324fe238e572c314f86dbc894f92.tar.gz external_llvm-fc046d52e442324fe238e572c314f86dbc894f92.tar.bz2 |
Make llvm-nm work in "pipe mode"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9172 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-nm')
-rw-r--r-- | tools/llvm-nm/llvm-nm.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/llvm-nm/llvm-nm.cpp b/tools/llvm-nm/llvm-nm.cpp index 2f59d69..e98f655 100644 --- a/tools/llvm-nm/llvm-nm.cpp +++ b/tools/llvm-nm/llvm-nm.cpp @@ -28,7 +28,7 @@ namespace { cl::list<std::string> InputFilenames(cl::Positional, cl::desc("<input bytecode files>"), - cl::OneOrMore); + cl::ZeroOrMore); cl::opt<bool> UndefinedOnly("undefined-only", cl::desc("Show only undefined symbols")); @@ -116,8 +116,12 @@ int main(int argc, char **argv) { ToolName = argv[0]; if (BSDFormat) OutputFormat = bsd; if (POSIXFormat) OutputFormat = posix; - if (InputFilenames.size () != 1) - MultipleFiles = true; + + switch (InputFilenames.size()) { + case 0: InputFilenames.push_back("-"); + case 1: break; + default: MultipleFiles = true; + } std::for_each (InputFilenames.begin (), InputFilenames.end (), DumpSymbolNamesFromFile); |