| 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 // The Module's BitcodeReader's BitstreamReader takes ownership | 181 // The Module's BitcodeReader's BitstreamReader takes ownership |
| 182 // of the StreamingMemoryObject. | 182 // of the StreamingMemoryObject. |
| 183 ErrorOr<std::unique_ptr<Module>> MOrErr = | 183 ErrorOr<std::unique_ptr<Module>> MOrErr = |
| 184 getStreamedBitcodeModule(DisplayFilename, Buffer.release(), | 184 getStreamedBitcodeModule(DisplayFilename, Buffer.release(), |
| 185 Context); | 185 Context); |
| 186 M = std::move(*MOrErr); | 186 M = std::move(*MOrErr); |
| 187 M->materializeAllPermanently(); | 187 M->materializeAllPermanently(); |
| 188 break; | 188 break; |
| 189 } | 189 } |
| 190 case PNaClFormat: { | 190 case PNaClFormat: { |
| 191 DiagnosticHandlerFunction DiagnosticHandler = nullptr; |
| 191 M.reset(getNaClStreamedBitcodeModule( | 192 M.reset(getNaClStreamedBitcodeModule( |
| 192 DisplayFilename, Buffer.release(), Context, &errs(), | 193 DisplayFilename, Buffer.release(), Context, |
| 193 &ErrorMessage)); | 194 /* DiagnosticHandler = */ nullptr, &ErrorMessage)); |
| 194 if(M.get()) { | 195 if(M.get()) { |
| 195 if (std::error_code EC = M->materializeAllPermanently()) { | 196 if (std::error_code EC = M->materializeAllPermanently()) { |
| 196 FoundErrors = true; | 197 FoundErrors = true; |
| 197 ErrorMessage = EC.message(); | 198 ErrorMessage = EC.message(); |
| 198 M.reset(); | 199 M.reset(); |
| 199 } | 200 } |
| 200 } else { | 201 } else { |
| 201 FoundErrors = true; | 202 FoundErrors = true; |
| 202 } | 203 } |
| 203 break; | 204 break; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 | 249 |
| 249 // All that llvm-dis does is write the assembly to a file. | 250 // All that llvm-dis does is write the assembly to a file. |
| 250 if (!DontPrint) | 251 if (!DontPrint) |
| 251 M->print(Out->os(), Annotator.get(), PreserveAssemblyUseListOrder); | 252 M->print(Out->os(), Annotator.get(), PreserveAssemblyUseListOrder); |
| 252 | 253 |
| 253 // Declare success. | 254 // Declare success. |
| 254 Out->keep(); | 255 Out->keep(); |
| 255 | 256 |
| 256 return 0; | 257 return 0; |
| 257 } | 258 } |
| OLD | NEW |