[PATCH] D74166: [AIX][Frontend] Static init implementation for AIX considering no priority

Xiangling Liao via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 12 12:54:58 PDT 2020


Xiangling_L marked 7 inline comments as done.
Xiangling_L added inline comments.


================
Comment at: clang/lib/CodeGen/CGDeclCXX.cpp:691
   AddGlobalDtor(Fn);
+  CXXGlobalDtors.clear();
 }
----------------
ZarkoCA wrote:
> I may be missing something but why do we need this now, as opposed to not needing it before? Why didn't we need to clear the CXXGlobalDtors after emitting the function function before?
No, you didn't miss anything here. I just followed what `EmitCXXGlobalInitFunc()` does, which is to clear the std::vecotr once we are certain it's useless.


================
Comment at: clang/lib/Sema/SemaDeclAttr.cpp:6898
   case ParsedAttr::AT_Constructor:
-    handleConstructorAttr(S, D, AL);
+    if (S.Context.getTargetInfo().getTriple().isOSAIX())
+      S.Diag(AL.getLoc(), diag::warn_attribute_type_not_supported) << AL << "";
----------------
aaron.ballman wrote:
> This change (and the others like it) should be done within Attr.td and not exposed here. You should make these attributes target-specific.
> 
> You should also update AttrDocs.td for these attributes to document that they're not supported on AIX.
Thanks for your comments. As I mentioned in the below testcase, those three attributes actually will be supported by the follow-up patches for AIX.  I will update them to `report_fatal_error` instead.


================
Comment at: clang/test/CodeGen/aix-priority-attribute.cpp:1-4
+// RUN: %clang_cc1 -triple powerpc-ibm-aix-xcoff -x c++ -emit-llvm < %s 2>&1 | \
+// RUN: FileCheck %s
+// RUN: %clang_cc1 -triple powerpc64-ibm-aix-xcoff -x c++ -emit-llvm < %s 2>&1 | \
+// RUN: FileCheck %s
----------------
aaron.ballman wrote:
> I think this test file should live in SemaCXX instead, as this is not testing the codegen behavior, but testing the semantic checking behavior.
Actually we will support those three attributes in the future, so the warning are placeholders waiting for the future upgrade where we do want to check the codegen results. 

I agree the warnings here are confusing, I will update them with report_fatal_error.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D74166





More information about the cfe-commits mailing list