llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

<details>
<summary>Changes</summary>

The addition of the type kind to the profile ID of IntegerLiterals results in 
e.g. size_t and unsigned long literals mismatch even on platforms where they 
are canonically the same type. This patch checks the Canonical field to 
determine whether to canonicalize the type first.

rdar://116063468

---
Full diff: https://github.com/llvm/llvm-project/pull/67822.diff


1 Files Affected:

- (modified) clang/lib/AST/StmtProfile.cpp (+2) 


``````````diff
diff --git a/clang/lib/AST/StmtProfile.cpp b/clang/lib/AST/StmtProfile.cpp
index 2e4f15f83ac26ef..763d3d612698095 100644
--- a/clang/lib/AST/StmtProfile.cpp
+++ b/clang/lib/AST/StmtProfile.cpp
@@ -1335,6 +1335,8 @@ void StmtProfiler::VisitIntegerLiteral(const 
IntegerLiteral *S) {
   S->getValue().Profile(ID);
 
   QualType T = S->getType();
+  if (Canonical)
+    T = T.getCanonicalType();
   ID.AddInteger(T->getTypeClass());
   if (auto BitIntT = T->getAs<BitIntType>())
     BitIntT->Profile(ID);

``````````

</details>


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

Reply via email to