Skip to content

Commit 0c75e09

Browse files
authored
[TableGen] Add getName() to error messages for better debugging (#149531)
Including the name helps quickly locate the corresponding Instruction that caused the issue.
1 parent 7d040d4 commit 0c75e09

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

llvm/utils/TableGen/Common/CodeGenSchedule.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2114,7 +2114,8 @@ void CodeGenSchedModels::addWriteRes(const Record *ProcWriteResDef,
21142114
const Record *WRDef = ProcWriteResDef->getValueAsDef("WriteType");
21152115
if (!WRMap.try_emplace(WRDef, ProcWriteResDef).second)
21162116
PrintFatalError(ProcWriteResDef->getLoc(),
2117-
"WriteType already used in another WriteRes");
2117+
"WriteType of " + WRDef->getName() +
2118+
" already used in another WriteRes");
21182119
}
21192120

21202121
// Visit ProcResourceKinds referenced by the newly discovered WriteRes.
@@ -2148,7 +2149,8 @@ void CodeGenSchedModels::addReadAdvance(const Record *ProcReadAdvanceDef,
21482149
const Record *RADef = ProcReadAdvanceDef->getValueAsDef("ReadType");
21492150
if (!RAMap.try_emplace(RADef, ProcReadAdvanceDef).second)
21502151
PrintFatalError(ProcReadAdvanceDef->getLoc(),
2151-
"ReadType already used in another ReadAdvance");
2152+
"ReadType of " + RADef->getName() +
2153+
" already used in another ReadAdvance");
21522154
}
21532155
}
21542156

0 commit comments

Comments
 (0)