[llvm] 5178585 - [NFC][Instrumentation] Use `Twine` in `createPrivateGlobalForString` (#104726)

via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 19 11:24:47 PDT 2024


Author: Vitaly Buka
Date: 2024-08-19T11:24:42-07:00
New Revision: 51785856ec5fb6c3f17834b212086d9fc7183868

URL: https://github.com/llvm/llvm-project/commit/51785856ec5fb6c3f17834b212086d9fc7183868
DIFF: https://github.com/llvm/llvm-project/commit/51785856ec5fb6c3f17834b212086d9fc7183868.diff

LOG: [NFC][Instrumentation] Use `Twine` in `createPrivateGlobalForString` (#104726)

Added: 
    

Modified: 
    llvm/include/llvm/Transforms/Instrumentation.h
    llvm/lib/Transforms/Instrumentation/Instrumentation.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Transforms/Instrumentation.h b/llvm/include/llvm/Transforms/Instrumentation.h
index 885d3249fb4f83..1a4824a806dc6e 100644
--- a/llvm/include/llvm/Transforms/Instrumentation.h
+++ b/llvm/include/llvm/Transforms/Instrumentation.h
@@ -46,7 +46,7 @@ BasicBlock::iterator PrepareToSplitEntryBlock(BasicBlock &BB,
 // Create a constant for Str so that we can pass it to the run-time lib.
 GlobalVariable *createPrivateGlobalForString(Module &M, StringRef Str,
                                              bool AllowMerging,
-                                             const char *NamePrefix = "");
+                                             Twine NamePrefix = "");
 
 // Returns F.getComdat() if it exists.
 // Otherwise creates a new comdat, sets F's comdat, and returns it.

diff  --git a/llvm/lib/Transforms/Instrumentation/Instrumentation.cpp b/llvm/lib/Transforms/Instrumentation/Instrumentation.cpp
index 19f4d8064fc27d..305bae0e2010d1 100644
--- a/llvm/lib/Transforms/Instrumentation/Instrumentation.cpp
+++ b/llvm/lib/Transforms/Instrumentation/Instrumentation.cpp
@@ -91,7 +91,7 @@ BasicBlock::iterator llvm::PrepareToSplitEntryBlock(BasicBlock &BB,
 // Create a constant for Str so that we can pass it to the run-time lib.
 GlobalVariable *llvm::createPrivateGlobalForString(Module &M, StringRef Str,
                                                    bool AllowMerging,
-                                                   const char *NamePrefix) {
+                                                   Twine NamePrefix) {
   Constant *StrConst = ConstantDataArray::getString(M.getContext(), Str);
   // We use private linkage for module-local strings. If they can be merged
   // with another one, we set the unnamed_addr attribute.


        


More information about the llvm-commits mailing list