Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve attributes on rewriting #466

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Preserve attributes on rewriting #466

wants to merge 14 commits into from

Conversation

john-h-kastner
Copy link
Collaborator

@john-h-kastner john-h-kastner commented Mar 2, 2021

3C ignored attributes when rewriting, so they would often be deleted or mess up rewriting in a way that made the uncompilable. Fixes #459 and adds a regression test for #450.

For example

void foo( const char *fmt, __builtin_ms_va_list argp);
__attribute__((ms_abi)) void bar ( const char *fmt, ...)  {
  __builtin_ms_va_list argp;
  __builtin_ms_va_start(argp, fmt);
  foo(fmt, argp);
  __builtin_ms_va_end(argp);
}

previously converted to

void foo( const char *fmt, __builtin_ms_va_list argp);
const char *fmt : itype(_Ptr<const char>), ...) {
  __builtin_ms_va_list argp;
  __builtin_ms_va_start(argp, fmt);
  foo(fmt, argp);
  __builtin_ms_va_end(argp);
}

but is now converted correctly.


benchmark run

@kyleheadley
Copy link
Member

LGTM

@john-h-kastner
Copy link
Collaborator Author

Now that we have compilation checks for our benchmarks in the works, I'll hold off on merging this until we can check that it doesn't break any currently compiling benchmarks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rewrite error on functions with attributes
2 participants