[PATCH] D132977: [HLSL] Call global constructors inside entry

Chris Bieneman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 30 14:44:23 PDT 2022


beanz created this revision.
beanz added reviewers: aaron.ballman, bogner, python3kgae, pow2clk, tex3d, eli.friedman.
Herald added a subscriber: Anastasia.
Herald added a project: All.
beanz requested review of this revision.
Herald added a project: clang.

HLSL doesn't have a runtime loader model that supports global
construction by a loader or runtime initializer. To allow us to leverage
global constructors with minimal code generation impact we put calls to
the global constructors inside the generated entry function.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D132977

Files:
  clang/docs/HLSL/EntryFunctions.rst
  clang/lib/CodeGen/CGHLSLRuntime.cpp
  clang/lib/CodeGen/CGHLSLRuntime.h
  clang/test/CodeGenHLSL/GlobalConstructors.hlsl

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132977.456801.patch
Type: text/x-patch
Size: 4488 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220830/8ece39b2/attachment-0001.bin>


More information about the cfe-commits mailing list