blob: 18863630fde23d5a9812604642fa80e63ae4162b [file] [log] [blame]
Krzysztof Parzyszek5de59102016-04-21 18:56:45 +00001//===-- HexagonTargetObjectFile.h -----------------------------------------===//
Tony Linthicum1213a7a2011-12-12 21:14:40 +00002//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
Benjamin Kramera7c40ef2014-08-13 16:26:38 +000010#ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGONTARGETOBJECTFILE_H
11#define LLVM_LIB_TARGET_HEXAGON_HEXAGONTARGETOBJECTFILE_H
Tony Linthicum1213a7a2011-12-12 21:14:40 +000012
13#include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
14#include "llvm/MC/MCSectionELF.h"
15
16namespace llvm {
17
18 class HexagonTargetObjectFile : public TargetLoweringObjectFileELF {
Tony Linthicum1213a7a2011-12-12 21:14:40 +000019 public:
Craig Topper73156022014-03-02 09:09:27 +000020 void Initialize(MCContext &Ctx, const TargetMachine &TM) override;
Tony Linthicum1213a7a2011-12-12 21:14:40 +000021
Peter Collingbourne67335642016-10-24 19:23:39 +000022 MCSection *SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind,
Eric Christopher4367c7f2016-09-16 07:33:15 +000023 const TargetMachine &TM) const override;
Krzysztof Parzyszek5de59102016-04-21 18:56:45 +000024
Peter Collingbourne67335642016-10-24 19:23:39 +000025 MCSection *getExplicitSectionGlobal(const GlobalObject *GO,
26 SectionKind Kind,
Eric Christopher4367c7f2016-09-16 07:33:15 +000027 const TargetMachine &TM) const override;
Krzysztof Parzyszek5de59102016-04-21 18:56:45 +000028
Peter Collingbourne67335642016-10-24 19:23:39 +000029 bool isGlobalInSmallSection(const GlobalObject *GO,
30 const TargetMachine &TM) const;
Krzysztof Parzyszek5de59102016-04-21 18:56:45 +000031
Krzysztof Parzyszek977a1fe2018-10-31 15:54:31 +000032 bool isSmallDataEnabled(const TargetMachine &TM) const;
Krzysztof Parzyszek5de59102016-04-21 18:56:45 +000033
34 unsigned getSmallDataSize() const;
35
Sumanth Gundapaneni8c5d5952017-06-30 20:21:48 +000036 bool shouldPutJumpTableInFunctionSection(bool UsesLabelDifference,
37 const Function &F) const override;
38
Sumanth Gundapanenid5aa0f32017-07-18 15:31:37 +000039 const Function *getLutUsedFunction(const GlobalObject *GO) const;
40
Krzysztof Parzyszek5de59102016-04-21 18:56:45 +000041 private:
42 MCSectionELF *SmallDataSection;
43 MCSectionELF *SmallBSSSection;
44
45 unsigned getSmallestAddressableSize(const Type *Ty, const GlobalValue *GV,
46 const TargetMachine &TM) const;
47
Peter Collingbourne67335642016-10-24 19:23:39 +000048 MCSection *selectSmallSectionForGlobal(const GlobalObject *GO,
Eric Christopher4367c7f2016-09-16 07:33:15 +000049 SectionKind Kind,
50 const TargetMachine &TM) const;
Sumanth Gundapanenid5aa0f32017-07-18 15:31:37 +000051
52 MCSection *selectSectionForLookupTable(const GlobalObject *GO,
53 const TargetMachine &TM,
54 const Function *Fn) const;
Tony Linthicum1213a7a2011-12-12 21:14:40 +000055 };
56
57} // namespace llvm
58
59#endif