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

Chris Bieneman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 7 13:47:00 PDT 2022


beanz added inline comments.


================
Comment at: clang/test/CodeGenHLSL/GlobalConstructors.hlsl:3
+
+RWBuffer<float> Buffer;
+
----------------
aaron.ballman wrote:
> Can you also add a test using `__attribute__((constructor))`? And probably one using `__attribute__((destructor))` at some point as well?
> 
> https://godbolt.org/z/jqedf1qGa
> 
> I see the docs said that global destructors are not supported, which is fine, but then what's the behavior when a user tries one anyway? (I would expect we'd get reasonable errors about it not being supported). Feel free to handle the dtor bits in a follow-up though.
I need to play with this. We don't currently support global destructors, but I think we're going to in Clang.

I'll try to get a second patch up today or tomorrow to add global destructors.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132977/new/

https://reviews.llvm.org/D132977



More information about the cfe-commits mailing list