[all-commits] [llvm/llvm-project] edd819: [AIX] supporting the visibility attribute for aix ...

diggerlin via All-commits all-commits at lists.llvm.org
Tue Jun 9 13:15:45 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: edd819c7576b5183f0d9ef90c48bf903e22035d0
      https://github.com/llvm/llvm-project/commit/edd819c7576b5183f0d9ef90c48bf903e22035d0
  Author: diggerlin <digger.llvm at gmail.com>
  Date:   2020-06-09 (Tue, 09 Jun 2020)

  Changed paths:
    M llvm/include/llvm/BinaryFormat/XCOFF.h
    M llvm/include/llvm/CodeGen/AsmPrinter.h
    M llvm/include/llvm/MC/MCAsmInfo.h
    M llvm/include/llvm/MC/MCStreamer.h
    M llvm/include/llvm/MC/MCSymbolXCOFF.h
    M llvm/include/llvm/MC/MCXCOFFStreamer.h
    M llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
    M llvm/lib/MC/MCAsmInfoXCOFF.cpp
    M llvm/lib/MC/MCAsmStreamer.cpp
    M llvm/lib/MC/MCStreamer.cpp
    M llvm/lib/MC/MCXCOFFStreamer.cpp
    M llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp

  Log Message:
  -----------
  [AIX] supporting the visibility attribute for aix assembly

SUMMARY:

in the aix assembly , it do not have .hidden and .protected directive.
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.
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)++;
}
the visibility of .comm linkage do not support , we will have a separate patch for it.
we have the unsupported cases ("default" and "internal") , we will implement them in a a separate patch for it.

Reviewers: Jason Liu ,hubert.reinterpretcast,James Henderson

Differential Revision: https://reviews.llvm.org/D75866




More information about the All-commits mailing list