1 //===-- LanaiTargetObjectFile.h - Lanai Object Info -----------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_LIB_TARGET_LANAI_LANAITARGETOBJECTFILE_H
11 #define LLVM_LIB_TARGET_LANAI_LANAITARGETOBJECTFILE_H
13 #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
16 class LanaiTargetMachine;
17 class LanaiTargetObjectFile : public TargetLoweringObjectFileELF {
18 MCSection *SmallDataSection;
19 MCSection *SmallBSSSection;
21 bool isGlobalInSmallSection(const GlobalObject *GO, const TargetMachine &TM,
22 SectionKind Kind) const;
23 bool isGlobalInSmallSectionImpl(const GlobalObject *GO,
24 const TargetMachine &TM) const;
27 void Initialize(MCContext &Ctx, const TargetMachine &TM) override;
29 /// Return true if this global address should be placed into small data/bss
31 bool isGlobalInSmallSection(const GlobalObject *GO,
32 const TargetMachine &TM) const;
34 MCSection *SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind,
35 const TargetMachine &TM) const override;
37 /// Return true if this constant should be placed into small data section.
38 bool isConstantInSmallSection(const DataLayout &DL, const Constant *CN) const;
40 MCSection *getSectionForConstant(const DataLayout &DL, SectionKind Kind,
42 unsigned &Align) const override;
44 } // end namespace llvm
46 #endif // LLVM_LIB_TARGET_LANAI_LANAITARGETOBJECTFILE_H