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

Unified Diff: lib/Bitcode/NaCl/Reader/NaClBitcodeReader.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/Reader/NaClBitcodeHeader.cpp ('k') | lib/Bitcode/NaCl/Reader/NaClBitstreamReader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp
diff --git a/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp b/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp
index fca2ee760e09af1c50b2356626c1931c8b8e191b..c4cae2ca8165aaa73ddcda0a9bbaaf6036e54ee3 100644
--- a/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp
+++ b/lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp
@@ -1844,16 +1844,15 @@ std::error_code NaClBitcodeReader::InitStreamFromBuffer() {
return Error(InvalidBitstream,
"Bitcode stream should be a multiple of 4 bytes in length");
- const unsigned char *HeaderPtr = BufPtr;
- if (Header.Read(HeaderPtr, BufEnd))
+ if (Header.Read(BufPtr, BufEnd))
return Error(InvalidBitstream, Header.Unsupported());
- StreamFile.reset(new NaClBitstreamReader(BufPtr, BufEnd,
- Header.getHeaderSize()));
- Stream.init(StreamFile.get());
-
if (AcceptHeader())
return Error(InvalidBitstream, Header.Unsupported());
+
+ StreamFile.reset(new NaClBitstreamReader(BufPtr, BufEnd, Header));
+ Stream.init(StreamFile.get());
+
return std::error_code();
}
@@ -1861,11 +1860,11 @@ std::error_code NaClBitcodeReader::InitLazyStream() {
if (Header.Read(LazyStreamer))
return Error(InvalidBitstream, Header.Unsupported());
- StreamFile.reset(new NaClBitstreamReader(LazyStreamer,
- Header.getHeaderSize()));
- Stream.init(StreamFile.get());
if (AcceptHeader())
return Error(InvalidBitstream, Header.Unsupported());
+
+ StreamFile.reset(new NaClBitstreamReader(LazyStreamer, Header));
+ Stream.init(StreamFile.get());
return std::error_code();
}
« no previous file with comments | « lib/Bitcode/NaCl/Reader/NaClBitcodeHeader.cpp ('k') | lib/Bitcode/NaCl/Reader/NaClBitstreamReader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698