]> granicus.if.org Git - clang/commitdiff
Serialization: Switch over to using the native SmallVector based BitstreamWriter
authorDaniel Dunbar <daniel@zuster.org>
Wed, 29 Feb 2012 20:31:23 +0000 (20:31 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Wed, 29 Feb 2012 20:31:23 +0000 (20:31 +0000)
ctor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151752 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Serialization/ASTWriter.h
lib/Frontend/ASTUnit.cpp
lib/Frontend/SerializedDiagnosticPrinter.cpp

index a0ea220b2dcb1aed8bf72999d5c6faee7cc82bb9..940c86ab333c59a69b3ba820426e4f04a569618c 100644 (file)
@@ -709,7 +709,7 @@ class PCHGenerator : public SemaConsumer {
   raw_ostream *Out;
   Sema *SemaPtr;
   MemorizeStatCalls *StatCalls; // owned by the FileManager
-  std::vector<unsigned char> Buffer;
+  llvm::SmallVector<char, 128> Buffer;
   llvm::BitstreamWriter Stream;
   ASTWriter Writer;
 
index 3ffb6ecb4b259fb8a208f73f0bddbb0bb8dcc78b..c1678d4ef01a37d5a86682f1f34de283a69b659f 100644 (file)
@@ -2423,7 +2423,7 @@ bool ASTUnit::serialize(raw_ostream &OS) {
   if (getDiagnostics().hasErrorOccurred())
     return true;
 
-  std::vector<unsigned char> Buffer;
+  SmallString<128> Buffer;
   llvm::BitstreamWriter Stream(Buffer);
   ASTWriter Writer(Stream);
   // FIXME: Handle modules
index 7a8edf7f5c5b1186228a9a3d00f48474278b774d..7bf8742a8040748b03e52ae0f30480ba010b69b9 100644 (file)
@@ -159,7 +159,7 @@ private:
   const DiagnosticOptions &DiagOpts;
   
   /// \brief The byte buffer for the serialized content.
-  std::vector<unsigned char> Buffer;
+  SmallString<1024> Buffer;
 
   /// \brief The BitStreamWriter for the serialized diagnostics.
   llvm::BitstreamWriter Stream;