From: Chris Lattner Date: Fri, 13 Jan 2006 17:47:52 +0000 (+0000) Subject: Provide an interface for Targets to specify their stack pointer register X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d90ef9ef2b24047f46973a43390a3191fc1fee63;p=oota-llvm.git Provide an interface for Targets to specify their stack pointer register for llvm.stacksave/restore. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25275 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h index 84018a61703..f596ea93ab8 100644 --- a/include/llvm/Target/TargetLowering.h +++ b/include/llvm/Target/TargetLowering.h @@ -234,6 +234,13 @@ public: bool usesUnderscoreSetJmpLongJmp() const { return UseUnderscoreSetJmpLongJmp; } + + /// getStackPointerRegisterToSaveRestore - If a physical register, this + /// specifies the register that llvm.savestack/llvm.restorestack should save + /// and restore. + unsigned getStackPointerRegisterToSaveRestore() const { + return StackPointerRegisterToSaveRestore; + } //===--------------------------------------------------------------------===// // TargetLowering Configuration Methods - These methods should be invoked by @@ -267,6 +274,13 @@ protected: UseUnderscoreSetJmpLongJmp = Val; } + /// setStackPointerRegisterToSaveRestore - If set to a physical register, this + /// specifies the register that llvm.savestack/llvm.restorestack should save + /// and restore. + void setStackPointerRegisterToSaveRestore(unsigned R) { + StackPointerRegisterToSaveRestore = R; + } + /// setSetCCIxExpensive - This is a short term hack for targets that codegen /// setcc as a conditional branch. This encourages the code generator to fold /// setcc operations into other operations if possible. @@ -443,6 +457,11 @@ private: /// UseUnderscoreSetJmpLongJmp - This target prefers to use _setjmp and /// _longjmp to implement llvm.setjmp/llvm.longjmp. Defaults to false. bool UseUnderscoreSetJmpLongJmp; + + /// StackPointerRegisterToSaveRestore - If set to a physical register, this + /// specifies the register that llvm.savestack/llvm.restorestack should save + /// and restore. + unsigned StackPointerRegisterToSaveRestore; /// RegClassForVT - This indicates the default register class to use for /// each ValueType the target supports natively.