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