Provide an interface for Targets to specify their stack pointer register
authorChris Lattner <sabre@nondot.org>
Fri, 13 Jan 2006 17:47:52 +0000 (17:47 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 13 Jan 2006 17:47:52 +0000 (17:47 +0000)
for llvm.stacksave/restore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25275 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/TargetLowering.h

index 84018a61703e0537d6ba3f7b723f1dff56c44ac1..f596ea93ab8f3109fdf7c8eb04d46abd31a954e2 100644 (file)
@@ -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.