[PATCH] D156213: [XCOFF] Enable available_externally linkage for functions.
Esme Yi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 25 19:48:07 PDT 2023
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGe83b8a5e711a: [XCOFF] Enable available_externally linkage for functions. (authored by Esme).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D156213/new/
https://reviews.llvm.org/D156213
Files:
llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
llvm/test/CodeGen/PowerPC/aix-available-externally-linkage-fun.ll
Index: llvm/test/CodeGen/PowerPC/aix-available-externally-linkage-fun.ll
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/PowerPC/aix-available-externally-linkage-fun.ll
@@ -0,0 +1,51 @@
+; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \
+; RUN: -mattr=-altivec < %s | FileCheck %s
+
+; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr4 \
+; RUN: -mattr=-altivec < %s | FileCheck %s
+
+; RUN: llc -verify-machineinstrs -mtriple powerpc-ibm-aix-xcoff -mcpu=pwr4 \
+; RUN: -mattr=-altivec -filetype=obj -o %t.o < %s
+; RUN: llvm-readobj --symbols %t.o | FileCheck --check-prefix=OBJ %s
+
+; RUN: llc -verify-machineinstrs -mtriple powerpc64-ibm-aix-xcoff -mcpu=pwr4 \
+; RUN: -mattr=-altivec -filetype=obj -o %t64.o < %s
+; RUN: llvm-readobj --symbols %t64.o | FileCheck --check-prefix=OBJ %s
+
+define available_externally i32 @foo(i32 %a) {
+entry:
+ ret i32 %a
+}
+
+; CHECK: .extern .foo[PR]
+; CHECK: .extern foo[DS]
+
+; OBJ: Name: .foo
+; OBJ-NEXT: Value (RelocatableAddress): 0x0
+; OBJ-NEXT: Section: N_UNDEF
+; OBJ-NEXT: Type: 0x0
+; OBJ-NEXT: StorageClass: C_EXT (0x2)
+; OBJ-NEXT: NumberOfAuxEntries: 1
+; OBJ-NEXT: CSECT Auxiliary Entry {
+; OBJ-NEXT: Index: 2
+; OBJ-NEXT: SectionLen: 0
+; OBJ-NEXT: ParameterHashIndex: 0x0
+; OBJ-NEXT: TypeChkSectNum: 0x0
+; OBJ-NEXT: SymbolAlignmentLog2: 0
+; OBJ-NEXT: SymbolType: XTY_ER (0x0)
+; OBJ-NEXT: StorageMappingClass: XMC_PR (0x0)
+
+; OBJ: Name: foo
+; OBJ-NEXT: Value (RelocatableAddress): 0x0
+; OBJ-NEXT: Section: N_UNDEF
+; OBJ-NEXT: Type: 0x0
+; OBJ-NEXT: StorageClass: C_EXT (0x2)
+; OBJ-NEXT: NumberOfAuxEntries: 1
+; OBJ-NEXT: CSECT Auxiliary Entry {
+; OBJ-NEXT: Index: 4
+; OBJ-NEXT: SectionLen: 0
+; OBJ-NEXT: ParameterHashIndex: 0x0
+; OBJ-NEXT: TypeChkSectNum: 0x0
+; OBJ-NEXT: SymbolAlignmentLog2: 0
+; OBJ-NEXT: SymbolType: XTY_ER (0x0)
+; OBJ-NEXT: StorageMappingClass: XMC_DS (0xA)
Index: llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
===================================================================
--- llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -2628,12 +2628,12 @@
// function entry point csect instead. And for function delcarations, the
// undefined symbols gets treated as csect with XTY_ER property.
if (((TM.getFunctionSections() && !Func->hasSection()) ||
- Func->isDeclaration()) &&
+ Func->isDeclarationForLinker()) &&
isa<Function>(Func)) {
return getContext()
.getXCOFFSection(
NameStr, SectionKind::getText(),
- XCOFF::CsectProperties(XCOFF::XMC_PR, Func->isDeclaration()
+ XCOFF::CsectProperties(XCOFF::XMC_PR, Func->isDeclarationForLinker()
? XCOFF::XTY_ER
: XCOFF::XTY_SD))
->getQualNameSymbol();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156213.544184.patch
Type: text/x-patch
Size: 3020 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230726/73c2edfd/attachment.bin>
More information about the llvm-commits
mailing list