[PATCH] D54344: [Clang][CodeGen][CXX]: Workaround __attribute((no_destroy)) crash/incorrect code generation.

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Nov 10 14:53:25 PST 2018

aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

LGTM aside from some small commenting nits. However, I leave it to @erik.pilkington to make the final sign-off.

Comment at: lib/CodeGen/CGDeclCXX.cpp:68
+  // Honor __attribute__((no_destroy)) and bail instead of attempting
+  // to emit a reference to a possibly non-existant destructor, which
+  // in turn can cause a crash. This will result in a global constructor
non-existant -> nonexistent

Comment at: lib/CodeGen/CGDeclCXX.cpp:72
+  // attribute. This also checks for -fno-c++-static-destructors and
+  // bails even if the attribute is not present. (D54344)
+  if (D.isNoDestroy(CGF.getContext()))
Drop the (D54344) from the comment.

  rC Clang


More information about the cfe-commits mailing list