summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2016-05-20 03:39:28 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2016-05-20 03:39:28 +0000
commit0266e3802a987b7df26df8c96b649deb28099667 (patch)
tree6424321331489ca1c7de7e5e84c6af7cf77059a8 /include
parent1c820cfeb985c686a355dd48d612b2b80ae57d07 (diff)
Target: move the EH enumeration and add option
Move the ExceptionHandling enumeration into TargetOptions and introduce a field to track the desired exception model. This will allow us to set the exception model from the frontend (needed to optionally use SjLj EH on other targets where zero-cost is available and preferred). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270178 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/MC/MCAsmInfo.h9
-rw-r--r--include/llvm/Target/TargetOptions.h25
2 files changed, 20 insertions, 14 deletions
diff --git a/include/llvm/MC/MCAsmInfo.h b/include/llvm/MC/MCAsmInfo.h
index 737637942ff..2c987da0e57 100644
--- a/include/llvm/MC/MCAsmInfo.h
+++ b/include/llvm/MC/MCAsmInfo.h
@@ -16,6 +16,7 @@
#ifndef LLVM_MC_MCASMINFO_H
#define LLVM_MC_MCASMINFO_H
+#include "llvm/Target/TargetOptions.h"
#include "llvm/MC/MCDirectives.h"
#include "llvm/MC/MCDwarf.h"
#include <cassert>
@@ -41,14 +42,6 @@ enum class EncodingType {
};
}
-enum class ExceptionHandling {
- None, /// No exception support
- DwarfCFI, /// DWARF-like instruction based exceptions
- SjLj, /// setjmp/longjmp based exceptions
- ARM, /// ARM EHABI
- WinEH, /// Windows Exception Handling
-};
-
namespace LCOMM {
enum LCOMMType { NoAlignment, ByteAlignment, Log2Alignment };
}
diff --git a/include/llvm/Target/TargetOptions.h b/include/llvm/Target/TargetOptions.h
index 950132d134e..b1cfb2a5e00 100644
--- a/include/llvm/Target/TargetOptions.h
+++ b/include/llvm/Target/TargetOptions.h
@@ -88,6 +88,14 @@ namespace llvm {
SCE // Tune debug info for SCE targets (e.g. PS4).
};
+ enum class ExceptionHandling {
+ None, /// No exception support
+ DwarfCFI, /// DWARF-like instruction based exceptions
+ SjLj, /// setjmp/longjmp based exceptions
+ ARM, /// ARM EHABI
+ WinEH, /// Windows Exception Handling
+ };
+
class TargetOptions {
public:
TargetOptions()
@@ -95,14 +103,15 @@ namespace llvm {
UnsafeFPMath(false), NoInfsFPMath(false), NoNaNsFPMath(false),
HonorSignDependentRoundingFPMathOption(false), NoZerosInBSS(false),
GuaranteedTailCallOpt(false), StackAlignmentOverride(0),
- StackSymbolOrdering(true), EnableFastISel(false),
- UseInitArray(false), DisableIntegratedAS(false),
- CompressDebugSections(false), FunctionSections(false),
- DataSections(false), UniqueSectionNames(true), TrapUnreachable(false),
- EmulatedTLS(false), FloatABIType(FloatABI::Default),
+ StackSymbolOrdering(true), EnableFastISel(false), UseInitArray(false),
+ DisableIntegratedAS(false), CompressDebugSections(false),
+ FunctionSections(false), DataSections(false),
+ UniqueSectionNames(true), TrapUnreachable(false), EmulatedTLS(false),
+ FloatABIType(FloatABI::Default),
AllowFPOpFusion(FPOpFusion::Standard), Reciprocals(TargetRecip()),
JTType(JumpTable::Single), ThreadModel(ThreadModel::POSIX),
- EABIVersion(EABI::Default), DebuggerTuning(DebuggerKind::Default) {}
+ EABIVersion(EABI::Default), DebuggerTuning(DebuggerKind::Default),
+ ExceptionModel(ExceptionHandling::None) {}
/// PrintMachineCode - This flag is enabled when the -print-machineinstrs
/// option is specified on the command line, and should enable debugging
@@ -246,6 +255,9 @@ namespace llvm {
/// Which debugger to tune for.
DebuggerKind DebuggerTuning;
+ /// What exception model to use
+ ExceptionHandling ExceptionModel;
+
/// Machine level options.
MCTargetOptions MCOptions;
};
@@ -275,6 +287,7 @@ inline bool operator==(const TargetOptions &LHS,
ARE_EQUAL(ThreadModel) &&
ARE_EQUAL(EABIVersion) &&
ARE_EQUAL(DebuggerTuning) &&
+ ARE_EQUAL(ExceptionModel) &&
ARE_EQUAL(MCOptions);
#undef ARE_EQUAL
}