diff options
author | Sasa Stankovic <Sasa.Stankovic@imgtec.com> | 2014-11-06 13:20:12 +0000 |
---|---|---|
committer | Sasa Stankovic <Sasa.Stankovic@imgtec.com> | 2014-11-06 13:20:12 +0000 |
commit | b38db1eff84cb954a59007ad63bfe3bd1a749fb7 (patch) | |
tree | c83cdef37f6977c24e2231e983544e2c2e43e0ec /llvm/lib/Target/Mips/MipsTargetObjectFile.h | |
parent | 9760a44d1a3480ef17bdb052f86ee33bde830116 (diff) | |
download | llvm-b38db1eff84cb954a59007ad63bfe3bd1a749fb7.zip llvm-b38db1eff84cb954a59007ad63bfe3bd1a749fb7.tar.gz llvm-b38db1eff84cb954a59007ad63bfe3bd1a749fb7.tar.bz2 |
[mips] Add the following MIPS options that control gp-relative addressing of
small data items: -mgpopt, -mlocal-sdata, -mextern-sdata. Implement gp-relative
addressing for constants.
Differential Revision: http://reviews.llvm.org/D4903
llvm-svn: 221450
Diffstat (limited to 'llvm/lib/Target/Mips/MipsTargetObjectFile.h')
-rw-r--r-- | llvm/lib/Target/Mips/MipsTargetObjectFile.h | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/llvm/lib/Target/Mips/MipsTargetObjectFile.h b/llvm/lib/Target/Mips/MipsTargetObjectFile.h index 9bc9357..3a2b298 100644 --- a/llvm/lib/Target/Mips/MipsTargetObjectFile.h +++ b/llvm/lib/Target/Mips/MipsTargetObjectFile.h @@ -17,21 +17,30 @@ namespace llvm { class MipsTargetObjectFile : public TargetLoweringObjectFileELF { const MCSection *SmallDataSection; const MCSection *SmallBSSSection; + const TargetMachine *TM; public: void Initialize(MCContext &Ctx, const TargetMachine &TM) override; - - /// IsGlobalInSmallSection - 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; + /// 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; bool IsGlobalInSmallSection(const GlobalValue *GV, const TargetMachine &TM) const; + bool IsGlobalInSmallSectionImpl(const GlobalValue *GV, + const TargetMachine &TM) const; const MCSection *SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind, Mangler &Mang, const TargetMachine &TM) const override; + + /// Return true if this constant should be placed into small data section. + bool IsConstantInSmallSection(const Constant *CN, + const TargetMachine &TM) const; + + const MCSection *getSectionForConstant(SectionKind Kind, + const Constant *C) const override; }; } // end namespace llvm |