• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
13 #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
14 #include "llvm/MC/MCSectionELF.h"
15 
16 namespace llvm {
17 
18   class HexagonTargetObjectFile : public TargetLoweringObjectFileELF {
19   public:
20     void Initialize(MCContext &Ctx, const TargetMachine &TM) override;
21 
22     MCSection *SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
23         Mangler &Mang, const TargetMachine &TM) const override;
24 
25     MCSection *getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind,
26         Mangler &Mang, const TargetMachine &TM) const override;
27 
28     bool isGlobalInSmallSection(const GlobalValue *GV, const TargetMachine &TM)
29         const;
30 
31     bool isSmallDataEnabled() const;
32 
33     unsigned getSmallDataSize() const;
34 
35   private:
36     MCSectionELF *SmallDataSection;
37     MCSectionELF *SmallBSSSection;
38 
39     unsigned getSmallestAddressableSize(const Type *Ty, const GlobalValue *GV,
40         const TargetMachine &TM) const;
41 
42     MCSection *selectSmallSectionForGlobal(const GlobalValue *GV,
43         SectionKind Kind, Mangler &Mang, const TargetMachine &TM) const;
44   };
45 
46 } // namespace llvm
47 
48 #endif
49