[PATCH] D76932: [AIX] emit .extern and .weak directive linkage

Digger via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 27 09:05:23 PDT 2020


DiggerLin created this revision.
DiggerLin added reviewers: hubert.reinterpretcast, jasonliu, sfertile, daltenty.
Herald added subscribers: cfe-commits, kbarton, hiraditya, nemanjai.
Herald added a project: clang.
DiggerLin edited the summary of this revision.
Herald added a subscriber: wuzish.
DiggerLin edited the summary of this revision.
DiggerLin edited the summary of this revision.

1. emit .extern  and .weak directive linkage
2. delete -u option for as in clang.

the c source code for test case  aix-extern-weak.ll as 
bash> cat test_extern_weak_all.c

extern int bar_extern(int* ip);
extern int bar_ref();
extern int b_e;

__attribute__ ((weak)) void foo_weak(){
}

__attribute__ ((weak)) void foo_ref_weak(){
}

extern __attribute__ ((weak)) void foo_ext_weak(void);

void foo(){ }

int (*bar_p)() = bar_ref;
void (*foo_weak_p)() = foo_ref_weak;
void (*foo_ext_weak_p)() = foo_ext_weak;

int __attribute__ ((weak)) b;
int main() {

  bar_extern(&b);
  foo();
  bar_p(&b_e);
  foo_weak_p();
  foo_ext_weak_p();
  foo_weak();

}


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D76932

Files:
  clang/lib/Driver/ToolChains/AIX.cpp
  llvm/include/llvm/CodeGen/AsmPrinter.h
  llvm/include/llvm/MC/MCAsmInfo.h
  llvm/include/llvm/MC/MCDirectives.h
  llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
  llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
  llvm/lib/MC/MCAsmInfoXCOFF.cpp
  llvm/lib/MC/MCAsmStreamer.cpp
  llvm/lib/MC/MCXCOFFStreamer.cpp
  llvm/lib/MC/XCOFFObjectWriter.cpp
  llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
  llvm/test/CodeGen/PowerPC/aix-extern-weak.ll
  llvm/test/CodeGen/PowerPC/aix-reference-func-addr-const.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76932.253131.patch
Type: text/x-patch
Size: 35585 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200327/0ea11b01/attachment-0001.bin>


More information about the cfe-commits mailing list