[all-commits] [llvm/llvm-project] c3717b: Simplify handling of builtin with inline redefinition

serge-sans-paille via All-commits all-commits at lists.llvm.org
Tue Sep 28 12:01:59 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c3717b6858d32d64514a187ede1a77be8ba4e542
      https://github.com/llvm/llvm-project/commit/c3717b6858d32d64514a187ede1a77be8ba4e542
  Author: serge-sans-paille <sguelton at redhat.com>
  Date:   2021-09-28 (Tue, 28 Sep 2021)

  Changed paths:
    M clang/lib/CodeGen/CodeGenFunction.cpp
    M clang/lib/CodeGen/CodeGenModule.cpp
    A clang/test/CodeGen/memcpy-inline-builtin.c
    R clang/test/CodeGen/memcpy-no-nobuiltin-if-not-emitted.c
    M clang/test/CodeGen/memcpy-nobuiltin.c
    M clang/test/CodeGen/pr9614.c

  Log Message:
  -----------
  Simplify handling of builtin with inline redefinition

(This is a recommit of 3d6f49a56995b845 that should no longer break validation since
bd379915de38a9af3d65e1).

It is a common practice in glibc header to provide an inline redefinition of an
existing function. It is especially the case for fortified function.

Clang currently has an imperfect approach to the problem, using a combination of
trivially recursive function detection and noinline attribute.

Simplify the logic by suffixing these functions by `.inline` during codegen, so
that they are not recognized as builtin by llvm.

After that patch, clang passes all tests from https://github.com/serge-sans-paille/fortify-test-suite

Differential Revision: https://reviews.llvm.org/D109967




More information about the All-commits mailing list