[PATCH] D75866: [AIX] supporting the visibility attribute for aix assembly

Digger via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 9 12:25:21 PDT 2020


DiggerLin created this revision.
DiggerLin added reviewers: hubert.reinterpretcast, daltenty, jasonliu, sfertile.
Herald added subscribers: llvm-commits, kbarton, hiraditya, nemanjai.
Herald added a project: LLVM.
DiggerLin retitled this revision from "[AIX] supporting the visibility attribute for XCOFF assembly" to "[AIX] supporting the visibility attribute for aix assembly".
Herald added a subscriber: wuzish.

1. in the aix assembly , it do not have .hidden and .protected directive.
2. in current llvm. if a function or a variable which has visibility attribute,  it  will generate something like the .hidden or .protected , it can not recognize by aix as.
3. in aix assembly, the visibility attribute are support in the pseudo-op like

.extern	Name [ , Visibility ]
.globl	Name [, Visibility ]
.weak       Name [, Visibility ]

in this patch, we implement the visibility attribute for the global variable, function or extern function .

for example.
extern __attribute__ ((visibility ("hidden"))) int

  bar(int* ip);

__attribute__ ((visibility ("hidden"))) int b = 0;
__attribute__ ((visibility ("hidden"))) int

  foo(int* ip){
   return (*ip)++;

}


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D75866

Files:
  llvm/include/llvm/CodeGen/AsmPrinter.h
  llvm/include/llvm/MC/MCAsmInfo.h
  llvm/include/llvm/MC/MCDirectives.h
  llvm/include/llvm/MC/MCStreamer.h
  llvm/include/llvm/MC/MCXCOFFStreamer.h
  llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
  llvm/lib/MC/MCAsmInfoXCOFF.cpp
  llvm/lib/MC/MCAsmStreamer.cpp
  llvm/lib/MC/MCStreamer.cpp
  llvm/lib/MC/MCXCOFFStreamer.cpp
  llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
  llvm/lib/Target/PowerPC/PPCISelLowering.cpp
  llvm/test/CodeGen/PowerPC/aix-xcoff-hidden.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75866.249179.patch
Type: text/x-patch
Size: 26933 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200309/1369c0cd/attachment.bin>


More information about the llvm-commits mailing list