[all-commits] [llvm/llvm-project] 6bfc85: Fix inline builtin handling in case of redefinition

serge-sans-paille via All-commits all-commits at lists.llvm.org
Tue Nov 2 01:54:05 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6bfc85c217e443ecbde37b142a01dc7925792edc
      https://github.com/llvm/llvm-project/commit/6bfc85c217e443ecbde37b142a01dc7925792edc
  Author: serge-sans-paille <sguelton at redhat.com>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M clang/lib/CodeGen/CodeGenFunction.cpp
    A clang/test/CodeGen/strlen-inline-builtin-redecl.c
    A clang/test/CodeGen/user-func-gnu-inline-redecl.c

  Log Message:
  -----------
  Fix inline builtin handling in case of redefinition

Basically, inline builtin definition are shadowed by externally visible
redefinition. This matches GCC behavior.

The implementation has to workaround the fact that:

1. inline builtin are renamed at callsite during codegen, but
2. they may be shadowed by a later external definition

As a consequence, during codegen, we need to walk redecls and eventually rewrite
some call sites, which is totally inelegant.

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




More information about the All-commits mailing list