Browse Source

Simplify code a bit by passing StreamFile to the BitstreamCursor constructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221784 91177308-0d34-0410-b5e6-96231b3b80d8
Rafael Espindola 10 years ago
parent
commit
3d4dc34043

+ 1 - 2
lib/Frontend/SerializedDiagnosticReader.cpp

@@ -29,8 +29,7 @@ std::error_code SerializedDiagnosticReader::readDiagnostics(StringRef File) {
   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' ||

+ 2 - 4
lib/Serialization/ASTReader.cpp

@@ -4124,10 +4124,9 @@ std::string ASTReader::getOriginalSourceFile(const std::string &ASTFileName,
 
   // 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(StringRef Filename,
 
   // 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' ||

+ 1 - 2
lib/Serialization/GlobalModuleIndex.cpp

@@ -501,10 +501,9 @@ bool GlobalModuleIndexBuilder::loadModuleFile(const FileEntry *File) {
 
   // 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' ||