aboutsummaryrefslogtreecommitdiff
path: root/clang/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
commit67fbfa377308b9839b63b9c8f656c2604dbaa174 (patch)
treec64a3de57bbb455dea69caff225fe5988a164248 /clang/lib/Frontend/ChainedIncludesSource.cpp
parent18232f7ecc6b4940faa5d1a4effaa0a8bc29243e (diff)
downloadllvm-67fbfa377308b9839b63b9c8f656c2604dbaa174.zip
llvm-67fbfa377308b9839b63b9c8f656c2604dbaa174.tar.gz
llvm-67fbfa377308b9839b63b9c8f656c2604dbaa174.tar.bz2
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. llvm-svn: 230103
Diffstat (limited to 'clang/lib/Frontend/ChainedIncludesSource.cpp')
-rw-r--r--clang/lib/Frontend/ChainedIncludesSource.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/clang/lib/Frontend/ChainedIncludesSource.cpp b/clang/lib/Frontend/ChainedIncludesSource.cpp
index 1ecc0bf..cb260b4 100644
--- a/clang/lib/Frontend/ChainedIncludesSource.cpp
+++ b/clang/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());
}