Home | History | Annotate | Download | only in MC
      1 //===- MCTargetOptions.h - MC Target Options --------------------*- C++ -*-===//
      2 //
      3 //                     The LLVM Compiler Infrastructure
      4 //
      5 // This file is distributed under the University of Illinois Open Source
      6 // License. See LICENSE.TXT for details.
      7 //
      8 //===----------------------------------------------------------------------===//
      9 
     10 #ifndef LLVM_MC_MCTARGETOPTIONS_H
     11 #define LLVM_MC_MCTARGETOPTIONS_H
     12 
     13 #include <string>
     14 #include <vector>
     15 
     16 namespace llvm {
     17 
     18 enum class ExceptionHandling {
     19   None,     /// No exception support
     20   DwarfCFI, /// DWARF-like instruction based exceptions
     21   SjLj,     /// setjmp/longjmp based exceptions
     22   ARM,      /// ARM EHABI
     23   WinEH,    /// Windows Exception Handling
     24 };
     25 
     26 enum class DebugCompressionType {
     27   None, /// No compression
     28   GNU,  /// zlib-gnu style compression
     29   Z,    /// zlib style complession
     30 };
     31 
     32 class StringRef;
     33 
     34 class MCTargetOptions {
     35 public:
     36   enum AsmInstrumentation {
     37     AsmInstrumentationNone,
     38     AsmInstrumentationAddress
     39   };
     40 
     41   /// Enables AddressSanitizer instrumentation at machine level.
     42   bool SanitizeAddress : 1;
     43 
     44   bool MCRelaxAll : 1;
     45   bool MCNoExecStack : 1;
     46   bool MCFatalWarnings : 1;
     47   bool MCNoWarn : 1;
     48   bool MCNoDeprecatedWarn : 1;
     49   bool MCSaveTempLabels : 1;
     50   bool MCUseDwarfDirectory : 1;
     51   bool MCIncrementalLinkerCompatible : 1;
     52   bool MCPIECopyRelocations : 1;
     53   bool ShowMCEncoding : 1;
     54   bool ShowMCInst : 1;
     55   bool AsmVerbose : 1;
     56 
     57   /// Preserve Comments in Assembly.
     58   bool PreserveAsmComments : 1;
     59 
     60   int DwarfVersion = 0;
     61 
     62   std::string ABIName;
     63   std::string SplitDwarfFile;
     64 
     65   /// Additional paths to search for `.include` directives when using the
     66   /// integrated assembler.
     67   std::vector<std::string> IASSearchPaths;
     68 
     69   MCTargetOptions();
     70 
     71   /// getABIName - If this returns a non-empty string this represents the
     72   /// textual name of the ABI that we want the backend to use, e.g. o32, or
     73   /// aapcs-linux.
     74   StringRef getABIName() const;
     75 };
     76 
     77 } // end namespace llvm
     78 
     79 #endif // LLVM_MC_MCTARGETOPTIONS_H
     80