diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2016-10-24 19:23:39 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2016-10-24 19:23:39 +0000 |
commit | 6733564e5aff326bffb858fb0b2358905b792f24 (patch) | |
tree | 3aa98ff5a91ac560d2bbb54661df5bedd97e56d1 /llvm/lib/Target/PowerPC/PPCTargetObjectFile.cpp | |
parent | 87eea10711a610eee827258d510ef9a34dfab73a (diff) | |
download | bcm5719-llvm-6733564e5aff326bffb858fb0b2358905b792f24.tar.gz bcm5719-llvm-6733564e5aff326bffb858fb0b2358905b792f24.zip |
Target: Change various section classifiers in TargetLoweringObjectFile to take a GlobalObject.
These functions are about classifying a global which will actually be
emitted, so it does not make sense for them to take a GlobalValue which may
for example be an alias.
Change the Mach-O object writer and the Hexagon, Lanai and MIPS backends to
look through aliases before using TargetLoweringObjectFile interfaces. These
are functional changes but all appear to be bug fixes.
Differential Revision: https://reviews.llvm.org/D25917
llvm-svn: 285006
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCTargetObjectFile.cpp')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCTargetObjectFile.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCTargetObjectFile.cpp b/llvm/lib/Target/PowerPC/PPCTargetObjectFile.cpp index 870a4e3128a..a049dc3fda9 100644 --- a/llvm/lib/Target/PowerPC/PPCTargetObjectFile.cpp +++ b/llvm/lib/Target/PowerPC/PPCTargetObjectFile.cpp @@ -23,7 +23,7 @@ Initialize(MCContext &Ctx, const TargetMachine &TM) { } MCSection *PPC64LinuxTargetObjectFile::SelectSectionForGlobal( - const GlobalValue *GV, SectionKind Kind, const TargetMachine &TM) const { + const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const { // Here override ReadOnlySection to DataRelROSection for PPC64 SVR4 ABI // when we have a constant that contains global relocations. This is // necessary because of this ABI's handling of pointers to functions in @@ -39,13 +39,13 @@ MCSection *PPC64LinuxTargetObjectFile::SelectSectionForGlobal( // For more information, see the description of ELIMINATE_COPY_RELOCS in // GNU ld. if (Kind.isReadOnly()) { - const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV); + const auto *GVar = dyn_cast<GlobalVariable>(GO); if (GVar && GVar->isConstant() && GVar->getInitializer()->needsRelocation()) Kind = SectionKind::getReadOnlyWithRel(); } - return TargetLoweringObjectFileELF::SelectSectionForGlobal(GV, Kind, TM); + return TargetLoweringObjectFileELF::SelectSectionForGlobal(GO, Kind, TM); } const MCExpr *PPC64LinuxTargetObjectFile:: |