Renaming a function

Using BRONTO_INLINE() to rename a function

You can use BRONTO_INLINE() to rename a function across your entire code base.

First add a function with the new name that you want.

int OldBadName(int x, int y);

int NewGoodName(int x, int y) { return OldBadName(x, y); }

Then switch the new function to be the primary implementation and the old function to call the new one.

int NewGoodName(int x, int y);

int OldBadName(int x, int y) { return NewGoodName(x, y); }

Now annotate the old function to be inlined.

int NewGoodName(int x, int y);

BRONTO_INLINE()
int OldBadName(int x, int y) { return NewGoodName(x, y); }

Sit back while Bronto switches all the callers of the old function to use the new name. It's fine if the new name is in a different namespace, Bronto will handle that for you intelligently.

After Bronto has removed all calls to OldBadName, you can simply delete it.

int NewGoodName(int x, int y);

See it in action on Compiler Explorer.