Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1249)

Side by Side Diff: tools/llvm-dis/llvm-dis.cpp

Issue 770853002: Fix error reporting in the PNaCl bitcode reader. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Patch Set: Fix typo. Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/IRReader/IRReader.cpp ('k') | tools/llvm-nm/llvm-nm.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « lib/IRReader/IRReader.cpp ('k') | tools/llvm-nm/llvm-nm.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698