[PATCH] D119209: Implement -mctor_dtor_return_this ABI option.

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 28 21:45:36 PDT 2022


MaskRay added inline comments.


================
Comment at: clang/include/clang/Driver/Options.td:3471
   HelpText<"Set the deployment target to be the specified OS and OS version">;
+def mctor_dtor_return_this : Flag<["-"], "mctor-dtor-return-this">, Group<m_Group>, Flags<[CC1Option]>,
+  HelpText<"Change the Itanium C++ ABI to returning `this` pointer from constructors and non-deleting destructors">,
----------------
One idea is to make this a CC1 only option (`NoDriverOption`) so that it is clear this is internal only and not  recommended for general use.

For some ABI changing options we penalize the option name, e.g. `-fexperimental-relative-c++-abi-vtables`


================
Comment at: clang/lib/CodeGen/CGCXXABI.h:131
+         GD.getDtorType() != Dtor_Deleting)) {
+      return constructorsAndDestructorsReturnThis();
+    }
----------------
delete braces


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119209



More information about the cfe-commits mailing list