blob: e5423f9578a8ab199b6ae55be4a225f025064b56 [file] [log] [blame]
Akira Hatanakae2489122011-04-15 21:51:11 +00001//===-- llvm/Target/MipsTargetObjectFile.h - Mips Object Info ---*- C++ -*-===//
Chris Lattner68535f72009-08-13 06:28:06 +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//
Akira Hatanakae2489122011-04-15 21:51:11 +00008//===----------------------------------------------------------------------===//
Chris Lattner68535f72009-08-13 06:28:06 +00009
Benjamin Kramera7c40ef2014-08-13 16:26:38 +000010#ifndef LLVM_LIB_TARGET_MIPS_MIPSTARGETOBJECTFILE_H
11#define LLVM_LIB_TARGET_MIPS_MIPSTARGETOBJECTFILE_H
Chris Lattner68535f72009-08-13 06:28:06 +000012
Anton Korobeynikovab663a02010-02-15 22:37:53 +000013#include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
Chris Lattner68535f72009-08-13 06:28:06 +000014
15namespace llvm {
Eric Christopher948bdf92015-03-21 03:13:05 +000016class MipsTargetMachine;
Chris Lattner68535f72009-08-13 06:28:06 +000017 class MipsTargetObjectFile : public TargetLoweringObjectFileELF {
Rafael Espindola0709a7b2015-05-21 19:20:38 +000018 MCSection *SmallDataSection;
19 MCSection *SmallBSSSection;
Eric Christopher948bdf92015-03-21 03:13:05 +000020 const MipsTargetMachine *TM;
Peter Collingbourne67335642016-10-24 19:23:39 +000021
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 Lattner68535f72009-08-13 06:28:06 +000026 public:
Bruno Cardoso Lopesed874ef2011-03-04 17:51:39 +000027
Craig Topper73156022014-03-02 09:09:27 +000028 void Initialize(MCContext &Ctx, const TargetMachine &TM) override;
Chris Lattner68535f72009-08-13 06:28:06 +000029
Sasa Stankovicb38db1e2014-11-06 13:20:12 +000030 /// Return true if this global address should be placed into small data/bss
31 /// section.
Peter Collingbourne67335642016-10-24 19:23:39 +000032 bool IsGlobalInSmallSection(const GlobalObject *GO,
Bruno Cardoso Lopesed874ef2011-03-04 17:51:39 +000033 const TargetMachine &TM) const;
34
Peter Collingbourne67335642016-10-24 19:23:39 +000035 MCSection *SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind,
Rafael Espindola0709a7b2015-05-21 19:20:38 +000036 const TargetMachine &TM) const override;
Sasa Stankovicb38db1e2014-11-06 13:20:12 +000037
38 /// Return true if this constant should be placed into small data section.
Mehdi Aminibd7287e2015-07-16 06:11:10 +000039 bool IsConstantInSmallSection(const DataLayout &DL, const Constant *CN,
Sasa Stankovicb38db1e2014-11-06 13:20:12 +000040 const TargetMachine &TM) const;
41
Mehdi Amini5c0fa582015-07-16 06:04:17 +000042 MCSection *getSectionForConstant(const DataLayout &DL, SectionKind Kind,
David Majnemer78f46be2016-02-21 01:40:04 +000043 const Constant *C,
44 unsigned &Align) const override;
Chris Lattner68535f72009-08-13 06:28:06 +000045 };
46} // end namespace llvm
47
48#endif