Clang-Rename usage multiple files


I have managed to compile clang-rename and to get it to rename some symbols.

I have simple example I cant get to work correctly if anyone can help me out it would be greatly appreciated.

3 files:

int foo (int x, int y)
return x + y;

extern int foo (int x, int y);

#include “foo.h”
int main (void)
return foo(1, 1);


“directory”: “c:\ClangRenameTest\”,
“command”: “clang main.c”,
“file”: “main.c”
“directory”: “c:\ClangRenameTest\”,
“command”: “clang foo.c”,
“file”: “foo.c”

I run clang-rename with the following arguments:

“clang-rename main.c -offset=50 -i -new-name=sum -pl”

All the instances of foo are renamed to sum except in foo.c.

Can anyone help me how to get clang-rename to work for foo.c also?

Any advice is greatly appreciated.


Your command invocation only includes main.c, try adding foo.c as well.