diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2015-07-16 06:04:17 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2015-07-16 06:04:17 +0000 |
commit | 5c0fa58e91cffdc0b7a1024890533942876d5691 (patch) | |
tree | c8791793e9627ea490fb0d42f5e209ba808d5978 /llvm/lib/Target/Mips/MipsTargetObjectFile.cpp | |
parent | 1660cab341ab154e7b0b70eee132be3a646c3ff7 (diff) | |
download | llvm-5c0fa58e91cffdc0b7a1024890533942876d5691.zip llvm-5c0fa58e91cffdc0b7a1024890533942876d5691.tar.gz llvm-5c0fa58e91cffdc0b7a1024890533942876d5691.tar.bz2 |
Remove DataLayout from TargetLoweringObjectFile, redirect to Module
Summary:
This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.
Reviewers: echristo
Subscribers: yaron.keren, rafael, llvm-commits, jholewinski
Differential Revision: http://reviews.llvm.org/D11079
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 242385
Diffstat (limited to 'llvm/lib/Target/Mips/MipsTargetObjectFile.cpp')
-rw-r--r-- | llvm/lib/Target/Mips/MipsTargetObjectFile.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/Target/Mips/MipsTargetObjectFile.cpp b/llvm/lib/Target/Mips/MipsTargetObjectFile.cpp index 0f2db60..8c681ed 100644 --- a/llvm/lib/Target/Mips/MipsTargetObjectFile.cpp +++ b/llvm/lib/Target/Mips/MipsTargetObjectFile.cpp @@ -107,7 +107,8 @@ IsGlobalInSmallSectionImpl(const GlobalValue *GV, return false; Type *Ty = GV->getType()->getElementType(); - return IsInSmallSection(TM.getDataLayout()->getTypeAllocSize(Ty)); + return IsInSmallSection( + GV->getParent()->getDataLayout().getTypeAllocSize(Ty)); } MCSection * @@ -137,12 +138,12 @@ IsConstantInSmallSection(const Constant *CN, const TargetMachine &TM) const { CN->getType()))); } -MCSection * -MipsTargetObjectFile::getSectionForConstant(SectionKind Kind, - const Constant *C) const { +/// Return true if this constant should be placed into small data section. +MCSection *MipsTargetObjectFile::getSectionForConstant( + const DataLayout &DL, SectionKind Kind, const Constant *C) const { if (IsConstantInSmallSection(C, *TM)) return SmallDataSection; // Otherwise, we work the same as ELF. - return TargetLoweringObjectFileELF::getSectionForConstant(Kind, C); + return TargetLoweringObjectFileELF::getSectionForConstant(DL, Kind, C); } |