[clang] [clang] improve consistency with GCC vector comparison (PR #148954)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 21 06:36:37 PDT 2025


================
@@ -876,6 +876,15 @@ class ASTContext : public RefCountedBase<ASTContext> {
   QualType getIntTypeForBitwidth(unsigned DestWidth,
                                  unsigned Signed) const;
 
+  /// getGCCCompatibleIntTypeForBitwidth -
+  /// sets integer QualTy according to specified details:
+  /// bitwidth, signed/unsigned.
+  /// this function is compatible with GCC's preference:
+  /// int > signed char > short > long > long long > int128_t
+  /// Returns empty type if there is no appropriate target types.
+  QualType getGCCCompatibleIntTypeForBitwidth(unsigned DestWidth,
+                                              unsigned Signed) const;
----------------
erichkeane wrote:

```suggestion
                                              bool Signed) const;
```

https://github.com/llvm/llvm-project/pull/148954


More information about the cfe-commits mailing list