aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDuraid Madina <duraid@octopus.com.au>2006-09-04 06:21:35 +0000
committerDuraid Madina <duraid@octopus.com.au>2006-09-04 06:21:35 +0000
commit2a0013f59fb3b23010c0509fab8bf509eb30fb36 (patch)
tree5eeee3804055cf753a41fd33334eae94b65d6e9b /include
parent362b3680c1d8f92609ee37c4a6943c7a45f287cb (diff)
downloadexternal_llvm-2a0013f59fb3b23010c0509fab8bf509eb30fb36.zip
external_llvm-2a0013f59fb3b23010c0509fab8bf509eb30fb36.tar.gz
external_llvm-2a0013f59fb3b23010c0509fab8bf509eb30fb36.tar.bz2
add setJumpBufSize() and setJumpBufAlignment() to target-lowering.
Call these from your backend to enjoy setjmp/longjmp goodness, see lib/Target/IA64/IA64ISelLowering.cpp for an example git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30095 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Target/TargetLowering.h31
-rw-r--r--include/llvm/Transforms/Scalar.h3
2 files changed, 32 insertions, 2 deletions
diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h
index 3da8baa..6cecbbc 100644
--- a/include/llvm/Target/TargetLowering.h
+++ b/include/llvm/Target/TargetLowering.h
@@ -327,6 +327,18 @@ public:
return StackPointerRegisterToSaveRestore;
}
+ /// getJumpBufSize - returns the target's jmp_buf size in bytes (if never
+ /// set, the default is 200)
+ unsigned getJumpBufSize() const {
+ return JumpBufSize;
+ }
+
+ /// getJumpBufAlignment - returns the target's jmp_buf alignment in bytes
+ /// (if never set, the default is 0)
+ unsigned getJumpBufAlignment() const {
+ return JumpBufAlignment;
+ }
+
//===--------------------------------------------------------------------===//
// TargetLowering Optimization Methods
//
@@ -537,6 +549,18 @@ protected:
TargetDAGCombineArray[NT >> 3] |= 1 << (NT&7);
}
+ /// setJumpBufSize - Set the target's required jmp_buf buffer size (in
+ /// bytes); default is 200
+ void setJumpBufSize(unsigned Size) {
+ JumpBufSize = Size;
+ }
+
+ /// setJumpBufAlignment - Set the target's required jmp_buf buffer
+ /// alignment (in bytes); default is 0
+ void setJumpBufAlignment(unsigned Align) {
+ JumpBufAlignment = Align;
+ }
+
public:
//===--------------------------------------------------------------------===//
@@ -718,6 +742,13 @@ private:
/// _longjmp to implement llvm.setjmp/llvm.longjmp. Defaults to false.
bool UseUnderscoreSetJmpLongJmp;
+ /// JumpBufSize - The size, in bytes, of the target's jmp_buf buffers
+ unsigned JumpBufSize;
+
+ /// JumpBufAlignment - The alignment, in bytes, of the target's jmp_buf
+ /// buffers
+ unsigned JumpBufAlignment;
+
/// StackPointerRegisterToSaveRestore - If set to a physical register, this
/// specifies the register that llvm.savestack/llvm.restorestack should save
/// and restore.
diff --git a/include/llvm/Transforms/Scalar.h b/include/llvm/Transforms/Scalar.h
index 077972f..85242f8 100644
--- a/include/llvm/Transforms/Scalar.h
+++ b/include/llvm/Transforms/Scalar.h
@@ -286,8 +286,7 @@ FunctionPass *createLowerPackedPass();
// "my LLVM-to-LLVM pass doesn't support the invoke instruction yet" lowering
// pass.
//
-FunctionPass *createLowerInvokePass(unsigned JumBufSize = 200,
- unsigned JumpBufAlign = 0);
+FunctionPass *createLowerInvokePass(const TargetLowering *TLI = NULL);
extern const PassInfo *LowerInvokePassID;