CodeGen.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. #ifndef LLVM_SUPPORT_CODEGEN_H
  14. #define LLVM_SUPPORT_CODEGEN_H
  15. namespace llvm {
  16. // Relocation model types.
  17. namespace Reloc {
  18. // Cannot be named PIC due to collision with -DPIC
  19. enum Model { Static, PIC_, DynamicNoPIC, ROPI, RWPI, ROPI_RWPI };
  20. }
  21. // Code model types.
  22. namespace CodeModel {
  23. // Sync changes with CodeGenCWrappers.h.
  24. enum Model { Tiny, Small, Kernel, Medium, Large };
  25. }
  26. namespace PICLevel {
  27. // This is used to map -fpic/-fPIC.
  28. enum Level { NotPIC=0, SmallPIC=1, BigPIC=2 };
  29. }
  30. namespace PIELevel {
  31. enum Level { Default=0, Small=1, Large=2 };
  32. }
  33. // TLS models.
  34. namespace TLSModel {
  35. enum Model {
  36. GeneralDynamic,
  37. LocalDynamic,
  38. InitialExec,
  39. LocalExec
  40. };
  41. }
  42. // Code generation optimization level.
  43. namespace CodeGenOpt {
  44. enum Level {
  45. None = 0, // -O0
  46. Less = 1, // -O1
  47. Default = 2, // -O2, -Os
  48. Aggressive = 3 // -O3
  49. };
  50. }
  51. /// These enums are meant to be passed into addPassesToEmitFile to indicate
  52. /// what type of file to emit, and returned by it to indicate what type of
  53. /// file could actually be made.
  54. enum CodeGenFileType {
  55. CGFT_AssemblyFile,
  56. CGFT_ObjectFile,
  57. CGFT_Null // Do not emit any output.
  58. };
  59. // Specify what functions should keep the frame pointer.
  60. enum class FramePointerKind { None, NonLeaf, All };
  61. } // end llvm namespace
  62. #endif