From 494d07516e6aaa3014656f01584ba4acee4bf542 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Sat, 24 Mar 2018 21:22:32 +0000 Subject: [PATCH] [SchedModel] Record::getName() returns StringRef - avoid std::string creation. NFCI. llvm-svn: 328437 --- llvm/utils/TableGen/CodeGenSchedule.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/utils/TableGen/CodeGenSchedule.cpp b/llvm/utils/TableGen/CodeGenSchedule.cpp index b73e0767e3b0..ff5353d3ec3b 100644 --- a/llvm/utils/TableGen/CodeGenSchedule.cpp +++ b/llvm/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'; } }); }