[PATCH] D125095: [Clang][AIX] Add .ref in frontend for AIX XCOFF to support `-bcdtors:csect` linker option

ChenZheng via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 4 23:42:57 PDT 2022


shchenz added a comment.

Sorry, I am really not familiar with these FE stuffs. Need approval from other reviewers who know more about this part.



================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:522
   EmitCXXThreadLocalInitFunc();
+  if (getTriple().isOSAIX()) {
+    genAssocMeta();
----------------
Seems this dos not follow other functions call's style. Can we call a function like `EmitAssociatedMetadata()` here and do the clean up (`cleanupAssoc()` may not be needed) in the `EmitAssociatedMetadata()`? 


================
Comment at: clang/test/CodeGen/PowerPC/aix-init-ref-null.cpp:2
+// RUN: %clang_cc1 -triple powerpc64-ibm-aix-xcoff -emit-llvm -O3 -x c++ \
+// RUN:     -debug-info-kind=limited < %s | \
+// RUN:   FileCheck %s
----------------
is `-debug-info-kind=limited` or `-O3` necessary in this test? Same as other new added cases.


================
Comment at: clang/test/CodeGen/PowerPC/aix-ref-tls_init.cpp:10
+// CHECK: @r = thread_local global ptr null, align [[ALIGN:[0-9]+]], !dbg ![[DBG0:[0-9]+]], !associated ![[ASSOC0:[0-9]+]]
+// CHECK: ![[ASSOC0]] = !{ptr @__tls_init}
----------------
Not sure if this is right or not. XLC on AIX seems refer to `__tls_get_addr` instead  of `__tls_init`...


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125095/new/

https://reviews.llvm.org/D125095



More information about the cfe-commits mailing list