[HLSL] Remove global ctor/dtor variable for non-lib profile.
authorXiang Li <python3kgae@outlook.com>
Thu, 6 Oct 2022 21:00:25 +0000 (14:00 -0700)
committerXiang Li <python3kgae@outlook.com>
Thu, 6 Oct 2022 22:00:50 +0000 (15:00 -0700)
commit2bdfececef4330b3a6489cdb67c57eb771d5f9e4
treeefbb516d3e5afffb728b015f7d8efac24ffb37fa
parentf491b898c5d1312112d14f02d9cbdea7a4b4dc9d
[HLSL] Remove global ctor/dtor variable for non-lib profile.

After generated call for ctor/dtor for entry, global variable for ctor/dtor are useless.
Remove them for non-lib profiles.
Lib profile still need these in case export function used the global variable which require ctor/dtor.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D133993
clang/lib/CodeGen/CGHLSLRuntime.cpp
clang/test/CodeGenHLSL/GlobalConstructorFunction.hlsl
clang/test/CodeGenHLSL/GlobalConstructorLib.hlsl
clang/test/CodeGenHLSL/GlobalConstructors.hlsl
clang/test/CodeGenHLSL/GlobalDestructors.hlsl