Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 1 | //===-- llvm/Support/CodeGen.h - CodeGen Concepts ---------------*- C++ -*-===// |
| 2 | // |
Andrew Walbran | 16937d0 | 2019-10-22 13:54:20 +0100 | [diff] [blame^] | 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 |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 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 | 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 Scull | 0372a57 | 2018-11-16 15:47:06 +0000 | [diff] [blame] | 27 | enum Model { Tiny, Small, Kernel, Medium, Large }; |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 28 | } |
| 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 Walbran | 16937d0 | 2019-10-22 13:54:20 +0100 | [diff] [blame^] | 52 | None = 0, // -O0 |
| 53 | Less = 1, // -O1 |
| 54 | Default = 2, // -O2, -Os |
| 55 | Aggressive = 3 // -O3 |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 56 | }; |
| 57 | } |
| 58 | |
Andrew Walbran | 16937d0 | 2019-10-22 13:54:20 +0100 | [diff] [blame^] | 59 | // Specify effect of frame pointer elimination optimization. |
| 60 | namespace FramePointer { |
| 61 | enum FP {All, NonLeaf, None}; |
| 62 | } |
| 63 | |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 64 | } // end llvm namespace |
| 65 | |
| 66 | #endif |