diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2010-01-01 10:34:51 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2010-01-01 10:34:51 +0000 |
commit | bb1e3bc1e0be2b8f891db46457a8943451bf4d8b (patch) | |
tree | 1e68501209c9133fbda8d45171e59f8d6f12dd55 /lib/Lex/Preprocessor.cpp | |
parent | 77212133072dc40f070a280af8217032f55a9eb4 (diff) | |
download | FreeBSD-src-bb1e3bc1e0be2b8f891db46457a8943451bf4d8b.zip FreeBSD-src-bb1e3bc1e0be2b8f891db46457a8943451bf4d8b.tar.gz |
Updaet clang to 92395.
Diffstat (limited to 'lib/Lex/Preprocessor.cpp')
-rw-r--r-- | lib/Lex/Preprocessor.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp index d4e441b..81966cb 100644 --- a/lib/Lex/Preprocessor.cpp +++ b/lib/Lex/Preprocessor.cpp @@ -446,19 +446,10 @@ void Preprocessor::EnterMainSourceFile() { if (const FileEntry *FE = SourceMgr.getFileEntryForID(MainFileID)) HeaderInfo.IncrementIncludeCount(FE); - std::vector<char> PrologFile; - PrologFile.reserve(4080); - - // FIXME: Don't make a copy. - PrologFile.insert(PrologFile.end(), Predefines.begin(), Predefines.end()); - - // Memory buffer must end with a null byte! - PrologFile.push_back(0); - - // Now that we have emitted the predefined macros, #includes, etc into - // PrologFile, preprocess it to populate the initial preprocessor state. + // Preprocess Predefines to populate the initial preprocessor state. llvm::MemoryBuffer *SB = - llvm::MemoryBuffer::getMemBufferCopy(&PrologFile.front(),&PrologFile.back(), + llvm::MemoryBuffer::getMemBufferCopy(Predefines.data(), + Predefines.data() + Predefines.size(), "<built-in>"); assert(SB && "Cannot fail to create predefined source buffer"); FileID FID = SourceMgr.createFileIDForMemBuffer(SB); |