blob: 3175b29a4dd9a6e61c783730a01f9fea15c8085f [file] [log] [blame]
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01001//===-- llvm/Support/CodeGen.h - CodeGen Concepts ---------------*- C++ -*-===//
2//
Andrew Walbran16937d02019-10-22 13:54:20 +01003// 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
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01006//
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
17namespace llvm {
18
19 // Relocation model types.
20 namespace Reloc {
21 enum Model { Static, PIC_, DynamicNoPIC, ROPI, RWPI, ROPI_RWPI };
22 }
23
24 // Code model types.
25 namespace CodeModel {
26 // Sync changes with CodeGenCWrappers.h.
Andrew Scull0372a572018-11-16 15:47:06 +000027 enum Model { Tiny, Small, Kernel, Medium, Large };
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010028 }
29
30 namespace PICLevel {
31 // This is used to map -fpic/-fPIC.
32 enum Level { NotPIC=0, SmallPIC=1, BigPIC=2 };
33 }
34
35 namespace PIELevel {
36 enum Level { Default=0, Small=1, Large=2 };
37 }
38
39 // TLS models.
40 namespace TLSModel {
41 enum Model {
42 GeneralDynamic,
43 LocalDynamic,
44 InitialExec,
45 LocalExec
46 };
47 }
48
49 // Code generation optimization level.
50 namespace CodeGenOpt {
51 enum Level {
Andrew Walbran16937d02019-10-22 13:54:20 +010052 None = 0, // -O0
53 Less = 1, // -O1
54 Default = 2, // -O2, -Os
55 Aggressive = 3 // -O3
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010056 };
57 }
58
Andrew Walbran16937d02019-10-22 13:54:20 +010059 // Specify effect of frame pointer elimination optimization.
60 namespace FramePointer {
61 enum FP {All, NonLeaf, None};
62 }
63
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010064} // end llvm namespace
65
66#endif