Fix assertion in GCStrategy.
authorDenis Antrushin <dantrushin@gmail.com>
Wed, 25 Jan 2023 17:17:06 +0000 (20:17 +0300)
committerDenis Antrushin <dantrushin@gmail.com>
Wed, 25 Jan 2023 17:46:51 +0000 (20:46 +0300)
It meant to check that `UseRS4GC` requires `UseStatepoints`.
Instead it always required `UseStatepoints` when `useRS4GC()`
was called.

llvm/include/llvm/IR/GCStrategy.h

index 9f3904f4c850c895468702f4b7dba30cf649e9a8..3186465f0018124ac168072ad0f6293c88827149 100644 (file)
@@ -105,7 +105,7 @@ public:
   /// 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;
   }