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 GlobalObject *GO, SectionKind Kind, 23 const TargetMachine &TM) const override; 24 25 MCSection *getExplicitSectionGlobal(const GlobalObject *GO, 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; 33 34 unsigned getSmallDataSize() const; 35 36 private: 37 MCSectionELF *SmallDataSection; 38 MCSectionELF *SmallBSSSection; 39 40 unsigned getSmallestAddressableSize(const Type *Ty, const GlobalValue *GV, 41 const TargetMachine &TM) const; 42 43 MCSection *selectSmallSectionForGlobal(const GlobalObject *GO, 44 SectionKind Kind, 45 const TargetMachine &TM) const; 46 }; 47 48 } // namespace llvm 49 50 #endif 51