Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 1 | //===-- llvm/Support/CodeGen.h - CodeGen Concepts ---------------*- 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 define some types which define code generation concepts. For |
| 11 | // example, relocation model. |
| 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
| 15 | #ifndef LLVM_SUPPORT_CODEGEN_H |
| 16 | #define LLVM_SUPPORT_CODEGEN_H |
| 17 | |
| 18 | namespace llvm { |
| 19 | |
| 20 | // Relocation model types. |
| 21 | namespace Reloc { |
| 22 | enum Model { Static, PIC_, DynamicNoPIC, ROPI, RWPI, ROPI_RWPI }; |
| 23 | } |
| 24 | |
| 25 | // Code model types. |
| 26 | namespace CodeModel { |
| 27 | // Sync changes with CodeGenCWrappers.h. |
Andrew Scull | 0372a57 | 2018-11-16 15:47:06 +0000 | [diff] [blame^] | 28 | enum Model { Tiny, Small, Kernel, Medium, Large }; |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 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 { |
| 43 | GeneralDynamic, |
| 44 | LocalDynamic, |
| 45 | InitialExec, |
| 46 | LocalExec |
| 47 | }; |
| 48 | } |
| 49 | |
| 50 | // Code generation optimization level. |
| 51 | namespace CodeGenOpt { |
| 52 | enum Level { |
| 53 | None, // -O0 |
| 54 | Less, // -O1 |
| 55 | Default, // -O2, -Os |
| 56 | Aggressive // -O3 |
| 57 | }; |
| 58 | } |
| 59 | |
| 60 | } // end llvm namespace |
| 61 | |
| 62 | #endif |