Author: Sander de Smalen
Date: 2024-05-02T16:13:37Z
New Revision: 0708500ce0149c501e802b7ab6581770cc7a5334

URL: 
https://github.com/llvm/llvm-project/commit/0708500ce0149c501e802b7ab6581770cc7a5334
DIFF: 
https://github.com/llvm/llvm-project/commit/0708500ce0149c501e802b7ab6581770cc7a5334.diff

LOG: [Clang] Remove bogus assert in are[Lax]CompatibleSveTypes()

This caused an assertion failure for the following input:

  __SVInt32_t bar(__SVInt32_t x);

  void foo(__SVInt32_t x) {
    return bar(x);
  }

Added: 
    

Modified: 
    clang/lib/AST/ASTContext.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index cbf4932aff9a6b..03014568f8fe66 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -9554,11 +9554,6 @@ static uint64_t getSVETypeSize(ASTContext &Context, 
const BuiltinType *Ty) {
 
 bool ASTContext::areCompatibleSveTypes(QualType FirstType,
                                        QualType SecondType) {
-  assert(
-      ((FirstType->isSVESizelessBuiltinType() && SecondType->isVectorType()) ||
-       (FirstType->isVectorType() && SecondType->isSVESizelessBuiltinType())) 
&&
-      "Expected SVE builtin type and vector type!");
-
   auto IsValidCast = [this](QualType FirstType, QualType SecondType) {
     if (const auto *BT = FirstType->getAs<BuiltinType>()) {
       if (const auto *VT = SecondType->getAs<VectorType>()) {
@@ -9584,11 +9579,6 @@ bool ASTContext::areCompatibleSveTypes(QualType 
FirstType,
 
 bool ASTContext::areLaxCompatibleSveTypes(QualType FirstType,
                                           QualType SecondType) {
-  assert(
-      ((FirstType->isSVESizelessBuiltinType() && SecondType->isVectorType()) ||
-       (FirstType->isVectorType() && SecondType->isSVESizelessBuiltinType())) 
&&
-      "Expected SVE builtin type and vector type!");
-
   auto IsLaxCompatible = [this](QualType FirstType, QualType SecondType) {
     const auto *BT = FirstType->getAs<BuiltinType>();
     if (!BT)


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to