diff --git a/llvm/include/llvm/Transforms/IPO/Attributor.h b/llvm/include/llvm/Transforms/IPO/Attributor.h --- a/llvm/include/llvm/Transforms/IPO/Attributor.h +++ b/llvm/include/llvm/Transforms/IPO/Attributor.h @@ -3537,7 +3537,7 @@ AAHeapToStack(const IRPosition &IRP, Attributor &A) : Base(IRP) {} /// Returns true if HeapToStack conversion is assumed to be possible. - virtual bool isAssumedHeapToStack(CallBase &CB) const = 0; + virtual bool isAssumedHeapToStack(const CallBase &CB) const = 0; /// Create an abstract attribute view for the position \p IRP. static AAHeapToStack &createForPosition(const IRPosition &IRP, Attributor &A); diff --git a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp --- a/llvm/lib/Transforms/IPO/AttributorAttributes.cpp +++ b/llvm/lib/Transforms/IPO/AttributorAttributes.cpp @@ -5707,7 +5707,7 @@ ++BUILD_STAT_NAME(MallocCalls, Function); } - bool isAssumedHeapToStack(CallBase &CB) const override { + bool isAssumedHeapToStack(const CallBase &CB) const override { if (isValidState()) if (AllocationInfo *AI = AllocationInfos.lookup(&CB)) return AI->Status != AllocationInfo::INVALID;