aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/LLVMContext.cpp
diff options
context:
space:
mode:
authorgonzalobg <65027571+gonzalobg@users.noreply.github.com>2024-09-25 20:13:56 +0200
committerGitHub <noreply@github.com>2024-09-25 11:13:56 -0700
commit0f521931b85e6b5f798af357cf32a7ae782a848d (patch)
tree6061d2028587020f0063b40885f3eee486c157cc /llvm/lib/IR/LLVMContext.cpp
parentc71bfc59ee1cec32d56a82476461e242398f82ca (diff)
downloadllvm-0f521931b85e6b5f798af357cf32a7ae782a848d.zip
llvm-0f521931b85e6b5f798af357cf32a7ae782a848d.tar.gz
llvm-0f521931b85e6b5f798af357cf32a7ae782a848d.tar.bz2
LLVMContext: add getSyncScopeName() to lookup individual scope name (#109484)
This PR adds a `getSyncScopeString(Id)` API to `LLVMContext` that returns the `StringRef` for that ID, if any.
Diffstat (limited to 'llvm/lib/IR/LLVMContext.cpp')
-rw-r--r--llvm/lib/IR/LLVMContext.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/IR/LLVMContext.cpp b/llvm/lib/IR/LLVMContext.cpp
index 22e6077..e078527 100644
--- a/llvm/lib/IR/LLVMContext.cpp
+++ b/llvm/lib/IR/LLVMContext.cpp
@@ -330,6 +330,10 @@ void LLVMContext::getSyncScopeNames(SmallVectorImpl<StringRef> &SSNs) const {
pImpl->getSyncScopeNames(SSNs);
}
+std::optional<StringRef> LLVMContext::getSyncScopeName(SyncScope::ID Id) const {
+ return pImpl->getSyncScopeName(Id);
+}
+
void LLVMContext::setGC(const Function &Fn, std::string GCName) {
pImpl->GCNames[&Fn] = std::move(GCName);
}