summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/python_api/process/TestProcessAPI.py
diff options
context:
space:
mode:
authorSam McCall <sam.mccall@gmail.com>2020-04-07 02:46:16 +0200
committerHaojian Wu <hokein.wu@gmail.com>2020-06-10 14:21:44 +0200
commit41c5efc3f2f22475bf3290309c90e84713511711 (patch)
tree63bdb8690948c427f768a2d9705ac095732a4941 /lldb/packages/Python/lldbsuite/test/python_api/process/TestProcessAPI.py
parent230b872c290d8c80a60accb06f3267e0703d0c49 (diff)
downloadbcm5719-llvm-41c5efc3f2f22475bf3290309c90e84713511711.tar.gz
bcm5719-llvm-41c5efc3f2f22475bf3290309c90e84713511711.zip
[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 (cherry picked from commit ec0b9908952a9f4a19c3eb92ba0fc01cffcb8614)
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/python_api/process/TestProcessAPI.py')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud