1 //===-- HexagonTargetObjectFile.h -----------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGONTARGETOBJECTFILE_H
10 #define LLVM_LIB_TARGET_HEXAGON_HEXAGONTARGETOBJECTFILE_H
12 #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
13 #include "llvm/MC/MCSectionELF.h"
17 class HexagonTargetObjectFile
: public TargetLoweringObjectFileELF
{
19 void Initialize(MCContext
&Ctx
, const TargetMachine
&TM
) override
;
21 MCSection
*SelectSectionForGlobal(const GlobalObject
*GO
, SectionKind Kind
,
22 const TargetMachine
&TM
) const override
;
24 MCSection
*getExplicitSectionGlobal(const GlobalObject
*GO
,
26 const TargetMachine
&TM
) const override
;
28 bool isGlobalInSmallSection(const GlobalObject
*GO
,
29 const TargetMachine
&TM
) const;
31 bool isSmallDataEnabled(const TargetMachine
&TM
) const;
33 unsigned getSmallDataSize() const;
35 bool shouldPutJumpTableInFunctionSection(bool UsesLabelDifference
,
36 const Function
&F
) const override
;
38 const Function
*getLutUsedFunction(const GlobalObject
*GO
) const;
41 MCSectionELF
*SmallDataSection
;
42 MCSectionELF
*SmallBSSSection
;
44 unsigned getSmallestAddressableSize(const Type
*Ty
, const GlobalValue
*GV
,
45 const TargetMachine
&TM
) const;
47 MCSection
*selectSmallSectionForGlobal(const GlobalObject
*GO
,
49 const TargetMachine
&TM
) const;
51 MCSection
*selectSectionForLookupTable(const GlobalObject
*GO
,
52 const TargetMachine
&TM
,
53 const Function
*Fn
) const;