aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/MachineFunction.h45
-rw-r--r--include/llvm/CodeGen/SelectionDAGNodes.h4
-rw-r--r--include/llvm/Intrinsics.td6
-rw-r--r--include/llvm/Target/TargetAsmInfo.h10
-rw-r--r--include/llvm/Target/TargetOptions.h12
5 files changed, 69 insertions, 8 deletions
diff --git a/include/llvm/CodeGen/MachineFunction.h b/include/llvm/CodeGen/MachineFunction.h
index 57c946c789..f30cb821c1 100644
--- a/include/llvm/CodeGen/MachineFunction.h
+++ b/include/llvm/CodeGen/MachineFunction.h
@@ -18,6 +18,7 @@
#ifndef LLVM_CODEGEN_MACHINEFUNCTION_H
#define LLVM_CODEGEN_MACHINEFUNCTION_H
+#include <map>
#include "llvm/ADT/ilist.h"
#include "llvm/Support/DebugLoc.h"
#include "llvm/CodeGen/Dump.h"
@@ -114,6 +115,15 @@ class MachineFunction {
// The alignment of the function.
unsigned Alignment;
+ // The currently active call_site value
+ unsigned CallSiteIndex;
+
+ // The largest call_site value encountered
+ unsigned MaxCallSiteIndex;
+
+ // Call sites mapped to corresponding landing pads
+ std::map<MachineBasicBlock*, unsigned> LandingPadCallSiteIndexMap;
+
public:
MachineFunction(Function *Fn, const TargetMachine &TM);
~MachineFunction();
@@ -159,6 +169,41 @@ public:
///
void setAlignment(unsigned A) { Alignment = A; }
+ /// getCallSiteIndex() - Get the current call site index
+ ///
+ unsigned getCallSiteIndex() { return CallSiteIndex; }
+
+ /// setCallSiteIndex() - Set the current call site index
+ ///
+ void setCallSiteIndex(unsigned Idx) {
+ CallSiteIndex = Idx;
+ if (CallSiteIndex > MaxCallSiteIndex)
+ MaxCallSiteIndex = CallSiteIndex;
+ }
+
+ /// getMaxCallSiteIndex() - Get the largest call site index issued
+ ///
+ unsigned getMaxCallSiteIndex() { return MaxCallSiteIndex; }
+
+ /// setCallSiteIndexLandingPad() - Map the call site to a landing pad
+ ///
+ void setLandingPadCallSiteIndex(MachineBasicBlock *LandingPad,
+ unsigned CallSite) {
+ LandingPadCallSiteIndexMap[LandingPad] = CallSite;
+ }
+
+ /// getCallSiteIndexLandingPad() - Get landing pad for the call site index
+ ///
+ unsigned getLandingPadCallSiteIndex(MachineBasicBlock *LandingPad) {
+ return LandingPadCallSiteIndexMap[LandingPad];
+ }
+
+ /// getCallSiteCount() - Get the count of call site entries
+ ///
+ unsigned getCallSiteCount() {
+ return LandingPadCallSiteIndexMap.size();
+ }
+
/// MachineFunctionInfo - Keep track of various per-function pieces of
/// information for backends that would like to do so.
///
diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h
index bbb1f3bd90..7229463d4e 100644
--- a/include/llvm/CodeGen/SelectionDAGNodes.h
+++ b/include/llvm/CodeGen/SelectionDAGNodes.h
@@ -121,6 +121,10 @@ namespace ISD {
// address of the exception block on entry to an landing pad block.
EXCEPTIONADDR,
+ // RESULT, OUTCHAIN = LSDAADDR(INCHAIN) - This node represents the
+ // address of the Language Specific Data Area for the enclosing function.
+ LSDAADDR,
+
// RESULT, OUTCHAIN = EHSELECTION(INCHAIN, EXCEPTION) - This node represents
// the selection index of the exception thrown.
EHSELECTION,
diff --git a/include/llvm/Intrinsics.td b/include/llvm/Intrinsics.td
index fa21dc0682..25f6604afa 100644
--- a/include/llvm/Intrinsics.td
+++ b/include/llvm/Intrinsics.td
@@ -305,8 +305,10 @@ def int_eh_unwind_init: Intrinsic<[llvm_void_ty]>,
def int_eh_dwarf_cfa : Intrinsic<[llvm_ptr_ty], [llvm_i32_ty]>;
let Properties = [IntrNoMem] in {
-def int_eh_sjlj_setjmp : Intrinsic<[llvm_i32_ty], [llvm_ptr_ty]>;
-def int_eh_sjlj_longjmp : Intrinsic<[llvm_void_ty], [llvm_ptr_ty, llvm_i32_ty]>;
+ def int_eh_sjlj_setjmp : Intrinsic<[llvm_i32_ty], [llvm_ptr_ty]>;
+ def int_eh_sjlj_longjmp : Intrinsic<[llvm_void_ty], [llvm_ptr_ty]>;
+ def int_eh_sjlj_lsda : Intrinsic<[llvm_ptr_ty]>;
+ def int_eh_sjlj_callsite: Intrinsic<[llvm_void_ty], [llvm_i32_ty]>;
}
//===---------------- Generic Variable Attribute Intrinsics----------------===//
diff --git a/include/llvm/Target/TargetAsmInfo.h b/include/llvm/Target/TargetAsmInfo.h
index aa39c90c5a..2dd644c089 100644
--- a/include/llvm/Target/TargetAsmInfo.h
+++ b/include/llvm/Target/TargetAsmInfo.h
@@ -25,6 +25,8 @@ namespace llvm {
/// TargetAsmInfo - This class is intended to be used as a base class for asm
/// properties and features specific to the target.
+ namespace ExceptionHandling { enum ExceptionsType { None, Dwarf, SjLj }; }
+
class TargetAsmInfo {
protected:
//===------------------------------------------------------------------===//
@@ -269,7 +271,8 @@ namespace llvm {
/// SupportsExceptionHandling - True if target supports
/// exception handling.
///
- bool SupportsExceptionHandling; // Defaults to false.
+ // Defaults to None
+ ExceptionHandling::ExceptionsType ExceptionsType;
/// RequiresFrameSection - true if the Dwarf2 output needs a frame section
///
@@ -482,7 +485,10 @@ namespace llvm {
return SupportsDebugInformation;
}
bool doesSupportExceptionHandling() const {
- return SupportsExceptionHandling;
+ return ExceptionsType != ExceptionHandling::None;
+ }
+ ExceptionHandling::ExceptionsType getExceptionHandlingType() const {
+ return ExceptionsType;
}
bool doesDwarfRequireFrameSection() const {
return DwarfRequiresFrameSection;
diff --git a/include/llvm/Target/TargetOptions.h b/include/llvm/Target/TargetOptions.h
index ccce2f0de8..b27d49630a 100644
--- a/include/llvm/Target/TargetOptions.h
+++ b/include/llvm/Target/TargetOptions.h
@@ -94,10 +94,14 @@ namespace llvm {
/// .bss section. This flag disables such behaviour (necessary, e.g. for
/// crt*.o compiling).
extern bool NoZerosInBSS;
-
- /// ExceptionHandling - This flag indicates that exception information should
- /// be emitted.
- extern bool ExceptionHandling;
+
+ /// DwarfExceptionHandling - This flag indicates that Dwarf exception
+ /// information should be emitted.
+ extern bool DwarfExceptionHandling;
+
+ /// SjLjExceptionHandling - This flag indicates that SJLJ exception
+ /// information should be emitted.
+ extern bool SjLjExceptionHandling;
/// UnwindTablesMandatory - This flag indicates that unwind tables should
/// be emitted for all functions.