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 | |
Krzysztof Parzyszek | 977a1fe | 2018-10-31 15:54:31 +0000 | [diff] [blame] | 32 | bool isSmallDataEnabled(const TargetMachine &TM) const; |
Krzysztof Parzyszek | 5de5910 | 2016-04-21 18:56:45 +0000 | [diff] [blame] | 33 | |
| 34 | unsigned getSmallDataSize() const; |
| 35 | |
Sumanth Gundapaneni | 8c5d595 | 2017-06-30 20:21:48 +0000 | [diff] [blame] | 36 | bool shouldPutJumpTableInFunctionSection(bool UsesLabelDifference, |
| 37 | const Function &F) const override; |
| 38 | |
Sumanth Gundapaneni | d5aa0f3 | 2017-07-18 15:31:37 +0000 | [diff] [blame] | 39 | const Function *getLutUsedFunction(const GlobalObject *GO) const; |
| 40 | |
Krzysztof Parzyszek | 5de5910 | 2016-04-21 18:56:45 +0000 | [diff] [blame] | 41 | private: |
| 42 | MCSectionELF *SmallDataSection; |
| 43 | MCSectionELF *SmallBSSSection; |
| 44 | |
| 45 | unsigned getSmallestAddressableSize(const Type *Ty, const GlobalValue *GV, |
| 46 | const TargetMachine &TM) const; |
| 47 | |
Peter Collingbourne | 6733564 | 2016-10-24 19:23:39 +0000 | [diff] [blame] | 48 | MCSection *selectSmallSectionForGlobal(const GlobalObject *GO, |
Eric Christopher | 4367c7f | 2016-09-16 07:33:15 +0000 | [diff] [blame] | 49 | SectionKind Kind, |
| 50 | const TargetMachine &TM) const; |
Sumanth Gundapaneni | d5aa0f3 | 2017-07-18 15:31:37 +0000 | [diff] [blame] | 51 | |
| 52 | MCSection *selectSectionForLookupTable(const GlobalObject *GO, |
| 53 | const TargetMachine &TM, |
| 54 | const Function *Fn) const; |
Tony Linthicum | 1213a7a | 2011-12-12 21:14:40 +0000 | [diff] [blame] | 55 | }; |
| 56 | |
| 57 | } // namespace llvm |
| 58 | |
| 59 | #endif |