================
@@ -406,6 +406,16 @@ void TargetInfo::adjust(DiagnosticsEngine &Diags, 
LangOptions &Opts) {
     LongDoubleAlign = 64;
   }
 
+  // HLSL explicitly defines the sizes and formats of some data types, and we
+  // need to conform to those regardless of what architecture you are 
targeting.
+  if (Opts.HLSL) {
+    LongWidth = LongAlign = 64;
+    if (!Opts.NativeHalfType) {
+      HalfFormat = &llvm::APFloat::IEEEsingle();
+      HalfWidth = HalfAlign = 32;
----------------
llvm-beanz wrote:

Just as a note, we don't actually use this value anywhere in the HLSL code 
generation paths (yet), which is why it wasn't causing problems that we 
overrode the format returned by the AST context, but didn't override these 
values.

https://github.com/llvm/llvm-project/pull/90694
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to