diff options
author | Adrian Prantl <aprantl@apple.com> | 2015-02-24 05:14:17 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2015-02-24 05:14:17 +0000 |
commit | a39924a1f8b97a2b65765f31d7e87884541d52ec (patch) | |
tree | 33aa61a31fb088dbf006aa7f2ca7e471ae257033 /clang/lib/Frontend/ChainedIncludesSource.cpp | |
parent | 1f6a32b3e7aa095263a5a0bbb1cc0576dce441a6 (diff) | |
download | bcm5719-llvm-a39924a1f8b97a2b65765f31d7e87884541d52ec.tar.gz bcm5719-llvm-a39924a1f8b97a2b65765f31d7e87884541d52ec.zip |
Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."
This reverts commit r230305.
Off to fix another round of missing dependencies on various platforms.
llvm-svn: 230309
Diffstat (limited to 'clang/lib/Frontend/ChainedIncludesSource.cpp')
-rw-r--r-- | clang/lib/Frontend/ChainedIncludesSource.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/clang/lib/Frontend/ChainedIncludesSource.cpp b/clang/lib/Frontend/ChainedIncludesSource.cpp index 1ecc0bfc6b4..cb260b4f4c6 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()); } |