================
@@ -400,6 +400,69 @@ constexpr TypeBuilderFunc getModel<bool &>() {
     return fir::ReferenceType::get(f(context));
   };
 }
+template <>
+constexpr TypeBuilderFunc getModel<unsigned short>() {
+  return getModel<short>();
----------------
jeanPerier wrote:

> The existing code does not distinguish unsigned int from signed int
Oh, I see.

That is likely just because only the short case is likely problematic. The 
[code dealing with target specific 
aspects](https://github.com/llvm/llvm-project/blob/ed6ddffb583beb450c4b0e1747ccd14f7e063105/flang/lib/Optimizer/CodeGen/Target.cpp#L113
 ) that adds signext/zeroext is only triggered for integer types strictly 
smaller that the `int` type.

I think I would favor things being consistent and having the unsigned aspect 
always set here and leave it up to the target aspects to do whatever is needed 
when generating the LLVM IR (that does not have an unsigned integer type, just 
specific operations and integer extension attributes).

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

Reply via email to