diff options
author | Fangrui Song <i@maskray.me> | 2025-03-23 23:58:41 -0700 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2025-03-23 23:58:41 -0700 |
commit | 7e6d008023e0892558f75ae3606d0b62000a66d0 (patch) | |
tree | 67a76882f35918889d17209d6cbda2afe0eb82eb /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | |
parent | ddc62797c4fb30475bb2787101fc5b7acb641af9 (diff) | |
download | llvm-7e6d008023e0892558f75ae3606d0b62000a66d0.zip llvm-7e6d008023e0892558f75ae3606d0b62000a66d0.tar.gz llvm-7e6d008023e0892558f75ae3606d0b62000a66d0.tar.bz2 |
AsmPrinter: Remove unneeded lowerRelativeReference overrides
The function is only called by AsmPrinter, where there is a fallback
when lowerRelativeReference returns nullptr.
wasm and XCOFF could use the fallback code.
(lowerRelativeReference was introduced in 2016 (https://reviews.llvm.org/D17938)
for C++ relative vtables, but C++ relative vtables ended up using
dso_local_equivalent. llvm/test/MC/COFF/cross-section-relative.ll also
uses this.)
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index a6b5e2e..0e44acd 100644 --- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -2289,25 +2289,6 @@ bool TargetLoweringObjectFileWasm::shouldPutJumpTableInFunctionSection( return false; } -const MCExpr *TargetLoweringObjectFileWasm::lowerRelativeReference( - const GlobalValue *LHS, const GlobalValue *RHS, - const TargetMachine &TM) const { - // We may only use a PLT-relative relocation to refer to unnamed_addr - // functions. - if (!LHS->hasGlobalUnnamedAddr() || !LHS->getValueType()->isFunctionTy()) - return nullptr; - - // Basic correctness checks. - if (LHS->getType()->getPointerAddressSpace() != 0 || - RHS->getType()->getPointerAddressSpace() != 0 || LHS->isThreadLocal() || - RHS->isThreadLocal()) - return nullptr; - - return MCBinaryExpr::createSub( - MCSymbolRefExpr::create(TM.getSymbol(LHS), getContext()), - MCSymbolRefExpr::create(TM.getSymbol(RHS), getContext()), getContext()); -} - void TargetLoweringObjectFileWasm::InitializeWasm() { StaticCtorSection = getContext().getWasmSection(".init_array", SectionKind::getData()); @@ -2635,13 +2616,6 @@ MCSection *TargetLoweringObjectFileXCOFF::getStaticDtorSection( report_fatal_error("no static destructor section on AIX"); } -const MCExpr *TargetLoweringObjectFileXCOFF::lowerRelativeReference( - const GlobalValue *LHS, const GlobalValue *RHS, - const TargetMachine &TM) const { - /* Not implemented yet, but don't crash, return nullptr. */ - return nullptr; -} - XCOFF::StorageClass TargetLoweringObjectFileXCOFF::getStorageClassForGlobal(const GlobalValue *GV) { assert(!isa<GlobalIFunc>(GV) && "GlobalIFunc is not supported on AIX."); |