use clang-query to match specified string

71 Views Asked by At

how should I use clang-query to match specified string souece code:

int main()
{
__asm__ __volatile__("pause");
}

I want to substituted "yield" for "pause"

what I have tried in clang-query, I can only match the stringLiteral and I cant match "pause"

match asmStmt(hasDescendant(stringLiteral()))

how should I match "pause" in clang-query

0

There are 0 best solutions below