[llvm] [NFCI][Globals]For GlobalObjects, add updateSectionPrefix and change setSectionPrefix to handle empty strings (PR #158460)
Mingming Liu via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 15 15:52:37 PDT 2025
================
@@ -121,9 +121,14 @@ class GlobalObject : public GlobalValue {
/// appropriate default object file section.
LLVM_ABI void setSection(StringRef S);
- /// Set the section prefix for this global object.
+ /// Set the section prefix for this global object. If \p Prefix is empty,
+ /// the section prefix metadata will be cleared if it exists.
LLVM_ABI void setSectionPrefix(StringRef Prefix);
+ /// If \p Prefix is different from existing prefix, update section prefix.
+ /// Returns true if an update happens and false otherwise.
+ LLVM_ABI bool updateSectionPrefix(StringRef Prefix);
----------------
mingmingl-llvm wrote:
done.
https://github.com/llvm/llvm-project/pull/158460
More information about the llvm-commits
mailing list