[PATCH] D148723: [clang] Enforce internal linkage for inline builtin

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 19 10:20:23 PDT 2023


efriedma added a comment.

This seems like a weird way to fix this.  The point of an "inline builtin" is that the inline function is actually the original function; it's just the inline implementation is only used in limited circumstances (in particular, it can't be used recursively).  Changing the linkage could have unexpected side-effects.

Maybe it makes sense to restore some form of the "GNUInlineAttr" check in isInlineBuiltinDeclaration.  But instead of actually checking for the attribute, check that the function would be emitted with available_externally linkage.  So "inline builtins" don't exist on Windows because inline functions are linkonce_odr.  But we still detect builtins that are declared `inline` instead of `extern inline __attribute((gnu_inline))`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148723/new/

https://reviews.llvm.org/D148723



More information about the cfe-commits mailing list