[PATCH] D111009: Update inline builtin handling to honor gnu inline attribute

serge via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 3 04:56:55 PDT 2021


serge-sans-paille created this revision.
serge-sans-paille added reviewers: kees, nickdesaulniers.
serge-sans-paille requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Per the GCC info page:

  If the function is declared 'extern', then this definition of the
  function is used only for inlining.  In no case is the function
  compiled as a standalone function, not even if you take its address
  explicitly.  Such an address becomes an external reference, as if
  you had only declared the function, and had not defined it.

Respect that behavior for inline builtins: keep the original definition, and
generate a copy of the declaration suffixed by '.inline' that's only referenced
in direct call.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D111009

Files:
  clang/lib/AST/Decl.cpp
  clang/lib/CodeGen/CGExpr.cpp
  clang/lib/CodeGen/CodeGenFunction.cpp
  clang/test/CodeGen/memcpy-inline-builtin.c
  clang/test/CodeGen/memcpy-nobuiltin.c
  clang/test/CodeGen/memcpy-nobuiltin.inc
  clang/test/CodeGen/pr9614.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111009.376751.patch
Type: text/x-patch
Size: 8956 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20211003/d238649d/attachment-0001.bin>


More information about the cfe-commits mailing list