[PATCH] D147127: [TableGen] Enable "Type set is empty for each HW mode" error in non-debug builds
Jay Foad via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 29 02:42:14 PDT 2023
foad created this revision.
foad added reviewers: Joe_Nash, craig.topper, arichardson, jrtc27, hfinkel, kparzysz, uweigand, arsenm, Pierre-vh.
Herald added a subscriber: StephenFan.
Herald added a project: All.
foad requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D147127
Files:
llvm/utils/TableGen/CodeGenDAGPatterns.cpp
llvm/utils/TableGen/CodeGenDAGPatterns.h
Index: llvm/utils/TableGen/CodeGenDAGPatterns.h
===================================================================
--- llvm/utils/TableGen/CodeGenDAGPatterns.h
+++ llvm/utils/TableGen/CodeGenDAGPatterns.h
@@ -338,11 +338,7 @@
struct ValidateOnExit {
ValidateOnExit(TypeSetByHwMode &T, TypeInfer &TI) : Infer(TI), VTS(T) {}
- #ifndef NDEBUG
~ValidateOnExit();
- #else
- ~ValidateOnExit() {} // Empty destructor with NDEBUG.
- #endif
TypeInfer &Infer;
TypeSetByHwMode &VTS;
};
Index: llvm/utils/TableGen/CodeGenDAGPatterns.cpp
===================================================================
--- llvm/utils/TableGen/CodeGenDAGPatterns.cpp
+++ llvm/utils/TableGen/CodeGenDAGPatterns.cpp
@@ -355,15 +355,12 @@
}
bool TypeSetByHwMode::validate() const {
-#ifndef NDEBUG
if (empty())
return true;
bool AllEmpty = true;
for (const auto &I : *this)
AllEmpty &= I.second.empty();
return !AllEmpty;
-#endif
- return true;
}
// --- TypeInfer
@@ -888,9 +885,9 @@
return LegalCache;
}
-#ifndef NDEBUG
TypeInfer::ValidateOnExit::~ValidateOnExit() {
if (Infer.Validate && !VTS.validate()) {
+#ifndef NDEBUG
dbgs() << "Type set is empty for each HW mode:\n"
"possible type contradiction in the pattern below "
"(use -print-records with llvm-tblgen to see all "
@@ -898,12 +895,12 @@
Infer.TP.dump();
dbgs() << "Generated from record:\n";
Infer.TP.getRecord()->dump();
+#endif
PrintFatalError(Infer.TP.getRecord()->getLoc(),
"Type set is empty for each HW mode in '" +
Infer.TP.getRecord()->getName() + "'");
}
}
-#endif
//===----------------------------------------------------------------------===//
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D147127.509269.patch
Type: text/x-patch
Size: 1775 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230329/340f6bf4/attachment.bin>
More information about the llvm-commits
mailing list