From bc4a5bdce4af82a5522869d8a154e9e15cf809df Mon Sep 17 00:00:00 2001 From: serge-sans-paille Date: Fri, 12 Mar 2021 14:27:15 +0100 Subject: [PATCH] [NFC] Use StringRef instead of const char* for AsmPrinter This avoids calling strlen to repeatedly compute some string size. --- llvm/include/llvm/CodeGen/AsmPrinter.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/llvm/include/llvm/CodeGen/AsmPrinter.h b/llvm/include/llvm/CodeGen/AsmPrinter.h index dcd9cca0d81d..52b5ecd1a3bb 100644 --- a/llvm/include/llvm/CodeGen/AsmPrinter.h +++ b/llvm/include/llvm/CodeGen/AsmPrinter.h @@ -144,14 +144,14 @@ public: /// AsmPrinter to add their own handlers. struct HandlerInfo { std::unique_ptr Handler; - const char *TimerName; - const char *TimerDescription; - const char *TimerGroupName; - const char *TimerGroupDescription; + StringRef TimerName; + StringRef TimerDescription; + StringRef TimerGroupName; + StringRef TimerGroupDescription; - HandlerInfo(std::unique_ptr Handler, - const char *TimerName, const char *TimerDescription, - const char *TimerGroupName, const char *TimerGroupDescription) + HandlerInfo(std::unique_ptr Handler, StringRef TimerName, + StringRef TimerDescription, StringRef TimerGroupName, + StringRef TimerGroupDescription) : Handler(std::move(Handler)), TimerName(TimerName), TimerDescription(TimerDescription), TimerGroupName(TimerGroupName), TimerGroupDescription(TimerGroupDescription) {}