llvmorg-github-actions[bot] wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Erich Keane (erichkeane)

<details>
<summary>Changes</summary>

This is a blocking feature for a few of the ABIs, plus is a command line option 
for existing itanium ABIs.  This patch fills in the handful of "NYI" spots.

The real 'interesting' part of this is the tests.  This was well-tested in the 
CodeGenCXX classic codegen test, so this patch enables those of which can be 
enabled trivially (or with minor SSA name removals).

SOME of those run-lines are not yet converted because they have unsupported 
platforms in their RUN lines, but we intend to convert those eventually.

FIXED since revert: The test wasn't updated for a different patch that I wrote 
that changed how vtable lookups happened.  Woops!

---

Patch is 29.79 KiB, truncated to 20.00 KiB below, full version: 
https://github.com/llvm/llvm-project/pull/242922.diff


7 Files Affected:

- (modified) clang/lib/CIR/CodeGen/CIRGenCXXABI.h (+11-1) 
- (modified) clang/lib/CIR/CodeGen/CIRGenCall.cpp (+9-7) 
- (modified) clang/lib/CIR/CodeGen/CIRGenFunction.cpp (+1-1) 
- (modified) clang/lib/CIR/CodeGen/CIRGenItaniumCXXABI.cpp (+3-4) 
- (modified) clang/lib/CIR/CodeGen/CIRGenModule.cpp (+9) 
- (added) clang/test/CIR/CodeGen/constructor-destructor-return-this.cpp (+145) 
- (modified) clang/test/CodeGenCXX/constructor-destructor-return-this.cpp 
(+96-93) 


``````````diff
diff --git a/clang/lib/CIR/CodeGen/CIRGenCXXABI.h 
b/clang/lib/CIR/CodeGen/CIRGenCXXABI.h
index 733b6dcef13875..28868817452d13 100644
--- a/clang/lib/CIR/CodeGen/CIRGenCXXABI.h
+++ b/clang/lib/CIR/CodeGen/CIRGenCXXABI.h
@@ -31,6 +31,10 @@ class CIRGenCXXABI {
 
   virtual bool requiresArrayCookie(const CXXNewExpr *e);
 
+  virtual bool constructorsAndDestructorsReturnThis() const {
+    return cgm.getCodeGenOpts().CtorDtorReturnThis;
+  }
+
 public:
   // TODO(cir): make this protected when target-specific CIRGenCXXABIs are
   // implemented.
@@ -325,7 +329,13 @@ class CIRGenCXXABI {
   ///
   /// There currently is no way to indicate if a destructor returns 'this' when
   /// called virtually, and CIR generation does not support this case.
-  virtual bool hasThisReturn(clang::GlobalDecl gd) const { return false; }
+  virtual bool hasThisReturn(clang::GlobalDecl gd) const {
+    if (isa<CXXConstructorDecl>(gd.getDecl()) ||
+        (isa<CXXDestructorDecl>(gd.getDecl()) &&
+         gd.getDtorType() != Dtor_Deleting))
+      return constructorsAndDestructorsReturnThis();
+    return false;
+  }
 
   virtual bool hasMostDerivedReturn(clang::GlobalDecl gd) const {
     return false;
diff --git a/clang/lib/CIR/CodeGen/CIRGenCall.cpp 
b/clang/lib/CIR/CodeGen/CIRGenCall.cpp
index 22a7f909e9730a..87c53ef8dfb94a 100644
--- a/clang/lib/CIR/CodeGen/CIRGenCall.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenCall.cpp
@@ -913,9 +913,6 @@ CIRGenTypes::arrangeCXXStructorDeclaration(GlobalDecl gd) {
                                ? astContext.VoidPtrTy
                                : astContext.VoidTy;
 
-  assert(!theCXXABI.hasThisReturn(gd) &&
-         "Please send PR with a test and remove this");
-
   assert(!cir::MissingFeatures::opCallCIRGenFuncInfoExtParamInfo());
   assert(!cir::MissingFeatures::opCallFnInfoOpts());
 
@@ -1051,13 +1048,18 @@ const CIRGenFunctionInfo 
&CIRGenTypes::arrangeCXXConstructorCall(
                               : RequiredArgs::All;
 
   GlobalDecl gd(d, ctorKind);
-  if (theCXXABI.hasThisReturn(gd))
-    cgm.errorNYI(d->getSourceRange(),
-                 "arrangeCXXConstructorCall: hasThisReturn");
+
+  // TODO: hasMostDerivedReturn isn't implemented or tested yet, but the below
+  // init of 'resultType' should be enough once it is thoroughly
+  // tested/implemented everywhere else.
   if (theCXXABI.hasMostDerivedReturn(gd))
     cgm.errorNYI(d->getSourceRange(),
                  "arrangeCXXConstructorCall: hasMostDerivedReturn");
-  CanQualType resultType = astContext.VoidTy;
+
+  CanQualType resultType = theCXXABI.hasThisReturn(gd) ? argTypes.front()
+                           : theCXXABI.hasMostDerivedReturn(gd)
+                               ? astContext.VoidPtrTy
+                               : astContext.VoidTy;
 
   assert(!cir::MissingFeatures::opCallFnInfoOpts());
   assert(!cir::MissingFeatures::opCallCIRGenFuncInfoExtParamInfo());
diff --git a/clang/lib/CIR/CodeGen/CIRGenFunction.cpp 
b/clang/lib/CIR/CodeGen/CIRGenFunction.cpp
index b48664ed9c6796..23fbd963ef7864 100644
--- a/clang/lib/CIR/CodeGen/CIRGenFunction.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenFunction.cpp
@@ -1109,7 +1109,7 @@ clang::QualType 
CIRGenFunction::buildFunctionArgList(clang::GlobalDecl gd,
   const auto *md = dyn_cast<CXXMethodDecl>(fd);
   if (md && md->isImplicitObjectMemberFunction()) {
     if (cgm.getCXXABI().hasThisReturn(gd))
-      cgm.errorNYI(fd->getSourceRange(), "this return");
+      retTy = md->getThisType();
     else if (cgm.getCXXABI().hasMostDerivedReturn(gd))
       cgm.errorNYI(fd->getSourceRange(), "most derived return");
     cgm.getCXXABI().buildThisParam(*this, args);
diff --git a/clang/lib/CIR/CodeGen/CIRGenItaniumCXXABI.cpp 
b/clang/lib/CIR/CodeGen/CIRGenItaniumCXXABI.cpp
index cea4bae77be106..c4798ebc2a50a5 100644
--- a/clang/lib/CIR/CodeGen/CIRGenItaniumCXXABI.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenItaniumCXXABI.cpp
@@ -268,10 +268,9 @@ void 
CIRGenItaniumCXXABI::emitInstanceFunctionProlog(SourceLocation loc,
   /// 1) getThisValue is currently protected
   /// 2) in theory, an ABI could implement 'this' returns some other way;
   ///    HasThisReturn only specifies a contract, not the implementation
-  if (hasThisReturn(cgf.curGD)) {
-    cgf.cgm.errorNYI(cgf.curFuncDecl->getLocation(),
-                     "emitInstanceFunctionProlog: hasThisReturn");
-  }
+  if (hasThisReturn(cgf.curGD))
+    cgf.getBuilder().createStore(cgf.getLoc(loc), cgf.cxxabiThisValue,
+                                 cgf.returnValue);
 }
 
 CIRGenCXXABI::AddedStructorArgCounts
diff --git a/clang/lib/CIR/CodeGen/CIRGenModule.cpp 
b/clang/lib/CIR/CodeGen/CIRGenModule.cpp
index 219822f2d631f8..0b832e140ee6d1 100644
--- a/clang/lib/CIR/CodeGen/CIRGenModule.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenModule.cpp
@@ -16,6 +16,7 @@
 #include "CIRGenConstantEmitter.h"
 #include "CIRGenFunction.h"
 
+#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
 #include "mlir/Dialect/OpenMP/Utils/Utils.h"
 #include "mlir/IR/SymbolTable.h"
 #include "clang/AST/ASTContext.h"
@@ -3481,6 +3482,14 @@ void CIRGenModule::setFunctionAttributes(GlobalDecl 
globalDecl,
                              getTypes().arrangeGlobalDeclaration(globalDecl),
                              func, isThunk);
 
+  // Add the Returned attribute for "this", except for iOS 5 and earlier
+  // where substantial code, including the libstdc++ dylib, was compiled with
+  // GCC and does not actually return "this".
+  if (!isThunk && getCXXABI().hasThisReturn(globalDecl) &&
+      !(getTriple().isiOS() && getTriple().isOSVersionLT(6)))
+    func.setArgAttr(0, mlir::LLVM::LLVMDialect::getReturnedAttrName(),
+                    mlir::UnitAttr::get(&getMLIRContext()));
+
   if (!isIncompleteFunction && func.isDeclaration())
     getTargetCIRGenInfo().setTargetAttributes(funcDecl, func, *this);
 
diff --git a/clang/test/CIR/CodeGen/constructor-destructor-return-this.cpp 
b/clang/test/CIR/CodeGen/constructor-destructor-return-this.cpp
new file mode 100644
index 00000000000000..01aa58e521ab87
--- /dev/null
+++ b/clang/test/CIR/CodeGen/constructor-destructor-return-this.cpp
@@ -0,0 +1,145 @@
+// RUN: %clang_cc1 %s -fclangir -emit-cir -o - 
-triple=aarch64-unknown-linux-gnu -fctor-dtor-return-this 
-Wno-inaccessible-base | FileCheck --check-prefix=CIRRET %s
+// RUN: %clang_cc1 %s -fclangir -emit-cir -o - -triple=i686-unknown-linux-gnu 
-fctor-dtor-return-this -Wno-inaccessible-base | FileCheck 
--check-prefix=CIRRET %s
+// RUN: %clang_cc1 %s -fclangir -emit-cir -o - 
-triple=x86_64-unknown-linux-gnu -Wno-inaccessible-base | FileCheck 
--check-prefix=CIRGEN %s
+// Make sure we attach the 'returned' attribute to the 'this' parameter of
+// constructors and destructors which return this (and only these cases)
+
+class A {
+public:
+  A();
+  virtual ~A();
+
+private:
+  int x_;
+};
+
+class B : public A {
+public:
+  B(int *i);
+  virtual ~B();
+
+private:
+  int *i_;
+};
+
+B::B(int *i) : i_(i) { }
+B::~B() { }
+
+
+// CIRRET-LABEL: cir.func {{.*}} @_ZN1BC2EPi(
+// CIRRET-SAME:    %[[THIS_ARG:[^:]*]]: !cir.ptr<!rec_B> 
{{{[^}]*}}llvm.returned{{[^}]*}}}
+// CIRRET-SAME:    -> (!cir.ptr<!rec_B> {llvm.noundef})
+// CIRRET:         %[[RETVAL:.*]] = cir.alloca "__retval"
+// CIRRET:         %[[THIS_ADDR:.*]] = cir.alloca "this"
+// CIRRET:         cir.store %[[THIS_ARG]], %[[THIS_ADDR]]
+// CIRRET:         %[[THIS:.*]] = cir.load %[[THIS_ADDR]]
+// CIRRET-NEXT:    cir.store {{.*}}%[[THIS]], %[[RETVAL]]
+// CIRRET:         cir.call @_ZN1AC2Ev({{.*}}) : ({{.*}}) -> (!cir.ptr<!rec_A> 
{llvm.noundef})
+// CIRRET:         %[[RET:.*]] = cir.load %[[RETVAL]]
+// CIRRET-NEXT:    cir.return implicit %[[RET]] : !cir.ptr<!rec_B>
+// CIRRET-LABEL: cir.func {{.*}} @_ZN1BC1EPi(
+// CIRRET-SAME:    llvm.returned
+// CIRRET:         cir.call @_ZN1BC2EPi({{.*}}) : ({{.*}}) -> 
(!cir.ptr<!rec_B> {llvm.noundef})
+// CIRRET-LABEL: cir.func {{.*}} @_ZN1BD2Ev(
+// CIRRET-SAME:    llvm.returned
+// CIRRET-SAME:    -> (!cir.ptr<!rec_B> {llvm.noundef})
+// CIRRET:         cir.call @_ZN1AD2Ev({{.*}}) nothrow : ({{.*}}) -> 
(!cir.ptr<!rec_A> {llvm.noundef})
+// CIRRET-LABEL: cir.func {{.*}} @_ZN1BD1Ev(
+// CIRRET-SAME:    llvm.returned
+// CIRRET:         cir.call @_ZN1BD2Ev({{.*}}) nothrow : ({{.*}}) -> 
(!cir.ptr<!rec_B> {llvm.noundef})
+// The deleting destructor is called virtually, so it still returns void.
+// CIRRET-LABEL: cir.func {{.*}} @_ZN1BD0Ev(
+// CIRRET-NOT:     llvm.returned
+// CIRRET:         cir.call @_ZN1BD1Ev({{.*}}) nothrow : ({{.*}}) -> 
(!cir.ptr<!rec_B> {llvm.noundef})
+
+// Without the flag, nothing returns 'this'.
+// CIRGEN-LABEL: cir.func {{.*}} @_ZN1BC2EPi(
+// CIRGEN-NOT:     llvm.returned
+// CIRGEN-LABEL: cir.func {{.*}} @_ZN1BC1EPi(
+// CIRGEN-NOT:     llvm.returned
+// CIRGEN-LABEL: cir.func {{.*}} @_ZN1BD2Ev(
+// CIRGEN-NOT:     llvm.returned
+// CIRGEN-LABEL: cir.func {{.*}} @_ZN1BD1Ev(
+// CIRGEN-NOT:     llvm.returned
+
+class C : public A, public B {
+public:
+  C(int *i, char *c);
+  virtual ~C();
+private:
+  char *c_;
+};
+
+C::C(int *i, char *c) : B(i), c_(c) { }
+C::~C() { }
+
+
+// CIRRET-LABEL: cir.func {{.*}} @_ZN1CC2EPiPc(
+// CIRRET-SAME:    llvm.returned
+// CIRRET-SAME:    -> (!cir.ptr<!rec_C> {llvm.noundef})
+// CIRRET:         cir.call @_ZN1AC2Ev({{.*}}) : ({{.*}}) -> (!cir.ptr<!rec_A> 
{llvm.noundef})
+// CIRRET:         cir.call @_ZN1BC2EPi({{.*}}) : ({{.*}}) -> 
(!cir.ptr<!rec_B> {llvm.noundef})
+// CIRRET-LABEL: cir.func {{.*}} @_ZN1CC1EPiPc(
+// CIRRET-SAME:    llvm.returned
+// CIRRET-LABEL: cir.func {{.*}} @_ZN1CD2Ev(
+// CIRRET-SAME:    llvm.returned
+// CIRRET-LABEL: cir.func {{.*}} @_ZN1CD1Ev(
+// CIRRET-SAME:    llvm.returned
+// The thunk forwards the returned 'this' value; its parameter is not 
'returned'.
+// CIRRET-LABEL: cir.func {{.*}} @_ZThn{{8|16}}_N1CD1Ev(
+// CIRRET-NOT:     llvm.returned
+// CIRRET-SAME:    -> (!cir.ptr<!rec_C> {llvm.noundef})
+// CIRRET:         %[[CALL:.*]] = cir.call @_ZN1CD1Ev({{.*}}) {{.*}}-> 
(!cir.ptr<!rec_C> {llvm.noundef})
+// CIRRET:         cir.store {{.*}}%[[CALL]]
+// CIRRET-LABEL: cir.func {{.*}} @_ZN1CD0Ev(
+// CIRRET-NOT:     llvm.returned
+// CIRRET-LABEL: cir.func {{.*}} @_ZThn{{8|16}}_N1CD0Ev(
+// CIRRET-NOT:     llvm.returned
+
+class D : public virtual A {
+public:
+  D();
+  ~D();
+};
+
+D::D() { }
+D::~D() { }
+
+
+// The VTT parameter stays after 'this'.
+// CIRRET-LABEL: cir.func {{.*}} @_ZN1DC2Ev(
+// CIRRET-SAME:    llvm.returned{{.*}}%{{.*}}: !cir.ptr<!cir.ptr<!void>> 
{llvm.noundef}
+// CIRRET-SAME:    -> (!cir.ptr<!rec_D> {llvm.noundef})
+// CIRRET-LABEL: cir.func {{.*}} @_ZN1DC1Ev(
+// CIRRET-SAME:    llvm.returned
+// CIRRET-LABEL: cir.func {{.*}} @_ZN1DD2Ev(
+// CIRRET-SAME:    llvm.returned{{.*}}%{{.*}}: !cir.ptr<!cir.ptr<!void>> 
{llvm.noundef}
+// CIRRET-LABEL: cir.func {{.*}} @_ZN1DD1Ev(
+// CIRRET-SAME:    llvm.returned
+
+class E {
+public:
+  E();
+  virtual ~E();
+};
+
+E* gete();
+
+void test_destructor() {
+  const E& e1 = E();
+  E* e2 = gete();
+  e2->~E();
+}
+
+// Verify that virtual calls to destructors are not marked with a 'returned'
+// this parameter at the call site...
+
+// ...but static calls create declarations with 'returned' this
+
+// CIRRET-LABEL: cir.func {{.*}} @_Z15test_destructorv()
+// CIRRET:         cir.call @_ZN1EC1Ev({{.*}}) : ({{.*}}) -> (!cir.ptr<!rec_E> 
{llvm.noundef})
+// CIRRET:         %[[FN:.*]] = cir.vtable.get_virtual_fn {{.*}} : !cir.vptr 
-> !cir.ptr<!cir.func<(!cir.ptr<!rec_E>) -> !cir.ptr<!rec_E>>>
+// CIRRET:         cir.call %[[FN]]({{.*}}) nothrow : ({{.*}}) -> 
(!cir.ptr<!rec_E> {llvm.noundef})
+// CIRRET:         cir.call @_ZN1ED1Ev({{.*}}) nothrow : ({{.*}}) -> 
(!cir.ptr<!rec_E> {llvm.noundef})
+// CIRRET:       cir.func private unnamed_addr 
@_ZN1EC1Ev({{.*}}llvm.returned{{.*}}) -> (!cir.ptr<!rec_E> {llvm.noundef})
+// CIRRET:       cir.func private unnamed_addr 
@_ZN1ED1Ev({{.*}}llvm.returned{{.*}}) -> (!cir.ptr<!rec_E> {llvm.noundef})
diff --git a/clang/test/CodeGenCXX/constructor-destructor-return-this.cpp 
b/clang/test/CodeGenCXX/constructor-destructor-return-this.cpp
index d71949f25af0fa..03bac776f237e8 100644
--- a/clang/test/CodeGenCXX/constructor-destructor-return-this.cpp
+++ b/clang/test/CodeGenCXX/constructor-destructor-return-this.cpp
@@ -1,4 +1,5 @@
 //RUN: %clang_cc1 %s -emit-llvm -o - -triple=i686-unknown-linux | FileCheck 
--check-prefix=CHECKGEN %s
+//RUN: %if cir-enabled %{ %clang_cc1 %s -fclangir -emit-llvm -o - 
-triple=i686-unknown-linux -Wno-inaccessible-base | FileCheck 
--check-prefix=CHECKGEN %s %}
 //RUN: %clang_cc1 %s -emit-llvm -o - -triple=thumbv7-apple-ios6.0 -target-abi 
apcs-gnu | FileCheck --check-prefix=CHECKARM %s
 //RUN: %clang_cc1 %s -emit-llvm -o - -triple=thumbv7-apple-ios5.0 -target-abi 
apcs-gnu | FileCheck --check-prefix=CHECKIOS5 %s
 //RUN: %clang_cc1 %s -emit-llvm -o - -triple=wasm32-unknown-unknown \
@@ -7,7 +8,9 @@
 //RUN: %clang_cc1 %s -emit-llvm -o - -triple=aarch64-unknown-fuchsia | 
FileCheck --check-prefix=CHECKFUCHSIA %s
 //RUN: %clang_cc1 %s -emit-llvm -o - -triple=i386-pc-win32 -fno-rtti | 
FileCheck --check-prefix=CHECKMS %s
 //RUN: %clang_cc1 %s -emit-llvm -o - -triple=i686-unknown-linux-gnu 
-fctor-dtor-return-this | FileCheck --check-prefix=CHECKI686RET %s
+//RUN: %if cir-enabled %{ %clang_cc1 %s -fclangir -emit-llvm -o - 
-triple=i686-unknown-linux-gnu -fctor-dtor-return-this -Wno-inaccessible-base | 
FileCheck --check-prefix=CHECKI686RET %s %}
 //RUN: %clang_cc1 %s -emit-llvm -o - -triple=aarch64-unknown-linux-gnu 
-fctor-dtor-return-this | FileCheck --check-prefix=CHECKAARCH64RET %s
+//RUN: %if cir-enabled %{ %clang_cc1 %s -fclangir -emit-llvm -o - 
-triple=aarch64-unknown-linux-gnu -fctor-dtor-return-this 
-Wno-inaccessible-base | FileCheck --check-prefix=CHECKAARCH64RET %s %}
 // FIXME: these tests crash on the bots when run with -triple=x86_64-pc-win32
 
 // Make sure we attach the 'returned' attribute to the 'this' parameter of
@@ -34,33 +37,33 @@ class B : public A {
 B::B(int *i) : i_(i) { }
 B::~B() { }
 
-// CHECKGEN-LABEL: define{{.*}} void @_ZN1BC2EPi(ptr {{[^,]*}} %this, ptr 
noundef %i)
-// CHECKGEN-LABEL: define{{.*}} void @_ZN1BC1EPi(ptr {{[^,]*}} %this, ptr 
noundef %i)
-// CHECKGEN-LABEL: define{{.*}} void @_ZN1BD2Ev(ptr {{[^,]*}} %this)
-// CHECKGEN-LABEL: define{{.*}} void @_ZN1BD1Ev(ptr {{[^,]*}} %this)
+// CHECKGEN-LABEL: define{{.*}} void @_ZN1BC2EPi(ptr {{[^,]*}} %{{[^,)]*}}, 
ptr noundef %{{[^,)]*}})
+// CHECKGEN-LABEL: define{{.*}} void @_ZN1BC1EPi(ptr {{[^,]*}} %{{[^,)]*}}, 
ptr noundef %{{[^,)]*}})
+// CHECKGEN-LABEL: define{{.*}} void @_ZN1BD2Ev(ptr {{[^,]*}} %{{[^,)]*}})
+// CHECKGEN-LABEL: define{{.*}} void @_ZN1BD1Ev(ptr {{[^,]*}} %{{[^,)]*}})
 
-// CHECKARM-LABEL,CHECKAARCH64RET-LABEL: define{{.*}} ptr @_ZN1BC2EPi(ptr 
{{[^,]*}} returned{{[^,]*}} %this, ptr noundef %i)
-// CHECKARM-LABEL,CHECKAARCH64RET-LABEL: define{{.*}} ptr @_ZN1BC1EPi(ptr 
{{[^,]*}} returned{{[^,]*}} %this, ptr noundef %i)
-// CHECKARM-LABEL,CHECKAARCH64RET-LABEL: define{{.*}} ptr @_ZN1BD2Ev(ptr 
{{[^,]*}} returned{{[^,]*}} %this)
-// CHECKARM-LABEL,CHECKAARCH64RET-LABEL: define{{.*}} ptr @_ZN1BD1Ev(ptr 
{{[^,]*}} returned{{[^,]*}} %this)
+// CHECKARM-LABEL,CHECKAARCH64RET-LABEL: define{{.*}} ptr @_ZN1BC2EPi(ptr 
{{[^,]*}} returned{{[^,]*}} %{{[^,)]*}}, ptr noundef %{{[^,)]*}})
+// CHECKARM-LABEL,CHECKAARCH64RET-LABEL: define{{.*}} ptr @_ZN1BC1EPi(ptr 
{{[^,]*}} returned{{[^,]*}} %{{[^,)]*}}, ptr noundef %{{[^,)]*}})
+// CHECKARM-LABEL,CHECKAARCH64RET-LABEL: define{{.*}} ptr @_ZN1BD2Ev(ptr 
{{[^,]*}} returned{{[^,]*}} %{{[^,)]*}})
+// CHECKARM-LABEL,CHECKAARCH64RET-LABEL: define{{.*}} ptr @_ZN1BD1Ev(ptr 
{{[^,]*}} returned{{[^,]*}} %{{[^,)]*}})
 
-// CHECKI686RET-LABEL: define{{.*}} ptr @_ZN1BC2EPi(ptr {{[^,]*}} %this, ptr 
noundef %i)
-// CHECKI686RET-LABEL: define{{.*}} ptr @_ZN1BC1EPi(ptr {{[^,]*}} %this, ptr 
noundef %i)
-// CHECKI686RET-LABEL: define{{.*}} ptr @_ZN1BD2Ev(ptr {{[^,]*}} %this)
-// CHECKI686RET-LABEL: define{{.*}} ptr @_ZN1BD1Ev(ptr {{[^,]*}} %this)
+// CHECKI686RET-LABEL: define{{.*}} ptr @_ZN1BC2EPi(ptr {{[^,]*}} %{{[^,)]*}}, 
ptr noundef %{{[^,)]*}})
+// CHECKI686RET-LABEL: define{{.*}} ptr @_ZN1BC1EPi(ptr {{[^,]*}} %{{[^,)]*}}, 
ptr noundef %{{[^,)]*}})
+// CHECKI686RET-LABEL: define{{.*}} ptr @_ZN1BD2Ev(ptr {{[^,]*}} %{{[^,)]*}})
+// CHECKI686RET-LABEL: define{{.*}} ptr @_ZN1BD1Ev(ptr {{[^,]*}} %{{[^,)]*}})
 
-// CHECKIOS5-LABEL: define{{.*}} ptr @_ZN1BC2EPi(ptr {{[^,]*}} %this, ptr 
noundef %i)
-// CHECKIOS5-LABEL: define{{.*}} ptr @_ZN1BC1EPi(ptr {{[^,]*}} %this, ptr 
noundef %i)
-// CHECKIOS5-LABEL: define{{.*}} ptr @_ZN1BD2Ev(ptr {{[^,]*}} %this)
-// CHECKIOS5-LABEL: define{{.*}} ptr @_ZN1BD1Ev(ptr {{[^,]*}} %this)
+// CHECKIOS5-LABEL: define{{.*}} ptr @_ZN1BC2EPi(ptr {{[^,]*}} %{{[^,)]*}}, 
ptr noundef %{{[^,)]*}})
+// CHECKIOS5-LABEL: define{{.*}} ptr @_ZN1BC1EPi(ptr {{[^,]*}} %{{[^,)]*}}, 
ptr noundef %{{[^,)]*}})
+// CHECKIOS5-LABEL: define{{.*}} ptr @_ZN1BD2Ev(ptr {{[^,]*}} %{{[^,)]*}})
+// CHECKIOS5-LABEL: define{{.*}} ptr @_ZN1BD1Ev(ptr {{[^,]*}} %{{[^,)]*}})
 
-// CHECKFUCHSIA-LABEL: define{{.*}} ptr @_ZN1BC2EPi(ptr {{[^,]*}} 
returned{{[^,]*}} %this, ptr noundef %i)
-// CHECKFUCHSIA-LABEL: define{{.*}} ptr @_ZN1BC1EPi(ptr {{[^,]*}} 
returned{{[^,]*}} %this, ptr noundef %i)
-// CHECKFUCHSIA-LABEL: define{{.*}} ptr @_ZN1BD2Ev(ptr {{[^,]*}} 
returned{{[^,]*}} %this)
-// CHECKFUCHSIA-LABEL: define{{.*}} ptr @_ZN1BD1Ev(ptr {{[^,]*}} 
returned{{[^,]*}} %this)
+// CHECKFUCHSIA-LABEL: define{{.*}} ptr @_ZN1BC2EPi(ptr {{[^,]*}} 
returned{{[^,]*}} %{{[^,)]*}}, ptr noundef %{{[^,)]*}})
+// CHECKFUCHSIA-LABEL: define{{.*}} ptr @_ZN1BC1EPi(ptr {{[^,]*}} 
returned{{[^,]*}} %{{[^,)]*}}, ptr noundef %{{[^,)]*}})
+// CHECKFUCHSIA-LABEL: define{{.*}} ptr @_ZN1BD2Ev(ptr {{[^,]*}} 
returned{{[^,]*}} %{{[^,)]*}})
+// CHECKFUCHSIA-LABEL: define{{.*}} ptr @_ZN1BD1Ev(ptr {{[^,]*}} 
returned{{[^,]*}} %{{[^,)]*}})
 
-// CHECKMS-LABEL: define dso_local x86_thiscallcc noundef ptr 
@"??0B@@QAE@PAH@Z"(ptr {{[^,]*}} returned{{[^,]*}} %this, ptr noundef %i)
-// CHECKMS-LABEL: define dso_local x86_thiscallcc void @"??1B@@UAE@XZ"(ptr 
{{[^,]*}} %this)
+// CHECKMS-LABEL: define dso_local x86_thiscallcc noundef ptr 
@"??0B@@QAE@PAH@Z"(ptr {{[^,]*}} returned{{[^,]*}} %{{[^,)]*}}, ptr noundef 
%{{[^,)]*}})
+// CHECKMS-LABEL: define dso_local x86_thiscallcc void @"??1B@@UAE@XZ"(ptr 
{{[^,]*}} %{{[^,)]*}})
 
 class C : public A, public B {
 public:
@@ -73,50 +76,50 @@ class C : public A, public B {
 C::C(int *i, char *c) : B(i), c_(c) { }
 C::~C() { }
 
-// CHECKGEN-LABEL: define{{.*}} void @_ZN1CC2EPiPc(ptr {{[^,]*}} %this, ptr 
noundef %i, ptr noundef %c)
-// CHECKGEN-LABEL: define{{.*}} void @_ZN1CC1EPiPc(ptr {{[^,]*}} %this, ptr 
noundef %i, ptr noundef %c)
-// CHECKGEN-LABEL: define{{.*}} void @_ZN1CD2Ev(ptr {{[^,]*}} %this)
-// CHECKGEN-LABEL: define{{.*}} void @_ZN1CD1Ev(ptr {{[^,]*}} %this)
-// CHECKGEN-LABEL: define{{.*}} void @_ZThn8_N1CD1Ev(ptr noundef %this)
-// CHECKGEN-LABEL: define{{.*}} void @_ZN1CD0Ev(ptr {{[^,]*}} %this)
-// CHECKGEN-LABEL: define{{.*}} void @_ZThn8_N1CD0Ev(ptr noundef %this)
-
-// CHECKARM-LABEL,CHECKAARCH64RET-LABEL: define{{.*}} ptr @_ZN1CC2EPiPc(ptr 
{{[^,]*}} returned{{[^,]*}} %this, ptr noundef %i, ptr noundef %c)
-// CHECKARM-LABEL,CHECKAARCH64RET-LABEL: define{{.*}} ptr @_ZN1CC1EPiPc(ptr 
{{[^,]*}} returned{{[^,]*}} %this, ptr noundef %i, ptr noundef %c)
-// CHECKARM-LABEL,CHECKAARCH64RET-LABEL: define{{.*}} ptr @_ZN1CD2Ev(ptr 
{{[^,]*}} returned{{[^,]*}} %this)
-// CHECKARM-LABEL,CHECKAARCH64RET-LABEL: define{{.*}} ptr @_ZN1CD1Ev(ptr 
{{[^,]*}} returned{{[^,]*}} %this)
-// CHECKARM-LABEL: define{{.*}} ptr @_ZThn8_N1CD1Ev(ptr noundef %this)
-// CHECKAARCH64RET-LABEL: define{{.*}} ptr @_ZThn16_N1CD1Ev(ptr noundef %this)
-// CHECKARM-LABEL,CHECKAARCH64RET-LABEL: define{{.*}} void @_ZN1CD0Ev(ptr 
{{[^,]*}} %this)
-// CHECKARM-LABEL: define{{.*}} void @_ZThn8_N1CD0Ev(ptr noundef %this)
-// CHECKAARCH64RET-LABEL: define{{.*}} void @_ZThn16_N1CD0Ev(ptr noundef %this)
-
-// CHECKI686RET-LABEL: define{{.*}} ptr @_ZN1CC2EPiPc(ptr {{[^,]*}} %this, ptr 
noundef %i, ptr noundef %c)
-// CHECKI686RET-LABEL: define{{.*}} ptr @_ZN1CC1EPiPc(ptr {{[^,]*}} %this, ptr 
noundef %i, ptr noundef %c)
-// CHECKI686RET-LABEL: define{{.*}} ptr @_ZN1CD2Ev(ptr {{[^,]*}} %this)
-// CHECKI686RET-LABEL: define{{.*}} ptr @_ZN1CD1Ev(ptr {{[^,]*}} %this)
-// CHECKI686RET-LABEL: define{{.*}} ptr @_ZThn8_N1CD1Ev(ptr noundef %this)
-// CHECKI686RET-LABEL: define{{.*}} void @_ZN1CD0Ev(ptr {{[^,]*}} %this)
-// CHECKI686RET-LABEL: de...
[truncated]

``````````

</details>


https://github.com/llvm/llvm-project/pull/242922
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to