LLVM  10.0.0svn
HexagonTargetObjectFile.h
Go to the documentation of this file.
1 //===-- HexagonTargetObjectFile.h -----------------------------------------===//
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 #ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGONTARGETOBJECTFILE_H
10 #define LLVM_LIB_TARGET_HEXAGON_HEXAGONTARGETOBJECTFILE_H
11 
13 #include "llvm/MC/MCSectionELF.h"
14 
15 namespace llvm {
16 
18  public:
19  void Initialize(MCContext &Ctx, const TargetMachine &TM) override;
20 
22  const TargetMachine &TM) const override;
23 
25  SectionKind Kind,
26  const TargetMachine &TM) const override;
27 
28  bool isGlobalInSmallSection(const GlobalObject *GO,
29  const TargetMachine &TM) const;
30 
31  bool isSmallDataEnabled(const TargetMachine &TM) const;
32 
33  unsigned getSmallDataSize() const;
34 
35  bool shouldPutJumpTableInFunctionSection(bool UsesLabelDifference,
36  const Function &F) const override;
37 
38  const Function *getLutUsedFunction(const GlobalObject *GO) const;
39 
40  private:
41  MCSectionELF *SmallDataSection;
42  MCSectionELF *SmallBSSSection;
43 
44  unsigned getSmallestAddressableSize(const Type *Ty, const GlobalValue *GV,
45  const TargetMachine &TM) const;
46 
47  MCSection *selectSmallSectionForGlobal(const GlobalObject *GO,
48  SectionKind Kind,
49  const TargetMachine &TM) const;
50 
51  MCSection *selectSectionForLookupTable(const GlobalObject *GO,
52  const TargetMachine &TM,
53  const Function *Fn) const;
54  };
55 
56 } // namespace llvm
57 
58 #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:38
This class represents lattice values for constants.
Definition: AllocatorList.h:23
F(f)
Context object for machine code objects.
Definition: MCContext.h:65
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:45
SectionKind - This is a simple POD value that classifies the properties of a section.
Definition: SectionKind.h:22
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:27
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:65
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