================
@@ -1333,7 +1333,15 @@ void StmtProfiler::VisitPredefinedExpr(const 
PredefinedExpr *S) {
 void StmtProfiler::VisitIntegerLiteral(const IntegerLiteral *S) {
   VisitExpr(S);
   S->getValue().Profile(ID);
-  ID.AddInteger(S->getType()->castAs<BuiltinType>()->getKind());
+
+  int FoldingSetID = 0;
+
+  if (S->getType()->isBitIntType())
+    FoldingSetID = S->getValue().getSExtValue();
+  else
+    FoldingSetID = S->getType()->castAs<BuiltinType>()->getKind();
+
+  ID.AddInteger(FoldingSetID);
----------------
AaronBallman wrote:

Each `Type` subclass has a `Profile()` function that determines type identity. 
This is how we ensure that a `_BitInt(2)` and a `_BitInt(3)` can both be 
represented by `BitIntType` but not be the same type for things like 
redeclarations or overloading.

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

Reply via email to