2011-04-15 23:51:11 +02:00
|
|
|
//===-- llvm/Target/MipsTargetObjectFile.h - Mips Object Info ---*- C++ -*-===//
|
2009-08-13 08:28:06 +02:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
2011-04-15 23:51:11 +02:00
|
|
|
//===----------------------------------------------------------------------===//
|
2009-08-13 08:28:06 +02:00
|
|
|
|
2014-08-13 18:26:38 +02:00
|
|
|
#ifndef LLVM_LIB_TARGET_MIPS_MIPSTARGETOBJECTFILE_H
|
|
|
|
#define LLVM_LIB_TARGET_MIPS_MIPSTARGETOBJECTFILE_H
|
2009-08-13 08:28:06 +02:00
|
|
|
|
2010-02-15 23:37:53 +01:00
|
|
|
#include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
|
2009-08-13 08:28:06 +02:00
|
|
|
|
|
|
|
namespace llvm {
|
2015-03-21 04:13:05 +01:00
|
|
|
class MipsTargetMachine;
|
2009-08-13 08:28:06 +02:00
|
|
|
class MipsTargetObjectFile : public TargetLoweringObjectFileELF {
|
2015-05-21 21:20:38 +02:00
|
|
|
MCSection *SmallDataSection;
|
|
|
|
MCSection *SmallBSSSection;
|
2015-03-21 04:13:05 +01:00
|
|
|
const MipsTargetMachine *TM;
|
2016-10-24 21:23:39 +02:00
|
|
|
|
|
|
|
bool IsGlobalInSmallSection(const GlobalObject *GO, const TargetMachine &TM,
|
|
|
|
SectionKind Kind) const;
|
|
|
|
bool IsGlobalInSmallSectionImpl(const GlobalObject *GO,
|
|
|
|
const TargetMachine &TM) const;
|
2009-08-13 08:28:06 +02:00
|
|
|
public:
|
2011-03-04 18:51:39 +01:00
|
|
|
|
2014-03-02 10:09:27 +01:00
|
|
|
void Initialize(MCContext &Ctx, const TargetMachine &TM) override;
|
2009-08-13 08:28:06 +02:00
|
|
|
|
2014-11-06 14:20:12 +01:00
|
|
|
/// Return true if this global address should be placed into small data/bss
|
|
|
|
/// section.
|
2016-10-24 21:23:39 +02:00
|
|
|
bool IsGlobalInSmallSection(const GlobalObject *GO,
|
2011-03-04 18:51:39 +01:00
|
|
|
const TargetMachine &TM) const;
|
|
|
|
|
2016-10-24 21:23:39 +02:00
|
|
|
MCSection *SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind,
|
2015-05-21 21:20:38 +02:00
|
|
|
const TargetMachine &TM) const override;
|
2014-11-06 14:20:12 +01:00
|
|
|
|
|
|
|
/// Return true if this constant should be placed into small data section.
|
2015-07-16 08:11:10 +02:00
|
|
|
bool IsConstantInSmallSection(const DataLayout &DL, const Constant *CN,
|
2014-11-06 14:20:12 +01:00
|
|
|
const TargetMachine &TM) const;
|
|
|
|
|
2015-07-16 08:04:17 +02:00
|
|
|
MCSection *getSectionForConstant(const DataLayout &DL, SectionKind Kind,
|
2016-02-21 02:40:04 +01:00
|
|
|
const Constant *C,
|
|
|
|
unsigned &Align) const override;
|
2009-08-13 08:28:06 +02:00
|
|
|
};
|
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|