Simplify code a bit by passing StreamFile to the BitstreamCursor constructor.
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 12 Nov 2014 14:42:25 +0000 (14:42 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 12 Nov 2014 14:42:25 +0000 (14:42 +0000)
llvm-svn: 221784

clang/lib/Frontend/SerializedDiagnosticReader.cpp
clang/lib/Serialization/ASTReader.cpp
clang/lib/Serialization/GlobalModuleIndex.cpp

index 197132d..c8faef3 100644 (file)
@@ -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' ||
index 8f1abe0..df5a6bf 100644 (file)
@@ -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' ||
index a67f9f3..4791388 100644 (file)
@@ -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' ||