[clang] Fix the warning in RefCntblBaseVirtualDtorChecker.cpp:61 (PR #93403)

2024-05-26 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni approved this pull request. Thanks! https://github.com/llvm/llvm-project/pull/93403 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [webkit.RefCntblBaseVirtualDtor] Allow CRTP classes without a virtual destructor. (PR #92837)

2024-05-25 Thread NAKAMURA Takumi via cfe-commits
@@ -11,16 +11,116 @@ #include "PtrTypesSemantics.h" #include "clang/AST/CXXInheritance.h" #include "clang/AST/RecursiveASTVisitor.h" +#include "clang/AST/StmtVisitor.h" #include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h" #include

[clang] [Coverage][Expansion] handle nested macros in scratch space (PR #89869)

2024-05-23 Thread NAKAMURA Takumi via cfe-commits
chapuni wrote: @whentojump AFAIK, both of them missed boarding 18.1.6. I'll wait for opportunities. https://github.com/llvm/llvm-project/pull/89869 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Coverage][Expansion] handle nested macros in scratch space (PR #89869)

2024-05-23 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni closed https://github.com/llvm/llvm-project/pull/89869 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Coverage][Expansion] handle nested macros in scratch space (PR #89869)

2024-05-23 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni approved this pull request. I'd like other approvals by clang guys. @AaronBallman Could you nominate anyone? https://github.com/llvm/llvm-project/pull/89869 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Coverage][Expansion] handle nested macros in scratch space (PR #89869)

2024-05-23 Thread NAKAMURA Takumi via cfe-commits
@@ -0,0 +1,65 @@ +// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c99 -fcoverage-mcdc -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only %s | FileCheck %s chapuni wrote: You may overwrite 896bceb with this.

[clang] [MC/DC][Coverage] Add assertions into emitSourceRegions() (PR #89572)

2024-05-22 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni closed https://github.com/llvm/llvm-project/pull/89572 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [MC/DC][Coverage] Add assertions into emitSourceRegions() (PR #89572)

2024-05-22 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni edited https://github.com/llvm/llvm-project/pull/89572 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Coverage][Expansion] handle nested macros in scratch space (PR #89869)

2024-05-22 Thread NAKAMURA Takumi via cfe-commits
@@ -339,8 +365,18 @@ class CoverageMappingBuilder { llvm::SmallSet Visited; SmallVector, 8> FileLocs; -for (const auto : SourceRegions) { +for (auto : SourceRegions) { SourceLocation Loc = Region.getBeginLoc(); + + // Replace Region with its

[clang] [Coverage][Expansion] handle nested macros in scratch space (PR #89869)

2024-05-22 Thread NAKAMURA Takumi via cfe-commits
@@ -292,10 +292,36 @@ class CoverageMappingBuilder { return SM.getLocForEndOfFile(SM.getFileID(Loc)); } - /// Find out where the current file is included or macro is expanded. - SourceLocation getIncludeOrExpansionLoc(SourceLocation Loc) { -return Loc.isMacroID()

[clang] [Coverage][Expansion] handle nested macros in scratch space (PR #89869)

2024-05-22 Thread NAKAMURA Takumi via cfe-commits
@@ -339,8 +365,18 @@ class CoverageMappingBuilder { llvm::SmallSet Visited; SmallVector, 8> FileLocs; -for (const auto : SourceRegions) { +for (auto : SourceRegions) { SourceLocation Loc = Region.getBeginLoc(); + + // Replace Region with its

[clang] [Coverage][Expansion] handle nested macros in scratch space (PR #89869)

2024-05-21 Thread NAKAMURA Takumi via cfe-commits
chapuni wrote: @whentojump Any updates? Or Is it better for me to take this over? https://github.com/llvm/llvm-project/pull/89869 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Coverage] Rework !SystemHeadersCoverage (PR #91446)

2024-05-20 Thread NAKAMURA Takumi via cfe-commits
chapuni wrote: @AaronBallman Thanks. Aha, I've noticed my test was incompatible for targeting msvc mangling. https://github.com/llvm/llvm-project/pull/91446 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [MC/DC][Coverage] Add assertions into emitSourceRegions() (PR #89572)

2024-05-20 Thread NAKAMURA Takumi via cfe-commits
@@ -190,6 +190,16 @@ class SourceMappingRegion { bool isBranch() const { return FalseCount.has_value(); } + bool isMCDCBranch() const { +const auto *BranchParams = std::get_if(); +assert(BranchParams == nullptr || BranchParams->ID >= 0); +return (BranchParams

[clang] [MC/DC][Coverage] Add assertions into emitSourceRegions() (PR #89572)

2024-05-20 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni updated https://github.com/llvm/llvm-project/pull/89572 >From 13035b230fd51422f6c3223fcffab4f44bd00956 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Fri, 19 Apr 2024 15:26:34 +0900 Subject: [PATCH 1/4] [MC/DC][Coverage] Add assertions into emitSourceRegions()

[clang] [Coverage] Rework !SystemHeadersCoverage (PR #91446)

2024-05-20 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni closed https://github.com/llvm/llvm-project/pull/91446 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Coverage] Rework !SystemHeadersCoverage (PR #91446)

2024-05-20 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni updated https://github.com/llvm/llvm-project/pull/91446 >From d3ee2d086d07ce0803117ec9fa16ac72801619c7 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Thu, 2 May 2024 09:36:39 +0900 Subject: [PATCH 1/2] [Coverage] Rework !SystemHeadersCoverage - Introduce

[clang] [Coverage] Rework !SystemHeadersCoverage (PR #91446)

2024-05-19 Thread NAKAMURA Takumi via cfe-commits
@@ -2064,7 +2082,20 @@ struct CounterCoverageMappingBuilder createDecisionRegion(E, DecisionParams); } + /// Check if E belongs to system headers. + bool isExprInSystemHeader(const BinaryOperator *E) const { chapuni wrote: I assume each visitor

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-05-16 Thread NAKAMURA Takumi via cfe-commits
chapuni wrote: For now, I've implemented almost functionalities for this. Both `-fmcdc-max-conditions=32767` and `-fmcdc-max-test-vectors=0x7FFE` are cc1options. `llvm-cov` can understand `clang-18`'s profdata (and objects). TODO: documents and test cases

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-05-16 Thread NAKAMURA Takumi via cfe-commits
@@ -983,7 +979,7 @@ void CodeGenPGO::mapRegionCounters(const Decl *D) { // for most embedded applications. Setting a maximum value prevents the // bitmap footprint from growing too large without the user's knowledge. In // the future, this value could be adjusted with a

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-05-10 Thread NAKAMURA Takumi via cfe-commits
@@ -190,18 +190,30 @@ class SourceMappingRegion { bool isBranch() const { return FalseCount.has_value(); } + bool isMCDCBranch() const { +const auto *BranchParams = std::get_if(); +assert(BranchParams == nullptr || BranchParams->ID >= 0); +return

[clang] 2a61eeb - Cleanup asserts in BranchParameters and DecisionParameters

2024-05-10 Thread NAKAMURA Takumi via cfe-commits
Author: NAKAMURA Takumi Date: 2024-05-10T16:00:16+09:00 New Revision: 2a61eebc66c0903cf3834a520b1f975ac3cdf92b URL: https://github.com/llvm/llvm-project/commit/2a61eebc66c0903cf3834a520b1f975ac3cdf92b DIFF:

[clang] 7e52ad3 - Fix a warning for #91455 [-Wc++20-extensions]

2024-05-10 Thread NAKAMURA Takumi via cfe-commits
Author: NAKAMURA Takumi Date: 2024-05-10T16:00:16+09:00 New Revision: 7e52ad3b5b9509d0873965e8492ab01141342822 URL: https://github.com/llvm/llvm-project/commit/7e52ad3b5b9509d0873965e8492ab01141342822 DIFF:

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-05-10 Thread NAKAMURA Takumi via cfe-commits
@@ -190,18 +190,30 @@ class SourceMappingRegion { bool isBranch() const { return FalseCount.has_value(); } + bool isMCDCBranch() const { +const auto *BranchParams = std::get_if(); +assert(BranchParams == nullptr || BranchParams->ID >= 0); chapuni

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-05-10 Thread NAKAMURA Takumi via cfe-commits
@@ -1128,9 +1122,11 @@ void CodeGenPGO::emitMCDCParameters(CGBuilderTy ) { // Emit intrinsic representing MCDC bitmap parameters at function entry. // This is used by the instrumentation pass, but it isn't actually lowered to // anything. - llvm::Value *Args[3] =

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-05-09 Thread NAKAMURA Takumi via cfe-commits
@@ -2050,23 +2069,74 @@ struct CounterCoverageMappingBuilder subtractCounters(ParentCount, TrueCount)); } - void createDecision(const BinaryOperator *E) { + void createOrCancelDecision(const BinaryOperator *E, unsigned Since) { unsigned

[clang] [Coverage] Rework !SystemHeadersCoverage (PR #91446)

2024-05-08 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni created https://github.com/llvm/llvm-project/pull/91446 - Introduce `LeafExprSet`, - Suppress traversing LAnd and LOr expr under system headers. - Handle LAnd and LOr as instrumented leaves to override `!isInstrumentedCondition(C)`. - Replace Loc with FileLoc if

[clang] [Clang] Implement C++26 Attributes for Structured Bindings (P0609R3) (PR #89906)

2024-04-28 Thread NAKAMURA Takumi via cfe-commits
@@ -1115,7 +1115,9 @@ int64_t Decl::getID() const { const FunctionType *Decl::getFunctionType(bool BlocksToo) const { QualType Ty; - if (const auto *D = dyn_cast(this)) + if (const auto *D = dyn_cast(this)) chapuni wrote: Seems causes the warning.

[clang] [Coverage][Expansion] handle nested macros in scratch space (PR #89869)

2024-04-24 Thread NAKAMURA Takumi via cfe-commits
@@ -292,10 +292,36 @@ class CoverageMappingBuilder { return SM.getLocForEndOfFile(SM.getFileID(Loc)); } - /// Find out where the current file is included or macro is expanded. - SourceLocation getIncludeOrExpansionLoc(SourceLocation Loc) { -return Loc.isMacroID()

[clang] [Coverage][Expansion] handle nested macros in scratch space (PR #89869)

2024-04-24 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni commented: They could be simpler if `SourceRegion` were compatible to `std::pair`. (I don't require you to work) https://github.com/llvm/llvm-project/pull/89869 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Coverage][Expansion] handle nested macros in scratch space (PR #89869)

2024-04-24 Thread NAKAMURA Takumi via cfe-commits
@@ -339,8 +365,17 @@ class CoverageMappingBuilder { llvm::SmallSet Visited; SmallVector, 8> FileLocs; -for (const auto : SourceRegions) { +for (auto : SourceRegions) { SourceLocation Loc = Region.getBeginLoc(); + + // Replace Region with its

[clang] [Coverage][Expansion] handle nested macros in scratch space (PR #89869)

2024-04-24 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni edited https://github.com/llvm/llvm-project/pull/89869 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Coverage][Expansion] handle nested macros in scratch space (PR #89869)

2024-04-24 Thread NAKAMURA Takumi via cfe-commits
@@ -292,10 +292,36 @@ class CoverageMappingBuilder { return SM.getLocForEndOfFile(SM.getFileID(Loc)); } - /// Find out where the current file is included or macro is expanded. - SourceLocation getIncludeOrExpansionLoc(SourceLocation Loc) { -return Loc.isMacroID()

[clang] [Coverage][Expansion] handle nested macros in scratch space (PR #89869)

2024-04-24 Thread NAKAMURA Takumi via cfe-commits
@@ -292,10 +292,22 @@ class CoverageMappingBuilder { return SM.getLocForEndOfFile(SM.getFileID(Loc)); } - /// Find out where the current file is included or macro is expanded. - SourceLocation getIncludeOrExpansionLoc(SourceLocation Loc) { -return Loc.isMacroID()

[clang] [Coverage][Expansion] handle nested macros in scratch space (PR #89869)

2024-04-24 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni commented: I've confirmed this works. I'd like to wait for other opinions. My comments are just my preferences. https://github.com/llvm/llvm-project/pull/89869 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Coverage][Expansion] handle nested macros in scratch space (PR #89869)

2024-04-24 Thread NAKAMURA Takumi via cfe-commits
@@ -339,8 +355,18 @@ class CoverageMappingBuilder { llvm::SmallSet Visited; SmallVector, 8> FileLocs; -for (const auto : SourceRegions) { +for (auto : SourceRegions) { SourceLocation Loc = Region.getBeginLoc(); + + // Replace Region with its

[clang] [Coverage][Expansion] handle nested macros in scratch space (PR #89869)

2024-04-24 Thread NAKAMURA Takumi via cfe-commits
@@ -298,6 +298,22 @@ class CoverageMappingBuilder { : SM.getIncludeLoc(SM.getFileID(Loc)); } + /// Find out where the current file is included or macro is expanded. If the + /// found expansion is a , keep looking. + SourceLocation

[clang] [Coverage][Expansion] handle nested macros in scratch space (PR #89869)

2024-04-24 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni edited https://github.com/llvm/llvm-project/pull/89869 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [MC/DC][Coverage] Workaround for `##` conditions (PR #89573)

2024-04-24 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni closed https://github.com/llvm/llvm-project/pull/89573 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [MC/DC][Coverage] Workaround for `##` conditions (PR #89573)

2024-04-24 Thread NAKAMURA Takumi via cfe-commits
chapuni wrote: See #89869 . https://github.com/llvm/llvm-project/pull/89573 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [MC/DC][Coverage] Workaround for `##` conditions (PR #89573)

2024-04-24 Thread NAKAMURA Takumi via cfe-commits
chapuni wrote: @whentojump Thanks. Would you like to take this over? Then I will close this. https://github.com/llvm/llvm-project/pull/89573 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [MC/DC][Coverage] Workaround for `##` conditions (PR #89573)

2024-04-22 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni created https://github.com/llvm/llvm-project/pull/89573 A synthesized identifier with `##` is emitted to ``. `llvm-cov` cannot handle ` since it doesn't have actual files. As a workaround, peel `` to the actual definition if the definition is present. This affects

[clang] [MC/DC][Coverage] Add assertions into emitSourceRegions() (PR #89572)

2024-04-22 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni updated https://github.com/llvm/llvm-project/pull/89572 >From 13035b230fd51422f6c3223fcffab4f44bd00956 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Fri, 19 Apr 2024 15:26:34 +0900 Subject: [PATCH 1/2] [MC/DC][Coverage] Add assertions into emitSourceRegions()

[clang] [MC/DC][Coverage] Add assertions into emitSourceRegions() (PR #89572)

2024-04-22 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni created https://github.com/llvm/llvm-project/pull/89572 `emitSourceRegions()` has bugs to emit malformed MC/DC coverage mappings. They were detected in `llvm-cov` as the crash. Detect inconsistencies earlier in `clang` with assertions. * mcdc-system-headers.cpp

[clang] 36e2577 - clang/test/APINotes/instancetype.m: Clean the cache dir

2024-04-09 Thread NAKAMURA Takumi via cfe-commits
Author: NAKAMURA Takumi Date: 2024-04-10T10:14:22+09:00 New Revision: 36e25772ddd049c8c742e55fbd2b3c9aaceb7060 URL: https://github.com/llvm/llvm-project/commit/36e25772ddd049c8c742e55fbd2b3c9aaceb7060 DIFF:

[clang] d08a76d - Fix warnings discovered by #87348 [-Wunused-but-set-variable]

2024-04-06 Thread NAKAMURA Takumi via cfe-commits
Author: NAKAMURA Takumi Date: 2024-04-07T11:02:08+09:00 New Revision: d08a76d1ac1ba6b376faa908ccbaaabc999dfbc5 URL: https://github.com/llvm/llvm-project/commit/d08a76d1ac1ba6b376faa908ccbaaabc999dfbc5 DIFF:

[clang] [compiler-rt] [llvm] [InstrProf] Single byte counters in coverage (PR #75425)

2024-02-27 Thread NAKAMURA Takumi via cfe-commits
@@ -1503,38 +1527,53 @@ struct CounterCoverageMappingBuilder } // Create Branch Region around condition. -createBranchRegion(S->getCond(), BodyCount, - subtractCounters(CondCount, BodyCount)); +if (!llvm::EnableSingleByteCoverage) +

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-02-26 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni edited https://github.com/llvm/llvm-project/pull/82448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-02-26 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni edited https://github.com/llvm/llvm-project/pull/82448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-02-26 Thread NAKAMURA Takumi via cfe-commits
@@ -1201,19 +1197,22 @@ void CodeGenPGO::emitMCDCCondBitmapUpdate(CGBuilderTy , const Expr *S, // Extract the ID of the condition we are setting in the bitmap. const auto = BranchStateIter->second; assert(Branch.ID >= 0 && "Condition has no ID!"); +

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-02-26 Thread NAKAMURA Takumi via cfe-commits
@@ -1128,9 +1122,11 @@ void CodeGenPGO::emitMCDCParameters(CGBuilderTy ) { // Emit intrinsic representing MCDC bitmap parameters at function entry. // This is used by the instrumentation pass, but it isn't actually lowered to // anything. - llvm::Value *Args[3] =

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-02-26 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni edited https://github.com/llvm/llvm-project/pull/82448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-02-26 Thread NAKAMURA Takumi via cfe-commits
@@ -1201,19 +1197,22 @@ void CodeGenPGO::emitMCDCCondBitmapUpdate(CGBuilderTy , const Expr *S, // Extract the ID of the condition we are setting in the bitmap. const auto = BranchStateIter->second; assert(Branch.ID >= 0 && "Condition has no ID!"); +

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-02-26 Thread NAKAMURA Takumi via cfe-commits
@@ -973,9 +970,11 @@ void InstrLowerer::lowerMCDCTestVectorBitmapUpdate( auto *MCDCCondBitmapAddr = Update->getMCDCCondBitmapAddr(); auto *BitmapAddr = getBitmapAddress(Update); - // Load Temp Val. + // Load Temp Val + BitmapIdx. // %mcdc.temp = load i32, ptr

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-02-26 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni commented: TODO: * Version bump in file formats (wip) * Update documents https://github.com/llvm/llvm-project/pull/82448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-02-26 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni edited https://github.com/llvm/llvm-project/pull/82448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-02-26 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni ready_for_review https://github.com/llvm/llvm-project/pull/82448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-02-26 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni edited https://github.com/llvm/llvm-project/pull/82448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 0c7a605 - clangCodeGen: [MC/DC] Refactor CoverageGen.

2024-02-25 Thread NAKAMURA Takumi via cfe-commits
Author: NAKAMURA Takumi Date: 2024-02-26T16:44:19+09:00 New Revision: 0c7a605ada6cb392e6e8c16dbccf2b7e59017399 URL: https://github.com/llvm/llvm-project/commit/0c7a605ada6cb392e6e8c16dbccf2b7e59017399 DIFF:

[clang] 1f6a347 - Refactor: Let MCDC::State have DecisionByStmt and BranchByStmt

2024-02-25 Thread NAKAMURA Takumi via cfe-commits
Author: NAKAMURA Takumi Date: 2024-02-25T18:33:53+09:00 New Revision: 1f6a347c8abf8868fb4630c404480226c2efc2c2 URL: https://github.com/llvm/llvm-project/commit/1f6a347c8abf8868fb4630c404480226c2efc2c2 DIFF:

[clang] cc53707 - LLVMInstrumentation: Simplify mcdc.tvbitmap.update with GEP.

2024-02-24 Thread NAKAMURA Takumi via cfe-commits
Author: NAKAMURA Takumi Date: 2024-02-25T11:21:46+09:00 New Revision: cc53707a5c104eb7789829ecdb2e3ae2be1a42da URL: https://github.com/llvm/llvm-project/commit/cc53707a5c104eb7789829ecdb2e3ae2be1a42da DIFF:

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-02-20 Thread NAKAMURA Takumi via cfe-commits
chapuni wrote: @hanickadot Your comments to `llvm/CoverageMapping.cpp` are not for this PR. See #80676 . They are my preferences. https://github.com/llvm/llvm-project/pull/82448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-02-20 Thread NAKAMURA Takumi via cfe-commits
@@ -1959,9 +2013,44 @@ struct CounterCoverageMappingBuilder subtractCounters(ParentCount, TrueCount)); } + void RewindDecision(unsigned Since) { +#ifndef NDEBUG +llvm::DenseSet SeenIDs; +#endif +unsigned NConds = 0; chapuni

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-02-20 Thread NAKAMURA Takumi via cfe-commits
@@ -723,7 +737,15 @@ struct MCDCCoverageBuilder { if (I == CondIDs.end()) return -1; else - return I->second; + return I->second.ID; + } + + void ccc(const Expr *CondExpr, mcdc::ConditionIDs IDs) { chapuni wrote: This is w-i-p.

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-02-20 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni commented: Thanks for your comments and sorry for my hasty w-i-p work . I know a few rough implementations would be there. https://github.com/llvm/llvm-project/pull/82448 ___ cfe-commits mailing list

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-02-20 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni edited https://github.com/llvm/llvm-project/pull/82448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-02-20 Thread NAKAMURA Takumi via cfe-commits
@@ -983,7 +979,7 @@ void CodeGenPGO::mapRegionCounters(const Decl *D) { // for most embedded applications. Setting a maximum value prevents the // bitmap footprint from growing too large without the user's knowledge. In // the future, this value could be adjusted with a

[clang] [llvm] [MC/DC][Coverage] Loosen the limit of NumConds from 6 (PR #82448)

2024-02-20 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni edited https://github.com/llvm/llvm-project/pull/82448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] 75f0d40 - CoverageMapping: Move `getParams(MCDCParams)` into `mcdc::`

2024-02-15 Thread NAKAMURA Takumi via cfe-commits
Author: NAKAMURA Takumi Date: 2024-02-15T20:27:47+09:00 New Revision: 75f0d40507ea3f7c99dd3250ff0fbe6dab341910 URL: https://github.com/llvm/llvm-project/commit/75f0d40507ea3f7c99dd3250ff0fbe6dab341910 DIFF:

[clang] 3fe5a0c - MCDCCoverageBuilder: Use `pop_back_val()`

2024-02-15 Thread NAKAMURA Takumi via cfe-commits
Author: NAKAMURA Takumi Date: 2024-02-15T20:27:47+09:00 New Revision: 3fe5a0cfa5391db18fcc226f3f783642d3f44503 URL: https://github.com/llvm/llvm-project/commit/3fe5a0cfa5391db18fcc226f3f783642d3f44503 DIFF:

[clang] [llvm] [MC/DC] Refactor: Let MCDCConditionID int16_t with zero-origin (PR #81257)

2024-02-14 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni closed https://github.com/llvm/llvm-project/pull/81257 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [MC/DC] Refactor: Let MCDCConditionID int16_t with zero-origin (PR #81257)

2024-02-14 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni updated https://github.com/llvm/llvm-project/pull/81257 >From b2e8b3eaa067844a5fa5643aca17dbb0f237182e Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Sat, 10 Feb 2024 00:08:36 +0900 Subject: [PATCH 1/2] [MC/DC] Refactor: Let MCDCConditionID int16_t with

[clang] [llvm] [MC/DC] Refactor: Introduce `ConditionIDs` as `std::array<2>` (PR #81221)

2024-02-14 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni closed https://github.com/llvm/llvm-project/pull/81221 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [MC/DC] Refactor: Introduce `ConditionIDs` as `std::array<2>` (PR #81221)

2024-02-14 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni updated https://github.com/llvm/llvm-project/pull/81221 >From 66bb6cc3fd339360c16c6a98ce08f34978f665e0 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Fri, 9 Feb 2024 07:56:51 +0900 Subject: [PATCH 1/4] [MC/DC] Refactor: Introduce `ConditionIDs` as

[clang] clangCodeGen: Introduce `MCDC::State` with `MCDCState.h` (PR #81497)

2024-02-14 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni closed https://github.com/llvm/llvm-project/pull/81497 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clangCodeGen: Introduce `MCDC::State` with `MCDCState.h` (PR #81497)

2024-02-14 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni edited https://github.com/llvm/llvm-project/pull/81497 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [MC/DC] Refactor: Let MCDCConditionID int16_t with zero-origin (PR #81257)

2024-02-13 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni updated https://github.com/llvm/llvm-project/pull/81257 >From b2e8b3eaa067844a5fa5643aca17dbb0f237182e Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Sat, 10 Feb 2024 00:08:36 +0900 Subject: [PATCH 1/2] [MC/DC] Refactor: Let MCDCConditionID int16_t with

[clang] [llvm] [MC/DC] Refactor: Introduce `ConditionIDs` as `std::array<2>` (PR #81221)

2024-02-13 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni updated https://github.com/llvm/llvm-project/pull/81221 >From 66bb6cc3fd339360c16c6a98ce08f34978f665e0 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Fri, 9 Feb 2024 07:56:51 +0900 Subject: [PATCH 1/3] [MC/DC] Refactor: Introduce `ConditionIDs` as

[clang] clangCodeGen: Introduce `MCDC::State` with `MCDCState.h` (PR #81497)

2024-02-13 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni edited https://github.com/llvm/llvm-project/pull/81497 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clangCodeGen: Introduce `mcdc::State` with `MCDCState.h` (PR #81497)

2024-02-13 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni edited https://github.com/llvm/llvm-project/pull/81497 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clangCodeGen: Introduce `mcdc::State` with `MCDCState.h` (PR #81497)

2024-02-13 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni updated https://github.com/llvm/llvm-project/pull/81497 >From 80db8d1d054933a204b8b551687f65a80ea9cafa Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Tue, 13 Feb 2024 01:04:50 +0900 Subject: [PATCH] clangCodeGen: Introduce `mcdc::State` with `MCDCState.h` This

[clang] [llvm] [MC/DC] Refactor: Make `MCDCParams` as `std::variant` (PR #81227)

2024-02-13 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni closed https://github.com/llvm/llvm-project/pull/81227 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [MC/DC] Refactor: Make `MCDCParams` as `std::variant` (PR #81227)

2024-02-13 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni edited https://github.com/llvm/llvm-project/pull/81227 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [MC/DC] Refactor: Make `MCDCParams` as `std::variant` (PR #81227)

2024-02-13 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni updated https://github.com/llvm/llvm-project/pull/81227 >From c2b49a5317bf5b8af419cba814f95cc9305bec21 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Thu, 8 Feb 2024 23:12:54 +0900 Subject: [PATCH 1/3] [MC/DC] Refactor: Make `MCDCParams` as `std::variant`

[clang] [llvm] [MC/DC] Refactor: Introduce `MCDCTypes.h` for `coverage::mcdc` (PR #81459)

2024-02-13 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni closed https://github.com/llvm/llvm-project/pull/81459 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [MC/DC] Refactor: Introduce `MCDCTypes.h` for `coverage::mcdc` (PR #81459)

2024-02-13 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni edited https://github.com/llvm/llvm-project/pull/81459 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] clangCodeGen: Introduce `mcdc::State` with `MCDCState.h` (PR #81497)

2024-02-12 Thread NAKAMURA Takumi via cfe-commits
chapuni wrote: @evodius96 Thanks. I can wait for other comments for a few days. Considerations: * `MCDCState.h` is enough small to be embeded into `CodeGenPGO.h`. I guess it nasty a bit if I did, though. * `MCDCState.h` involves `CoverageMapping.h`, that is not small. It shall be replaced

[clang] [llvm] [MC/DC] Refactor: Introduce `MCDCTypes.h` for `coverage::mcdc` (PR #81459)

2024-02-12 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni updated https://github.com/llvm/llvm-project/pull/81459 >From 03bab9acf5aa3bf13c2223e92dbad040202d34bd Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Mon, 12 Feb 2024 18:43:56 +0900 Subject: [PATCH 1/3] [MC/DC] Refactor: Introduce `MCDCTypes.h` for the

[clang] clangCodeGen: Introduce `mcdc::State` with `MCDCState.h` (PR #81497)

2024-02-12 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni created https://github.com/llvm/llvm-project/pull/81497 This packs; * `BitmapBytes` * `BitmapMap` * `CondIDMap` Also imports `mcdc::ConditionID` and `mcdc::Parameters`. >From 80db8d1d054933a204b8b551687f65a80ea9cafa Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi

[clang] [llvm] [MC/DC] Refactor: Introduce `MCDCTypes.h` for `coverage::mcdc` (PR #81459)

2024-02-12 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni updated https://github.com/llvm/llvm-project/pull/81459 >From 03bab9acf5aa3bf13c2223e92dbad040202d34bd Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Mon, 12 Feb 2024 18:43:56 +0900 Subject: [PATCH 1/2] [MC/DC] Refactor: Introduce `MCDCTypes.h` for the

[clang] [llvm] [MC/DC] Refactor: Introduce `MCDCTypes.h` for `coverage::mcdc` (PR #81459)

2024-02-12 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni created https://github.com/llvm/llvm-project/pull/81459 They can be also used in `clang`. Introduce the lightweight header instead of `CoverageMapping.h`. >From 03bab9acf5aa3bf13c2223e92dbad040202d34bd Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Mon, 12 Feb

[clang] [llvm] [MC/DC] Refactor: Make `MCDCParams` as `std::variant` (PR #81227)

2024-02-12 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni updated https://github.com/llvm/llvm-project/pull/81227 >From c2b49a5317bf5b8af419cba814f95cc9305bec21 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Thu, 8 Feb 2024 23:12:54 +0900 Subject: [PATCH 1/3] [MC/DC] Refactor: Make `MCDCParams` as `std::variant`

[clang] [llvm] [MC/DC] Refactor: Make `MCDCParams` as `std::variant` (PR #81227)

2024-02-11 Thread NAKAMURA Takumi via cfe-commits
@@ -308,13 +309,21 @@ Error RawCoverageMappingReader::readMappingRegionsSubArray( return Err; if (auto Err = readIntMax(FID, std::numeric_limits::max())) return Err; + if (ID == 0) +return make_error( +

[clang] [llvm] [MC/DC] Refactor: Make `MCDCParams` as `std::variant` (PR #81227)

2024-02-11 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni commented: @ornata I want to isolate Decision stuff and Branch stuff in `MCDCParams`. Also I'd like to encapsulate params into each record. Once parameters are set, they are expected to hold "valid" values. Zeroing really confused me, (possibly us). I've found

[clang] [llvm] [MC/DC] Refactor: Make `MCDCParams` as `std::variant` (PR #81227)

2024-02-11 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni edited https://github.com/llvm/llvm-project/pull/81227 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [MC/DC] Refactor: Make `MCDCParams` as `std::variant` (PR #81227)

2024-02-10 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni updated https://github.com/llvm/llvm-project/pull/81227 >From c2b49a5317bf5b8af419cba814f95cc9305bec21 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Thu, 8 Feb 2024 23:12:54 +0900 Subject: [PATCH 1/2] [MC/DC] Refactor: Make `MCDCParams` as `std::variant`

[clang] [llvm] [MC/DC] Refactor: Make `MCDCParams` as `std::variant` (PR #81227)

2024-02-10 Thread NAKAMURA Takumi via cfe-commits
@@ -250,18 +251,27 @@ struct CounterMappingRegion { }; using MCDCConditionID = unsigned int; - struct MCDCParameters { + struct MCDCDecisionParameters { /// Byte Index of Bitmap Coverage Object for a Decision Region. -unsigned BitmapIdx = 0; +unsigned

[clang] [llvm] [MC/DC] Refactor: Introduce `ConditionIDs` as `std::array<2>` (PR #81221)

2024-02-10 Thread NAKAMURA Takumi via cfe-commits
chapuni wrote: @evodius96 As an experiment, I've made subscripts as `bool`. It works semantically however I wonder they wouldn't be intuitive to us. I can rewind it. https://github.com/llvm/llvm-project/pull/81221 ___ cfe-commits mailing list

[clang] [llvm] [MC/DC] Refactor: Introduce `ConditionIDs` as `std::array<2>` (PR #81221)

2024-02-10 Thread NAKAMURA Takumi via cfe-commits
@@ -217,6 +217,9 @@ class CounterExpressionBuilder { using LineColPair = std::pair; +using MCDCConditionID = unsigned int; +using MCDCConditionIDs = std::array; chapuni wrote: `first` and `second` didn't make sense to me.

[clang] [llvm] [MC/DC] Refactor: Introduce `ConditionIDs` as `std::array<2>` (PR #81221)

2024-02-10 Thread NAKAMURA Takumi via cfe-commits
https://github.com/chapuni updated https://github.com/llvm/llvm-project/pull/81221 >From 66bb6cc3fd339360c16c6a98ce08f34978f665e0 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Fri, 9 Feb 2024 07:56:51 +0900 Subject: [PATCH 1/3] [MC/DC] Refactor: Introduce `ConditionIDs` as

  1   2   3   4   5   6   >