[all-commits] [llvm/llvm-project] 2786e6: [IR][sanitizer] Add module flag "frame-pointer" an...

Fangrui Song via All-commits all-commits at lists.llvm.org
Thu Apr 22 18:07:45 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2786e673c7d67ffca531ef38d679620ee3048a1e
      https://github.com/llvm/llvm-project/commit/2786e673c7d67ffca531ef38d679620ee3048a1e
  Author: Fangrui Song <i at maskray.me>
  Date:   2021-04-22 (Thu, 22 Apr 2021)

  Changed paths:
    M clang/lib/CodeGen/CodeGenModule.cpp
    A clang/test/CodeGen/asan-frame-pointer.cpp
    M llvm/docs/LangRef.rst
    M llvm/include/llvm/CodeGen/CommandFlags.h
    M llvm/include/llvm/IR/Module.h
    M llvm/include/llvm/Support/CodeGen.h
    M llvm/lib/CodeGen/CommandFlags.cpp
    M llvm/lib/IR/Function.cpp
    M llvm/lib/IR/Module.cpp
    A llvm/test/Instrumentation/AddressSanitizer/module-flags.ll
    R llvm/test/Instrumentation/AddressSanitizer/uwtable.ll

  Log Message:
  -----------
  [IR][sanitizer] Add module flag "frame-pointer" and set it for cc1 -mframe-pointer={non-leaf,all}

The Linux kernel objtool diagnostic `call without frame pointer save/setup`
arise in multiple instrumentation passes (asan/tsan/gcov). With the mechanism
introduced in D100251, it's trivial to respect the command line
-m[no-]omit-leaf-frame-pointer/-f[no-]omit-frame-pointer, so let's do it.

Fix: https://github.com/ClangBuiltLinux/linux/issues/1236 (tsan)
Fix: https://github.com/ClangBuiltLinux/linux/issues/1238 (asan)

Also document the function attribute "frame-pointer" which is long overdue.

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




More information about the All-commits mailing list