From 0c75e093813c86a1c99b75d2a46f56db7ab516dd Mon Sep 17 00:00:00 2001 From: Shaoce SUN Date: Sat, 19 Jul 2025 00:44:16 +0800 Subject: [TableGen] Add `getName()` to error messages for better debugging (#149531) Including the name helps quickly locate the corresponding Instruction that caused the issue. --- llvm/utils/TableGen/Common/CodeGenSchedule.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'llvm') diff --git a/llvm/utils/TableGen/Common/CodeGenSchedule.cpp b/llvm/utils/TableGen/Common/CodeGenSchedule.cpp index 50346c2..b07ea9e9 100644 --- a/llvm/utils/TableGen/Common/CodeGenSchedule.cpp +++ b/llvm/utils/TableGen/Common/CodeGenSchedule.cpp @@ -2114,7 +2114,8 @@ void CodeGenSchedModels::addWriteRes(const Record *ProcWriteResDef, const Record *WRDef = ProcWriteResDef->getValueAsDef("WriteType"); if (!WRMap.try_emplace(WRDef, ProcWriteResDef).second) PrintFatalError(ProcWriteResDef->getLoc(), - "WriteType already used in another WriteRes"); + "WriteType of " + WRDef->getName() + + " already used in another WriteRes"); } // Visit ProcResourceKinds referenced by the newly discovered WriteRes. @@ -2148,7 +2149,8 @@ void CodeGenSchedModels::addReadAdvance(const Record *ProcReadAdvanceDef, const Record *RADef = ProcReadAdvanceDef->getValueAsDef("ReadType"); if (!RAMap.try_emplace(RADef, ProcReadAdvanceDef).second) PrintFatalError(ProcReadAdvanceDef->getLoc(), - "ReadType already used in another ReadAdvance"); + "ReadType of " + RADef->getName() + + " already used in another ReadAdvance"); } } -- cgit v1.1