blob: 3a2b298db329fedcfd756b6b0ac4fd9ce96d9e24 [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 {
16
17 class MipsTargetObjectFile : public TargetLoweringObjectFileELF {
18 const MCSection *SmallDataSection;
19 const MCSection *SmallBSSSection;
Sasa Stankovicb38db1e2014-11-06 13:20:12 +000020 const TargetMachine *TM;
Chris Lattner68535f72009-08-13 06:28:06 +000021 public:
Bruno Cardoso Lopesed874ef2011-03-04 17:51:39 +000022
Craig Topper73156022014-03-02 09:09:27 +000023 void Initialize(MCContext &Ctx, const TargetMachine &TM) override;
Chris Lattner68535f72009-08-13 06:28:06 +000024
Sasa Stankovicb38db1e2014-11-06 13:20:12 +000025 /// Return true if this global address should be placed into small data/bss
26 /// section.
27 bool IsGlobalInSmallSection(const GlobalValue *GV, const TargetMachine &TM,
28 SectionKind Kind) const;
Chris Lattner68535f72009-08-13 06:28:06 +000029 bool IsGlobalInSmallSection(const GlobalValue *GV,
Bruno Cardoso Lopesed874ef2011-03-04 17:51:39 +000030 const TargetMachine &TM) const;
Sasa Stankovicb38db1e2014-11-06 13:20:12 +000031 bool IsGlobalInSmallSectionImpl(const GlobalValue *GV,
32 const TargetMachine &TM) const;
Bruno Cardoso Lopesed874ef2011-03-04 17:51:39 +000033
Chris Lattner68535f72009-08-13 06:28:06 +000034 const MCSection *SelectSectionForGlobal(const GlobalValue *GV,
Craig Topper73156022014-03-02 09:09:27 +000035 SectionKind Kind, Mangler &Mang,
36 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.
39 bool IsConstantInSmallSection(const Constant *CN,
40 const TargetMachine &TM) const;
41
42 const MCSection *getSectionForConstant(SectionKind Kind,
43 const Constant *C) const override;
Chris Lattner68535f72009-08-13 06:28:06 +000044 };
45} // end namespace llvm
46
47#endif