blob: e79d72d1933c4e714e59bb3fec005405794fe1e9 [file] [log] [blame]
Brian Gaeke972d3d72003-10-16 04:43:15 +00001//===-- llvm-nm.cpp - Symbol table dumping utility for llvm ---------------===//
Misha Brukman3da94ae2005-04-22 00:00:37 +00002//
John Criswell7c0e0222003-10-20 17:47:21 +00003// The LLVM Compiler Infrastructure
4//
Chris Lattner21c62da2007-12-29 20:44:31 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Misha Brukman3da94ae2005-04-22 00:00:37 +00007//
John Criswell7c0e0222003-10-20 17:47:21 +00008//===----------------------------------------------------------------------===//
Brian Gaeke972d3d72003-10-16 04:43:15 +00009//
10// This program is a utility that works like traditional Unix "nm",
Gabor Greifa99be512007-07-05 17:07:56 +000011// that is, it prints out the names of symbols in a bitcode file,
Brian Gaeke972d3d72003-10-16 04:43:15 +000012// along with some information about each symbol.
Misha Brukman3da94ae2005-04-22 00:00:37 +000013//
Brian Gaeke972d3d72003-10-16 04:43:15 +000014// This "nm" does not print symbols' addresses. It supports many of
15// the features of GNU "nm", including its different output formats.
16//
17//===----------------------------------------------------------------------===//
18
Owen Anderson8b477ed2009-07-01 16:58:40 +000019#include "llvm/LLVMContext.h"
Brian Gaeke972d3d72003-10-16 04:43:15 +000020#include "llvm/Module.h"
Chris Lattner4d5aad22007-05-06 05:36:18 +000021#include "llvm/Bitcode/ReaderWriter.h"
Chris Lattner44dadff2007-05-06 09:29:57 +000022#include "llvm/Bitcode/Archive.h"
Michael J. Spencer9142ae22011-09-27 19:37:18 +000023#include "llvm/Object/Archive.h"
Michael J. Spencer20d335a2011-01-20 06:38:57 +000024#include "llvm/Object/ObjectFile.h"
Reid Spencer551ccae2004-09-01 22:55:40 +000025#include "llvm/Support/CommandLine.h"
Michael J. Spencer20d335a2011-01-20 06:38:57 +000026#include "llvm/Support/FileSystem.h"
Chris Lattnerc30598b2006-12-06 01:18:01 +000027#include "llvm/Support/ManagedStatic.h"
Chris Lattner4d5aad22007-05-06 05:36:18 +000028#include "llvm/Support/MemoryBuffer.h"
Chris Lattnercc14d252009-03-06 05:34:10 +000029#include "llvm/Support/PrettyStackTrace.h"
Dan Gohman65f57c22009-07-15 16:35:29 +000030#include "llvm/Support/raw_ostream.h"
Michael J. Spencer1f6efa32010-11-29 18:16:10 +000031#include "llvm/Support/Signals.h"
Michael J. Spencer20d335a2011-01-20 06:38:57 +000032#include "llvm/Support/Format.h"
Michael J. Spencer333fb042010-12-09 17:36:48 +000033#include "llvm/Support/system_error.h"
Jeff Cohenca5183d2007-03-05 00:00:42 +000034#include <algorithm>
Brian Gaeke972d3d72003-10-16 04:43:15 +000035#include <cctype>
Alkis Evlogimenos09233fb2004-04-21 16:11:40 +000036#include <cerrno>
Brian Gaeke08d03c72003-11-19 21:52:09 +000037#include <cstring>
Michael J. Spencer20d335a2011-01-20 06:38:57 +000038#include <vector>
Brian Gaeked0fde302003-11-11 22:41:34 +000039using namespace llvm;
Michael J. Spencer20d335a2011-01-20 06:38:57 +000040using namespace object;
Brian Gaeked0fde302003-11-11 22:41:34 +000041
Brian Gaeke972d3d72003-10-16 04:43:15 +000042namespace {
43 enum OutputFormatTy { bsd, sysv, posix };
44 cl::opt<OutputFormatTy>
45 OutputFormat("format",
46 cl::desc("Specify output format"),
47 cl::values(clEnumVal(bsd, "BSD format"),
48 clEnumVal(sysv, "System V format"),
Misha Brukman3da94ae2005-04-22 00:00:37 +000049 clEnumVal(posix, "POSIX.2 format"),
Chris Lattner4d143ee2004-07-16 00:08:28 +000050 clEnumValEnd), cl::init(bsd));
Brian Gaeke972d3d72003-10-16 04:43:15 +000051 cl::alias OutputFormat2("f", cl::desc("Alias for --format"),
52 cl::aliasopt(OutputFormat));
53
Misha Brukman3da94ae2005-04-22 00:00:37 +000054 cl::list<std::string>
Gabor Greifa99be512007-07-05 17:07:56 +000055 InputFilenames(cl::Positional, cl::desc("<input bitcode files>"),
Chris Lattnerfc046d52003-10-16 18:45:23 +000056 cl::ZeroOrMore);
Brian Gaeke972d3d72003-10-16 04:43:15 +000057
58 cl::opt<bool> UndefinedOnly("undefined-only",
59 cl::desc("Show only undefined symbols"));
60 cl::alias UndefinedOnly2("u", cl::desc("Alias for --undefined-only"),
61 cl::aliasopt(UndefinedOnly));
62
63 cl::opt<bool> DefinedOnly("defined-only",
64 cl::desc("Show only defined symbols"));
65
66 cl::opt<bool> ExternalOnly("extern-only",
67 cl::desc("Show only external symbols"));
68 cl::alias ExternalOnly2("g", cl::desc("Alias for --extern-only"),
69 cl::aliasopt(ExternalOnly));
70
71 cl::opt<bool> BSDFormat("B", cl::desc("Alias for --format=bsd"));
72 cl::opt<bool> POSIXFormat("P", cl::desc("Alias for --format=posix"));
73
Michael J. Spencer20d335a2011-01-20 06:38:57 +000074 cl::opt<bool> PrintFileName("print-file-name",
75 cl::desc("Precede each symbol with the object file it came from"));
76
77 cl::alias PrintFileNameA("A", cl::desc("Alias for --print-file-name"),
78 cl::aliasopt(PrintFileName));
79 cl::alias PrintFileNameo("o", cl::desc("Alias for --print-file-name"),
80 cl::aliasopt(PrintFileName));
81
82 cl::opt<bool> DebugSyms("debug-syms",
83 cl::desc("Show all symbols, even debugger only"));
84 cl::alias DebugSymsa("a", cl::desc("Alias for --debug-syms"),
85 cl::aliasopt(DebugSyms));
86
87 cl::opt<bool> NumericSort("numeric-sort",
88 cl::desc("Sort symbols by address"));
89 cl::alias NumericSortn("n", cl::desc("Alias for --numeric-sort"),
90 cl::aliasopt(NumericSort));
91 cl::alias NumericSortv("v", cl::desc("Alias for --numeric-sort"),
92 cl::aliasopt(NumericSort));
93
94 cl::opt<bool> NoSort("no-sort",
95 cl::desc("Show symbols in order encountered"));
96 cl::alias NoSortp("p", cl::desc("Alias for --no-sort"),
97 cl::aliasopt(NoSort));
98
99 cl::opt<bool> PrintSize("print-size",
100 cl::desc("Show symbol size instead of address"));
101 cl::alias PrintSizeS("S", cl::desc("Alias for --print-size"),
102 cl::aliasopt(PrintSize));
103
104 cl::opt<bool> SizeSort("size-sort", cl::desc("Sort symbols by size"));
105
106 bool PrintAddress = true;
107
Brian Gaeke972d3d72003-10-16 04:43:15 +0000108 bool MultipleFiles = false;
109
110 std::string ToolName;
Chris Lattnerd74ea2b2006-05-24 17:04:05 +0000111}
Brian Gaeke972d3d72003-10-16 04:43:15 +0000112
Michael J. Spencer20d335a2011-01-20 06:38:57 +0000113namespace {
114 struct NMSymbol {
115 uint64_t Address;
116 uint64_t Size;
117 char TypeChar;
118 StringRef Name;
119 };
120
121 static bool CompareSymbolAddress(const NMSymbol &a, const NMSymbol &b) {
122 if (a.Address < b.Address)
123 return true;
124 else if (a.Address == b.Address && a.Name < b.Name)
125 return true;
126 else
127 return false;
128
129 }
130
131 static bool CompareSymbolSize(const NMSymbol &a, const NMSymbol &b) {
132 if (a.Size < b.Size)
133 return true;
134 else if (a.Size == b.Size && a.Name < b.Name)
135 return true;
136 else
137 return false;
138 }
139
140 static bool CompareSymbolName(const NMSymbol &a, const NMSymbol &b) {
141 return a.Name < b.Name;
142 }
143
144 StringRef CurrentFilename;
145 typedef std::vector<NMSymbol> SymbolListT;
146 SymbolListT SymbolList;
Michael J. Spencer25b15772011-06-25 17:55:23 +0000147
148 bool error(error_code ec) {
149 if (!ec) return false;
150
151 outs() << ToolName << ": error reading file: " << ec.message() << ".\n";
152 outs().flush();
153 return true;
154 }
Michael J. Spencer20d335a2011-01-20 06:38:57 +0000155}
156
157static void SortAndPrintSymbolList() {
158 if (!NoSort) {
159 if (NumericSort)
160 std::sort(SymbolList.begin(), SymbolList.end(), CompareSymbolAddress);
161 else if (SizeSort)
162 std::sort(SymbolList.begin(), SymbolList.end(), CompareSymbolSize);
163 else
164 std::sort(SymbolList.begin(), SymbolList.end(), CompareSymbolName);
165 }
166
167 if (OutputFormat == posix && MultipleFiles) {
168 outs() << '\n' << CurrentFilename << ":\n";
169 } else if (OutputFormat == bsd && MultipleFiles) {
170 outs() << "\n" << CurrentFilename << ":\n";
171 } else if (OutputFormat == sysv) {
172 outs() << "\n\nSymbols from " << CurrentFilename << ":\n\n"
173 << "Name Value Class Type"
174 << " Size Line Section\n";
175 }
176
177 for (SymbolListT::iterator i = SymbolList.begin(),
178 e = SymbolList.end(); i != e; ++i) {
179 if ((i->TypeChar != 'U') && UndefinedOnly)
180 continue;
181 if ((i->TypeChar == 'U') && DefinedOnly)
182 continue;
183 if (SizeSort && !PrintAddress && i->Size == UnknownAddressOrSize)
184 continue;
185
186 char SymbolAddrStr[10] = "";
187 char SymbolSizeStr[10] = "";
188
189 if (OutputFormat == sysv || i->Address == object::UnknownAddressOrSize)
190 strcpy(SymbolAddrStr, " ");
191 if (OutputFormat == sysv)
192 strcpy(SymbolSizeStr, " ");
193
194 if (i->Address != object::UnknownAddressOrSize)
Stepan Dyatkovskiy9df3b912011-10-28 13:07:32 +0000195 format("%08"PRIx64, i->Address).print(SymbolAddrStr, sizeof(SymbolAddrStr));
Michael J. Spencer20d335a2011-01-20 06:38:57 +0000196 if (i->Size != object::UnknownAddressOrSize)
Stepan Dyatkovskiy9df3b912011-10-28 13:07:32 +0000197 format("%08"PRIx64, i->Size).print(SymbolSizeStr, sizeof(SymbolSizeStr));
Michael J. Spencer20d335a2011-01-20 06:38:57 +0000198
199 if (OutputFormat == posix) {
200 outs() << i->Name << " " << i->TypeChar << " "
201 << SymbolAddrStr << SymbolSizeStr << "\n";
202 } else if (OutputFormat == bsd) {
203 if (PrintAddress)
204 outs() << SymbolAddrStr << ' ';
205 if (PrintSize) {
206 outs() << SymbolSizeStr;
207 if (i->Size != object::UnknownAddressOrSize)
208 outs() << ' ';
209 }
210 outs() << i->TypeChar << " " << i->Name << "\n";
211 } else if (OutputFormat == sysv) {
212 std::string PaddedName (i->Name);
213 while (PaddedName.length () < 20)
214 PaddedName += " ";
215 outs() << PaddedName << "|" << SymbolAddrStr << "| "
216 << i->TypeChar
217 << " | |" << SymbolSizeStr << "| |\n";
218 }
219 }
220
221 SymbolList.clear();
222}
223
Chris Lattnerc30598b2006-12-06 01:18:01 +0000224static char TypeCharForSymbol(GlobalValue &GV) {
Lauro Ramos Venancio4a828ee2007-06-27 22:08:09 +0000225 if (GV.isDeclaration()) return 'U';
Chris Lattnerc30598b2006-12-06 01:18:01 +0000226 if (GV.hasLinkOnceLinkage()) return 'C';
Dale Johannesen7d5633e2008-05-16 22:44:18 +0000227 if (GV.hasCommonLinkage()) return 'C';
Chris Lattnerc30598b2006-12-06 01:18:01 +0000228 if (GV.hasWeakLinkage()) return 'W';
Lauro Ramos Venancio4a828ee2007-06-27 22:08:09 +0000229 if (isa<Function>(GV) && GV.hasInternalLinkage()) return 't';
Chris Lattnerc30598b2006-12-06 01:18:01 +0000230 if (isa<Function>(GV)) return 'T';
Lauro Ramos Venancio4a828ee2007-06-27 22:08:09 +0000231 if (isa<GlobalVariable>(GV) && GV.hasInternalLinkage()) return 'd';
Chris Lattnerc30598b2006-12-06 01:18:01 +0000232 if (isa<GlobalVariable>(GV)) return 'D';
Lauro Ramos Venancio4a828ee2007-06-27 22:08:09 +0000233 if (const GlobalAlias *GA = dyn_cast<GlobalAlias>(&GV)) {
234 const GlobalValue *AliasedGV = GA->getAliasedGlobal();
235 if (isa<Function>(AliasedGV)) return 'T';
236 if (isa<GlobalVariable>(AliasedGV)) return 'D';
237 }
238 return '?';
Brian Gaeke972d3d72003-10-16 04:43:15 +0000239}
240
Chris Lattnerc30598b2006-12-06 01:18:01 +0000241static void DumpSymbolNameForGlobalValue(GlobalValue &GV) {
Chris Lattner266c7bb2009-04-13 05:44:34 +0000242 // Private linkage and available_externally linkage don't exist in symtab.
Bill Wendling4e34d502010-08-24 20:00:52 +0000243 if (GV.hasPrivateLinkage() ||
244 GV.hasLinkerPrivateLinkage() ||
245 GV.hasLinkerPrivateWeakLinkage() ||
246 GV.hasLinkerPrivateWeakDefAutoLinkage() ||
247 GV.hasAvailableExternallyLinkage())
Bill Wendling5e721d72010-07-01 21:55:59 +0000248 return;
Chris Lattner266c7bb2009-04-13 05:44:34 +0000249 char TypeChar = TypeCharForSymbol(GV);
Rafael Espindolabb46f522009-01-15 20:18:42 +0000250 if (GV.hasLocalLinkage () && ExternalOnly)
Brian Gaeke972d3d72003-10-16 04:43:15 +0000251 return;
Michael J. Spencer20d335a2011-01-20 06:38:57 +0000252
253 NMSymbol s;
254 s.Address = object::UnknownAddressOrSize;
255 s.Size = object::UnknownAddressOrSize;
256 s.TypeChar = TypeChar;
257 s.Name = GV.getName();
258 SymbolList.push_back(s);
Brian Gaeke972d3d72003-10-16 04:43:15 +0000259}
260
Chris Lattnerc30598b2006-12-06 01:18:01 +0000261static void DumpSymbolNamesFromModule(Module *M) {
Michael J. Spencer20d335a2011-01-20 06:38:57 +0000262 CurrentFilename = M->getModuleIdentifier();
Chris Lattner266c7bb2009-04-13 05:44:34 +0000263 std::for_each (M->begin(), M->end(), DumpSymbolNameForGlobalValue);
264 std::for_each (M->global_begin(), M->global_end(),
Lauro Ramos Venancio4a828ee2007-06-27 22:08:09 +0000265 DumpSymbolNameForGlobalValue);
Chris Lattner266c7bb2009-04-13 05:44:34 +0000266 std::for_each (M->alias_begin(), M->alias_end(),
Lauro Ramos Venancio4a828ee2007-06-27 22:08:09 +0000267 DumpSymbolNameForGlobalValue);
Michael J. Spencer20d335a2011-01-20 06:38:57 +0000268
269 SortAndPrintSymbolList();
270}
271
272static void DumpSymbolNamesFromObject(ObjectFile *obj) {
Michael J. Spencer25b15772011-06-25 17:55:23 +0000273 error_code ec;
Michael J. Spencer01a4db32011-10-07 19:46:12 +0000274 for (symbol_iterator i = obj->begin_symbols(),
275 e = obj->end_symbols();
276 i != e; i.increment(ec)) {
Michael J. Spencer25b15772011-06-25 17:55:23 +0000277 if (error(ec)) break;
278 bool internal;
279 if (error(i->isInternal(internal))) break;
280 if (!DebugSyms && internal)
Michael J. Spencer20d335a2011-01-20 06:38:57 +0000281 continue;
282 NMSymbol s;
283 s.Size = object::UnknownAddressOrSize;
284 s.Address = object::UnknownAddressOrSize;
Michael J. Spencer25b15772011-06-25 17:55:23 +0000285 if (PrintSize || SizeSort) {
286 if (error(i->getSize(s.Size))) break;
287 }
Michael J. Spencer20d335a2011-01-20 06:38:57 +0000288 if (PrintAddress)
Benjamin Kramerac241fe2011-09-14 01:22:52 +0000289 if (error(i->getOffset(s.Address))) break;
Michael J. Spencer25b15772011-06-25 17:55:23 +0000290 if (error(i->getNMTypeChar(s.TypeChar))) break;
291 if (error(i->getName(s.Name))) break;
Michael J. Spencer20d335a2011-01-20 06:38:57 +0000292 SymbolList.push_back(s);
293 }
294
Michael J. Spencer001c9202011-06-25 17:54:50 +0000295 CurrentFilename = obj->getFileName();
Michael J. Spencer20d335a2011-01-20 06:38:57 +0000296 SortAndPrintSymbolList();
Brian Gaeke972d3d72003-10-16 04:43:15 +0000297}
298
Chris Lattnerc30598b2006-12-06 01:18:01 +0000299static void DumpSymbolNamesFromFile(std::string &Filename) {
Owen Anderson0d7c6952009-07-15 22:16:10 +0000300 LLVMContext &Context = getGlobalContext();
Brian Gaeke972d3d72003-10-16 04:43:15 +0000301 std::string ErrorMessage;
Reid Spencer11db4b82004-12-13 03:01:26 +0000302 sys::Path aPath(Filename);
Michael J. Spencer20d335a2011-01-20 06:38:57 +0000303 bool exists;
304 if (sys::fs::exists(aPath.str(), exists) || !exists)
305 errs() << ToolName << ": '" << Filename << "': " << "No such file\n";
Brian Gaeke8b1daa32003-11-19 22:15:00 +0000306 // Note: Currently we do not support reading an archive from stdin.
Chris Lattner44dadff2007-05-06 09:29:57 +0000307 if (Filename == "-" || aPath.isBitcodeFile()) {
Michael J. Spencer3ff95632010-12-16 03:29:14 +0000308 OwningPtr<MemoryBuffer> Buffer;
309 if (error_code ec = MemoryBuffer::getFileOrSTDIN(Filename, Buffer))
Michael J. Spencer333fb042010-12-09 17:36:48 +0000310 ErrorMessage = ec.message();
Chris Lattner4d5aad22007-05-06 05:36:18 +0000311 Module *Result = 0;
312 if (Buffer.get())
Owen Anderson31895e72009-07-01 21:22:36 +0000313 Result = ParseBitcodeFile(Buffer.get(), Context, &ErrorMessage);
Michael J. Spencer4a295d32010-08-31 06:36:46 +0000314
Nuno Lopes8018f5d2009-09-10 14:56:31 +0000315 if (Result) {
Chris Lattner4d5aad22007-05-06 05:36:18 +0000316 DumpSymbolNamesFromModule(Result);
Nuno Lopes8018f5d2009-09-10 14:56:31 +0000317 delete Result;
318 } else
Dan Gohman65f57c22009-07-15 16:35:29 +0000319 errs() << ToolName << ": " << Filename << ": " << ErrorMessage << "\n";
Michael J. Spencer4a295d32010-08-31 06:36:46 +0000320
Reid Spencer11db4b82004-12-13 03:01:26 +0000321 } else if (aPath.isArchive()) {
Michael J. Spencer9142ae22011-09-27 19:37:18 +0000322 OwningPtr<Binary> arch;
323 if (error_code ec = object::createBinary(aPath.str(), arch)) {
324 errs() << ToolName << ": " << Filename << ": " << ec.message() << ".\n";
Brian Gaeke08d03c72003-11-19 21:52:09 +0000325 return;
326 }
Michael J. Spencer9142ae22011-09-27 19:37:18 +0000327 if (object::Archive *a = dyn_cast<object::Archive>(arch.get())) {
328 for (object::Archive::child_iterator i = a->begin_children(),
329 e = a->end_children(); i != e; ++i) {
330 OwningPtr<Binary> child;
331 if (error_code ec = i->getAsBinary(child)) {
332 // Try opening it as a bitcode file.
Benjamin Kramer1a9908d2011-10-10 13:10:04 +0000333 OwningPtr<MemoryBuffer> buff(i->getBuffer());
Michael J. Spencer9142ae22011-09-27 19:37:18 +0000334 Module *Result = 0;
335 if (buff)
Benjamin Kramer1a9908d2011-10-10 13:10:04 +0000336 Result = ParseBitcodeFile(buff.get(), Context, &ErrorMessage);
Michael J. Spencer9142ae22011-09-27 19:37:18 +0000337
338 if (Result) {
339 DumpSymbolNamesFromModule(Result);
340 delete Result;
341 }
342 continue;
343 }
344 if (object::ObjectFile *o = dyn_cast<ObjectFile>(child.get())) {
345 outs() << o->getFileName() << ":\n";
346 DumpSymbolNamesFromObject(o);
347 }
348 }
349 }
Michael J. Spencer20d335a2011-01-20 06:38:57 +0000350 } else if (aPath.isObjectFile()) {
Michael J. Spencer76fb9b02011-06-25 17:54:59 +0000351 OwningPtr<Binary> obj;
352 if (error_code ec = object::createBinary(aPath.str(), obj)) {
353 errs() << ToolName << ": " << Filename << ": " << ec.message() << ".\n";
Michael J. Spencer20d335a2011-01-20 06:38:57 +0000354 return;
355 }
Michael J. Spencer76fb9b02011-06-25 17:54:59 +0000356 if (object::ObjectFile *o = dyn_cast<ObjectFile>(obj.get()))
357 DumpSymbolNamesFromObject(o);
Brian Gaeke82042872003-11-19 21:57:30 +0000358 } else {
Dan Gohman65f57c22009-07-15 16:35:29 +0000359 errs() << ToolName << ": " << Filename << ": "
360 << "unrecognizable file type\n";
Brian Gaeke82042872003-11-19 21:57:30 +0000361 return;
Brian Gaeke972d3d72003-10-16 04:43:15 +0000362 }
363}
364
365int main(int argc, char **argv) {
Chris Lattnercc14d252009-03-06 05:34:10 +0000366 // Print a stack trace if we signal out.
Chris Lattner4d5aad22007-05-06 05:36:18 +0000367 sys::PrintStackTraceOnErrorSignal();
Chris Lattnercc14d252009-03-06 05:34:10 +0000368 PrettyStackTraceProgram X(argc, argv);
Michael J. Spencer4a295d32010-08-31 06:36:46 +0000369
Chris Lattnercc14d252009-03-06 05:34:10 +0000370 llvm_shutdown_obj Y; // Call llvm_shutdown() on exit.
371 cl::ParseCommandLineOptions(argc, argv, "llvm symbol table dumper\n");
Chris Lattnerf73b4ca2004-02-19 20:32:12 +0000372
Chris Lattner4d5aad22007-05-06 05:36:18 +0000373 ToolName = argv[0];
374 if (BSDFormat) OutputFormat = bsd;
375 if (POSIXFormat) OutputFormat = posix;
Chris Lattnerfc046d52003-10-16 18:45:23 +0000376
Michael J. Spencer20d335a2011-01-20 06:38:57 +0000377 // The relative order of these is important. If you pass --size-sort it should
378 // only print out the size. However, if you pass -S --size-sort, it should
379 // print out both the size and address.
380 if (SizeSort && !PrintSize) PrintAddress = false;
381 if (OutputFormat == sysv || SizeSort) PrintSize = true;
382
Chris Lattner4d5aad22007-05-06 05:36:18 +0000383 switch (InputFilenames.size()) {
384 case 0: InputFilenames.push_back("-");
385 case 1: break;
386 default: MultipleFiles = true;
Chris Lattnerfc046d52003-10-16 18:45:23 +0000387 }
Chris Lattner4d5aad22007-05-06 05:36:18 +0000388
389 std::for_each(InputFilenames.begin(), InputFilenames.end(),
390 DumpSymbolNamesFromFile);
391 return 0;
Brian Gaeke972d3d72003-10-16 04:43:15 +0000392}