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

Side by Side Diff: lib/Bitcode/NaCl/Analysis/NaClBitcodeAnalyzer.cpp

Issue 1122423005: Add (unsupported experimental) feature allowing byte aligned bitcode. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Patch Set: Fix nits. Created 5 years, 7 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
OLDNEW
1 //===-- NaClBitcodeAnalyzer.cpp - Bitcode Analyzer ------------------------===// 1 //===-- NaClBitcodeAnalyzer.cpp - Bitcode Analyzer ------------------------===//
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 #define DEBUG_TYPE "nacl-bitcode-analyzer" 10 #define DEBUG_TYPE "nacl-bitcode-analyzer"
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 NaClBitcodeHeader Header; 412 NaClBitcodeHeader Header;
413 if (Header.Read(BufPtr, EndBufPtr)) 413 if (Header.Read(BufPtr, EndBufPtr))
414 return Error("Invalid PNaCl bitcode header"); 414 return Error("Invalid PNaCl bitcode header");
415 415
416 if (!Header.IsSupported()) 416 if (!Header.IsSupported())
417 errs() << "Warning: " << Header.Unsupported() << "\n"; 417 errs() << "Warning: " << Header.Unsupported() << "\n";
418 418
419 if (!Header.IsReadable()) 419 if (!Header.IsReadable())
420 Error("Bitcode file is not readable"); 420 Error("Bitcode file is not readable");
421 421
422 NaClBitstreamReader StreamFile(BufPtr, EndBufPtr); 422 NaClBitstreamReader StreamFile(BufPtr, EndBufPtr, Header);
423 NaClBitstreamCursor Stream(StreamFile); 423 NaClBitstreamCursor Stream(StreamFile);
424 424
425 unsigned NumTopBlocks = 0; 425 unsigned NumTopBlocks = 0;
426 426
427 // Print out header information. 427 // Print out header information.
428 for (size_t i = 0, limit = Header.NumberFields(); i < limit; ++i) { 428 for (size_t i = 0, limit = Header.NumberFields(); i < limit; ++i) {
429 OS << Header.GetField(i)->Contents() << "\n"; 429 OS << Header.GetField(i)->Contents() << "\n";
430 } 430 }
431 if (Header.NumberFields()) OS << "\n"; 431 if (Header.NumberFields()) OS << "\n";
432 432
(...skipping 27 matching lines...) Expand all
460 ErrorOr<std::unique_ptr<MemoryBuffer>> ErrOrFile = 460 ErrorOr<std::unique_ptr<MemoryBuffer>> ErrOrFile =
461 MemoryBuffer::getFileOrSTDIN(InputFilename); 461 MemoryBuffer::getFileOrSTDIN(InputFilename);
462 if (std::error_code EC = ErrOrFile.getError()) 462 if (std::error_code EC = ErrOrFile.getError())
463 return Error(Twine("Error reading '") + InputFilename + "': " + 463 return Error(Twine("Error reading '") + InputFilename + "': " +
464 EC.message()); 464 EC.message());
465 465
466 return AnalyzeBitcodeInBuffer(ErrOrFile.get(), OS, DumpOptions); 466 return AnalyzeBitcodeInBuffer(ErrOrFile.get(), OS, DumpOptions);
467 } 467 }
468 468
469 } // namespace llvm 469 } // namespace llvm
OLDNEW
« no previous file with comments | « include/llvm/Bitcode/NaCl/NaClBitstreamWriter.h ('k') | lib/Bitcode/NaCl/Analysis/NaClCompress.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698