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

Unified Diff: lib/Bitcode/Reader/BitcodeReader.cpp

Issue 939073008: Rebased PNaCl localmods in LLVM to 223109 (Closed)
Patch Set: undo localmod Created 5 years, 10 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/Reader/BitcodeReader.h ('k') | lib/CodeGen/AsmPrinter/AsmPrinter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/Bitcode/Reader/BitcodeReader.cpp
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp
index 7aadb43b3dd698325c115afe206df362193c6661..f9b881b4d4ea4c8e66223509b136adb82e245a43 100644
--- a/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -3426,12 +3426,12 @@ std::error_code BitcodeReader::InitStreamFromBuffer() {
std::error_code BitcodeReader::InitLazyStream() {
// Check and strip off the bitcode wrapper; BitstreamReader expects never to
// see it.
- StreamingMemoryObject *Bytes = new StreamingMemoryObject(LazyStreamer);
- StreamFile.reset(new BitstreamReader(Bytes));
+ // @LOCALMOD Bytes -> LazyStreamer
+ StreamFile.reset(new BitstreamReader(LazyStreamer));
Stream.init(&*StreamFile);
unsigned char buf[16];
- if (Bytes->readBytes(buf, 16, 0) != 16)
+ if (LazyStreamer->readBytes(buf, 16, 0) != 16)
return Error(BitcodeError::InvalidBitcodeSignature);
if (!isBitcode(buf, buf + 16))
@@ -3441,8 +3441,8 @@ std::error_code BitcodeReader::InitLazyStream() {
const unsigned char *bitcodeStart = buf;
const unsigned char *bitcodeEnd = buf + 16;
SkipBitcodeWrapperHeader(bitcodeStart, bitcodeEnd, false);
- Bytes->dropLeadingBytes(bitcodeStart - buf);
- Bytes->setKnownObjectSize(bitcodeEnd - bitcodeStart);
+ LazyStreamer->dropLeadingBytes(bitcodeStart - buf);
+ LazyStreamer->setKnownObjectSize(bitcodeEnd - bitcodeStart);
}
return std::error_code();
}
@@ -3549,7 +3549,8 @@ llvm::getLazyBitcodeModule(std::unique_ptr<MemoryBuffer> &&Buffer,
}
Module *llvm::getStreamedBitcodeModule(const std::string &name,
- DataStreamer *streamer,
+ // @LOCALMOD
+ StreamingMemoryObject *streamer,
LLVMContext &Context,
std::string *ErrMsg) {
Module *M = new Module(name, Context);
« no previous file with comments | « lib/Bitcode/Reader/BitcodeReader.h ('k') | lib/CodeGen/AsmPrinter/AsmPrinter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698