LLVM  14.0.0git
CodeGen.h
Go to the documentation of this file.
1 //===-- llvm/Support/CodeGen.h - CodeGen Concepts ---------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file define some types which define code generation concepts. For
10 // example, relocation model.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_SUPPORT_CODEGEN_H
15 #define LLVM_SUPPORT_CODEGEN_H
16 
17 namespace llvm {
18 
19  // Relocation model types.
20  namespace Reloc {
21  // Cannot be named PIC due to collision with -DPIC
23  }
24 
25  // Code model types.
26  namespace CodeModel {
27  // Sync changes with CodeGenCWrappers.h.
29  }
30 
31  namespace PICLevel {
32  // This is used to map -fpic/-fPIC.
33  enum Level { NotPIC=0, SmallPIC=1, BigPIC=2 };
34  }
35 
36  namespace PIELevel {
37  enum Level { Default=0, Small=1, Large=2 };
38  }
39 
40  // TLS models.
41  namespace TLSModel {
42  enum Model {
47  };
48  }
49 
50  // Code generation optimization level.
51  namespace CodeGenOpt {
52  enum Level {
53  None = 0, // -O0
54  Less = 1, // -O1
55  Default = 2, // -O2, -Os
56  Aggressive = 3 // -O3
57  };
58  }
59 
60  /// These enums are meant to be passed into addPassesToEmitFile to indicate
61  /// what type of file to emit, and returned by it to indicate what type of
62  /// file could actually be made.
66  CGFT_Null // Do not emit any output.
67  };
68 
69  // Specify what functions should keep the frame pointer.
70  enum class FramePointerKind { None, NonLeaf, All };
71 
72 } // end llvm namespace
73 
74 #endif
llvm::PIELevel::Small
@ Small
Definition: CodeGen.h:37
llvm
---------------------— PointerInfo ------------------------------------—
Definition: AllocatorList.h:23
llvm::PICLevel::SmallPIC
@ SmallPIC
Definition: CodeGen.h:33
llvm::CGFT_ObjectFile
@ CGFT_ObjectFile
Definition: CodeGen.h:65
llvm::TLSModel::GeneralDynamic
@ GeneralDynamic
Definition: CodeGen.h:43
llvm::CodeModel::Medium
@ Medium
Definition: CodeGen.h:28
llvm::CGFT_Null
@ CGFT_Null
Definition: CodeGen.h:66
llvm::Reloc::ROPI_RWPI
@ ROPI_RWPI
Definition: CodeGen.h:22
llvm::CodeModel::Kernel
@ Kernel
Definition: CodeGen.h:28
llvm::Reloc::Model
Model
Definition: CodeGen.h:22
llvm::CodeModel::Small
@ Small
Definition: CodeGen.h:28
llvm::CodeModel::Model
Model
Definition: CodeGen.h:28
llvm::CodeGenOpt::Default
@ Default
Definition: CodeGen.h:55
llvm::TLSModel::LocalDynamic
@ LocalDynamic
Definition: CodeGen.h:44
llvm::PICLevel::NotPIC
@ NotPIC
Definition: CodeGen.h:33
llvm::FramePointerKind::All
@ All
llvm::FramePointerKind
FramePointerKind
Definition: CodeGen.h:70
llvm::Reloc::ROPI
@ ROPI
Definition: CodeGen.h:22
llvm::CodeGenOpt::Aggressive
@ Aggressive
Definition: CodeGen.h:56
llvm::Reloc::DynamicNoPIC
@ DynamicNoPIC
Definition: CodeGen.h:22
llvm::CodeGenOpt::None
@ None
Definition: CodeGen.h:53
llvm::Reloc::RWPI
@ RWPI
Definition: CodeGen.h:22
llvm::Reloc::PIC_
@ PIC_
Definition: CodeGen.h:22
llvm::PIELevel::Default
@ Default
Definition: CodeGen.h:37
llvm::CodeGenFileType
CodeGenFileType
These enums are meant to be passed into addPassesToEmitFile to indicate what type of file to emit,...
Definition: CodeGen.h:63
llvm::Reloc::Static
@ Static
Definition: CodeGen.h:22
llvm::PICLevel::Level
Level
Definition: CodeGen.h:33
llvm::CodeGenOpt::Level
Level
Definition: CodeGen.h:52
llvm::CodeModel::Tiny
@ Tiny
Definition: CodeGen.h:28
llvm::FramePointerKind::NonLeaf
@ NonLeaf
llvm::PIELevel::Large
@ Large
Definition: CodeGen.h:37
llvm::TLSModel::Model
Model
Definition: CodeGen.h:42
llvm::TLSModel::InitialExec
@ InitialExec
Definition: CodeGen.h:45
llvm::CodeModel::Large
@ Large
Definition: CodeGen.h:28
llvm::PIELevel::Level
Level
Definition: CodeGen.h:37
llvm::FramePointerKind::None
@ None
llvm::CGFT_AssemblyFile
@ CGFT_AssemblyFile
Definition: CodeGen.h:64
llvm::CodeGenOpt::Less
@ Less
Definition: CodeGen.h:54
llvm::PICLevel::BigPIC
@ BigPIC
Definition: CodeGen.h:33
llvm::TLSModel::LocalExec
@ LocalExec
Definition: CodeGen.h:46