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 | |
Peter Collingbourne | 6733564 | 2016-10-24 19:23:39 +0000 | [diff] [blame] | 22 | MCSection *SelectSectionForGlobal(const GlobalObject *GO, 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 | |
Peter Collingbourne | 6733564 | 2016-10-24 19:23:39 +0000 | [diff] [blame] | 25 | MCSection *getExplicitSectionGlobal(const GlobalObject *GO, |
| 26 | SectionKind Kind, |
Eric Christopher | 4367c7f | 2016-09-16 07:33:15 +0000 | [diff] [blame] | 27 | const TargetMachine &TM) const override; |
Krzysztof Parzyszek | 5de5910 | 2016-04-21 18:56:45 +0000 | [diff] [blame] | 28 | |
Peter Collingbourne | 6733564 | 2016-10-24 19:23:39 +0000 | [diff] [blame] | 29 | bool isGlobalInSmallSection(const GlobalObject *GO, |
| 30 | const TargetMachine &TM) const; |
Krzysztof Parzyszek | 5de5910 | 2016-04-21 18:56:45 +0000 | [diff] [blame] | 31 | |
| 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 Collingbourne | 6733564 | 2016-10-24 19:23:39 +0000 | [diff] [blame] | 43 | MCSection *selectSmallSectionForGlobal(const GlobalObject *GO, |
Eric Christopher | 4367c7f | 2016-09-16 07:33:15 +0000 | [diff] [blame] | 44 | SectionKind Kind, |
| 45 | const TargetMachine &TM) const; |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 46 | }; |
| 47 | |
| 48 | } // namespace llvm |
| 49 | |
| 50 | #endif |