[PATCH] D83702: [AIX]Generate debug info for static init related functions

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 13 16:35:56 PDT 2020


dblaikie added inline comments.


================
Comment at: clang/lib/CodeGen/CGDeclCXX.cpp:248-250
   CGF.StartFunction(GlobalDecl(&VD, DynamicInitKind::AtExit),
-                    CGM.getContext().VoidTy, fn, FI, FunctionArgList());
+                    CGM.getContext().VoidTy, fn, FI, FunctionArgList(),
+                    VD.getLocation(), VD.getInit()->getExprLoc());
----------------
Any ideas why this is only showing up for AIX & not other targets, given this code looks to be generic, not AIX-specific?


================
Comment at: clang/test/CodeGenCXX/aix-static-init-debug-info.cpp:9-19
+int a = 0;
+
+class X {
+public:
+  X() {
+    a = 1;
+  }
----------------
This could probably be simplified to:
```
struct X {
  X();
  ~X();
};
```

This would still produce a global ctor and dtor without the superfluous variable, etc.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83702





More information about the cfe-commits mailing list