blob: 58dff2b95e199640b9d306d8979e8edb1b533708 [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
32 bool isSmallDataEnabled() const;
33
34 unsigned getSmallDataSize() const;
35
36 private:
37 MCSectionELF *SmallDataSection;
38 MCSectionELF *SmallBSSSection;
39
40 unsigned getSmallestAddressableSize(const Type *Ty, const GlobalValue *GV,
41 const TargetMachine &TM) const;
42
Peter Collingbourne67335642016-10-24 19:23:39 +000043 MCSection *selectSmallSectionForGlobal(const GlobalObject *GO,
Eric Christopher4367c7f2016-09-16 07:33:15 +000044 SectionKind Kind,
45 const TargetMachine &TM) const;
Tony Linthicum1213a7a2011-12-12 21:14:40 +000046 };
47
48} // namespace llvm
49
50#endif