[TableGen] Add getName() to error messages for better debugging#149531
Merged
[TableGen] Add getName() to error messages for better debugging#149531
getName() to error messages for better debugging#149531Conversation
Including the name helps quickly locate the corresponding Instruction that caused the issue.
Member
|
@llvm/pr-subscribers-tablegen Author: Shaoce SUN (sunshaoce) ChangesIncluding the name helps quickly locate the corresponding Instruction that caused the issue. Full diff: https://github.com/llvm/llvm-project/pull/149531.diff 1 Files Affected:
diff --git a/llvm/utils/TableGen/Common/CodeGenSchedule.cpp b/llvm/utils/TableGen/Common/CodeGenSchedule.cpp
index 50346c29e8862..b07ea9e9d5caf 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");
}
}
|
jurahul
approved these changes
Jul 18, 2025
This was referenced Jul 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Including the name helps quickly locate the corresponding Instruction that caused the issue.