r221784 - Simplify code a bit by passing StreamFile to the BitstreamCursor constructor.
Rafael Espindola
rafael.espindola at gmail.com
Wed Nov 12 06:42:25 PST 2014
Author: rafael
Date: Wed Nov 12 08:42:25 2014
New Revision: 221784
URL: http://llvm.org/viewvc/llvm-project?rev=221784&view=rev
Log:
Simplify code a bit by passing StreamFile to the BitstreamCursor constructor.
Modified:
cfe/trunk/lib/Frontend/SerializedDiagnosticReader.cpp
cfe/trunk/lib/Serialization/ASTReader.cpp
cfe/trunk/lib/Serialization/GlobalModuleIndex.cpp
Modified: cfe/trunk/lib/Frontend/SerializedDiagnosticReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/SerializedDiagnosticReader.cpp?rev=221784&r1=221783&r2=221784&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/SerializedDiagnosticReader.cpp (original)
+++ cfe/trunk/lib/Frontend/SerializedDiagnosticReader.cpp Wed Nov 12 08:42:25 2014
@@ -29,8 +29,7 @@ std::error_code SerializedDiagnosticRead
StreamFile.init((const unsigned char *)(*Buffer)->getBufferStart(),
(const unsigned char *)(*Buffer)->getBufferEnd());
- llvm::BitstreamCursor Stream;
- Stream.init(StreamFile);
+ llvm::BitstreamCursor Stream(StreamFile);
// Sniff for the signature.
if (Stream.Read(8) != 'D' ||
Modified: cfe/trunk/lib/Serialization/ASTReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=221784&r1=221783&r2=221784&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReader.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReader.cpp Wed Nov 12 08:42:25 2014
@@ -4124,10 +4124,9 @@ std::string ASTReader::getOriginalSource
// Initialize the stream
llvm::BitstreamReader StreamFile;
- BitstreamCursor Stream;
StreamFile.init((const unsigned char *)(*Buffer)->getBufferStart(),
(const unsigned char *)(*Buffer)->getBufferEnd());
- Stream.init(StreamFile);
+ BitstreamCursor Stream(StreamFile);
// Sniff for the signature.
if (Stream.Read(8) != 'C' ||
@@ -4211,10 +4210,9 @@ bool ASTReader::readASTFileControlBlock(
// Initialize the stream
llvm::BitstreamReader StreamFile;
- BitstreamCursor Stream;
StreamFile.init((const unsigned char *)(*Buffer)->getBufferStart(),
(const unsigned char *)(*Buffer)->getBufferEnd());
- Stream.init(StreamFile);
+ BitstreamCursor Stream(StreamFile);
// Sniff for the signature.
if (Stream.Read(8) != 'C' ||
Modified: cfe/trunk/lib/Serialization/GlobalModuleIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/GlobalModuleIndex.cpp?rev=221784&r1=221783&r2=221784&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/GlobalModuleIndex.cpp (original)
+++ cfe/trunk/lib/Serialization/GlobalModuleIndex.cpp Wed Nov 12 08:42:25 2014
@@ -501,10 +501,9 @@ bool GlobalModuleIndexBuilder::loadModul
// Initialize the input stream
llvm::BitstreamReader InStreamFile;
- llvm::BitstreamCursor InStream;
InStreamFile.init((const unsigned char *)(*Buffer)->getBufferStart(),
(const unsigned char *)(*Buffer)->getBufferEnd());
- InStream.init(InStreamFile);
+ llvm::BitstreamCursor InStream(InStreamFile);
// Sniff for the signature.
if (InStream.Read(8) != 'C' ||
More information about the cfe-commits
mailing list