This revision was automatically updated to reflect the committed changes. Closed by commit rGdde4e0318c4c: clang/CodeGen: Stop using SourceManager::getBuffer, NFC (authored by dexonsmith). Herald added a project: clang.
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89411/new/ https://reviews.llvm.org/D89411 Files: clang/lib/CodeGen/CGDebugInfo.cpp clang/lib/CodeGen/CodeGenAction.cpp Index: clang/lib/CodeGen/CodeGenAction.cpp =================================================================== --- clang/lib/CodeGen/CodeGenAction.cpp +++ clang/lib/CodeGen/CodeGenAction.cpp @@ -1122,11 +1122,10 @@ if (BA != Backend_EmitNothing && !OS) return; - bool Invalid; SourceManager &SM = CI.getSourceManager(); FileID FID = SM.getMainFileID(); - const llvm::MemoryBuffer *MainFile = SM.getBuffer(FID, &Invalid); - if (Invalid) + Optional<MemoryBufferRef> MainFile = SM.getBufferOrNone(FID); + if (!MainFile) return; TheModule = loadModule(*MainFile); @@ -1141,8 +1140,7 @@ TheModule->setTargetTriple(TargetOpts.Triple); } - EmbedBitcode(TheModule.get(), CodeGenOpts, - MainFile->getMemBufferRef()); + EmbedBitcode(TheModule.get(), CodeGenOpts, *MainFile); LLVMContext &Ctx = TheModule->getContext(); Ctx.setInlineAsmDiagnosticHandler(BitcodeInlineAsmDiagHandler, Index: clang/lib/CodeGen/CGDebugInfo.cpp =================================================================== --- clang/lib/CodeGen/CGDebugInfo.cpp +++ clang/lib/CodeGen/CGDebugInfo.cpp @@ -374,9 +374,8 @@ return None; SourceManager &SM = CGM.getContext().getSourceManager(); - bool Invalid; - const llvm::MemoryBuffer *MemBuffer = SM.getBuffer(FID, &Invalid); - if (Invalid) + Optional<llvm::MemoryBufferRef> MemBuffer = SM.getBufferOrNone(FID); + if (!MemBuffer) return None; llvm::MD5 Hash;
Index: clang/lib/CodeGen/CodeGenAction.cpp =================================================================== --- clang/lib/CodeGen/CodeGenAction.cpp +++ clang/lib/CodeGen/CodeGenAction.cpp @@ -1122,11 +1122,10 @@ if (BA != Backend_EmitNothing && !OS) return; - bool Invalid; SourceManager &SM = CI.getSourceManager(); FileID FID = SM.getMainFileID(); - const llvm::MemoryBuffer *MainFile = SM.getBuffer(FID, &Invalid); - if (Invalid) + Optional<MemoryBufferRef> MainFile = SM.getBufferOrNone(FID); + if (!MainFile) return; TheModule = loadModule(*MainFile); @@ -1141,8 +1140,7 @@ TheModule->setTargetTriple(TargetOpts.Triple); } - EmbedBitcode(TheModule.get(), CodeGenOpts, - MainFile->getMemBufferRef()); + EmbedBitcode(TheModule.get(), CodeGenOpts, *MainFile); LLVMContext &Ctx = TheModule->getContext(); Ctx.setInlineAsmDiagnosticHandler(BitcodeInlineAsmDiagHandler, Index: clang/lib/CodeGen/CGDebugInfo.cpp =================================================================== --- clang/lib/CodeGen/CGDebugInfo.cpp +++ clang/lib/CodeGen/CGDebugInfo.cpp @@ -374,9 +374,8 @@ return None; SourceManager &SM = CGM.getContext().getSourceManager(); - bool Invalid; - const llvm::MemoryBuffer *MemBuffer = SM.getBuffer(FID, &Invalid); - if (Invalid) + Optional<llvm::MemoryBufferRef> MemBuffer = SM.getBufferOrNone(FID); + if (!MemBuffer) return None; llvm::MD5 Hash;
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits