Skip to content

Commit 65c6e68

Browse files
hnrklssnharviniriawan
authored andcommitted
[clang] Add missing canonicalization in int literal profile (#67822)
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
1 parent 9e15eb5 commit 65c6e68

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

clang/lib/AST/StmtProfile.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,6 +1335,8 @@ void StmtProfiler::VisitIntegerLiteral(const IntegerLiteral *S) {
13351335
S->getValue().Profile(ID);
13361336

13371337
QualType T = S->getType();
1338+
if (Canonical)
1339+
T = T.getCanonicalType();
13381340
ID.AddInteger(T->getTypeClass());
13391341
if (auto BitIntT = T->getAs<BitIntType>())
13401342
BitIntT->Profile(ID);

0 commit comments

Comments
 (0)