CodeGen.h revision 360784
11541Srgrimes//===-- llvm/Support/CodeGen.h - CodeGen Concepts ---------------*- C++ -*-===// 2109524Sphk// 3109524Sphk// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4109524Sphk// See https://llvm.org/LICENSE.txt for license information. 5109524Sphk// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6109524Sphk// 7109524Sphk//===----------------------------------------------------------------------===// 8109524Sphk// 9109524Sphk// This file define some types which define code generation concepts. For 10109524Sphk// example, relocation model. 11109524Sphk// 12109524Sphk//===----------------------------------------------------------------------===// 13109524Sphk 14109524Sphk#ifndef LLVM_SUPPORT_CODEGEN_H 15109524Sphk#define LLVM_SUPPORT_CODEGEN_H 16109524Sphk 17109524Sphknamespace llvm { 18109524Sphk 19109524Sphk // Relocation model types. 20109524Sphk namespace Reloc { 21109524Sphk // Cannot be named PIC due to collision with -DPIC 22109524Sphk enum Model { Static, PIC_, DynamicNoPIC, ROPI, RWPI, ROPI_RWPI }; 23109524Sphk } 24109524Sphk 25109524Sphk // Code model types. 26116182Sobrien namespace CodeModel { 27116182Sobrien // Sync changes with CodeGenCWrappers.h. 28116182Sobrien enum Model { Tiny, Small, Kernel, Medium, Large }; 29109524Sphk } 30109524Sphk 31109524Sphk namespace PICLevel { 32109524Sphk // This is used to map -fpic/-fPIC. 33109524Sphk enum Level { NotPIC=0, SmallPIC=1, BigPIC=2 }; 34109524Sphk } 35109524Sphk 36109524Sphk namespace PIELevel { 37109524Sphk enum Level { Default=0, Small=1, Large=2 }; 38109524Sphk } 39109524Sphk 40109524Sphk // TLS models. 41126080Sphk namespace TLSModel { 42111815Sphk enum Model { 43111815Sphk GeneralDynamic, 44111815Sphk LocalDynamic, 45126080Sphk InitialExec, 46109524Sphk LocalExec 47109524Sphk }; 48130585Sphk } 49109524Sphk 50109524Sphk // Code generation optimization level. 51130585Sphk namespace CodeGenOpt { 52109524Sphk enum Level { 53109524Sphk None = 0, // -O0 54109524Sphk Less = 1, // -O1 55109524Sphk Default = 2, // -O2, -Os 56109524Sphk Aggressive = 3 // -O3 57109524Sphk }; 58130585Sphk } 59109524Sphk 60109524Sphk /// These enums are meant to be passed into addPassesToEmitFile to indicate 61130640Sphk /// what type of file to emit, and returned by it to indicate what type of 62109524Sphk /// file could actually be made. 63109524Sphk enum CodeGenFileType { 64109524Sphk CGFT_AssemblyFile, 65109940Sphk CGFT_ObjectFile, 66109940Sphk CGFT_Null // Do not emit any output. 67109940Sphk }; 68109940Sphk 69109940Sphk // Specify effect of frame pointer elimination optimization. 70109524Sphk namespace FramePointer { 71109524Sphk enum FP {All, NonLeaf, None}; 72109524Sphk } 73109524Sphk 74109524Sphk} // end llvm namespace 75109524Sphk 76109524Sphk#endif 77109524Sphk