LLVM  8.0.1
HexagonTargetObjectFile.h
Go to the documentation of this file.
1 //===-- HexagonTargetObjectFile.h -----------------------------------------===//
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 #ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGONTARGETOBJECTFILE_H
11 #define LLVM_LIB_TARGET_HEXAGON_HEXAGONTARGETOBJECTFILE_H
12 
14 #include "llvm/MC/MCSectionELF.h"
15 
16 namespace llvm {
17 
19  public:
20  void Initialize(MCContext &Ctx, const TargetMachine &TM) override;
21 
23  const TargetMachine &TM) const override;
24 
26  SectionKind Kind,
27  const TargetMachine &TM) const override;
28 
29  bool isGlobalInSmallSection(const GlobalObject *GO,
30  const TargetMachine &TM) const;
31 
32  bool isSmallDataEnabled(const TargetMachine &TM) const;
33 
34  unsigned getSmallDataSize() const;
35 
36  bool shouldPutJumpTableInFunctionSection(bool UsesLabelDifference,
37  const Function &F) const override;
38 
39  const Function *getLutUsedFunction(const GlobalObject *GO) const;
40 
41  private:
42  MCSectionELF *SmallDataSection;
43  MCSectionELF *SmallBSSSection;
44 
45  unsigned getSmallestAddressableSize(const Type *Ty, const GlobalValue *GV,
46  const TargetMachine &TM) const;
47 
48  MCSection *selectSmallSectionForGlobal(const GlobalObject *GO,
49  SectionKind Kind,
50  const TargetMachine &TM) const;
51 
52  MCSection *selectSectionForLookupTable(const GlobalObject *GO,
53  const TargetMachine &TM,
54  const Function *Fn) const;
55  };
56 
57 } // namespace llvm
58 
59 #endif
bool isGlobalInSmallSection(const GlobalObject *GO, const TargetMachine &TM) const
Return true if this global value should be placed into small data/bss section.
Instances of this class represent a uniqued identifier for a section in the current translation unit...
Definition: MCSection.h:39
This class represents lattice values for constants.
Definition: AllocatorList.h:24
F(f)
Context object for machine code objects.
Definition: MCContext.h:63
bool shouldPutJumpTableInFunctionSection(bool UsesLabelDifference, const Function &F) const override
const Function * getLutUsedFunction(const GlobalObject *GO) const
MCSection * SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:46
SectionKind - This is a simple POD value that classifies the properties of a section.
Definition: SectionKind.h:23
void Initialize(MCContext &Ctx, const TargetMachine &TM) override
This method must be called before any actual lowering is done.
This represents a section on linux, lots of unix variants and some bare metal systems.
Definition: MCSectionELF.h:28
const unsigned Kind
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:59
MCSection * getExplicitSectionGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override
Targets should implement this method to assign a section to globals with an explicit section specfied...
bool isSmallDataEnabled(const TargetMachine &TM) const