Skip to content

Commit 2532b68

Browse files
committed
[TableGen] Do not compile CombineRuleBuilder::verify in release builds
Avoids a warning about the function being unused. Reviewed By: DavidSpickett Differential Revision: https://reviews.llvm.org/D157085
1 parent bbe945b commit 2532b68

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/utils/TableGen/GlobalISelCombinerMatchTableEmitter.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,9 @@ class CombineRuleBuilder {
491491
void dump() const { print(dbgs()); }
492492

493493
/// Debug-only verification of invariants.
494+
#ifndef NDEBUG
494495
void verify() const;
496+
#endif
495497

496498
private:
497499
void PrintError(Twine Msg) const { ::PrintError(RuleDef.getLoc(), Msg); }
@@ -669,6 +671,7 @@ void CombineRuleBuilder::print(raw_ostream &OS) const {
669671
OS << ")\n";
670672
}
671673

674+
#ifndef NDEBUG
672675
void CombineRuleBuilder::verify() const {
673676
const auto VerifyPats = [&](const PatternMap &Pats) {
674677
for (const auto &[Name, Pat] : Pats) {
@@ -706,6 +709,7 @@ void CombineRuleBuilder::verify() const {
706709
}
707710
}
708711
}
712+
#endif
709713

710714
bool CombineRuleBuilder::addFeaturePredicates(RuleMatcher &M) {
711715
if (!RuleDef.getValue("Predicates"))

0 commit comments

Comments
 (0)