[all-commits] [llvm/llvm-project] 3933c4: [clang] Add cc1 option -fctor-dtor-return-this

Shu-Chun Weng via All-commits all-commits at lists.llvm.org
Mon Oct 3 14:28:36 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3933c43d9008bb1b151156da92827a109e7963b6
      https://github.com/llvm/llvm-project/commit/3933c43d9008bb1b151156da92827a109e7963b6
  Author: Shu-Chun Weng <scw at google.com>
  Date:   2022-10-03 (Mon, 03 Oct 2022)

  Changed paths:
    M clang/include/clang/Basic/CodeGenOptions.def
    M clang/include/clang/Driver/Options.td
    M clang/lib/CodeGen/CGCXXABI.h
    M clang/lib/CodeGen/ItaniumCXXABI.cpp
    M clang/test/CodeGenCXX/constructor-destructor-return-this.cpp

  Log Message:
  -----------
  [clang] Add cc1 option -fctor-dtor-return-this

This option forces constructors and non-deleting destructors to return
`this` pointer in C++ ABI (except for Microsoft ABI, on which this flag
has no effect).

This is similar to ARM32, Apple ARM64, or Fuchsia C++ ABI, but can be
applied to any target triple.

Differential Revision: https://reviews.llvm.org/D119209




More information about the All-commits mailing list