aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/ReachingDefAnalysis.cpp
diff options
context:
space:
mode:
authorSam McCall <sam.mccall@gmail.com>2020-04-07 02:46:16 +0200
committerSam McCall <sam.mccall@gmail.com>2020-04-07 15:01:34 +0200
commitec0b9908952a9f4a19c3eb92ba0fc01cffcb8614 (patch)
tree6fa5b12c1c242d2d2294dc151e60aeb8e2ec6710 /llvm/lib/CodeGen/ReachingDefAnalysis.cpp
parent9949cfbd05a076ee4b70e393c5da49dce640a3c7 (diff)
downloadllvm-ec0b9908952a9f4a19c3eb92ba0fc01cffcb8614.zip
llvm-ec0b9908952a9f4a19c3eb92ba0fc01cffcb8614.tar.gz
llvm-ec0b9908952a9f4a19c3eb92ba0fc01cffcb8614.tar.bz2
[Syntax] Simplify TokenCollector::Builder, use captured expansion bounds. NFC
Summary: The motivation here is fixing https://bugs.llvm.org/show_bug.cgi?id=45428, see D77507. The fundamental problem is that a "top-level" expansion wasn't precisely defined. Repairing this concept means that TokenBuffer's "top-level expansion" may not correspond to a single macro expansion. Example: ``` M(2); // expands to 1+2 ``` The expansions overlap, but neither expansion alone yields all the tokens. We need a TokenBuffer::Mapping that corresponds to their union. This is fairly easy to fix in CollectPPExpansions, but the current design of TokenCollector::Builder needs a fix too as it relies on the macro's expansion range rather than the captured expansion bounds. This fix is hard to make due to the way code is reused within Builder. And honestly, I found that code pretty hard to reason about too. The new approach doesn't use the expansion range, but only the expansion location: it assumes an expansion is the contiguous set of expanded tokens with the same expansion location, which seems like a reasonable formalization of the "top-level" notion. And hopefully the control flow is easier to follow too, it's considerably shorter even with more documentation. Reviewers: kadircet Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D77614
Diffstat (limited to 'llvm/lib/CodeGen/ReachingDefAnalysis.cpp')
0 files changed, 0 insertions, 0 deletions