[llvm] 2532b68 - [TableGen] Do not compile CombineRuleBuilder::verify in release builds

via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 4 04:59:58 PDT 2023


Author: pvanhout
Date: 2023-08-04T13:59:53+02:00
New Revision: 2532b68f684c25d98d6b25be2814bef0fd164332

URL: https://github.com/llvm/llvm-project/commit/2532b68f684c25d98d6b25be2814bef0fd164332
DIFF: https://github.com/llvm/llvm-project/commit/2532b68f684c25d98d6b25be2814bef0fd164332.diff

LOG: [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

Added: 
    

Modified: 
    llvm/utils/TableGen/GlobalISelCombinerMatchTableEmitter.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/utils/TableGen/GlobalISelCombinerMatchTableEmitter.cpp b/llvm/utils/TableGen/GlobalISelCombinerMatchTableEmitter.cpp
index 09b70639c240d6..b4a16a34f88e28 100644
--- a/llvm/utils/TableGen/GlobalISelCombinerMatchTableEmitter.cpp
+++ b/llvm/utils/TableGen/GlobalISelCombinerMatchTableEmitter.cpp
@@ -491,7 +491,9 @@ class CombineRuleBuilder {
   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 @@ void CombineRuleBuilder::print(raw_ostream &OS) const {
   OS << ")\n";
 }
 
+#ifndef NDEBUG
 void CombineRuleBuilder::verify() const {
   const auto VerifyPats = [&](const PatternMap &Pats) {
     for (const auto &[Name, Pat] : Pats) {
@@ -706,6 +709,7 @@ void CombineRuleBuilder::verify() const {
     }
   }
 }
+#endif
 
 bool CombineRuleBuilder::addFeaturePredicates(RuleMatcher &M) {
   if (!RuleDef.getValue("Predicates"))


        


More information about the llvm-commits mailing list