[llvm-branch-commits] [TableGen] Slightly improve error location for a fatal error (PR #170790)
Matt Arsenault via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Sun Dec 7 09:28:07 PST 2025
================
@@ -1316,11 +1316,18 @@ CodeGenRegBank::getOrCreateSubClass(const CodeGenRegisterClass *RC,
return {&RegClasses.back(), true};
}
-CodeGenRegisterClass *CodeGenRegBank::getRegClass(const Record *Def) const {
+CodeGenRegisterClass *CodeGenRegBank::getRegClass(const Record *Def,
+ ArrayRef<SMLoc> Loc) const {
if (CodeGenRegisterClass *RC = Def2RC.lookup(Def))
return RC;
- PrintFatalError(Def->getLoc(), "Not a known RegisterClass!");
+ ArrayRef<SMLoc> DiagLoc = Loc.empty() ? Def->getLoc() : Loc;
+ // TODO: Ideally we should update the API to allow resolving HwMode.
----------------
arsenm wrote:
No, that would not be very ergonomic. The point is to have reusable patterns and not have to spam every possible detail through every deeply nested multi class
https://github.com/llvm/llvm-project/pull/170790
More information about the llvm-branch-commits
mailing list