Akira Hatanaka | e248912 | 2011-04-15 21:51:11 +0000 | [diff] [blame] | 1 | //===-- llvm/Target/MipsTargetObjectFile.h - Mips Object Info ---*- C++ -*-===// |
Chris Lattner | 68535f7 | 2009-08-13 06:28:06 +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 | // |
Akira Hatanaka | e248912 | 2011-04-15 21:51:11 +0000 | [diff] [blame] | 8 | //===----------------------------------------------------------------------===// |
Chris Lattner | 68535f7 | 2009-08-13 06:28:06 +0000 | [diff] [blame] | 9 | |
Benjamin Kramer | a7c40ef | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 10 | #ifndef LLVM_LIB_TARGET_MIPS_MIPSTARGETOBJECTFILE_H |
| 11 | #define LLVM_LIB_TARGET_MIPS_MIPSTARGETOBJECTFILE_H |
Chris Lattner | 68535f7 | 2009-08-13 06:28:06 +0000 | [diff] [blame] | 12 | |
Anton Korobeynikov | ab663a0 | 2010-02-15 22:37:53 +0000 | [diff] [blame] | 13 | #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h" |
Chris Lattner | 68535f7 | 2009-08-13 06:28:06 +0000 | [diff] [blame] | 14 | |
| 15 | namespace llvm { |
Eric Christopher | 948bdf9 | 2015-03-21 03:13:05 +0000 | [diff] [blame] | 16 | class MipsTargetMachine; |
Chris Lattner | 68535f7 | 2009-08-13 06:28:06 +0000 | [diff] [blame] | 17 | class MipsTargetObjectFile : public TargetLoweringObjectFileELF { |
Rafael Espindola | 0709a7b | 2015-05-21 19:20:38 +0000 | [diff] [blame] | 18 | MCSection *SmallDataSection; |
| 19 | MCSection *SmallBSSSection; |
Eric Christopher | 948bdf9 | 2015-03-21 03:13:05 +0000 | [diff] [blame] | 20 | const MipsTargetMachine *TM; |
Peter Collingbourne | 6733564 | 2016-10-24 19:23:39 +0000 | [diff] [blame] | 21 | |
| 22 | bool IsGlobalInSmallSection(const GlobalObject *GO, const TargetMachine &TM, |
| 23 | SectionKind Kind) const; |
| 24 | bool IsGlobalInSmallSectionImpl(const GlobalObject *GO, |
| 25 | const TargetMachine &TM) const; |
Chris Lattner | 68535f7 | 2009-08-13 06:28:06 +0000 | [diff] [blame] | 26 | public: |
Bruno Cardoso Lopes | ed874ef | 2011-03-04 17:51:39 +0000 | [diff] [blame] | 27 | |
Craig Topper | 7315602 | 2014-03-02 09:09:27 +0000 | [diff] [blame] | 28 | void Initialize(MCContext &Ctx, const TargetMachine &TM) override; |
Chris Lattner | 68535f7 | 2009-08-13 06:28:06 +0000 | [diff] [blame] | 29 | |
Sasa Stankovic | b38db1e | 2014-11-06 13:20:12 +0000 | [diff] [blame] | 30 | /// Return true if this global address should be placed into small data/bss |
| 31 | /// section. |
Peter Collingbourne | 6733564 | 2016-10-24 19:23:39 +0000 | [diff] [blame] | 32 | bool IsGlobalInSmallSection(const GlobalObject *GO, |
Bruno Cardoso Lopes | ed874ef | 2011-03-04 17:51:39 +0000 | [diff] [blame] | 33 | const TargetMachine &TM) const; |
| 34 | |
Peter Collingbourne | 6733564 | 2016-10-24 19:23:39 +0000 | [diff] [blame] | 35 | MCSection *SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind, |
Rafael Espindola | 0709a7b | 2015-05-21 19:20:38 +0000 | [diff] [blame] | 36 | const TargetMachine &TM) const override; |
Sasa Stankovic | b38db1e | 2014-11-06 13:20:12 +0000 | [diff] [blame] | 37 | |
| 38 | /// Return true if this constant should be placed into small data section. |
Mehdi Amini | bd7287e | 2015-07-16 06:11:10 +0000 | [diff] [blame] | 39 | bool IsConstantInSmallSection(const DataLayout &DL, const Constant *CN, |
Sasa Stankovic | b38db1e | 2014-11-06 13:20:12 +0000 | [diff] [blame] | 40 | const TargetMachine &TM) const; |
| 41 | |
Mehdi Amini | 5c0fa58 | 2015-07-16 06:04:17 +0000 | [diff] [blame] | 42 | MCSection *getSectionForConstant(const DataLayout &DL, SectionKind Kind, |
David Majnemer | 78f46be | 2016-02-21 01:40:04 +0000 | [diff] [blame] | 43 | const Constant *C, |
| 44 | unsigned &Align) const override; |
Chris Lattner | 68535f7 | 2009-08-13 06:28:06 +0000 | [diff] [blame] | 45 | }; |
| 46 | } // end namespace llvm |
| 47 | |
| 48 | #endif |