Remove static global GCNames from Function.cpp and move it to the Context
[oota-llvm.git] / lib / Transforms / Scalar / RewriteStatepointsForGC.cpp
index b21d037bf7a986ae409f4046aba4360203ce1ec0..94768a255cad37bf58d66e88c36ac16c6588b334 100644 (file)
@@ -2558,7 +2558,7 @@ void RewriteStatepointsForGC::stripNonValidAttributesFromBody(Function &F) {
 static bool shouldRewriteStatepointsIn(Function &F) {
   // TODO: This should check the GCStrategy
   if (F.hasGC()) {
-    const char *FunctionGCName = F.getGC();
+    const auto &FunctionGCName = F.getGC();
     const StringRef StatepointExampleName("statepoint-example");
     const StringRef CoreCLRName("coreclr");
     return (StatepointExampleName == FunctionGCName) ||