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

Unified Diff: lib/Bitcode/NaCl/Analysis/NaClObjDump.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/NaClCompress.cpp ('k') | lib/Bitcode/NaCl/Reader/NaClBitcodeHeader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/Bitcode/NaCl/Analysis/NaClObjDump.cpp
diff --git a/lib/Bitcode/NaCl/Analysis/NaClObjDump.cpp b/lib/Bitcode/NaCl/Analysis/NaClObjDump.cpp
index f1606596baf46e9c93577f21d2ccc5d45718425b..3699f1f5bda143009f77b8197f4cd12baeae727c 100644
--- a/lib/Bitcode/NaCl/Analysis/NaClObjDump.cpp
+++ b/lib/Bitcode/NaCl/Analysis/NaClObjDump.cpp
@@ -3531,18 +3531,23 @@ bool NaClObjDump(MemoryBufferRef MemBuf, raw_ostream &Output,
const unsigned char *BufPtr = (const unsigned char *)MemBuf.getBufferStart();
const unsigned char *EndBufPtr = BufPtr+MemBuf.getBufferSize();
- const unsigned char *HeaderPtr = BufPtr;
// Read header and verify it is good.
NaClBitcodeHeader Header;
- if (Header.Read(HeaderPtr, EndBufPtr) || !Header.IsSupported()) {
+ if (Header.Read(BufPtr, EndBufPtr)) {
ObjDump.Error() << "Invalid PNaCl bitcode header.\n";
return true;
}
+ if (!Header.IsSupported()) {
+ ObjDump.Warning() << Header.Unsupported();
+ if (!Header.IsReadable()) {
+ ObjDump.Error() << "Invalid PNaCl bitcode header.\n";
+ return true;
+ }
+ }
// Create a bitstream reader to read the bitcode file.
- NaClBitstreamReader InputStreamFile(BufPtr, EndBufPtr,
- Header.getHeaderSize());
+ NaClBitstreamReader InputStreamFile(BufPtr, EndBufPtr, Header);
NaClBitstreamCursor InputStream(InputStreamFile);
// Parse the the bitcode file.
« no previous file with comments | « lib/Bitcode/NaCl/Analysis/NaClCompress.cpp ('k') | lib/Bitcode/NaCl/Reader/NaClBitcodeHeader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698