[all-commits] [llvm/llvm-project] 140bfd: [clang][CodeGen] add fn_ret_thunk_extern to synthe...

Nick Desaulniers via All-commits all-commits at lists.llvm.org
Thu Jul 14 11:31:30 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 140bfdca60ae8b1b2ad115846379e3c9ca914bfb
      https://github.com/llvm/llvm-project/commit/140bfdca60ae8b1b2ad115846379e3c9ca914bfb
  Author: Nick Desaulniers <ndesaulniers at google.com>
  Date:   2022-07-14 (Thu, 14 Jul 2022)

  Changed paths:
    M clang/lib/CodeGen/CodeGenModule.cpp
    M clang/test/CodeGen/attr-function-return.c
    M llvm/docs/LangRef.rst
    M llvm/lib/IR/Function.cpp

  Log Message:
  -----------
  [clang][CodeGen] add fn_ret_thunk_extern to synthetic fns

Follow up fix to
commit 2240d72f15f3 ("[X86] initial -mfunction-return=thunk-extern
support")
https://reviews.llvm.org/D129572

@nathanchance reported that -mfunction-return=thunk-extern was failing
to annotate the asan and tsan contructors.
https://lore.kernel.org/llvm/Ys7pLq+tQk5xEa%2FB@dev-arch.thelio-3990X/

I then noticed the same occurring for gcov synthetic functions.

Similar to
commit 2786e67 ("[IR][sanitizer] Add module flag "frame-pointer" and set
it for cc1 -mframe-pointer={non-leaf,all}")
define a new module level MetaData, "fn_ret_thunk_extern", then when set
adds the fn_ret_thunk_extern IR Fn Attr to synthetically created
Functions.

Fixes https://github.com/llvm/llvm-project/issues/56514

Reviewed By: MaskRay

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




More information about the All-commits mailing list