diff --git a/llvm/include/llvm/CodeGen/TargetLowering.h b/llvm/include/llvm/CodeGen/TargetLowering.h --- a/llvm/include/llvm/CodeGen/TargetLowering.h +++ b/llvm/include/llvm/CodeGen/TargetLowering.h @@ -1904,11 +1904,11 @@ /// Returns the name of the symbol used to emit stack probes or the empty /// string if not applicable. - virtual bool hasStackProbeSymbol(MachineFunction &MF) const { return false; } + virtual bool hasStackProbeSymbol(const MachineFunction &MF) const { return false; } - virtual bool hasInlineStackProbe(MachineFunction &MF) const { return false; } + virtual bool hasInlineStackProbe(const MachineFunction &MF) const { return false; } - virtual StringRef getStackProbeSymbolName(MachineFunction &MF) const { + virtual StringRef getStackProbeSymbolName(const MachineFunction &MF) const { return ""; } diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.h b/llvm/lib/Target/PowerPC/PPCISelLowering.h --- a/llvm/lib/Target/PowerPC/PPCISelLowering.h +++ b/llvm/lib/Target/PowerPC/PPCISelLowering.h @@ -954,9 +954,9 @@ MachineBasicBlock *emitProbedAlloca(MachineInstr &MI, MachineBasicBlock *MBB) const; - bool hasInlineStackProbe(MachineFunction &MF) const override; + bool hasInlineStackProbe(const MachineFunction &MF) const override; - unsigned getStackProbeSize(MachineFunction &MF) const; + unsigned getStackProbeSize(const MachineFunction &MF) const; ConstraintType getConstraintType(StringRef Constraint) const override; diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp --- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp @@ -11998,7 +11998,7 @@ return MBB; } -bool PPCTargetLowering::hasInlineStackProbe(MachineFunction &MF) const { +bool PPCTargetLowering::hasInlineStackProbe(const MachineFunction &MF) const { // If the function specifically requests inline stack probes, emit them. if (MF.getFunction().hasFnAttribute("probe-stack")) return MF.getFunction().getFnAttribute("probe-stack").getValueAsString() == @@ -12006,7 +12006,7 @@ return false; } -unsigned PPCTargetLowering::getStackProbeSize(MachineFunction &MF) const { +unsigned PPCTargetLowering::getStackProbeSize(const MachineFunction &MF) const { const TargetFrameLowering *TFI = Subtarget.getFrameLowering(); unsigned StackAlign = TFI->getStackAlignment(); assert(StackAlign >= 1 && isPowerOf2_32(StackAlign) && diff --git a/llvm/lib/Target/SystemZ/SystemZISelLowering.h b/llvm/lib/Target/SystemZ/SystemZISelLowering.h --- a/llvm/lib/Target/SystemZ/SystemZISelLowering.h +++ b/llvm/lib/Target/SystemZ/SystemZISelLowering.h @@ -447,7 +447,7 @@ // LD, and having the full constant in memory enables reg/mem opcodes. return VT != MVT::f64; } - bool hasInlineStackProbe(MachineFunction &MF) const override; + bool hasInlineStackProbe(const MachineFunction &MF) const override; bool isLegalICmpImmediate(int64_t Imm) const override; bool isLegalAddImmediate(int64_t Imm) const override; bool isLegalAddressingMode(const DataLayout &DL, const AddrMode &AM, Type *Ty, @@ -614,7 +614,7 @@ return true; } - unsigned getStackProbeSize(MachineFunction &MF) const; + unsigned getStackProbeSize(const MachineFunction &MF) const; private: const SystemZSubtarget &Subtarget; diff --git a/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp b/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp --- a/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp +++ b/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp @@ -842,7 +842,7 @@ } /// Returns true if stack probing through inline assembly is requested. -bool SystemZTargetLowering::hasInlineStackProbe(MachineFunction &MF) const { +bool SystemZTargetLowering::hasInlineStackProbe(const MachineFunction &MF) const { // If the function specifically requests inline stack probes, emit them. if (MF.getFunction().hasFnAttribute("probe-stack")) return MF.getFunction().getFnAttribute("probe-stack").getValueAsString() == @@ -7439,7 +7439,7 @@ } unsigned -SystemZTargetLowering::getStackProbeSize(MachineFunction &MF) const { +SystemZTargetLowering::getStackProbeSize(const MachineFunction &MF) const { const TargetFrameLowering *TFI = Subtarget.getFrameLowering(); unsigned StackAlign = TFI->getStackAlignment(); assert(StackAlign >=1 && isPowerOf2_32(StackAlign) && diff --git a/llvm/lib/Target/X86/X86ISelLowering.h b/llvm/lib/Target/X86/X86ISelLowering.h --- a/llvm/lib/Target/X86/X86ISelLowering.h +++ b/llvm/lib/Target/X86/X86ISelLowering.h @@ -1455,11 +1455,11 @@ bool supportKCFIBundles() const override { return true; } - bool hasStackProbeSymbol(MachineFunction &MF) const override; - bool hasInlineStackProbe(MachineFunction &MF) const override; - StringRef getStackProbeSymbolName(MachineFunction &MF) const override; + bool hasStackProbeSymbol(const MachineFunction &MF) const override; + bool hasInlineStackProbe(const MachineFunction &MF) const override; + StringRef getStackProbeSymbolName(const MachineFunction &MF) const override; - unsigned getStackProbeSize(MachineFunction &MF) const; + unsigned getStackProbeSize(const MachineFunction &MF) const; bool hasVectorBlend() const override { return true; } diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -56594,12 +56594,12 @@ } /// Returns true if stack probing through a function call is requested. -bool X86TargetLowering::hasStackProbeSymbol(MachineFunction &MF) const { +bool X86TargetLowering::hasStackProbeSymbol(const MachineFunction &MF) const { return !getStackProbeSymbolName(MF).empty(); } /// Returns true if stack probing through inline assembly is requested. -bool X86TargetLowering::hasInlineStackProbe(MachineFunction &MF) const { +bool X86TargetLowering::hasInlineStackProbe(const MachineFunction &MF) const { // No inline stack probe for Windows, they have their own mechanism. if (Subtarget.isOSWindows() || @@ -56617,7 +56617,7 @@ /// Returns the name of the symbol used to emit stack probes or the empty /// string if not applicable. StringRef -X86TargetLowering::getStackProbeSymbolName(MachineFunction &MF) const { +X86TargetLowering::getStackProbeSymbolName(const MachineFunction &MF) const { // Inline Stack probes disable stack probe call if (hasInlineStackProbe(MF)) return ""; @@ -56640,7 +56640,7 @@ } unsigned -X86TargetLowering::getStackProbeSize(MachineFunction &MF) const { +X86TargetLowering::getStackProbeSize(const MachineFunction &MF) const { // The default stack probe size is 4096 if the function has no stackprobesize // attribute. unsigned StackProbeSize = 4096;