summaryrefslogtreecommitdiffstats
path: root/lib/Frontend/ChainedIncludesSource.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2015-02-21 00:29:14 +0000
committerAdrian Prantl <aprantl@apple.com>2015-02-21 00:29:14 +0000
commit59fc8c4fb646077e362a29ada5091d3ee66254f8 (patch)
tree230a4575664871ddb239e537d363af092ca05a29 /lib/Frontend/ChainedIncludesSource.cpp
parent9d86a6e84c1344a9acfb5a51402601f3792a5d6e (diff)
Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."
This reverts commit 230099. The Linux configure+make build variant still needs some work. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230103 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/ChainedIncludesSource.cpp')
-rw-r--r--lib/Frontend/ChainedIncludesSource.cpp16
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());
}