bloomberg / clangmetatool

A framework for reusing code in Clang tools
https://bloomberg.github.io/clangmetatool/
Apache License 2.0
121 stars 25 forks source link

Correctly find the location when a macro is called within a macro #77

Closed samanpa closed 1 year ago

samanpa commented 1 year ago

Assuming we have the following code


#define print_foo() printf("foo")

#define call_print_foo() printf_foo()

int main() {
  call_print_foo();
}

The current code doesn't record the location that print_foo() is referenced since it happens in scratch space. This PR adds support for it.