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

Side by Side Diff: tools/pnacl-llc/pnacl-llc.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 nits. 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
OLDNEW
1 //===-- pnacl-llc.cpp - PNaCl-specific llc: pexe ---> nexe ---------------===// 1 //===-- pnacl-llc.cpp - PNaCl-specific llc: pexe ---> nexe ---------------===//
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 // pnacl-llc: the core of the PNaCl translator, compiling a pexe into a nexe. 10 // pnacl-llc: the core of the PNaCl translator, compiling a pexe into a nexe.
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 } 318 }
319 Reporter.reset(); 319 Reporter.reset();
320 } 320 }
321 321
322 static Module* getModule(StringRef ProgramName, LLVMContext &Context, 322 static Module* getModule(StringRef ProgramName, LLVMContext &Context,
323 StreamingMemoryObject *StreamingObject) { 323 StreamingMemoryObject *StreamingObject) {
324 Module *M = nullptr; 324 Module *M = nullptr;
325 SMDiagnostic Err; 325 SMDiagnostic Err;
326 if (LazyBitcode) { 326 if (LazyBitcode) {
327 std::string StrError; 327 std::string StrError;
328 bool VerboseErrors =
329 #if defined(__native_client__)
330 false
331 #else
332 /* Print useful parse errors when not sandboxed */
333 true
334 #endif
335 ;
328 if (InputFileFormat == PNaClFormat) { 336 if (InputFileFormat == PNaClFormat) {
329 M = getNaClStreamedBitcodeModule( 337 M = getNaClStreamedBitcodeModule(
330 InputFilename, 338 InputFilename,
331 new ThreadedStreamingCache(StreamingObject), Context, &StrError); 339 new ThreadedStreamingCache(StreamingObject),
340 Context, VerboseErrors, &StrError);
332 } else if (InputFileFormat == LLVMFormat) { 341 } else if (InputFileFormat == LLVMFormat) {
333 M = getStreamedBitcodeModule( 342 M = getStreamedBitcodeModule(
334 InputFilename, 343 InputFilename,
335 new ThreadedStreamingCache(StreamingObject), Context, &StrError); 344 new ThreadedStreamingCache(StreamingObject), Context, &StrError);
336 } else { 345 } else {
337 llvm_unreachable("Unknown bitcode format"); 346 llvm_unreachable("Unknown bitcode format");
338 } 347 }
339 if (!StrError.empty()) 348 if (!StrError.empty())
340 Err = SMDiagnostic(InputFilename, SourceMgr::DK_Error, StrError); 349 Err = SMDiagnostic(InputFilename, SourceMgr::DK_Error, StrError);
341 } else { 350 } else {
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 return 0; 776 return 0;
768 } 777 }
769 778
770 int main(int argc, char **argv) { 779 int main(int argc, char **argv) {
771 #if defined(__native_client__) 780 #if defined(__native_client__)
772 return srpc_main(argc, argv); 781 return srpc_main(argc, argv);
773 #else 782 #else
774 return llc_main(argc, argv); 783 return llc_main(argc, argv);
775 #endif // __native_client__ 784 #endif // __native_client__
776 } 785 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698