aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
diff options
context:
space:
mode:
authordiggerlin <digger.llvm@gmail.com>2020-03-26 15:46:52 -0400
committerdiggerlin <digger.llvm@gmail.com>2020-03-26 15:46:52 -0400
commitfdfe411e7c9a844e7465bbe443fb6d1d9dbc4539 (patch)
treef9bc241f5baaa49d6927f04513d668d60b8600e0 /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
parent856c99543693138b2365ff84b6ac6f31b0acf394 (diff)
downloadllvm-fdfe411e7c9a844e7465bbe443fb6d1d9dbc4539.zip
llvm-fdfe411e7c9a844e7465bbe443fb6d1d9dbc4539.tar.gz
llvm-fdfe411e7c9a844e7465bbe443fb6d1d9dbc4539.tar.bz2
[AIX] discard the label in the csect of function description and use qualname for linkage
SUMMARY: SUMMARY for a source file "test.c" void foo() {}; llc will generate assembly code as (assembly patch) .globl foo .globl .foo .csect foo[DS] foo: .long .foo .long TOC[TC0] .long 0 and symbol table as (xcoff object file) [4] m 0x00000004 .data 1 unamex foo [5] a4 0x0000000c 0 0 SD DS 0 0 [6] m 0x00000004 .data 1 extern foo [7] a4 0x00000004 0 0 LD DS 0 0 After first patch, the assembly will be as .globl foo[DS] # -- Begin function foo .globl .foo .align 2 .csect foo[DS] .long .foo .long TOC[TC0] .long 0 and symbol table will as [6] m 0x00000004 .data 1 extern foo [7] a4 0x00000004 0 0 DS DS 0 0 Change the code for the assembly path and xcoff objectfile patch for llc. Reviewers: Jason Liu Subscribers: wuzish, nemanjai, hiraditya Differential Revision: https://reviews.llvm.org/D76162
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index dedb673..cc54b41 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -2022,9 +2022,11 @@ XCOFF::StorageClass TargetLoweringObjectFileXCOFF::getStorageClassForGlobal(
}
MCSection *TargetLoweringObjectFileXCOFF::getSectionForFunctionDescriptor(
- const MCSymbol *FuncSym) const {
- return getContext().getXCOFFSection(FuncSym->getName(), XCOFF::XMC_DS,
- XCOFF::XTY_SD, XCOFF::C_HIDEXT,
+ const Function *F, const TargetMachine &TM) const {
+ SmallString<128> NameStr;
+ getNameWithPrefix(NameStr, F, TM);
+ return getContext().getXCOFFSection(NameStr, XCOFF::XMC_DS, XCOFF::XTY_SD,
+ getStorageClassForGlobal(F),
SectionKind::getData());
}