[PATCH] D157085: [TableGen] Do not compile CombineRuleBuilder::verify in release builds

Pierre van Houtryve via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 4 04:51:01 PDT 2023


Pierre-vh created this revision.
Pierre-vh added a reviewer: DavidSpickett.
Herald added a project: All.
Pierre-vh requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Avoids a warning about the function being unused.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D157085

Files:
  llvm/utils/TableGen/GlobalISelCombinerMatchTableEmitter.cpp


Index: llvm/utils/TableGen/GlobalISelCombinerMatchTableEmitter.cpp
===================================================================
--- llvm/utils/TableGen/GlobalISelCombinerMatchTableEmitter.cpp
+++ llvm/utils/TableGen/GlobalISelCombinerMatchTableEmitter.cpp
@@ -491,7 +491,9 @@
   void dump() const { print(dbgs()); }
 
   /// Debug-only verification of invariants.
+#ifndef NDEBUG
   void verify() const;
+#endif
 
 private:
   void PrintError(Twine Msg) const { ::PrintError(RuleDef.getLoc(), Msg); }
@@ -669,6 +671,7 @@
   OS << ")\n";
 }
 
+#ifndef NDEBUG
 void CombineRuleBuilder::verify() const {
   const auto VerifyPats = [&](const PatternMap &Pats) {
     for (const auto &[Name, Pat] : Pats) {
@@ -706,6 +709,7 @@
     }
   }
 }
+#endif
 
 bool CombineRuleBuilder::addFeaturePredicates(RuleMatcher &M) {
   if (!RuleDef.getValue("Predicates"))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157085.547167.patch
Type: text/x-patch
Size: 859 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230804/697ce5a5/attachment.bin>


More information about the llvm-commits mailing list