blob: b362825789503cffdf0fac7bbefab3a5f22408f2 [file] [log] [blame]
Krzysztof Parzyszek5de59102016-04-21 18:56:45 +00001//===-- HexagonTargetObjectFile.h -----------------------------------------===//
Tony Linthicum1213a7a2011-12-12 21:14:40 +00002//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// 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
Tony Linthicum1213a7a2011-12-12 21:14:40 +00006//
7//===----------------------------------------------------------------------===//
8
Benjamin Kramera7c40ef2014-08-13 16:26:38 +00009#ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGONTARGETOBJECTFILE_H
10#define LLVM_LIB_TARGET_HEXAGON_HEXAGONTARGETOBJECTFILE_H
Tony Linthicum1213a7a2011-12-12 21:14:40 +000011
12#include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
13#include "llvm/MC/MCSectionELF.h"
14
15namespace llvm {
16
17 class HexagonTargetObjectFile : public TargetLoweringObjectFileELF {
Tony Linthicum1213a7a2011-12-12 21:14:40 +000018 public:
Craig Topper73156022014-03-02 09:09:27 +000019 void Initialize(MCContext &Ctx, const TargetMachine &TM) override;
Tony Linthicum1213a7a2011-12-12 21:14:40 +000020
Peter Collingbourne67335642016-10-24 19:23:39 +000021 MCSection *SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind,
Eric Christopher4367c7f2016-09-16 07:33:15 +000022 const TargetMachine &TM) const override;
Krzysztof Parzyszek5de59102016-04-21 18:56:45 +000023
Peter Collingbourne67335642016-10-24 19:23:39 +000024 MCSection *getExplicitSectionGlobal(const GlobalObject *GO,
25 SectionKind Kind,
Eric Christopher4367c7f2016-09-16 07:33:15 +000026 const TargetMachine &TM) const override;
Krzysztof Parzyszek5de59102016-04-21 18:56:45 +000027
Peter Collingbourne67335642016-10-24 19:23:39 +000028 bool isGlobalInSmallSection(const GlobalObject *GO,
29 const TargetMachine &TM) const;
Krzysztof Parzyszek5de59102016-04-21 18:56:45 +000030
Krzysztof Parzyszek977a1fe2018-10-31 15:54:31 +000031 bool isSmallDataEnabled(const TargetMachine &TM) const;
Krzysztof Parzyszek5de59102016-04-21 18:56:45 +000032
33 unsigned getSmallDataSize() const;
34
Sumanth Gundapaneni8c5d5952017-06-30 20:21:48 +000035 bool shouldPutJumpTableInFunctionSection(bool UsesLabelDifference,
36 const Function &F) const override;
37
Sumanth Gundapanenid5aa0f32017-07-18 15:31:37 +000038 const Function *getLutUsedFunction(const GlobalObject *GO) const;
39
Krzysztof Parzyszek5de59102016-04-21 18:56:45 +000040 private:
41 MCSectionELF *SmallDataSection;
42 MCSectionELF *SmallBSSSection;
43
44 unsigned getSmallestAddressableSize(const Type *Ty, const GlobalValue *GV,
45 const TargetMachine &TM) const;
46
Peter Collingbourne67335642016-10-24 19:23:39 +000047 MCSection *selectSmallSectionForGlobal(const GlobalObject *GO,
Eric Christopher4367c7f2016-09-16 07:33:15 +000048 SectionKind Kind,
49 const TargetMachine &TM) const;
Sumanth Gundapanenid5aa0f32017-07-18 15:31:37 +000050
51 MCSection *selectSectionForLookupTable(const GlobalObject *GO,
52 const TargetMachine &TM,
53 const Function *Fn) const;
Tony Linthicum1213a7a2011-12-12 21:14:40 +000054 };
55
56} // namespace llvm
57
58#endif