| OLD | NEW |
| 1 //===-- llvm-dis.cpp - The low-level LLVM disassembler --------------------===// | 1 //===-- llvm-dis.cpp - The low-level LLVM disassembler --------------------===// |
| 2 // | 2 // |
| 3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 // | 9 // |
| 10 // This utility may be invoked in the following manner: | 10 // This utility may be invoked in the following manner: |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 // @LOCALMOD-BEGIN | 155 // @LOCALMOD-BEGIN |
| 156 switch (InputFileFormat) { | 156 switch (InputFileFormat) { |
| 157 case LLVMFormat: | 157 case LLVMFormat: |
| 158 // The Module's BitcodeReader's BitstreamReader takes ownership | 158 // The Module's BitcodeReader's BitstreamReader takes ownership |
| 159 // of the StreamingMemoryObject. | 159 // of the StreamingMemoryObject. |
| 160 M.reset(getStreamedBitcodeModule( | 160 M.reset(getStreamedBitcodeModule( |
| 161 DisplayFilename, Buffer.release(), Context, &ErrorMessage)); | 161 DisplayFilename, Buffer.release(), Context, &ErrorMessage)); |
| 162 break; | 162 break; |
| 163 case PNaClFormat: | 163 case PNaClFormat: |
| 164 M.reset(getNaClStreamedBitcodeModule( | 164 M.reset(getNaClStreamedBitcodeModule( |
| 165 DisplayFilename, Buffer.release(), Context, &ErrorMessage)); | 165 DisplayFilename, Buffer.release(), Context, |
| 166 /*VerboseErrors=*/true, &ErrorMessage)); |
| 166 break; | 167 break; |
| 167 default: | 168 default: |
| 168 ErrorMessage = "Don't understand specified bitcode format"; | 169 ErrorMessage = "Don't understand specified bitcode format"; |
| 169 break; | 170 break; |
| 170 } | 171 } |
| 171 // @LOCALMOD-END | 172 // @LOCALMOD-END |
| 172 | 173 |
| 173 if(M.get()) { | 174 if(M.get()) { |
| 174 if (std::error_code EC = M->materializeAllPermanently()) { | 175 if (std::error_code EC = M->materializeAllPermanently()) { |
| 175 ErrorMessage = EC.message(); | 176 ErrorMessage = EC.message(); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 | 220 |
| 220 // All that llvm-dis does is write the assembly to a file. | 221 // All that llvm-dis does is write the assembly to a file. |
| 221 if (!DontPrint) | 222 if (!DontPrint) |
| 222 M->print(Out->os(), Annotator.get()); | 223 M->print(Out->os(), Annotator.get()); |
| 223 | 224 |
| 224 // Declare success. | 225 // Declare success. |
| 225 Out->keep(); | 226 Out->keep(); |
| 226 | 227 |
| 227 return 0; | 228 return 0; |
| 228 } | 229 } |
| OLD | NEW |