1*9880d681SAndroid Build Coastguard Worker //===-- LanaiTargetObjectFile.h - Lanai Object Info -----------------------===// 2*9880d681SAndroid Build Coastguard Worker // 3*9880d681SAndroid Build Coastguard Worker // The LLVM Compiler Infrastructure 4*9880d681SAndroid Build Coastguard Worker // 5*9880d681SAndroid Build Coastguard Worker // This file is distributed under the University of Illinois Open Source 6*9880d681SAndroid Build Coastguard Worker // License. See LICENSE.TXT for details. 7*9880d681SAndroid Build Coastguard Worker // 8*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===// 9*9880d681SAndroid Build Coastguard Worker 10*9880d681SAndroid Build Coastguard Worker #ifndef LLVM_LIB_TARGET_LANAI_LANAITARGETOBJECTFILE_H 11*9880d681SAndroid Build Coastguard Worker #define LLVM_LIB_TARGET_LANAI_LANAITARGETOBJECTFILE_H 12*9880d681SAndroid Build Coastguard Worker 13*9880d681SAndroid Build Coastguard Worker #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h" 14*9880d681SAndroid Build Coastguard Worker 15*9880d681SAndroid Build Coastguard Worker namespace llvm { 16*9880d681SAndroid Build Coastguard Worker class LanaiTargetMachine; 17*9880d681SAndroid Build Coastguard Worker class LanaiTargetObjectFile : public TargetLoweringObjectFileELF { 18*9880d681SAndroid Build Coastguard Worker MCSection *SmallDataSection; 19*9880d681SAndroid Build Coastguard Worker MCSection *SmallBSSSection; 20*9880d681SAndroid Build Coastguard Worker 21*9880d681SAndroid Build Coastguard Worker public: 22*9880d681SAndroid Build Coastguard Worker void Initialize(MCContext &Ctx, const TargetMachine &TM) override; 23*9880d681SAndroid Build Coastguard Worker 24*9880d681SAndroid Build Coastguard Worker /// Return true if this global address should be placed into small data/bss 25*9880d681SAndroid Build Coastguard Worker /// section. 26*9880d681SAndroid Build Coastguard Worker bool isGlobalInSmallSection(const GlobalValue *GV, const TargetMachine &TM, 27*9880d681SAndroid Build Coastguard Worker SectionKind Kind) const; 28*9880d681SAndroid Build Coastguard Worker bool isGlobalInSmallSection(const GlobalValue *GV, 29*9880d681SAndroid Build Coastguard Worker const TargetMachine &TM) const; 30*9880d681SAndroid Build Coastguard Worker bool isGlobalInSmallSectionImpl(const GlobalValue *GV, 31*9880d681SAndroid Build Coastguard Worker const TargetMachine &TM) const; 32*9880d681SAndroid Build Coastguard Worker 33*9880d681SAndroid Build Coastguard Worker MCSection *SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind, 34*9880d681SAndroid Build Coastguard Worker Mangler &Mang, 35*9880d681SAndroid Build Coastguard Worker const TargetMachine &TM) const override; 36*9880d681SAndroid Build Coastguard Worker 37*9880d681SAndroid Build Coastguard Worker /// Return true if this constant should be placed into small data section. 38*9880d681SAndroid Build Coastguard Worker bool isConstantInSmallSection(const DataLayout &DL, const Constant *CN) const; 39*9880d681SAndroid Build Coastguard Worker 40*9880d681SAndroid Build Coastguard Worker MCSection *getSectionForConstant(const DataLayout &DL, SectionKind Kind, 41*9880d681SAndroid Build Coastguard Worker const Constant *C, 42*9880d681SAndroid Build Coastguard Worker unsigned &Align) const override; 43*9880d681SAndroid Build Coastguard Worker }; 44*9880d681SAndroid Build Coastguard Worker } // end namespace llvm 45*9880d681SAndroid Build Coastguard Worker 46*9880d681SAndroid Build Coastguard Worker #endif // LLVM_LIB_TARGET_LANAI_LANAITARGETOBJECTFILE_H 47