[all-commits] [llvm/llvm-project] a8a499: [HLSL] Call global destructors from entries

Chris B via All-commits all-commits at lists.llvm.org
Tue Sep 13 13:06:12 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a8a49923ddf75be9b6166be2f6a1f50a99817841
      https://github.com/llvm/llvm-project/commit/a8a49923ddf75be9b6166be2f6a1f50a99817841
  Author: Chris Bieneman <chris.bieneman at me.com>
  Date:   2022-09-13 (Tue, 13 Sep 2022)

  Changed paths:
    M clang/docs/HLSL/EntryFunctions.rst
    M clang/lib/CodeGen/CGHLSLRuntime.cpp
    M clang/lib/CodeGen/CGHLSLRuntime.h
    M clang/lib/CodeGen/MicrosoftCXXABI.cpp
    M clang/test/CodeGenHLSL/GlobalConstructorFunction.hlsl
    A clang/test/CodeGenHLSL/GlobalDestructors.hlsl

  Log Message:
  -----------
  [HLSL] Call global destructors from entries

HLSL doesn't have a C++ runtime that supports `atexit` registration. To
enable global destructors we instead rely on the `llvm.global_dtor`
mechanism.

This change disables `atexit` generation for HLSL and updates the HLSL
code generation to call global destructors on the exit from entry
functions.

Depends on D132977.

Reviewed By: aaron.ballman

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




More information about the All-commits mailing list