CodeGenOptions.h revision 70f92436f5828c11ef108463da4473d44e114c28
1//===--- CompileOptions.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 CompileOptions interface.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_CLANG_COMPILEOPTIONS_H
15#define LLVM_CLANG_COMPILEOPTIONS_H
16
17namespace clang {
18
19/// CompileOptions - Track various options which control how the code
20/// is optimized and passed to the backend.
21struct CompileOptions {
22  unsigned OptimizationLevel : 3; /// The -O[0-4] option specified.
23  unsigned OptimizeSize      : 1; /// If -Os is specified.
24  unsigned UnitAtATime       : 1; /// Unused. For mirroring GCC
25                                  /// optimization selection.
26  unsigned InlineFunctions   : 1; /// Should functions be inlined?
27  unsigned SimplifyLibCalls  : 1; /// Should standard library calls be
28                                  /// treated specially.
29  unsigned UnrollLoops       : 1; /// Control whether loops are unrolled.
30  unsigned VerifyModule      : 1; /// Control whether the module
31                                  /// should be run through the LLVM Verifier.
32
33public:
34  CompileOptions() {
35    OptimizationLevel = 0;
36    OptimizeSize = 0;
37    UnitAtATime = InlineFunctions = SimplifyLibCalls = 1;
38    UnrollLoops = 1;
39    VerifyModule = 1;
40  }
41};
42
43}  // end namespace clang
44
45#endif
46