[clang] [clang] [C23] Fix crash with _BitInt running clang-tidy (PR #65889)

2023-09-29 Thread Henrik G. Olsson via cfe-commits
@@ -1333,7 +1333,13 @@ void StmtProfiler::VisitPredefinedExpr(const PredefinedExpr *S) { void StmtProfiler::VisitIntegerLiteral(const IntegerLiteral *S) { VisitExpr(S); S->getValue().Profile(ID); - ID.AddInteger(S->getType()->castAs()->getKind()); + + QualType T = S->get

[clang] [clang] [C23] Fix crash with _BitInt running clang-tidy (PR #65889)

2023-09-19 Thread via cfe-commits
vabridgers wrote: I've updated the review per recent comments, please review at your convenience. Thanks! https://github.com/llvm/llvm-project/pull/65889 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/li

[clang] [clang] [C23] Fix crash with _BitInt running clang-tidy (PR #65889)

2023-09-18 Thread via cfe-commits
@@ -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()->getKind()); + + QualType T = S->get

[clang] [clang] [C23] Fix crash with _BitInt running clang-tidy (PR #65889)

2023-09-17 Thread via cfe-commits
https://github.com/vabridgers resolved 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

[clang] [clang] [C23] Fix crash with _BitInt running clang-tidy (PR #65889)

2023-09-17 Thread via cfe-commits
@@ -0,0 +1,10 @@ +// RUN: %check_clang_tidy %s bugprone-inc-dec-in-conditions %t + +#define foo(x) \ + ({ \ +_BitInt(5) y = x; \

[clang] [clang] [C23] Fix crash with _BitInt running clang-tidy (PR #65889)

2023-09-17 Thread via cfe-commits
https://github.com/vabridgers updated https://github.com/llvm/llvm-project/pull/65889 >From 753f8fd0fba767a5ba1abd30d35df379292e454c Mon Sep 17 00:00:00 2001 From: Vince Bridgers Date: Sat, 9 Sep 2023 12:19:07 +0200 Subject: [PATCH] [clang] [C23] Fix crash with _BitInt running clang-tidy This

[clang] [clang] [C23] Fix crash with _BitInt running clang-tidy (PR #65889)

2023-09-11 Thread via cfe-commits
https://github.com/DonatNagyE edited 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

[clang] [clang] [C23] Fix crash with _BitInt running clang-tidy (PR #65889)

2023-09-11 Thread via cfe-commits
https://github.com/DonatNagyE edited 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

[clang] [clang] [C23] Fix crash with _BitInt running clang-tidy (PR #65889)

2023-09-11 Thread via cfe-commits
@@ -0,0 +1,10 @@ +// RUN: %check_clang_tidy %s bugprone-inc-dec-in-conditions %t + +#define foo(x) \ + ({ \ +_BitInt(5) y = x; \

[clang] [clang] [C23] Fix crash with _BitInt running clang-tidy (PR #65889)

2023-09-11 Thread via cfe-commits
@@ -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()->getKind()); + + int FoldingSetID =

[clang] [clang] [C23] Fix crash with _BitInt running clang-tidy (PR #65889)

2023-09-11 Thread via cfe-commits
https://github.com/DonatNagyE edited 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

[clang] [clang] [C23] Fix crash with _BitInt running clang-tidy (PR #65889)

2023-09-11 Thread via cfe-commits
https://github.com/DonatNagyE requested changes to this pull request. 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

[clang] [clang] [C23] Fix crash with _BitInt running clang-tidy (PR #65889)

2023-09-10 Thread via cfe-commits
https://github.com/llvmbot labeled 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

[clang] [clang] [C23] Fix crash with _BitInt running clang-tidy (PR #65889)

2023-09-10 Thread via cfe-commits
https://github.com/llvmbot labeled 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

[clang] [clang] [C23] Fix crash with _BitInt running clang-tidy (PR #65889)

2023-09-10 Thread via cfe-commits
https://github.com/vabridgers review_requested 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

[clang] [clang] [C23] Fix crash with _BitInt running clang-tidy (PR #65889)

2023-09-10 Thread via cfe-commits
https://github.com/vabridgers review_requested 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

[clang] [clang] [C23] Fix crash with _BitInt running clang-tidy (PR #65889)

2023-09-10 Thread via cfe-commits
https://github.com/vabridgers review_requested 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

[clang] [clang] [C23] Fix crash with _BitInt running clang-tidy (PR #65889)

2023-09-10 Thread via cfe-commits
https://github.com/vabridgers review_requested 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

[clang] [clang] [C23] Fix crash with _BitInt running clang-tidy (PR #65889)

2023-09-10 Thread via cfe-commits
https://github.com/vabridgers created https://github.com/llvm/llvm-project/pull/65889: This crash was exposed recently in our randomized testing. _BitInts were not being handled properly during IntegerLiteral visitation. This patch addresses the problem for now. The BitIntType has no getKind(