Chromium Code Reviews| Index: tools/llvm-nm/llvm-nm.cpp |
| diff --git a/tools/llvm-nm/llvm-nm.cpp b/tools/llvm-nm/llvm-nm.cpp |
| index 2c346e51a1fef59b3f69ae2ef8c35027f1628db4..691984e47c7e1a5cb5805cdaefa6bc1ddbb117ae 100644 |
| --- a/tools/llvm-nm/llvm-nm.cpp |
| +++ b/tools/llvm-nm/llvm-nm.cpp |
| @@ -166,6 +166,12 @@ cl::opt<NaClFileFormat> InputFileFormat( |
| clEnumValN(PNaClFormat, "pnacl", "PNaCl bitcode file"), |
| clEnumValEnd), |
| cl::init(LLVMFormat)); |
| + |
| +static cl::opt<bool> |
| +VerboseErrors( |
| + "verbose-parse-errors", |
| + cl::desc("Print out more descriptive PNaCl bitcode parse errors"), |
| + cl::init(false)); |
| // @LOCALMOD-END |
| } |
| @@ -1011,14 +1017,14 @@ static void dumpSymbolNamesFromFile(std::string &Filename) { |
| // Support parsing PNaCl bitcode files |
| /* TODO(jfb) This is currently broken: the code base now requires an Object. |
| if (InputFileFormat == PNaClFormat) { |
| - std::string ErrorMessage; |
| - Module *Result = NaClParseBitcodeFile(BufferOrErr.get().release(), Context, |
| - &ErrorMessage); |
| + ErrorOr<Module *> Result = |
| + NaClParseBitcodeFile(BufferOrErr.get().release(), VerboseErrors, |
|
jvoung (off chromium)
2014/12/03 19:43:46
NaClParseBitcodeFile now takes a pointer instead o
Karl
2014/12/03 20:53:44
Done.
|
| + Context); |
| if (Result) { |
| - DumpSymbolNamesFromModule(Result); |
| + DumpSymbolNamesFromModule(Result.get()); |
| delete Result; |
| } else { |
| - error(ErrorMessage, Filename); |
| + error(Result.message(), Filename); |
| return; |
| } |
| } |