10b57cec5SDimitry Andric //===-- LanaiTargetObjectFile.h - Lanai Object Info -----------------------===// 20b57cec5SDimitry Andric // 30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 60b57cec5SDimitry Andric // 70b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 80b57cec5SDimitry Andric 90b57cec5SDimitry Andric #ifndef LLVM_LIB_TARGET_LANAI_LANAITARGETOBJECTFILE_H 100b57cec5SDimitry Andric #define LLVM_LIB_TARGET_LANAI_LANAITARGETOBJECTFILE_H 110b57cec5SDimitry Andric 120b57cec5SDimitry Andric #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h" 130b57cec5SDimitry Andric 140b57cec5SDimitry Andric namespace llvm { 150b57cec5SDimitry Andric class LanaiTargetObjectFile : public TargetLoweringObjectFileELF { 160b57cec5SDimitry Andric MCSection *SmallDataSection; 170b57cec5SDimitry Andric MCSection *SmallBSSSection; 180b57cec5SDimitry Andric 190b57cec5SDimitry Andric bool isGlobalInSmallSection(const GlobalObject *GO, const TargetMachine &TM, 200b57cec5SDimitry Andric SectionKind Kind) const; 210b57cec5SDimitry Andric bool isGlobalInSmallSectionImpl(const GlobalObject *GO, 220b57cec5SDimitry Andric const TargetMachine &TM) const; 230b57cec5SDimitry Andric 240b57cec5SDimitry Andric public: 250b57cec5SDimitry Andric void Initialize(MCContext &Ctx, const TargetMachine &TM) override; 260b57cec5SDimitry Andric 270b57cec5SDimitry Andric /// Return true if this global address should be placed into small data/bss 280b57cec5SDimitry Andric /// section. 290b57cec5SDimitry Andric bool isGlobalInSmallSection(const GlobalObject *GO, 300b57cec5SDimitry Andric const TargetMachine &TM) const; 310b57cec5SDimitry Andric 320b57cec5SDimitry Andric MCSection *SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind, 330b57cec5SDimitry Andric const TargetMachine &TM) const override; 340b57cec5SDimitry Andric 350b57cec5SDimitry Andric /// Return true if this constant should be placed into small data section. 360b57cec5SDimitry Andric bool isConstantInSmallSection(const DataLayout &DL, const Constant *CN) const; 370b57cec5SDimitry Andric 380b57cec5SDimitry Andric MCSection *getSectionForConstant(const DataLayout &DL, SectionKind Kind, 390b57cec5SDimitry Andric const Constant *C, 40*5ffd83dbSDimitry Andric Align &Alignment) const override; 410b57cec5SDimitry Andric }; 420b57cec5SDimitry Andric } // end namespace llvm 430b57cec5SDimitry Andric 440b57cec5SDimitry Andric #endif // LLVM_LIB_TARGET_LANAI_LANAITARGETOBJECTFILE_H 45