Remove global std::string. StringRef is sufficient. NFC.
authorBenjamin Kramer <benny.kra@googlemail.com>
Sun, 7 Jun 2020 15:15:31 +0000 (17:15 +0200)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sun, 7 Jun 2020 15:22:44 +0000 (17:22 +0200)
clang/lib/Analysis/ExprMutationAnalyzer.cpp

index 5e30553..e57a425 100644 (file)
@@ -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,