1635ffcdf58f9bdc35c4ad4969fb35dc3659cf384Chris Lattner//===-- llvm/Target/TargetOptions.h - Target Options ------------*- C++ -*-===//
234695381d626485a560594f162701088079589dfMisha Brukman//
3635ffcdf58f9bdc35c4ad4969fb35dc3659cf384Chris Lattner//                     The LLVM Compiler Infrastructure
4635ffcdf58f9bdc35c4ad4969fb35dc3659cf384Chris Lattner//
57ed47a13356daed2a34cd2209a31f92552e3bdd8Chris Lattner// This file is distributed under the University of Illinois Open Source
67ed47a13356daed2a34cd2209a31f92552e3bdd8Chris Lattner// License. See LICENSE.TXT for details.
734695381d626485a560594f162701088079589dfMisha Brukman//
8635ffcdf58f9bdc35c4ad4969fb35dc3659cf384Chris Lattner//===----------------------------------------------------------------------===//
9635ffcdf58f9bdc35c4ad4969fb35dc3659cf384Chris Lattner//
10635ffcdf58f9bdc35c4ad4969fb35dc3659cf384Chris Lattner// This file defines command line option flags that are shared across various
11635ffcdf58f9bdc35c4ad4969fb35dc3659cf384Chris Lattner// targets.
12635ffcdf58f9bdc35c4ad4969fb35dc3659cf384Chris Lattner//
13635ffcdf58f9bdc35c4ad4969fb35dc3659cf384Chris Lattner//===----------------------------------------------------------------------===//
14635ffcdf58f9bdc35c4ad4969fb35dc3659cf384Chris Lattner
15635ffcdf58f9bdc35c4ad4969fb35dc3659cf384Chris Lattner#ifndef LLVM_TARGET_TARGETOPTIONS_H
16635ffcdf58f9bdc35c4ad4969fb35dc3659cf384Chris Lattner#define LLVM_TARGET_TARGETOPTIONS_H
17635ffcdf58f9bdc35c4ad4969fb35dc3659cf384Chris Lattner
188a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky#include <string>
198a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky
20635ffcdf58f9bdc35c4ad4969fb35dc3659cf384Chris Lattnernamespace llvm {
21e566763b1915c7a4821ce95937b763724d271fecEvan Cheng  class MachineFunction;
2284a61269370138b68ae2bcd6711a9ae8004fd77aEli Friedman  class StringRef;
23e566763b1915c7a4821ce95937b763724d271fecEvan Cheng
2405e5fcab0910b7e0ebdd03cb4c1960ae8ba219fdChris Lattner  // Possible float ABI settings. Used with FloatABIType in TargetOptions.h.
2505e5fcab0910b7e0ebdd03cb4c1960ae8ba219fdChris Lattner  namespace FloatABI {
2605e5fcab0910b7e0ebdd03cb4c1960ae8ba219fdChris Lattner    enum ABIType {
27a04d6c948cd6f273f6146fdb95a76e3bc587b9d4Chad Rosier      Default, // Target-specific (either soft or hard depending on triple,etc).
2805e5fcab0910b7e0ebdd03cb4c1960ae8ba219fdChris Lattner      Soft, // Soft float.
2905e5fcab0910b7e0ebdd03cb4c1960ae8ba219fdChris Lattner      Hard  // Hard float.
3005e5fcab0910b7e0ebdd03cb4c1960ae8ba219fdChris Lattner    };
3105e5fcab0910b7e0ebdd03cb4c1960ae8ba219fdChris Lattner  }
328a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky
33e0231413225cf47aaf3238bf21afd0d59025028dLang Hames  namespace FPOpFusion {
34e0231413225cf47aaf3238bf21afd0d59025028dLang Hames    enum FPOpFusionMode {
35e0231413225cf47aaf3238bf21afd0d59025028dLang Hames      Fast,     // Enable fusion of FP ops wherever it's profitable.
36e0231413225cf47aaf3238bf21afd0d59025028dLang Hames      Standard, // Only allow fusion of 'blessed' ops (currently just fmuladd).
37e0231413225cf47aaf3238bf21afd0d59025028dLang Hames      Strict    // Never fuse FP-ops.
38e0231413225cf47aaf3238bf21afd0d59025028dLang Hames    };
39e0231413225cf47aaf3238bf21afd0d59025028dLang Hames  }
40e0231413225cf47aaf3238bf21afd0d59025028dLang Hames
418a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky  class TargetOptions {
428a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky  public:
438a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    TargetOptions()
448a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky        : PrintMachineCode(false), NoFramePointerElim(false),
45f245ae5a4a78d5a02b3b9e2dae819077a56d81e7Bill Wendling          LessPreciseFPMADOption(false),
46e0231413225cf47aaf3238bf21afd0d59025028dLang Hames          UnsafeFPMath(false), NoInfsFPMath(false),
478a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky          NoNaNsFPMath(false), HonorSignDependentRoundingFPMathOption(false),
48e4496548155ba6606f107fbdc10ea17e58fd3401Rafael Espindola          UseSoftFloat(false), NoZerosInBSS(false),
498a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky          JITEmitDebugInfo(false), JITEmitDebugInfoToDisk(false),
5022de16dc7582dac43429ce0dcb374604020c01f5Nick Lewycky          GuaranteedTailCallOpt(false), DisableTailCalls(false),
5161fc8d670f1e991804c2ab753e567981e60962cbBill Wendling          StackAlignmentOverride(0),
52b09350d9a5639f55c46659b30be12a0c938378abChad Rosier          EnableFastISel(false), PositionIndependentExecutable(false),
53b09350d9a5639f55c46659b30be12a0c938378abChad Rosier          EnableSegmentedStacks(false), UseInitArray(false), TrapFuncName(""),
54b09350d9a5639f55c46659b30be12a0c938378abChad Rosier          FloatABIType(FloatABI::Default), AllowFPOpFusion(FPOpFusion::Standard)
558a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    {}
568a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky
578a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// PrintMachineCode - This flag is enabled when the -print-machineinstrs
588a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// option is specified on the command line, and should enable debugging
598a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// output from the code generator.
608a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    unsigned PrintMachineCode : 1;
618a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky
628a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// NoFramePointerElim - This flag is enabled when the -disable-fp-elim is
638a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// specified on the command line.  If the target supports the frame pointer
648a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// elimination optimization, this option should disable it.
658a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    unsigned NoFramePointerElim : 1;
668a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky
678a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// DisableFramePointerElim - This returns true if frame pointer elimination
688a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// optimization should be disabled for the given machine function.
698a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    bool DisableFramePointerElim(const MachineFunction &MF) const;
708a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky
718a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// LessPreciseFPMAD - This flag is enabled when the
728a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// -enable-fp-mad is specified on the command line.  When this flag is off
738a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// (the default), the code generator is not allowed to generate mad
748a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// (multiply add) if the result is "less precise" than doing those
758a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// operations individually.
768a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    unsigned LessPreciseFPMADOption : 1;
778a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    bool LessPreciseFPMAD() const;
788a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky
798a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// UnsafeFPMath - This flag is enabled when the
808a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// -enable-unsafe-fp-math flag is specified on the command line.  When
818a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// this flag is off (the default), the code generator is not allowed to
828a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// produce results that are "less precise" than IEEE allows.  This includes
838a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// use of X86 instructions like FSIN and FCOS instead of libcalls.
848a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// UnsafeFPMath implies LessPreciseFPMAD.
858a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    unsigned UnsafeFPMath : 1;
868a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky
878a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// NoInfsFPMath - This flag is enabled when the
888a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// -enable-no-infs-fp-math flag is specified on the command line. When
898a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// this flag is off (the default), the code generator is not allowed to
908a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// assume the FP arithmetic arguments and results are never +-Infs.
918a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    unsigned NoInfsFPMath : 1;
928a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky
938a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// NoNaNsFPMath - This flag is enabled when the
948a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// -enable-no-nans-fp-math flag is specified on the command line. When
958a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// this flag is off (the default), the code generator is not allowed to
968a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// assume the FP arithmetic arguments and results are never NaNs.
978a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    unsigned NoNaNsFPMath : 1;
988a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky
998a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// HonorSignDependentRoundingFPMath - This returns true when the
1008a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// -enable-sign-dependent-rounding-fp-math is specified.  If this returns
1018a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// false (the default), the code generator is allowed to assume that the
1028a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// rounding behavior is the default (round-to-zero for all floating point
1038a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// to integer conversions, and round-to-nearest for all other arithmetic
1048a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// truncations).  If this is enabled (set to true), the code generator must
1058a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// assume that the rounding mode may dynamically change.
1068a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    unsigned HonorSignDependentRoundingFPMathOption : 1;
1078a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    bool HonorSignDependentRoundingFPMath() const;
108b3fe88f8379c4c4193d5d84267ae1a304437f8faAndrew Trick
1098a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// UseSoftFloat - This flag is enabled when the -soft-float flag is
1108a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// specified on the command line.  When this flag is on, the code generator
1118a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// will generate libcalls to the software floating point library instead of
1128a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// target FP instructions.
1138a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    unsigned UseSoftFloat : 1;
1148a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky
1158a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// NoZerosInBSS - By default some codegens place zero-initialized data to
1168a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// .bss section. This flag disables such behaviour (necessary, e.g. for
1178a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// crt*.o compiling).
1188a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    unsigned NoZerosInBSS : 1;
1198a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky
1208a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// JITEmitDebugInfo - This flag indicates that the JIT should try to emit
1218a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// debug information and notify a debugger about it.
1228a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    unsigned JITEmitDebugInfo : 1;
1238a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky
1248a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// JITEmitDebugInfoToDisk - This flag indicates that the JIT should write
1258a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// the object files generated by the JITEmitDebugInfo flag to disk.  This
1268a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// flag is hidden and is only for debugging the debug info.
1278a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    unsigned JITEmitDebugInfoToDisk : 1;
1288a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky
1298a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// GuaranteedTailCallOpt - This flag is enabled when -tailcallopt is
1308a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// specified on the commandline. When the flag is on, participating targets
1318a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// will perform tail call optimization on all calls which use the fastcc
1328a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// calling convention and which satisfy certain target-independent
1338a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// criteria (being at the end of a function, having the same return type
1348a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// as their parent function, etc.), using an alternate ABI if necessary.
1358a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    unsigned GuaranteedTailCallOpt : 1;
1368a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky
13722de16dc7582dac43429ce0dcb374604020c01f5Nick Lewycky    /// DisableTailCalls - This flag controls whether we will use tail calls.
13822de16dc7582dac43429ce0dcb374604020c01f5Nick Lewycky    /// Disabling them may be useful to maintain a correct call stack.
13922de16dc7582dac43429ce0dcb374604020c01f5Nick Lewycky    unsigned DisableTailCalls : 1;
14022de16dc7582dac43429ce0dcb374604020c01f5Nick Lewycky
1418a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// StackAlignmentOverride - Override default stack alignment for target.
1428a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    unsigned StackAlignmentOverride;
1438a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky
1448a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// EnableFastISel - This flag enables fast-path instruction selection
1458a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// which trades away generated code quality in favor of reducing
1468a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// compile time.
1478a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    unsigned EnableFastISel : 1;
148b3fe88f8379c4c4193d5d84267ae1a304437f8faAndrew Trick
149253933ee9ef2c413ecd782efeacc5d7b9bcda09aChandler Carruth    /// PositionIndependentExecutable - This flag indicates whether the code
150253933ee9ef2c413ecd782efeacc5d7b9bcda09aChandler Carruth    /// will eventually be linked into a single executable, despite the PIC
151253933ee9ef2c413ecd782efeacc5d7b9bcda09aChandler Carruth    /// relocation model being in use. It's value is undefined (and irrelevant)
152253933ee9ef2c413ecd782efeacc5d7b9bcda09aChandler Carruth    /// if the relocation model is anything other than PIC.
153253933ee9ef2c413ecd782efeacc5d7b9bcda09aChandler Carruth    unsigned PositionIndependentExecutable : 1;
154253933ee9ef2c413ecd782efeacc5d7b9bcda09aChandler Carruth
1558a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    unsigned EnableSegmentedStacks : 1;
1568a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky
157d6b43a317e71246380db55a50b799b062b53cdceRafael Espindola    /// UseInitArray - Use .init_array instead of .ctors for static
158d6b43a317e71246380db55a50b799b062b53cdceRafael Espindola    /// constructors.
159d6b43a317e71246380db55a50b799b062b53cdceRafael Espindola    unsigned UseInitArray : 1;
160d6b43a317e71246380db55a50b799b062b53cdceRafael Espindola
1618a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// getTrapFunctionName - If this returns a non-empty string, this means
1628a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// isel should lower Intrinsic::trap to a call to the specified function
1638a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// name instead of an ISD::TRAP node.
1648a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    std::string TrapFuncName;
1658a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    StringRef getTrapFunctionName() const;
1668a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky
1678a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// FloatABIType - This setting is set by -float-abi=xxx option is specfied
1688a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// on the command line. This setting may either be Default, Soft, or Hard.
1698a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// Default selects the target's default behavior. Soft selects the ABI for
1708a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// UseSoftFloat, but does not indicate that FP hardware may not be used.
1718a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// Such a combination is unfortunately popular (e.g. arm-apple-darwin).
1728a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    /// Hard presumes that the normal FP ABI is used.
1738a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky    FloatABI::ABIType FloatABIType;
174e0231413225cf47aaf3238bf21afd0d59025028dLang Hames
175e0231413225cf47aaf3238bf21afd0d59025028dLang Hames    /// AllowFPOpFusion - This flag is set by the -fuse-fp-ops=xxx option.
176e0231413225cf47aaf3238bf21afd0d59025028dLang Hames    /// This controls the creation of fused FP ops that store intermediate
177e0231413225cf47aaf3238bf21afd0d59025028dLang Hames    /// results in higher precision than IEEE allows (E.g. FMAs).
178e0231413225cf47aaf3238bf21afd0d59025028dLang Hames    ///
179e0231413225cf47aaf3238bf21afd0d59025028dLang Hames    /// Fast mode - allows formation of fused FP ops whenever they're
180e0231413225cf47aaf3238bf21afd0d59025028dLang Hames    /// profitable.
181e0231413225cf47aaf3238bf21afd0d59025028dLang Hames    /// Standard mode - allow fusion only for 'blessed' FP ops. At present the
182e0231413225cf47aaf3238bf21afd0d59025028dLang Hames    /// only blessed op is the fmuladd intrinsic. In the future more blessed ops
183e0231413225cf47aaf3238bf21afd0d59025028dLang Hames    /// may be added.
184e0231413225cf47aaf3238bf21afd0d59025028dLang Hames    /// Strict mode - allow fusion only if/when it can be proven that the excess
185e0231413225cf47aaf3238bf21afd0d59025028dLang Hames    /// precision won't effect the result.
186e0231413225cf47aaf3238bf21afd0d59025028dLang Hames    ///
187a04d6c948cd6f273f6146fdb95a76e3bc587b9d4Chad Rosier    /// Note: This option only controls formation of fused ops by the
188a04d6c948cd6f273f6146fdb95a76e3bc587b9d4Chad Rosier    /// optimizers.  Fused operations that are explicitly specified (e.g. FMA
189a04d6c948cd6f273f6146fdb95a76e3bc587b9d4Chad Rosier    /// via the llvm.fma.* intrinsic) will always be honored, regardless of
19033634833aa651cab5ea92b87822c038fb6e71778Chad Rosier    /// the value of this option.
191e0231413225cf47aaf3238bf21afd0d59025028dLang Hames    FPOpFusion::FPOpFusionMode AllowFPOpFusion;
1928a8d479214745c82ef00f08d4e4f1c173b5f9ce2Nick Lewycky  };
19359aa54073848645cd20c828dfb1088127c541b36Bill Wendling
19459aa54073848645cd20c828dfb1088127c541b36Bill Wendling// Comparison operators:
19559aa54073848645cd20c828dfb1088127c541b36Bill Wendling
19659aa54073848645cd20c828dfb1088127c541b36Bill Wendling
197face8d901ebc2f3ac26e303603aae1b9304c4728Bill Wendlinginline bool operator==(const TargetOptions &LHS,
198face8d901ebc2f3ac26e303603aae1b9304c4728Bill Wendling                       const TargetOptions &RHS) {
1993b6e067f56db88509d9254ecc70951d77d51a2d7Bill Wendling#define ARE_EQUAL(X) LHS.X == RHS.X
2003b6e067f56db88509d9254ecc70951d77d51a2d7Bill Wendling  return
2013b6e067f56db88509d9254ecc70951d77d51a2d7Bill Wendling    ARE_EQUAL(UnsafeFPMath) &&
2023b6e067f56db88509d9254ecc70951d77d51a2d7Bill Wendling    ARE_EQUAL(NoInfsFPMath) &&
2033b6e067f56db88509d9254ecc70951d77d51a2d7Bill Wendling    ARE_EQUAL(NoNaNsFPMath) &&
2043b6e067f56db88509d9254ecc70951d77d51a2d7Bill Wendling    ARE_EQUAL(HonorSignDependentRoundingFPMathOption) &&
2053b6e067f56db88509d9254ecc70951d77d51a2d7Bill Wendling    ARE_EQUAL(UseSoftFloat) &&
2063b6e067f56db88509d9254ecc70951d77d51a2d7Bill Wendling    ARE_EQUAL(NoZerosInBSS) &&
2073b6e067f56db88509d9254ecc70951d77d51a2d7Bill Wendling    ARE_EQUAL(JITEmitDebugInfo) &&
2083b6e067f56db88509d9254ecc70951d77d51a2d7Bill Wendling    ARE_EQUAL(JITEmitDebugInfoToDisk) &&
2093b6e067f56db88509d9254ecc70951d77d51a2d7Bill Wendling    ARE_EQUAL(GuaranteedTailCallOpt) &&
2103b6e067f56db88509d9254ecc70951d77d51a2d7Bill Wendling    ARE_EQUAL(DisableTailCalls) &&
2113b6e067f56db88509d9254ecc70951d77d51a2d7Bill Wendling    ARE_EQUAL(StackAlignmentOverride) &&
2123b6e067f56db88509d9254ecc70951d77d51a2d7Bill Wendling    ARE_EQUAL(EnableFastISel) &&
2133b6e067f56db88509d9254ecc70951d77d51a2d7Bill Wendling    ARE_EQUAL(PositionIndependentExecutable) &&
2143b6e067f56db88509d9254ecc70951d77d51a2d7Bill Wendling    ARE_EQUAL(EnableSegmentedStacks) &&
2153b6e067f56db88509d9254ecc70951d77d51a2d7Bill Wendling    ARE_EQUAL(UseInitArray) &&
2163b6e067f56db88509d9254ecc70951d77d51a2d7Bill Wendling    ARE_EQUAL(TrapFuncName) &&
2173b6e067f56db88509d9254ecc70951d77d51a2d7Bill Wendling    ARE_EQUAL(FloatABIType) &&
2183b6e067f56db88509d9254ecc70951d77d51a2d7Bill Wendling    ARE_EQUAL(AllowFPOpFusion);
2193b6e067f56db88509d9254ecc70951d77d51a2d7Bill Wendling#undef ARE_EQUAL
2203b6e067f56db88509d9254ecc70951d77d51a2d7Bill Wendling}
2213b6e067f56db88509d9254ecc70951d77d51a2d7Bill Wendling
222face8d901ebc2f3ac26e303603aae1b9304c4728Bill Wendlinginline bool operator!=(const TargetOptions &LHS,
223face8d901ebc2f3ac26e303603aae1b9304c4728Bill Wendling                       const TargetOptions &RHS) {
22459aa54073848645cd20c828dfb1088127c541b36Bill Wendling  return !(LHS == RHS);
22559aa54073848645cd20c828dfb1088127c541b36Bill Wendling}
22659aa54073848645cd20c828dfb1088127c541b36Bill Wendling
227635ffcdf58f9bdc35c4ad4969fb35dc3659cf384Chris Lattner} // End llvm namespace
228635ffcdf58f9bdc35c4ad4969fb35dc3659cf384Chris Lattner
229635ffcdf58f9bdc35c4ad4969fb35dc3659cf384Chris Lattner#endif
230