]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - include/clang/CodeGen/CodeGenOptions.h
Update clang to r93512.
[FreeBSD/FreeBSD.git] / include / clang / CodeGen / CodeGenOptions.h
1 //===--- CodeGenOptions.h ---------------------------------------*- 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 //  This file defines the CodeGenOptions interface.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef LLVM_CLANG_CODEGEN_CODEGENOPTIONS_H
15 #define LLVM_CLANG_CODEGEN_CODEGENOPTIONS_H
16
17 #include <string>
18 #include <vector>
19
20 namespace clang {
21
22 /// CodeGenOptions - Track various options which control how the code
23 /// is optimized and passed to the backend.
24 class CodeGenOptions {
25 public:
26   enum InliningMethod {
27     NoInlining,         // Perform no inlining whatsoever.
28     NormalInlining,     // Use the standard function inlining pass.
29     OnlyAlwaysInlining  // Only run the always inlining pass.
30   };
31
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
38                                   /// done.
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
49                                   /// selection.
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.
54
55   /// The code model to use (-mcmodel).
56   std::string CodeModel;
57
58   /// Enable additional debugging information.
59   std::string DebugPass;
60
61   /// The string to embed in the debug information for the compile unit, if
62   /// non-empty.
63   std::string DwarfDebugFlags;
64
65   /// The ABI to use for passing floating point arguments.
66   std::string FloatABI;
67
68   /// The float precision limit to use, if non-empty.
69   std::string LimitFloatPrecision;
70
71   /// The kind of inlining to perform.
72   InliningMethod Inlining;
73
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;
78
79   /// The name of the relocation model to use.
80   std::string RelocationModel;
81
82 public:
83   CodeGenOptions() {
84     AsmVerbose = 0;
85     DebugInfo = 0;
86     DisableFPElim = 0;
87     DisableLLVMOpts = 0;
88     DisableRedZone = 0;
89     MergeAllConstants = 1;
90     NoCommon = 0;
91     NoImplicitFloat = 0;
92     NoZeroInitializedInBSS = 0;
93     OptimizationLevel = 0;
94     OptimizeSize = 0;
95     UnrollLoops = 0;
96     SoftFloat = 0;
97     TimePasses = 0;
98     UnitAtATime = 1;
99     UnwindTables = 0;
100     VerifyModule = 1;
101
102     Inlining = NoInlining;
103     RelocationModel = "pic";
104   }
105 };
106
107 }  // end namespace clang
108
109 #endif