aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
diff options
context:
space:
mode:
authorJay Foad <jay.foad@amd.com>2023-03-29 10:36:03 +0100
committerJay Foad <jay.foad@amd.com>2023-03-31 09:03:22 +0100
commita80b830e48ac2a9b3d6f545c6cc9b64ac58f7c92 (patch)
tree68c443d1550ce64efa32ee968a61e41fff5b8a71 /llvm/utils/TableGen/CodeGenDAGPatterns.cpp
parentc98372725b5a3e56bb1c003ef9981d644b79bce7 (diff)
downloadllvm-a80b830e48ac2a9b3d6f545c6cc9b64ac58f7c92.zip
llvm-a80b830e48ac2a9b3d6f545c6cc9b64ac58f7c92.tar.gz
llvm-a80b830e48ac2a9b3d6f545c6cc9b64ac58f7c92.tar.bz2
[TableGen] Enable "Type set is empty for each HW mode" error in non-debug builds
Differential Revision: https://reviews.llvm.org/D147127
Diffstat (limited to 'llvm/utils/TableGen/CodeGenDAGPatterns.cpp')
-rw-r--r--llvm/utils/TableGen/CodeGenDAGPatterns.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
index 8b9cfee..a110497 100644
--- a/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
+++ b/llvm/utils/TableGen/CodeGenDAGPatterns.cpp
@@ -355,15 +355,12 @@ bool TypeSetByHwMode::intersect(SetType &Out, const SetType &In) {
}
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,22 +885,22 @@ const TypeSetByHwMode &TypeInfer::getLegalTypes() {
return LegalCache;
}
-#ifndef NDEBUG
TypeInfer::ValidateOnExit::~ValidateOnExit() {
if (Infer.Validate && !VTS.validate()) {
- dbgs() << "Type set is empty for each HW mode:\n"
+#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
+ errs() << "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 "
"expanded records).\n";
Infer.TP.dump();
- dbgs() << "Generated from record:\n";
+ errs() << "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
//===----------------------------------------------------------------------===//