1 //===-- LanaiTargetObjectFile.h - Lanai Object Info -----------------------===// 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_LANAI_LANAITARGETOBJECTFILE_H 11 #define LLVM_LIB_TARGET_LANAI_LANAITARGETOBJECTFILE_H 12 13 #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h" 14 15 namespace llvm { 16 class LanaiTargetMachine; 17 class LanaiTargetObjectFile : public TargetLoweringObjectFileELF { 18 MCSection *SmallDataSection; 19 MCSection *SmallBSSSection; 20 21 public: 22 void Initialize(MCContext &Ctx, const TargetMachine &TM) override; 23 24 /// Return true if this global address should be placed into small data/bss 25 /// section. 26 bool isGlobalInSmallSection(const GlobalValue *GV, const TargetMachine &TM, 27 SectionKind Kind) const; 28 bool isGlobalInSmallSection(const GlobalValue *GV, 29 const TargetMachine &TM) const; 30 bool isGlobalInSmallSectionImpl(const GlobalValue *GV, 31 const TargetMachine &TM) const; 32 33 MCSection *SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind, 34 const TargetMachine &TM) const override; 35 36 /// Return true if this constant should be placed into small data section. 37 bool isConstantInSmallSection(const DataLayout &DL, const Constant *CN) const; 38 39 MCSection *getSectionForConstant(const DataLayout &DL, SectionKind Kind, 40 const Constant *C, 41 unsigned &Align) const override; 42 }; 43 } // end namespace llvm 44 45 #endif // LLVM_LIB_TARGET_LANAI_LANAITARGETOBJECTFILE_H 46