[llvm] 7564a9a - Fix assertion in GCStrategy.

Denis Antrushin via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 25 09:48:20 PST 2023


Author: Denis Antrushin
Date: 2023-01-25T20:46:51+03:00
New Revision: 7564a9ad30d3c03d0b4d0693908c00d1b85c98d4

URL: https://github.com/llvm/llvm-project/commit/7564a9ad30d3c03d0b4d0693908c00d1b85c98d4
DIFF: https://github.com/llvm/llvm-project/commit/7564a9ad30d3c03d0b4d0693908c00d1b85c98d4.diff

LOG: Fix assertion in GCStrategy.

It meant to check that `UseRS4GC` requires `UseStatepoints`.
Instead it always required `UseStatepoints` when `useRS4GC()`
was called.

Added: 
    

Modified: 
    llvm/include/llvm/IR/GCStrategy.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/IR/GCStrategy.h b/llvm/include/llvm/IR/GCStrategy.h
index 9f3904f4c850c..3186465f00181 100644
--- a/llvm/include/llvm/IR/GCStrategy.h
+++ b/llvm/include/llvm/IR/GCStrategy.h
@@ -105,7 +105,7 @@ class GCStrategy {
   /// Returns true if the RewriteStatepointsForGC pass should run on functions
   /// using this GC.
   bool useRS4GC() const {
-    assert(useStatepoints() &&
+    assert((!UseRS4GC || useStatepoints()) &&
            "GC strategy has useRS4GC but not useStatepoints set");
     return UseRS4GC;
   }


        


More information about the llvm-commits mailing list