tbaeder created this revision.
tbaeder added reviewers: aaron.ballman, erichkeane, tahonermann, shafik.
Herald added a project: All.
tbaeder requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Calling them isn't needed if I understand correctly.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D140807

Files:
  clang/lib/AST/Interp/ByteCodeExprGen.h


Index: clang/lib/AST/Interp/ByteCodeExprGen.h
===================================================================
--- clang/lib/AST/Interp/ByteCodeExprGen.h
+++ clang/lib/AST/Interp/ByteCodeExprGen.h
@@ -364,14 +364,16 @@
       if (!RDecl)
         continue;
 
-      if (const auto *DtorDecl = RDecl->getDestructor()) {
-        const Function *Dtor = this->Ctx->getFunction(DtorDecl);
-        if (Dtor && Dtor->isConstexpr()) {
-          assert(Dtor->hasThisPointer());
-          assert(Dtor->getNumParams() == 1);
-          // Emit destructor call.
-          this->Ctx->emitGetPtrLocal(Local.Offset, DtorDecl);
-          this->Ctx->emitCall(Dtor, DtorDecl);
+      if (!RDecl->hasSimpleDestructor()) {
+        if (const auto *DtorDecl = RDecl->getDestructor()) {
+          const Function *Dtor = this->Ctx->getFunction(DtorDecl);
+          if (Dtor && Dtor->isConstexpr()) {
+            assert(Dtor->hasThisPointer());
+            assert(Dtor->getNumParams() == 1);
+            // Emit destructor call.
+            this->Ctx->emitGetPtrLocal(Local.Offset, DtorDecl);
+            this->Ctx->emitCall(Dtor, DtorDecl);
+          }
         }
       }
     }


Index: clang/lib/AST/Interp/ByteCodeExprGen.h
===================================================================
--- clang/lib/AST/Interp/ByteCodeExprGen.h
+++ clang/lib/AST/Interp/ByteCodeExprGen.h
@@ -364,14 +364,16 @@
       if (!RDecl)
         continue;
 
-      if (const auto *DtorDecl = RDecl->getDestructor()) {
-        const Function *Dtor = this->Ctx->getFunction(DtorDecl);
-        if (Dtor && Dtor->isConstexpr()) {
-          assert(Dtor->hasThisPointer());
-          assert(Dtor->getNumParams() == 1);
-          // Emit destructor call.
-          this->Ctx->emitGetPtrLocal(Local.Offset, DtorDecl);
-          this->Ctx->emitCall(Dtor, DtorDecl);
+      if (!RDecl->hasSimpleDestructor()) {
+        if (const auto *DtorDecl = RDecl->getDestructor()) {
+          const Function *Dtor = this->Ctx->getFunction(DtorDecl);
+          if (Dtor && Dtor->isConstexpr()) {
+            assert(Dtor->hasThisPointer());
+            assert(Dtor->getNumParams() == 1);
+            // Emit destructor call.
+            this->Ctx->emitGetPtrLocal(Local.Offset, DtorDecl);
+            this->Ctx->emitCall(Dtor, DtorDecl);
+          }
         }
       }
     }
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to