[clang] [clang-tools-extra] [Clang] Make the SizeType, SignedSizeType and PtrdiffType be named sugar types instead of built-in types (PR #143653)
Matheus Izvekov via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 27 14:39:54 PDT 2025
================
@@ -1480,6 +1480,16 @@ static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context,
return false;
break;
}
+ case Type::PredefinedSugar: {
+ const auto *TP1 = cast<PredefinedSugarType>(T1);
+ const auto *TP2 = cast<PredefinedSugarType>(T2);
+ if (TP1->getKind() != TP2->getKind())
+ return false;
+ else
+ assert(TP1->getCanonicalTypeInternal() ==
+ TP2->getCanonicalTypeInternal());
----------------
mizvekov wrote:
```suggestion
```
We can't directly compare pointers like that here, as this structural equivalence library is used to compare nodes from different ASTContexts, and the pointers being different doesn't mean anything in that case.
https://github.com/llvm/llvm-project/pull/143653
More information about the cfe-commits
mailing list