diff options
author | Shaoce SUN <sunshaoce@outlook.com> | 2025-07-19 00:44:16 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-19 00:44:16 +0800 |
commit | 0c75e093813c86a1c99b75d2a46f56db7ab516dd (patch) | |
tree | ae8f428a6432d42319b07116fb0afe74ebc49eab | |
parent | 7d040d4675baf6881cf50c4dba78cc18af85f9ef (diff) | |
download | llvm-0c75e093813c86a1c99b75d2a46f56db7ab516dd.zip llvm-0c75e093813c86a1c99b75d2a46f56db7ab516dd.tar.gz llvm-0c75e093813c86a1c99b75d2a46f56db7ab516dd.tar.bz2 |
[TableGen] Add `getName()` to error messages for better debugging (#149531)
Including the name helps quickly locate the corresponding Instruction
that caused the issue.
-rw-r--r-- | llvm/utils/TableGen/Common/CodeGenSchedule.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
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"); } } |