[all-commits] [llvm/llvm-project] 4424c4: [Clang] Add fake use emission to Clang with -fexte...

Wolfgang Pieb via All-commits all-commits at lists.llvm.org
Tue Jan 28 04:32:30 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4424c44c8c4ec8e071f5c5999fba216d36fb92c9
      https://github.com/llvm/llvm-project/commit/4424c44c8c4ec8e071f5c5999fba216d36fb92c9
  Author: Wolfgang Pieb <wolfgang.pieb at sony.com>
  Date:   2025-01-28 (Tue, 28 Jan 2025)

  Changed paths:
    M clang/lib/CodeGen/CGCall.cpp
    M clang/lib/CodeGen/CGCleanup.cpp
    M clang/lib/CodeGen/CGCleanup.h
    M clang/lib/CodeGen/CGDecl.cpp
    M clang/lib/CodeGen/CodeGenFunction.cpp
    M clang/lib/CodeGen/CodeGenFunction.h
    M clang/lib/CodeGen/CodeGenModule.h
    M clang/lib/CodeGen/EHScopeStack.h
    A clang/test/CodeGen/extend-variable-liveness-except.cpp
    A clang/test/CodeGen/extend-variable-liveness-wide-scalar.cpp
    A clang/test/CodeGen/extend-variable-liveness.c
    A clang/test/CodeGen/fake-use-determinism.c
    A clang/test/CodeGen/fake-use-lambda.cpp
    A clang/test/CodeGen/fake-use-landingpad.c
    A clang/test/CodeGen/fake-use-noreturn.cpp
    A clang/test/CodeGen/fake-use-return-line.c
    A clang/test/CodeGen/fake-use-sanitizer.cpp
    A clang/test/CodeGen/fake-use-scalar.c
    A clang/test/CodeGen/fake-use-this.cpp
    A clang/test/CodeGen/fake-use-while.c

  Log Message:
  -----------
  [Clang] Add fake use emission to Clang with -fextend-lifetimes (#110102)

Following the previous patch which adds the "extend lifetimes" flag
without (almost) any functionality, this patch adds the real feature by
allowing Clang to emit fake uses. These are emitted as a new form of cleanup,
set for variable addresses, which just emits a fake use intrinsic when the
variable falls out of scope. The code for achieving this is simple, with most
of the logic centered on determining whether to emit a fake use for a given
address, and on ensuring that fake uses are ignored in a few cases.

Co-authored-by: Stephen Tozer <stephen.tozer at sony.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list