[IPO] Fix EXPENSIVE_CHECKS assert added at D83744. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 11 Mar 2021 10:29:02 +0000 (10:29 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 11 Mar 2021 10:29:15 +0000 (10:29 +0000)
It wasn't taking into account that QueryingAA was a pointer.

llvm/include/llvm/Transforms/IPO/Attributor.h

index 86f08ac..cbf33bc 100644 (file)
@@ -1127,11 +1127,11 @@ struct Attributor {
                    DepClassTy DepClass, bool ForceUpdate = false) {
 #ifdef EXPENSIVE_CHECKS
     // Don't allow callbase information to leak.
-    if (auto CBContext = IRP.getCallBaseContext()) {
+    if (auto *CBContext = IRP.getCallBaseContext()) {
       assert(
           ((CBContext->getCalledFunction() == IRP.getAnchorScope() ||
-            QueryingAA ||
-            !QueryingAA.getIRPosition().isAnyCallSitePosition())) &&
+            !QueryingAA ||
+            !QueryingAA->getIRPosition().isAnyCallSitePosition())) &&
           "non callsite positions are not allowed to propagate CallBaseContext "
           "across functions");
     }