diff options
author | Adrian Prantl <aprantl@apple.com> | 2015-02-20 22:12:19 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2015-02-20 22:12:19 +0000 |
commit | ff780299d2517c9e2bd5ce34ab59e150043ac633 (patch) | |
tree | 8ec389cc761e79374298f22d4d52b5c5fe7e5580 /lib/Frontend/ChainedIncludesSource.cpp | |
parent | d9468a7cf54e6e8f1b40b6ed4c4462f88b0564dd (diff) |
Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."
This reverts commit r230067.
Investigating another batch of problems found by the bots.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230073 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/ChainedIncludesSource.cpp')
-rw-r--r-- | lib/Frontend/ChainedIncludesSource.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/lib/Frontend/ChainedIncludesSource.cpp b/lib/Frontend/ChainedIncludesSource.cpp index 1ecc0bfc6b..cb260b4f4c 100644 --- a/lib/Frontend/ChainedIncludesSource.cpp +++ b/lib/Frontend/ChainedIncludesSource.cpp @@ -156,13 +156,11 @@ IntrusiveRefCntPtr<ExternalSemaSource> clang::createChainedIncludesSource( &Clang->getPreprocessor()); Clang->createASTContext(); - auto consumer = llvm::make_unique<PCHGenerator>(Clang->getPreprocessor(), - "-", nullptr, /*isysroot=*/""); - SmallVectorImpl<char> *serialAST; - consumer->RegisterSerializationFinishedCallback( - [&](SmallVectorImpl<char> *Buf){ - serialAST = Buf; - }); + SmallVector<char, 256> serialAST; + llvm::raw_svector_ostream OS(serialAST); + auto consumer = + llvm::make_unique<PCHGenerator>(Clang->getPreprocessor(), "-", nullptr, + /*isysroot=*/"", &OS); Clang->getASTContext().setASTMutationListener( consumer->GetASTMutationListener()); Clang->setASTConsumer(std::move(consumer)); @@ -199,9 +197,7 @@ IntrusiveRefCntPtr<ExternalSemaSource> clang::createChainedIncludesSource( ParseAST(Clang->getSema()); Clang->getDiagnosticClient().EndSourceFile(); - SerialBufs.push_back(llvm::MemoryBuffer:: - getMemBufferCopy(StringRef(serialAST->data(), serialAST->size()))); - serialAST->clear(); + SerialBufs.push_back(llvm::MemoryBuffer::getMemBufferCopy(OS.str())); source->CIs.push_back(Clang.release()); } |