google / google/effcee

Capture variables from successful combination of sub-matches

Open
#65 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
104
Forks
44
PR merge metrics
No merged PRs in 30d

Description

Hi there (cross-post from re2),

Hopefully not a silly question, but is there a way to capture the variables of all possible matches and perform checks with them?

For example, if I use the following made-up SPIR-V:
```cpp
%end = OpVariable %_ptr_Function_int Function
%15 = OpLoad %int %n
%16 = OpLoad %int %n
OpStore %end %16
```
...the following checks will return `false`...
```cpp
const std::string check = R"(
CHECK: [[END:%\w+]] = OpVariable
CHECK: [[LOADED:%\w+]] = OpLoad %int %n
CHECK: OpStore [[END]] [[LOADED]]
)";
```
...despite `OpStore %end %16` being a possibility.

Is there a better syntactical way to capture all possible versions of what `LOADED` might be and return success if a match is found with one of these versions (instead of stopping after the first match)?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.