[PATCH] D66094: [CodeGen] Emit destructor calls for non-trivial C structs returned by function calls and loaded from volatile objects

Akira Hatanaka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 12 10:15:54 PDT 2019


ahatanak created this revision.
ahatanak added a reviewer: rjmccall.
ahatanak added a project: clang.
Herald added subscribers: llvm-commits, dexonsmith, jkorous.
Herald added a project: LLVM.

This is the patch I split out of https://reviews.llvm.org/D64464.

The cleanup is pushed in `EmitCallExpr` and `EmitObjCMessageExpr` so that the destructor is called to destruct function call and ObjC message returns. I also added test cases for block function calls since the patch in https://reviews.llvm.org/D64464 wasn't handling that case correctly.

rdar://problem/51867864


Repository:
  rC Clang

https://reviews.llvm.org/D66094

Files:
  clang/include/clang/Sema/Sema.h
  clang/lib/CodeGen/CGCall.h
  clang/lib/CodeGen/CGExpr.cpp
  clang/lib/CodeGen/CGExprAgg.cpp
  clang/lib/CodeGen/CGObjC.cpp
  clang/lib/Parse/ParseObjc.cpp
  clang/lib/Sema/SemaExpr.cpp
  clang/lib/Sema/SemaExprObjC.cpp
  clang/test/CodeGenObjC/arc.m
  clang/test/CodeGenObjC/strong-in-c-struct.m
  llvm/test/Bitcode/upgrade-arc-runtime-calls.bc
  llvm/test/Bitcode/upgrade-mrr-runtime-calls.bc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66094.214651.patch
Type: text/x-patch
Size: 16535 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190812/2a3e998f/attachment-0001.bin>


More information about the cfe-commits mailing list