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

Saleem Abdulrasool via llvm-commits llvm-commits at lists.llvm.org
Fri May 20 20:07:49 PDT 2016


On Fri, May 20, 2016 at 12:02 AM, David Majnemer <david.majnemer at gmail.com>
wrote:

> Why do we even need ExceptionHandling? Can't this be inferred from the
> personality routine (+ maybe the triple)?


Well, I just need to know if SjLj is in use.  If your argument is on the
extra bits, I can shrink it to 1 bit.  The triple won't tell us the
exception model when zero cost is available and preferable.  Pulling it
from the personality feels less than ideal, and not always possible (like
in TLI which cares since the Unwind interfaces are different).


>
> On Thursday, May 19, 2016, Saleem Abdulrasool via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
>
>> 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
>>  }
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>
>


-- 
Saleem Abdulrasool
compnerd (at) compnerd (dot) org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160520/01b037f0/attachment.html>


More information about the llvm-commits mailing list