Krzysztof Parzyszek | 5de5910 | 2016-04-21 18:56:45 +0000 | [diff] [blame] | 1 | //===-- HexagonTargetObjectFile.h -----------------------------------------===// |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 2 | // |
| 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 Kramer | a7c40ef | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 10 | #ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGONTARGETOBJECTFILE_H |
| 11 | #define LLVM_LIB_TARGET_HEXAGON_HEXAGONTARGETOBJECTFILE_H |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 12 | |
| 13 | #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h" |
| 14 | #include "llvm/MC/MCSectionELF.h" |
| 15 | |
| 16 | namespace llvm { |
| 17 | |
| 18 | class HexagonTargetObjectFile : public TargetLoweringObjectFileELF { |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 19 | public: |
Craig Topper | 7315602 | 2014-03-02 09:09:27 +0000 | [diff] [blame] | 20 | void Initialize(MCContext &Ctx, const TargetMachine &TM) override; |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 21 | |
Rafael Espindola | 0709a7b | 2015-05-21 19:20:38 +0000 | [diff] [blame] | 22 | MCSection *SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind, |
Eric Christopher | 4367c7f | 2016-09-16 07:33:15 +0000 | [diff] [blame] | 23 | const TargetMachine &TM) const override; |
Krzysztof Parzyszek | 5de5910 | 2016-04-21 18:56:45 +0000 | [diff] [blame] | 24 | |
| 25 | MCSection *getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind, |
Eric Christopher | 4367c7f | 2016-09-16 07:33:15 +0000 | [diff] [blame] | 26 | const TargetMachine &TM) const override; |
Krzysztof Parzyszek | 5de5910 | 2016-04-21 18:56:45 +0000 | [diff] [blame] | 27 | |
| 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 Christopher | 4367c7f | 2016-09-16 07:33:15 +0000 | [diff] [blame] | 43 | SectionKind Kind, |
| 44 | const TargetMachine &TM) const; |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 45 | }; |
| 46 | |
| 47 | } // namespace llvm |
| 48 | |
| 49 | #endif |