Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

135 lines
4.8 KiB

  1. //==-- llvm/CodeGen/TargetLoweringObjectFileImpl.h - Object Info -*- 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 implements classes used to handle lowerings specific to common
  11. // object file formats.
  12. //
  13. //===----------------------------------------------------------------------===//
  14. #ifndef LLVM_CODEGEN_TARGETLOWERINGOBJECTFILEIMPL_H
  15. #define LLVM_CODEGEN_TARGETLOWERINGOBJECTFILEIMPL_H
  16. #include "llvm/ADT/StringRef.h"
  17. #include "llvm/MC/SectionKind.h"
  18. #include "llvm/Target/TargetLoweringObjectFile.h"
  19. namespace llvm {
  20. class MachineModuleInfo;
  21. class Mangler;
  22. class MCAsmInfo;
  23. class MCExpr;
  24. class MCSection;
  25. class MCSectionMachO;
  26. class MCSymbol;
  27. class MCContext;
  28. class GlobalValue;
  29. class TargetMachine;
  30. class TargetLoweringObjectFileELF : public TargetLoweringObjectFile {
  31. bool UseInitArray;
  32. public:
  33. virtual ~TargetLoweringObjectFileELF() {}
  34. virtual void emitPersonalityValue(MCStreamer &Streamer,
  35. const TargetMachine &TM,
  36. const MCSymbol *Sym) const;
  37. /// getSectionForConstant - Given a constant with the SectionKind, return a
  38. /// section that it should be placed in.
  39. virtual const MCSection *getSectionForConstant(SectionKind Kind) const;
  40. virtual const MCSection *
  41. getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind,
  42. Mangler *Mang, const TargetMachine &TM) const;
  43. virtual const MCSection *
  44. SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
  45. Mangler *Mang, const TargetMachine &TM) const;
  46. /// getTTypeGlobalReference - Return an MCExpr to use for a reference to the
  47. /// specified type info global variable from exception handling information.
  48. virtual const MCExpr *
  49. getTTypeGlobalReference(const GlobalValue *GV, Mangler *Mang,
  50. MachineModuleInfo *MMI, unsigned Encoding,
  51. MCStreamer &Streamer) const;
  52. // getCFIPersonalitySymbol - The symbol that gets passed to .cfi_personality.
  53. virtual MCSymbol *
  54. getCFIPersonalitySymbol(const GlobalValue *GV, Mangler *Mang,
  55. MachineModuleInfo *MMI) const;
  56. void InitializeELF(bool UseInitArray_);
  57. virtual const MCSection *
  58. getStaticCtorSection(unsigned Priority = 65535) const;
  59. virtual const MCSection *
  60. getStaticDtorSection(unsigned Priority = 65535) const;
  61. };
  62. class TargetLoweringObjectFileMachO : public TargetLoweringObjectFile {
  63. public:
  64. virtual ~TargetLoweringObjectFileMachO() {}
  65. /// emitModuleFlags - Emit the module flags that specify the garbage
  66. /// collection information.
  67. virtual void emitModuleFlags(MCStreamer &Streamer,
  68. ArrayRef<Module::ModuleFlagEntry> ModuleFlags,
  69. Mangler *Mang, const TargetMachine &TM) const;
  70. virtual const MCSection *
  71. SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
  72. Mangler *Mang, const TargetMachine &TM) const;
  73. virtual const MCSection *
  74. getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind,
  75. Mangler *Mang, const TargetMachine &TM) const;
  76. virtual const MCSection *getSectionForConstant(SectionKind Kind) const;
  77. /// shouldEmitUsedDirectiveFor - This hook allows targets to selectively
  78. /// decide not to emit the UsedDirective for some symbols in llvm.used.
  79. /// FIXME: REMOVE this (rdar://7071300)
  80. virtual bool shouldEmitUsedDirectiveFor(const GlobalValue *GV,
  81. Mangler *) const;
  82. /// getTTypeGlobalReference - The mach-o version of this method
  83. /// defaults to returning a stub reference.
  84. virtual const MCExpr *
  85. getTTypeGlobalReference(const GlobalValue *GV, Mangler *Mang,
  86. MachineModuleInfo *MMI, unsigned Encoding,
  87. MCStreamer &Streamer) const;
  88. // getCFIPersonalitySymbol - The symbol that gets passed to .cfi_personality.
  89. virtual MCSymbol *
  90. getCFIPersonalitySymbol(const GlobalValue *GV, Mangler *Mang,
  91. MachineModuleInfo *MMI) const;
  92. };
  93. class TargetLoweringObjectFileCOFF : public TargetLoweringObjectFile {
  94. public:
  95. virtual ~TargetLoweringObjectFileCOFF() {}
  96. virtual const MCSection *
  97. getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind,
  98. Mangler *Mang, const TargetMachine &TM) const;
  99. virtual const MCSection *
  100. SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
  101. Mangler *Mang, const TargetMachine &TM) const;
  102. };
  103. } // end namespace llvm
  104. #endif