1 //===--- CodeGenOptions.h ---------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines the CodeGenOptions interface.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_CLANG_CODEGEN_CODEGENOPTIONS_H
15 #define LLVM_CLANG_CODEGEN_CODEGENOPTIONS_H
22 /// CodeGenOptions - Track various options which control how the code
23 /// is optimized and passed to the backend.
24 class CodeGenOptions {
27 NoInlining, // Perform no inlining whatsoever.
28 NormalInlining, // Use the standard function inlining pass.
29 OnlyAlwaysInlining // Only run the always inlining pass.
32 unsigned AsmVerbose : 1; /// -dA, -fverbose-asm.
33 unsigned DebugInfo : 1; /// Should generate deubg info (-g).
34 unsigned DisableFPElim : 1; /// Set when -fomit-frame-pointer is enabled.
35 unsigned DisableLLVMOpts : 1; /// Don't run any optimizations, for use in
36 /// getting .bc files that correspond to the
37 /// internal state before optimizations are
39 unsigned DisableRedZone : 1; /// Set when -mno-red-zone is enabled.
40 unsigned MergeAllConstants : 1; /// Merge identical constants.
41 unsigned NoCommon : 1; /// Set when -fno-common or C++ is enabled.
42 unsigned NoImplicitFloat : 1; /// Set when -mno-implicit-float is enabled.
43 unsigned NoZeroInitializedInBSS : 1; /// -fno-zero-initialized-in-bss
44 unsigned OptimizationLevel : 3; /// The -O[0-4] option specified.
45 unsigned OptimizeSize : 1; /// If -Os is specified.
46 unsigned SoftFloat : 1; /// -soft-float.
47 unsigned TimePasses : 1; /// Set when -ftime-report is enabled.
48 unsigned UnitAtATime : 1; /// Unused. For mirroring GCC optimization
50 unsigned UnrollLoops : 1; /// Control whether loops are unrolled.
51 unsigned UnwindTables : 1; /// Emit unwind tables.
52 unsigned VerifyModule : 1; /// Control whether the module should be run
53 /// through the LLVM Verifier.
55 /// The code model to use (-mcmodel).
56 std::string CodeModel;
58 /// Enable additional debugging information.
59 std::string DebugPass;
61 /// The string to embed in the debug information for the compile unit, if
63 std::string DwarfDebugFlags;
65 /// The ABI to use for passing floating point arguments.
68 /// The float precision limit to use, if non-empty.
69 std::string LimitFloatPrecision;
71 /// The kind of inlining to perform.
72 InliningMethod Inlining;
74 /// The user provided name for the "main file", if non-empty. This is useful
75 /// in situations where the input file name does not match the original input
76 /// file, for example with -save-temps.
77 std::string MainFileName;
79 /// The name of the relocation model to use.
80 std::string RelocationModel;
89 MergeAllConstants = 1;
92 NoZeroInitializedInBSS = 0;
93 OptimizationLevel = 0;
102 Inlining = NoInlining;
103 RelocationModel = "pic";
107 } // end namespace clang