[PATCH] D68715: [mangle] Fix mangling where an extra mangle context is required.

Michael Liao via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 9 10:09:26 PDT 2019


hliao created this revision.
hliao added reviewers: rsmith, eli.friedman.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

- [Itanium C++ ABI][1], for certain contexts like default parameter and etc., mangling numbering will be local to the particular argument in which it appears.
- However, for these cases, the mangle numbering context is allocated per expression evaluation stack entry. That causes, for example, two lambdas defined/used understand the same default parameter are numbered as the same value and, in turn, one of them is not generated at all.
- In this patch, an extra mangle numbering context map is maintained in the AST context to map taht extra declaration context to its numbering context. So that, 2 different lambdas defined/used in the same default parameter are numbered differently.
- Minor coding change to perfer using tuple for multiple return values.

[1]: https://itanium-cxx-abi.github.io/cxx-abi/abi.html


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D68715

Files:
  clang/include/clang/AST/ASTContext.h
  clang/include/clang/Sema/Sema.h
  clang/lib/AST/ASTContext.cpp
  clang/lib/Sema/SemaDecl.cpp
  clang/lib/Sema/SemaExpr.cpp
  clang/lib/Sema/SemaLambda.cpp
  clang/test/CodeGenCXX/mangle-lambdas.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68715.224091.patch
Type: text/x-patch
Size: 11510 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191009/13fa3209/attachment.bin>


More information about the cfe-commits mailing list