================
@@ -1333,7 +1333,14 @@ 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());
+
+  QualType T = S->getType();
+  if (auto BitIntT = T->getAs<BitIntType>()) {
+    BitIntT->Profile(ID, BitIntT->isSigned(), BitIntT->getNumBits());
----------------
DonatNagyE wrote:

```suggestion
    ID.AddBoolean(true);
    BitIntT->Profile(ID);
```
(1) Add a boolean true to guarantee a difference from the other branch 
(otherwise we could theoretically get a hash collision in the case when the 
number of bits in an unsigned BitInt type happens to be equal to the kind of a 
builtin integer type).
(2) `BitIntType` has two methods named `Profile`; use the non-static one.

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