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

Unified Diff: lib/Bitcode/NaCl/Analysis/NaClCompress.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/Bitcode/NaCl/Analysis/NaClBitcodeAnalyzer.cpp ('k') | lib/Bitcode/NaCl/Analysis/NaClObjDump.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/Bitcode/NaCl/Analysis/NaClCompress.cpp
diff --git a/lib/Bitcode/NaCl/Analysis/NaClCompress.cpp b/lib/Bitcode/NaCl/Analysis/NaClCompress.cpp
index d4c327f6b189c8951c6ca8234b12165ca9b6a0f4..6e02eaf7e8edffa891b09e8192a31b185a753f84 100644
--- a/lib/Bitcode/NaCl/Analysis/NaClCompress.cpp
+++ b/lib/Bitcode/NaCl/Analysis/NaClCompress.cpp
@@ -1161,11 +1161,16 @@ static bool analyzeBitcode(
// First read header and verify it is good.
NaClBitcodeHeader Header;
- if (Header.Read(BufPtr, EndBufPtr) || !Header.IsSupported())
+ if (Header.Read(BufPtr, EndBufPtr))
return Error("Invalid PNaCl bitcode header");
+ if (!Header.IsSupported()) {
+ errs() << Header.Unsupported();
+ if (!Header.IsReadable())
+ return Error("Invalid PNaCl bitcode header");
+ }
// Create a bitstream reader to read the bitcode file.
- NaClBitstreamReader StreamFile(BufPtr, EndBufPtr);
+ NaClBitstreamReader StreamFile(BufPtr, EndBufPtr, Header);
NaClBitstreamCursor Stream(StreamFile);
// Parse the the bitcode file.
@@ -1389,7 +1394,7 @@ static bool chooseAbbrevs(MemoryBuffer *MemBuf, BlockAbbrevsMapType &AbbrevsMap,
return Error("Invalid PNaCl bitcode header");
// Create the bitcode reader.
- NaClBitstreamReader StreamFile(BufPtr, EndBufPtr);
+ NaClBitstreamReader StreamFile(BufPtr, EndBufPtr, Header);
NaClBitstreamCursor Stream(StreamFile);
// Set up the parser.
@@ -1587,7 +1592,7 @@ static bool copyBitcode(const NaClBitcodeCompressor::CompressFlags &Flags,
return Error("Invalid PNaCl bitcode header");
// Create the bitcode reader.
- NaClBitstreamReader StreamFile(BufPtr, EndBufPtr);
+ NaClBitstreamReader StreamFile(BufPtr, EndBufPtr, Header);
NaClBitstreamCursor Stream(StreamFile);
// Create the bitcode writer.
« no previous file with comments | « lib/Bitcode/NaCl/Analysis/NaClBitcodeAnalyzer.cpp ('k') | lib/Bitcode/NaCl/Analysis/NaClObjDump.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698