summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineBasicBlock.cpp
diff options
context:
space:
mode:
authorGabor Marton <gabor.marton@ericsson.com>2019-08-30 10:55:41 +0000
committerGabor Marton <gabor.marton@ericsson.com>2019-08-30 10:55:41 +0000
commite3e83d708ab6f933862b9537db42eb0e9454be26 (patch)
tree4995384a2667b69421beaeee8c3cd5d639b25777 /llvm/lib/CodeGen/MachineBasicBlock.cpp
parent7cbf823f9357cdefe30fba8981ce776dafb21958 (diff)
downloadbcm5719-llvm-e3e83d708ab6f933862b9537db42eb0e9454be26.tar.gz
bcm5719-llvm-e3e83d708ab6f933862b9537db42eb0e9454be26.zip
[ASTImporter] Do not look up lambda classes
Summary: Consider this code: ``` void f() { auto L0 = [](){}; auto L1 = [](){}; } ``` First we import `L0` then `L1`. Currently we end up having only one CXXRecordDecl for the two different lambdas. And that is a problem if the body of their op() is different. This happens because when we import `L1` then lookup finds the existing `L0` and since they are structurally equivalent we just map the imported L0 to be the counterpart of L1. We have the same problem in this case: ``` template <typename F0, typename F1> void f(F0 L0 = [](){}, F1 L1 = [](){}) {} ``` In StructuralEquivalenceContext we could distinquish lambdas only by their source location in these cases. But we the lambdas are actually structrually equivalent they differn only by the source location. Thus, the solution is to disable lookup completely if the decl in the "from" context is a lambda. However, that could have other problems: what if the lambda is defined in a header file and included in several TUs? I think we'd have as many duplicates as many includes we have. I think we could live with that, because the lambda classes are TU local anyway, we cannot just access them from another TU. Reviewers: a_sidorin, a.sidorin, shafik Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66348 llvm-svn: 370461
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud