[PATCH] D74094: Reapply: [IRGen] Emit lifetime intrinsics around temporary aggregate argument allocas

Duncan P. N. Exon Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 14 08:11:08 PDT 2023


dexonsmith added a comment.

In D74094#4645562 <https://reviews.llvm.org/D74094#4645562>, @nickdesaulniers wrote:

> I don't yet fully comprehend yet what's going wrong, and probably need to familiarize myself with the language rules around `auto`'s type deduction.

For reduction purposes, it might be useful to factor out the auto type deduction on the return. I think you can do that with the help of `-Xclang -ast-dump`. E.g., for this function:

  auto f() { return 1; };

the AST dump tells me the return type is `int`:

  |-FunctionDecl 0x1508e5698 <t.cpp:1:1, col:22> col:6 f 'int ()'
  | `-CompoundStmt 0x1508e5928 <col:10, col:22>
  |   `-ReturnStmt 0x1508e5918 <col:12, col:19>
  |     `-IntegerLiteral 0x1508e5780 <col:19> 'int' 1

You could then replace the `auto` with the type given in the dump.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74094



More information about the cfe-commits mailing list