FileInfo always has content cache and replaceBuffer became setBuffer.

See llvm/llvm-project@296314516d
This commit is contained in:
Vassil Vassilev 2021-09-11 20:39:04 +00:00 committed by jenkins
parent 0041450ed4
commit 7fcc35181a

View File

@ -1547,11 +1547,11 @@ namespace {
SM->setMainFileID(MainFileID);
const SrcMgr::SLocEntry& MainFileSLocE = SM->getSLocEntry(MainFileID);
const SrcMgr::FileInfo& MainFileFI = MainFileSLocE.getFile();
SrcMgr::ContentCache* MainFileCC
= const_cast<SrcMgr::ContentCache*>(MainFileFI.getContentCache());
SrcMgr::ContentCache& MainFileCC
= const_cast<SrcMgr::ContentCache&>(MainFileFI.getContentCache());
if (!Buffer)
Buffer = llvm::MemoryBuffer::getMemBuffer("/*CLING DEFAULT MEMBUF*/;\n");
MainFileCC->replaceBuffer(Buffer.release(), /*DoNotFree*/ false);
MainFileCC.setBuffer(std::move(Buffer));
// Create TargetInfo for the other side of CUDA and OpenMP compilation.
if ((CI->getLangOpts().CUDA || CI->getLangOpts().OpenMPIsDevice) &&