[clang] 0c3df70 - Remove global std::string. StringRef is sufficient. NFC.

Benjamin Kramer via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 7 08:27:34 PDT 2020


Author: Benjamin Kramer
Date: 2020-06-07T17:22:44+02:00
New Revision: 0c3df70fad83daba2384fab10e026288a9571901

URL: https://github.com/llvm/llvm-project/commit/0c3df70fad83daba2384fab10e026288a9571901
DIFF: https://github.com/llvm/llvm-project/commit/0c3df70fad83daba2384fab10e026288a9571901.diff

LOG: Remove global std::string. StringRef is sufficient. NFC.

Added: 
    

Modified: 
    clang/lib/Analysis/ExprMutationAnalyzer.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Analysis/ExprMutationAnalyzer.cpp b/clang/lib/Analysis/ExprMutationAnalyzer.cpp
index 5e305534c812..e57a425f802d 100644
--- a/clang/lib/Analysis/ExprMutationAnalyzer.cpp
+++ b/clang/lib/Analysis/ExprMutationAnalyzer.cpp
@@ -73,10 +73,8 @@ const auto isMoveOnly = [] {
 };
 
 template <class T> struct NodeID;
-template <> struct NodeID<Expr> { static const std::string value; };
-template <> struct NodeID<Decl> { static const std::string value; };
-const std::string NodeID<Expr>::value = "expr";
-const std::string NodeID<Decl>::value = "decl";
+template <> struct NodeID<Expr> { static constexpr StringRef value = "expr"; };
+template <> struct NodeID<Decl> { static constexpr StringRef value = "decl"; };
 
 template <class T, class F = const Stmt *(ExprMutationAnalyzer::*)(const T *)>
 const Stmt *tryEachMatch(ArrayRef<ast_matchers::BoundNodes> Matches,


        


More information about the cfe-commits mailing list