diff --git a/utils/TableGen/CodeGenSchedule.cpp b/utils/TableGen/CodeGenSchedule.cpp index b73e0767e3b..ff5353d3ec3 100644 --- a/utils/TableGen/CodeGenSchedule.cpp +++ b/utils/TableGen/CodeGenSchedule.cpp @@ -387,9 +387,9 @@ void CodeGenSchedModels::collectSchedRW() { RecVec RWDefs = Records.getAllDerivedDefinitions("SchedReadWrite"); for (Record *RWDef : RWDefs) { if (!getSchedRWIdx(RWDef, RWDef->isSubClassOf("SchedRead"))) { - const std::string &Name = RWDef->getName(); + StringRef Name = RWDef->getName(); if (Name != "NoWrite" && Name != "ReadDefault") - dbgs() << "Unused SchedReadWrite " << RWDef->getName() << '\n'; + dbgs() << "Unused SchedReadWrite " << Name << '\n'; } }); }