[llvm] r270178 - Target: move the EH enumeration and add option

Saleem Abdulrasool via llvm-commits llvm-commits at lists.llvm.org
Thu May 19 20:39:28 PDT 2016


Author: compnerd
Date: Thu May 19 22:39:28 2016
New Revision: 270178

URL: http://llvm.org/viewvc/llvm-project?rev=270178&view=rev
Log:
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).

Modified:
    llvm/trunk/include/llvm/MC/MCAsmInfo.h
    llvm/trunk/include/llvm/Target/TargetOptions.h

Modified: llvm/trunk/include/llvm/MC/MCAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCAsmInfo.h?rev=270178&r1=270177&r2=270178&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCAsmInfo.h (original)
+++ llvm/trunk/include/llvm/MC/MCAsmInfo.h Thu May 19 22:39:28 2016
@@ -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 };
 }

Modified: llvm/trunk/include/llvm/Target/TargetOptions.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetOptions.h?rev=270178&r1=270177&r2=270178&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetOptions.h (original)
+++ llvm/trunk/include/llvm/Target/TargetOptions.h Thu May 19 22:39:28 2016
@@ -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 TargetOptio
     ARE_EQUAL(ThreadModel) &&
     ARE_EQUAL(EABIVersion) &&
     ARE_EQUAL(DebuggerTuning) &&
+    ARE_EQUAL(ExceptionModel) &&
     ARE_EQUAL(MCOptions);
 #undef ARE_EQUAL
 }




More information about the llvm-commits mailing list