blob: c57d3325f20a85022eef9f2d68cec2a662a015be [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
Rafael Espindola0709a7b2015-05-21 19:20:38 +000022 MCSection *SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
Eric Christopher4367c7f2016-09-16 07:33:15 +000023 const TargetMachine &TM) const override;
Krzysztof Parzyszek5de59102016-04-21 18:56:45 +000024
25 MCSection *getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind,
Eric Christopher4367c7f2016-09-16 07:33:15 +000026 const TargetMachine &TM) const override;
Krzysztof Parzyszek5de59102016-04-21 18:56:45 +000027
28 bool isGlobalInSmallSection(const GlobalValue *GV, const TargetMachine &TM)
29 const;
30
31 bool isSmallDataEnabled() const;
32
33 unsigned getSmallDataSize() const;
34
35 private:
36 MCSectionELF *SmallDataSection;
37 MCSectionELF *SmallBSSSection;
38
39 unsigned getSmallestAddressableSize(const Type *Ty, const GlobalValue *GV,
40 const TargetMachine &TM) const;
41
42 MCSection *selectSmallSectionForGlobal(const GlobalValue *GV,
Eric Christopher4367c7f2016-09-16 07:33:15 +000043 SectionKind Kind,
44 const TargetMachine &TM) const;
Tony Linthicum1213a7a2011-12-12 21:14:40 +000045 };
46
47} // namespace llvm
48
49#endif