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

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

Issue 1310883003: Install notion of diagnostic handler into PNaCl bitcode readers. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Patch Set: Fix issues in patch set 2. Created 5 years, 4 months 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 | « test/NaCl/Bitcode/pnacl-bcdis/invalid.test ('k') | tools/pnacl-abicheck/pnacl-abicheck.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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « test/NaCl/Bitcode/pnacl-bcdis/invalid.test ('k') | tools/pnacl-abicheck/pnacl-abicheck.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698