[cfe-dev] Clang-Rename usage multiple files

Matthew Plant maplant2 at illinois.edu
Tue Dec 9 14:37:13 PST 2014


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

-M

> On Dec 9, 2014, at 2:27 PM, Dan Walmsley <dan at walms.co.uk> wrote:
> 
> Hello,
> 
>     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:
> 
> [foo.c]
> int foo (int x, int y)
> {
>     return x + y;
> }
> 
> [foo.h]
> extern int foo (int x, int y);
> 
> [main.c]
> #include "foo.h"
> int main (void)
> {
>     return foo(1, 1);
> }
> 
> [compile_commands.json]
> [
> {
>   "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.
> 
> Dan
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20141209/3d9f80ee/attachment.html>


More information about the cfe-dev mailing list