puneeth_aditya_56 aef7e5768e
[DirectX] Fix assertion in PointerTypeAnalysis with empty global_ctors (#179034)
When `llvm.global_ctors` has no elements (e.g., when all resources are
unused in a shader library), its initializer is a `zeroinitializer`
(`ConstantAggregateZero`) rather than a `ConstantArray`. The previous
code used `cast<ConstantArray>` which asserts on incompatible types:

> "cast<Ty>() argument of incompatible type!"

This patch uses `dyn_cast` and returns early if the initializer is not a
`ConstantArray`, handling the edge case gracefully.

Fixes #178993.

Co-authored-by: Kaitlin Peng <kaitlinpeng@microsoft.com>
2026-03-17 12:06:07 -07:00
..
2025-04-10 16:40:05 -04:00