aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2020-12-05 00:42:07 -0800
committerFangrui Song <i@maskray.me>2020-12-05 00:42:07 -0800
commit1ab9327d1c01645806394faa648f65e947b65177 (patch)
treeee41f2884dc1f54c50a954d3fbcf20f21823dd3a /clang/lib/CodeGen/CodeGenModule.cpp
parent2ec43a7b2276673c5556e40c954b1874ee5ec072 (diff)
downloadllvm-1ab9327d1c01645806394faa648f65e947b65177.zip
llvm-1ab9327d1c01645806394faa648f65e947b65177.tar.gz
llvm-1ab9327d1c01645806394faa648f65e947b65177.tar.bz2
[TargetMachine][CodeGenModule] Delete unneeded ppc32 special case from shouldAssumeDSOLocal
PPCMCInstLower does not actually call shouldAssumeDSOLocal for ppc32 so this is dead. Actually Clang ppc32 does produce a pair of absolute relocations which match GCC. This also fixes a comment (R_PPC_COPY and R_PPC64_COPY do exist).
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index ce5fb94..0bb9c91 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -967,10 +967,8 @@ static bool shouldAssumeDSOLocal(const CodeGenModule &CGM,
if (RM == llvm::Reloc::PIC_ && GV->hasExternalWeakLinkage())
return false;
- // PPC has no copy relocations and cannot use a plt entry as a symbol address.
- llvm::Triple::ArchType Arch = TT.getArch();
- if (Arch == llvm::Triple::ppc || Arch == llvm::Triple::ppc64 ||
- Arch == llvm::Triple::ppc64le)
+ // PowerPC64 prefers TOC indirection to avoid copy relocations.
+ if (TT.isPPC64())
return false;
// If we can use copy relocations we can assume it is local.