LLVM API Documentation
00001 //===-- llvm/Target/TargetOptions.h - Target Options ------------*- C++ -*-===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 // 00010 // This file defines command line option flags that are shared across various 00011 // targets. 00012 // 00013 //===----------------------------------------------------------------------===// 00014 00015 #ifndef LLVM_TARGET_TARGETOPTIONS_H 00016 #define LLVM_TARGET_TARGETOPTIONS_H 00017 00018 namespace llvm { 00019 // Possible float ABI settings. Used with FloatABIType in TargetOptions.h. 00020 namespace FloatABI { 00021 enum ABIType { 00022 Default, // Target-specific (either soft of hard depending on triple, etc). 00023 Soft, // Soft float. 00024 Hard // Hard float. 00025 }; 00026 } 00027 00028 /// PrintMachineCode - This flag is enabled when the -print-machineinstrs 00029 /// option is specified on the command line, and should enable debugging 00030 /// output from the code generator. 00031 extern bool PrintMachineCode; 00032 00033 /// NoFramePointerElim - This flag is enabled when the -disable-fp-elim is 00034 /// specified on the command line. If the target supports the frame pointer 00035 /// elimination optimization, this option should disable it. 00036 extern bool NoFramePointerElim; 00037 00038 /// LessPreciseFPMAD - This flag is enabled when the 00039 /// -enable-fp-mad is specified on the command line. When this flag is off 00040 /// (the default), the code generator is not allowed to generate mad 00041 /// (multiply add) if the result is "less precise" than doing those operations 00042 /// individually. 00043 extern bool LessPreciseFPMADOption; 00044 extern bool LessPreciseFPMAD(); 00045 00046 /// NoExcessFPPrecision - This flag is enabled when the 00047 /// -disable-excess-fp-precision flag is specified on the command line. When 00048 /// this flag is off (the default), the code generator is allowed to produce 00049 /// results that are "more precise" than IEEE allows. This includes use of 00050 /// FMA-like operations and use of the X86 FP registers without rounding all 00051 /// over the place. 00052 extern bool NoExcessFPPrecision; 00053 00054 /// UnsafeFPMath - This flag is enabled when the 00055 /// -enable-unsafe-fp-math flag is specified on the command line. When 00056 /// this flag is off (the default), the code generator is not allowed to 00057 /// produce results that are "less precise" than IEEE allows. This includes 00058 /// use of X86 instructions like FSIN and FCOS instead of libcalls. 00059 /// UnsafeFPMath implies FiniteOnlyFPMath and LessPreciseFPMAD. 00060 extern bool UnsafeFPMath; 00061 00062 /// FiniteOnlyFPMath - This returns true when the -enable-finite-only-fp-math 00063 /// option is specified on the command line. If this returns false (default), 00064 /// the code generator is not allowed to assume that FP arithmetic arguments 00065 /// and results are never NaNs or +-Infs. 00066 extern bool FiniteOnlyFPMathOption; 00067 extern bool FiniteOnlyFPMath(); 00068 00069 /// HonorSignDependentRoundingFPMath - This returns true when the 00070 /// -enable-sign-dependent-rounding-fp-math is specified. If this returns 00071 /// false (the default), the code generator is allowed to assume that the 00072 /// rounding behavior is the default (round-to-zero for all floating point to 00073 /// integer conversions, and round-to-nearest for all other arithmetic 00074 /// truncations). If this is enabled (set to true), the code generator must 00075 /// assume that the rounding mode may dynamically change. 00076 extern bool HonorSignDependentRoundingFPMathOption; 00077 extern bool HonorSignDependentRoundingFPMath(); 00078 00079 /// UseSoftFloat - This flag is enabled when the -soft-float flag is specified 00080 /// on the command line. When this flag is on, the code generator will 00081 /// generate libcalls to the software floating point library instead of 00082 /// target FP instructions. 00083 extern bool UseSoftFloat; 00084 00085 /// FloatABIType - This setting is set by -float-abi=xxx option is specfied 00086 /// on the command line. This setting may either be Default, Soft, or Hard. 00087 /// Default selects the target's default behavior. Soft selects the ABI for 00088 /// UseSoftFloat, but does not inidcate that FP hardware may not be used. 00089 /// Such a combination is unfortunately popular (e.g. arm-apple-darwin). 00090 /// Hard presumes that the normal FP ABI is used. 00091 extern FloatABI::ABIType FloatABIType; 00092 00093 /// NoZerosInBSS - By default some codegens place zero-initialized data to 00094 /// .bss section. This flag disables such behaviour (necessary, e.g. for 00095 /// crt*.o compiling). 00096 extern bool NoZerosInBSS; 00097 00098 /// DwarfExceptionHandling - This flag indicates that Dwarf exception 00099 /// information should be emitted. 00100 extern bool DwarfExceptionHandling; 00101 00102 /// SjLjExceptionHandling - This flag indicates that SJLJ exception 00103 /// information should be emitted. 00104 extern bool SjLjExceptionHandling; 00105 00106 /// UnwindTablesMandatory - This flag indicates that unwind tables should 00107 /// be emitted for all functions. 00108 extern bool UnwindTablesMandatory; 00109 00110 /// PerformTailCallOpt - This flag is enabled when -tailcallopt is specified 00111 /// on the commandline. When the flag is on, the target will perform tail call 00112 /// optimization (pop the caller's stack) providing it supports it. 00113 extern bool PerformTailCallOpt; 00114 00115 /// StackAlignment - Override default stack alignment for target. 00116 extern unsigned StackAlignment; 00117 00118 /// RealignStack - This flag indicates, whether stack should be automatically 00119 /// realigned, if needed. 00120 extern bool RealignStack; 00121 00122 /// DisableJumpTables - This flag indicates jump tables should not be 00123 /// generated. 00124 extern bool DisableJumpTables; 00125 00126 /// EnableFastISel - This flag enables fast-path instruction selection 00127 /// which trades away generated code quality in favor of reducing 00128 /// compile time. 00129 extern bool EnableFastISel; 00130 00131 /// StrongPHIElim - This flag enables more aggressive PHI elimination 00132 /// wth earlier copy coalescing. 00133 extern bool StrongPHIElim; 00134 00135 } // End llvm namespace 00136 00137 #endif