- [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.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
- Build Status
Buildable 39248 Build 39264: arc lint + arc unit
Event Timeline
The refactoring of the getCurrentMangleNumberContext API mixed with functional changes makes this much harder to review quickly. Please separate it out.
clang/lib/Sema/SemaLambda.cpp | ||
---|---|---|
358 | If I'm following correctly, the core of the change is right here? Instead of grabbing a context from the ExpressionEvaluationContextRecord directly, we instead grab the current decl from it, and look up the context from that? That makes sense. |
clang/lib/Sema/SemaLambda.cpp | ||
---|---|---|
358 | yeah, that's the code fix. Lots of changes are due to removing unused code due to this change. |
Thanks. BTW, shall I commit the refactoring code directly. That change just replaces the code returning multiple values from pointer/reference argument with a tuple.
If I'm following correctly, the core of the change is right here? Instead of grabbing a context from the ExpressionEvaluationContextRecord directly, we instead grab the current decl from it, and look up the context from that? That makes sense.