[all-commits] [llvm/llvm-project] a48300: [clang][OpenMP][DebugInfo] Debug support for TLS v...

Alok Kumar Sharma via All-commits all-commits at lists.llvm.org
Sat Apr 23 00:00:28 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a48300aee570f8eea4ec0b03e2d176aab648afb0
  Author: Alok Kumar Sharma <AlokKumar.Sharma at amd.com>
  Date:   2022-04-23 (Sat, 23 Apr 2022)

  Changed paths:
    M clang/include/clang/AST/Decl.h
    M clang/lib/CodeGen/CGDecl.cpp
    M clang/lib/CodeGen/CGStmtOpenMP.cpp
    A clang/test/OpenMP/debug_threadprivate_copyin.c

  Log Message:
  [clang][OpenMP][DebugInfo] Debug support for TLS variables present in OpenMP consruct

In case of OpenMP programs, thread local variables can be present in
any clause pertaining to OpenMP constructs, as we know that compiler
generates artificial functions and in some cases values are passed to
those artificial functions thru parameters. For an example, if thread
local variable is present in copyin clause (testcase attached with the
patch), parameter with same name is generated as parameter to artificial
function. When user inquires the thread Local variable, its debug info
is hidden by the parameter. User never gets the actual TLS variable
when inquires it, instead gets the artificial parameter.

Current patch suppresses the debug info for such artificial parameter to
enable correct debugging of TLS variables.

Reviewed By: aprantl

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

More information about the All-commits mailing list