Chromium Code Reviews| Index: tools/llvm-dis/llvm-dis.cpp |
| diff --git a/tools/llvm-dis/llvm-dis.cpp b/tools/llvm-dis/llvm-dis.cpp |
| index bdce91184a377f36175d2469ce0b2109b2d1be0d..0e9f19bf335420e5d4f54a7f8f6b900627515531 100644 |
| --- a/tools/llvm-dis/llvm-dis.cpp |
| +++ b/tools/llvm-dis/llvm-dis.cpp |
| @@ -65,6 +65,12 @@ 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 |
| namespace { |
| @@ -160,10 +166,13 @@ int main(int argc, char **argv) { |
| M.reset(getStreamedBitcodeModule( |
| DisplayFilename, Buffer.release(), Context, &ErrorMessage)); |
| break; |
| - case PNaClFormat: |
| + case PNaClFormat: { |
| + raw_ostream *Verbose = VerboseErrors ? &errs() : nullptr; |
|
jvoung (off chromium)
2014/12/03 19:43:46
I guess I was okay with this unconditionally havin
Karl
2014/12/03 20:53:44
Since this is an LLVM tool, I guess we should be j
|
| M.reset(getNaClStreamedBitcodeModule( |
| - DisplayFilename, Buffer.release(), Context, &ErrorMessage)); |
| + DisplayFilename, Buffer.release(), Context, Verbose, |
| + &ErrorMessage)); |
| break; |
| + } |
| default: |
| ErrorMessage = "Don't understand specified bitcode format"; |
| break; |