LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TargetLoweringObjectFileImpl.h
Go to the documentation of this file.
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 
15 #ifndef LLVM_CODEGEN_TARGETLOWERINGOBJECTFILEIMPL_H
16 #define LLVM_CODEGEN_TARGETLOWERINGOBJECTFILEIMPL_H
17 
18 #include "llvm/ADT/StringRef.h"
19 #include "llvm/MC/SectionKind.h"
21 
22 namespace llvm {
23  class MachineModuleInfo;
24  class Mangler;
25  class MCAsmInfo;
26  class MCExpr;
27  class MCSection;
28  class MCSectionMachO;
29  class MCSymbol;
30  class MCContext;
31  class GlobalValue;
32  class TargetMachine;
33 
34 
36  bool UseInitArray;
37 
38 public:
40 
41  virtual void emitPersonalityValue(MCStreamer &Streamer,
42  const TargetMachine &TM,
43  const MCSymbol *Sym) const;
44 
45  /// getSectionForConstant - Given a constant with the SectionKind, return a
46  /// section that it should be placed in.
47  virtual const MCSection *getSectionForConstant(SectionKind Kind) const;
48 
49 
50  virtual const MCSection *
52  Mangler *Mang, const TargetMachine &TM) const;
53 
54  virtual const MCSection *
56  Mangler *Mang, const TargetMachine &TM) const;
57 
58  /// getTTypeGlobalReference - Return an MCExpr to use for a reference to the
59  /// specified type info global variable from exception handling information.
60  virtual const MCExpr *
62  MachineModuleInfo *MMI, unsigned Encoding,
63  MCStreamer &Streamer) const;
64 
65  // getCFIPersonalitySymbol - The symbol that gets passed to .cfi_personality.
66  virtual MCSymbol *
68  MachineModuleInfo *MMI) const;
69 
70  void InitializeELF(bool UseInitArray_);
71  virtual const MCSection *
72  getStaticCtorSection(unsigned Priority = 65535) const;
73  virtual const MCSection *
74  getStaticDtorSection(unsigned Priority = 65535) const;
75 };
76 
77 
78 
80 public:
82 
83  /// emitModuleFlags - Emit the module flags that specify the garbage
84  /// collection information.
85  virtual void emitModuleFlags(MCStreamer &Streamer,
87  Mangler *Mang, const TargetMachine &TM) const;
88 
89  virtual const MCSection *
91  Mangler *Mang, const TargetMachine &TM) const;
92 
93  virtual const MCSection *
95  Mangler *Mang, const TargetMachine &TM) const;
96 
97  virtual const MCSection *getSectionForConstant(SectionKind Kind) const;
98 
99  /// shouldEmitUsedDirectiveFor - This hook allows targets to selectively
100  /// decide not to emit the UsedDirective for some symbols in llvm.used.
101  /// FIXME: REMOVE this (rdar://7071300)
102  virtual bool shouldEmitUsedDirectiveFor(const GlobalValue *GV,
103  Mangler *) const;
104 
105  /// getTTypeGlobalReference - The mach-o version of this method
106  /// defaults to returning a stub reference.
107  virtual const MCExpr *
109  MachineModuleInfo *MMI, unsigned Encoding,
110  MCStreamer &Streamer) const;
111 
112  // getCFIPersonalitySymbol - The symbol that gets passed to .cfi_personality.
113  virtual MCSymbol *
115  MachineModuleInfo *MMI) const;
116 };
117 
118 
119 
121 public:
123 
124  virtual const MCSection *
126  Mangler *Mang, const TargetMachine &TM) const;
127 
128  virtual const MCSection *
130  Mangler *Mang, const TargetMachine &TM) const;
131 
132  /// emitModuleFlags - Emit Obj-C garbage collection and linker options. Only
133  /// linker option emission is implemented for COFF.
134  virtual void emitModuleFlags(MCStreamer &Streamer,
136  Mangler *Mang, const TargetMachine &TM) const;
137 };
138 
139 } // end namespace llvm
140 
141 #endif
virtual const MCSection * SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind, Mangler *Mang, const TargetMachine &TM) const
virtual const MCExpr * getTTypeGlobalReference(const GlobalValue *GV, Mangler *Mang, MachineModuleInfo *MMI, unsigned Encoding, MCStreamer &Streamer) const
virtual void emitModuleFlags(MCStreamer &Streamer, ArrayRef< Module::ModuleFlagEntry > ModuleFlags, Mangler *Mang, const TargetMachine &TM) const
virtual void emitPersonalityValue(MCStreamer &Streamer, const TargetMachine &TM, const MCSymbol *Sym) const
virtual const MCSection * getSectionForConstant(SectionKind Kind) const
virtual const MCSection * getSectionForConstant(SectionKind Kind) const
virtual const MCExpr * getTTypeGlobalReference(const GlobalValue *GV, Mangler *Mang, MachineModuleInfo *MMI, unsigned Encoding, MCStreamer &Streamer) const
virtual const MCSection * getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind, Mangler *Mang, const TargetMachine &TM) const
virtual const MCSection * getStaticDtorSection(unsigned Priority=65535) const
virtual MCSymbol * getCFIPersonalitySymbol(const GlobalValue *GV, Mangler *Mang, MachineModuleInfo *MMI) const
virtual bool shouldEmitUsedDirectiveFor(const GlobalValue *GV, Mangler *) const
virtual const MCSection * getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind, Mangler *Mang, const TargetMachine &TM) const
virtual const MCSection * SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind, Mangler *Mang, const TargetMachine &TM) const
virtual const MCSection * SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind, Mangler *Mang, const TargetMachine &TM) const
virtual void emitModuleFlags(MCStreamer &Streamer, ArrayRef< Module::ModuleFlagEntry > ModuleFlags, Mangler *Mang, const TargetMachine &TM) const
emitModuleFlags - Perform code emission for module flags.
virtual const MCSection * getStaticCtorSection(unsigned Priority=65535) const
virtual MCSymbol * getCFIPersonalitySymbol(const GlobalValue *GV, Mangler *Mang, MachineModuleInfo *MMI) const
virtual const MCSection * getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind, Mangler *Mang, const TargetMachine &TM) const