| 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 DisplayFilename = InputFilename; | 153 DisplayFilename = InputFilename; |
| 154 | 154 |
| 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, nullptr, |
| 166 &ErrorMessage)); |
| 166 break; | 167 break; |
| 168 } |
| 167 default: | 169 default: |
| 168 ErrorMessage = "Don't understand specified bitcode format"; | 170 ErrorMessage = "Don't understand specified bitcode format"; |
| 169 break; | 171 break; |
| 170 } | 172 } |
| 171 // @LOCALMOD-END | 173 // @LOCALMOD-END |
| 172 | 174 |
| 173 if(M.get()) { | 175 if(M.get()) { |
| 174 if (std::error_code EC = M->materializeAllPermanently()) { | 176 if (std::error_code EC = M->materializeAllPermanently()) { |
| 175 ErrorMessage = EC.message(); | 177 ErrorMessage = EC.message(); |
| 176 M.reset(); | 178 M.reset(); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 | 221 |
| 220 // All that llvm-dis does is write the assembly to a file. | 222 // All that llvm-dis does is write the assembly to a file. |
| 221 if (!DontPrint) | 223 if (!DontPrint) |
| 222 M->print(Out->os(), Annotator.get()); | 224 M->print(Out->os(), Annotator.get()); |
| 223 | 225 |
| 224 // Declare success. | 226 // Declare success. |
| 225 Out->keep(); | 227 Out->keep(); |
| 226 | 228 |
| 227 return 0; | 229 return 0; |
| 228 } | 230 } |
| OLD | NEW |