[clang] 8116dfb - [InstallAPI] Use unique identifiers for input buffers (#83523)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 29 21:42:46 PST 2024
Author: Cyndy Ishida
Date: 2024-02-29T21:42:43-08:00
New Revision: 8116dfb8b58a65e78e341f09f5728d345f086b7b
URL: https://github.com/llvm/llvm-project/commit/8116dfb8b58a65e78e341f09f5728d345f086b7b
DIFF: https://github.com/llvm/llvm-project/commit/8116dfb8b58a65e78e341f09f5728d345f086b7b.diff
LOG: [InstallAPI] Use unique identifiers for input buffers (#83523)
Added:
Modified:
clang/lib/InstallAPI/Frontend.cpp
Removed:
################################################################################
diff --git a/clang/lib/InstallAPI/Frontend.cpp b/clang/lib/InstallAPI/Frontend.cpp
index 9f675ef7d1bd22..133e49230ffa9b 100644
--- a/clang/lib/InstallAPI/Frontend.cpp
+++ b/clang/lib/InstallAPI/Frontend.cpp
@@ -51,8 +51,10 @@ std::unique_ptr<MemoryBuffer> createInputBuffer(const InstallAPIContext &Ctx) {
if (Contents.empty())
return nullptr;
- return llvm::MemoryBuffer::getMemBufferCopy(
- Contents, "installapi-includes" + getFileExtension(Ctx.LangMode));
+ SmallString<64> BufferName(
+ {"installapi-includes-", Ctx.Slice->getTriple().str(), "-",
+ getName(Ctx.Type), getFileExtension(Ctx.LangMode)});
+ return llvm::MemoryBuffer::getMemBufferCopy(Contents, BufferName);
}
} // namespace clang::installapi
More information about the cfe-commits
mailing list