[llvm-branch-commits] [libcxx] [libc++][modules] Increase clang-tidy version used. (PR #76268)
H-G-Hristov wrote: > Oh shit. I just realized that this is most likely a latent bug no matter > what. We build the module with Clang 18, and then essentially try to load it > with Clang 17 (aka Clang Tidy 17). AFAIK that's not guaranteed to work, and > probably just happens to work currently with Clang 17 building and Clang 18 > loading the module (assuming we even test that right now?). I think we may > have to always match the Clang and Clang Tidy versions we use. I should probably keep out of these discussions but here I am: Matching Clang with Clang-Tidy versions feels only natural. For instance "Member visit" requires new syntax (deducing this) and fixes available in the latest Clang 18 nightly, so it was surprising to find out the test failing due to Clang-Tidy being used in the CI. I guess this case happens rarely but this means working on newly implemented language features might have to be postponed to the next release. https://github.com/llvm/llvm-project/pull/76268 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [libcxx] [libc++][modules] Increase clang-tidy version used. (PR #76268)
philnik777 wrote: > > Oh shit. I just realized that this is most likely a latent bug no matter > > what. We build the module with Clang 18, and then essentially try to load > > it with Clang 17 (aka Clang Tidy 17). AFAIK that's not guaranteed to work, > > and probably just happens to work currently with Clang 17 building and > > Clang 18 loading the module (assuming we even test that right now?). I > > think we may have to always match the Clang and Clang Tidy versions we use. > > I should probably keep out of these discussions but here I am: Matching Clang > with Clang-Tidy versions feels only natural. For instance "Member visit" > requires new syntax (deducing this) and fixes available in the latest Clang > 18 nightly, so it was surprising to find out the test failing due to > Clang-Tidy being used in the CI. I guess this case happens rarely but this > means working on library features dependant on newly implemented language > features might have to be postponed to the release after. This change doesn't actually help you in this regard. We still support Clang 16 and 17, so the CI would have simply failed at a later stage, but for the same reason. @mordante I'd much rather see this fixed properly than tape over it with this patch. https://github.com/llvm/llvm-project/pull/76268 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [llvm-exegesis] Add additional validation counters (PR #76788)
RKSimon wrote: Thanks, no more comments from me - but a exegesis owner should review the rest https://github.com/llvm/llvm-project/pull/76788 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [llvm-exegesis] Add tablegen support for validation counters (PR #76652)
@@ -28,6 +28,22 @@ class PfmIssueCounter string ResourceName = resource_name; } +class ValidationEvent { legrosbuffle wrote: This needs doc to explain what a `ValidationEvent` and `PfmValidationCounter` are. https://github.com/llvm/llvm-project/pull/76652 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [llvm-exegesis] Add tablegen support for validation counters (PR #76652)
@@ -59,6 +68,8 @@ struct PfmCountersInfo { const IssueCounter *IssueCounters; unsigned NumIssueCounters; + std::unordered_map ValidationCounters; legrosbuffle wrote: `unordered_map` means that: - We'll allocate on startup. - We don't have consistent ordering between runs, which might be a source of debugging pain. Can we use a sorted array of `pair` instead ? https://github.com/llvm/llvm-project/pull/76652 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [mlir] [flang] [MLIR][LLVM] Add distinct identifier to the DISubprogram attribute (PR #77093)
https://github.com/Dinistro created https://github.com/llvm/llvm-project/pull/77093 This commit adds an optional distinct attribute parameter to the DISubprogramAttr. This enables modeling of distinct subprograms, as required for LLVM IR. This change is required to avoid accidential uniquing of subprograms on functions that would lead to invalid LLVM IR post export. >From 33ee6deadd6318adcfc45dba1d39bc38514bcd4b Mon Sep 17 00:00:00 2001 From: Christian Ulmann Date: Fri, 5 Jan 2024 13:20:10 + Subject: [PATCH] [MLIR][LLVM] Add distinct identifier to the DISubprogram attribute This commit adds an optional distinct attribute parameter to the DISubprogramAttr. This enables modeling of distinct subprograms, as required for LLVM IR. This change is required to avoid accidential uniquing of subprograms on functions that would lead to invalid LLVM IR post export. --- .../Transforms/AddDebugFoundation.cpp | 22 +--- .../Transforms/debug-line-table-inc-file.fir | 6 ++-- flang/test/Transforms/debug-line-table.fir| 12 +-- .../mlir/Dialect/LLVMIR/LLVMAttrDefs.td | 11 +++--- .../Transforms/DIScopeForLLVMFuncOp.cpp | 28 +++ mlir/lib/Target/LLVMIR/DebugImporter.cpp | 6 +++- .../LLVMIR/add-debuginfo-func-scope.mlir | 20 --- mlir/test/Target/LLVMIR/Import/debug-info.ll | 35 +-- .../Target/LLVMIR/Import/global-variables.ll | 4 +-- 9 files changed, 104 insertions(+), 40 deletions(-) diff --git a/flang/lib/Optimizer/Transforms/AddDebugFoundation.cpp b/flang/lib/Optimizer/Transforms/AddDebugFoundation.cpp index 9972961de29f25..e286e640b82eee 100644 --- a/flang/lib/Optimizer/Transforms/AddDebugFoundation.cpp +++ b/flang/lib/Optimizer/Transforms/AddDebugFoundation.cpp @@ -93,10 +93,24 @@ void AddDebugFoundationPass::runOnOperation() { context, llvm::dwarf::getCallingConvention("DW_CC_normal"), {bT, bT}); mlir::LLVM::DIFileAttr funcFileAttr = getFileAttr(funcFilePath); -mlir::LLVM::DISubprogramAttr spAttr = mlir::LLVM::DISubprogramAttr::get( -context, cuAttr, fileAttr, funcName, funcName, funcFileAttr, /*line=*/1, -/*scopeline=*/1, mlir::LLVM::DISubprogramFlags::Definition, -subTypeAttr); +mlir::LLVM::DISubprogramAttr spAttr; +// Only definitions need a distinct identifier and a compilation unit. +if (!funcOp.isExternal()) { + auto id = mlir::DistinctAttr::create(mlir::UnitAttr::get(context)); + spAttr = mlir::LLVM::DISubprogramAttr::get( + context, id, cuAttr, fileAttr, funcName, funcName, funcFileAttr, + /*line=*/1, + /*scopeline=*/1, mlir::LLVM::DISubprogramFlags::Definition, + subTypeAttr); +} else { + // TODO: Fix the subprogram flags once their modeling has been fixed. + spAttr = mlir::LLVM::DISubprogramAttr::get( + context, mlir::DistinctAttr(), mlir::LLVM::DICompileUnitAttr(), + fileAttr, funcName, funcName, funcFileAttr, + /*line=*/1, + /*scopeline=*/1, mlir::LLVM::DISubprogramFlags::Definition, + subTypeAttr); +} funcOp->setLoc(builder.getFusedLoc({funcOp->getLoc()}, spAttr)); }); } diff --git a/flang/test/Transforms/debug-line-table-inc-file.fir b/flang/test/Transforms/debug-line-table-inc-file.fir index 9ab4025a586268..f809ab99b47279 100644 --- a/flang/test/Transforms/debug-line-table-inc-file.fir +++ b/flang/test/Transforms/debug-line-table-inc-file.fir @@ -30,8 +30,8 @@ module attributes {} { // CHECK: #[[MODULE_LOC]] = loc("{{.*}}simple.f90":0:0) // CHECK: #[[LOC_INC_FILE:.*]] = loc("{{.*}}inc.f90":1:1) // CHECK: #[[LOC_FILE:.*]] = loc("{{.*}}simple.f90":3:1) -// CHECK: #[[DI_CU:.*]] = #llvm.di_compile_unit, sourceLanguage = DW_LANG_Fortran95, file = #[[DI_FILE]], producer = "Flang", isOptimized = false, emissionKind = LineTablesOnly> -// CHECK: #[[DI_SP_INC:.*]] = #llvm.di_subprogram -// CHECK: #[[DI_SP:.*]] = #llvm.di_subprogram +// CHECK: #[[DI_CU:.*]] = #llvm.di_compile_unit, sourceLanguage = DW_LANG_Fortran95, file = #[[DI_FILE]], producer = "Flang", isOptimized = false, emissionKind = LineTablesOnly> +// CHECK: #[[DI_SP_INC:.*]] = #llvm.di_subprogram, compileUnit = #[[DI_CU]], scope = #[[DI_FILE]], name = "_QPsinc", linkageName = "_QPsinc", file = #[[DI_INC_FILE]], {{.*}}> +// CHECK: #[[DI_SP:.*]] = #llvm.di_subprogram, compileUnit = #[[DI_CU]], scope = #[[DI_FILE]], name = "_QQmain", linkageName = "_QQmain", file = #[[DI_FILE]], {{.*}}> // CHECK: #[[FUSED_LOC_INC_FILE]] = loc(fused<#[[DI_SP_INC]]>[#[[LOC_INC_FILE]]]) // CHECK: #[[FUSED_LOC_FILE]] = loc(fused<#[[DI_SP]]>[#[[LOC_FILE]]]) diff --git a/flang/test/Transforms/debug-line-table.fir b/flang/test/Transforms/debug-line-table.fir index 115c6929778ec4..f091d97ce89eaa 100644 --- a/flang/test/Transforms/debug-line-table.fir +++ b/flang/test/Transforms/debug-line-table.fir @@ -5,20 +5,26 @@ module attributes { fir.defaultkind = "a1c4d8i4l4r4", fi
[llvm-branch-commits] [flang] [mlir] [MLIR][LLVM] Add distinct identifier to the DISubprogram attribute (PR #77093)
llvmbot wrote: @llvm/pr-subscribers-mlir-llvm @llvm/pr-subscribers-flang-fir-hlfir @llvm/pr-subscribers-mlir Author: Christian Ulmann (Dinistro) Changes This commit adds an optional distinct attribute parameter to the DISubprogramAttr. This enables modeling of distinct subprograms, as required for LLVM IR. This change is required to avoid accidential uniquing of subprograms on functions that would lead to invalid LLVM IR post export. --- Patch is 24.36 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/77093.diff 9 Files Affected: - (modified) flang/lib/Optimizer/Transforms/AddDebugFoundation.cpp (+18-4) - (modified) flang/test/Transforms/debug-line-table-inc-file.fir (+3-3) - (modified) flang/test/Transforms/debug-line-table.fir (+9-3) - (modified) mlir/include/mlir/Dialect/LLVMIR/LLVMAttrDefs.td (+6-5) - (modified) mlir/lib/Dialect/LLVMIR/Transforms/DIScopeForLLVMFuncOp.cpp (+22-6) - (modified) mlir/lib/Target/LLVMIR/DebugImporter.cpp (+5-1) - (modified) mlir/test/Dialect/LLVMIR/add-debuginfo-func-scope.mlir (+15-5) - (modified) mlir/test/Target/LLVMIR/Import/debug-info.ll (+24-11) - (modified) mlir/test/Target/LLVMIR/Import/global-variables.ll (+2-2) ``diff diff --git a/flang/lib/Optimizer/Transforms/AddDebugFoundation.cpp b/flang/lib/Optimizer/Transforms/AddDebugFoundation.cpp index 9972961de29f25..e286e640b82eee 100644 --- a/flang/lib/Optimizer/Transforms/AddDebugFoundation.cpp +++ b/flang/lib/Optimizer/Transforms/AddDebugFoundation.cpp @@ -93,10 +93,24 @@ void AddDebugFoundationPass::runOnOperation() { context, llvm::dwarf::getCallingConvention("DW_CC_normal"), {bT, bT}); mlir::LLVM::DIFileAttr funcFileAttr = getFileAttr(funcFilePath); -mlir::LLVM::DISubprogramAttr spAttr = mlir::LLVM::DISubprogramAttr::get( -context, cuAttr, fileAttr, funcName, funcName, funcFileAttr, /*line=*/1, -/*scopeline=*/1, mlir::LLVM::DISubprogramFlags::Definition, -subTypeAttr); +mlir::LLVM::DISubprogramAttr spAttr; +// Only definitions need a distinct identifier and a compilation unit. +if (!funcOp.isExternal()) { + auto id = mlir::DistinctAttr::create(mlir::UnitAttr::get(context)); + spAttr = mlir::LLVM::DISubprogramAttr::get( + context, id, cuAttr, fileAttr, funcName, funcName, funcFileAttr, + /*line=*/1, + /*scopeline=*/1, mlir::LLVM::DISubprogramFlags::Definition, + subTypeAttr); +} else { + // TODO: Fix the subprogram flags once their modeling has been fixed. + spAttr = mlir::LLVM::DISubprogramAttr::get( + context, mlir::DistinctAttr(), mlir::LLVM::DICompileUnitAttr(), + fileAttr, funcName, funcName, funcFileAttr, + /*line=*/1, + /*scopeline=*/1, mlir::LLVM::DISubprogramFlags::Definition, + subTypeAttr); +} funcOp->setLoc(builder.getFusedLoc({funcOp->getLoc()}, spAttr)); }); } diff --git a/flang/test/Transforms/debug-line-table-inc-file.fir b/flang/test/Transforms/debug-line-table-inc-file.fir index 9ab4025a586268..f809ab99b47279 100644 --- a/flang/test/Transforms/debug-line-table-inc-file.fir +++ b/flang/test/Transforms/debug-line-table-inc-file.fir @@ -30,8 +30,8 @@ module attributes {} { // CHECK: #[[MODULE_LOC]] = loc("{{.*}}simple.f90":0:0) // CHECK: #[[LOC_INC_FILE:.*]] = loc("{{.*}}inc.f90":1:1) // CHECK: #[[LOC_FILE:.*]] = loc("{{.*}}simple.f90":3:1) -// CHECK: #[[DI_CU:.*]] = #llvm.di_compile_unit, sourceLanguage = DW_LANG_Fortran95, file = #[[DI_FILE]], producer = "Flang", isOptimized = false, emissionKind = LineTablesOnly> -// CHECK: #[[DI_SP_INC:.*]] = #llvm.di_subprogram -// CHECK: #[[DI_SP:.*]] = #llvm.di_subprogram +// CHECK: #[[DI_CU:.*]] = #llvm.di_compile_unit, sourceLanguage = DW_LANG_Fortran95, file = #[[DI_FILE]], producer = "Flang", isOptimized = false, emissionKind = LineTablesOnly> +// CHECK: #[[DI_SP_INC:.*]] = #llvm.di_subprogram, compileUnit = #[[DI_CU]], scope = #[[DI_FILE]], name = "_QPsinc", linkageName = "_QPsinc", file = #[[DI_INC_FILE]], {{.*}}> +// CHECK: #[[DI_SP:.*]] = #llvm.di_subprogram, compileUnit = #[[DI_CU]], scope = #[[DI_FILE]], name = "_QQmain", linkageName = "_QQmain", file = #[[DI_FILE]], {{.*}}> // CHECK: #[[FUSED_LOC_INC_FILE]] = loc(fused<#[[DI_SP_INC]]>[#[[LOC_INC_FILE]]]) // CHECK: #[[FUSED_LOC_FILE]] = loc(fused<#[[DI_SP]]>[#[[LOC_FILE]]]) diff --git a/flang/test/Transforms/debug-line-table.fir b/flang/test/Transforms/debug-line-table.fir index 115c6929778ec4..f091d97ce89eaa 100644 --- a/flang/test/Transforms/debug-line-table.fir +++ b/flang/test/Transforms/debug-line-table.fir @@ -5,20 +5,26 @@ module attributes { fir.defaultkind = "a1c4d8i4l4r4", fir.kindmap = "", llvm.dat func.func @_QPsb() { return loc(#loc_sb) } loc(#loc_sb) + func.func private @decl() -> i32 loc(#loc_decl) } loc(#loc_module) #loc_module = loc("./simple.f90":1:1) #loc_sb = loc("./simple.f90":2:1) +#
[llvm-branch-commits] [flang] [mlir] [MLIR][LLVM] Add distinct identifier to the DISubprogram attribute (PR #77093)
https://github.com/gysit edited https://github.com/llvm/llvm-project/pull/77093 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [mlir] [flang] [MLIR][LLVM] Add distinct identifier to the DISubprogram attribute (PR #77093)
https://github.com/gysit approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/77093 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [mlir] [flang] [MLIR][LLVM] Add distinct identifier to the DISubprogram attribute (PR #77093)
@@ -66,12 +66,28 @@ static void addScopeToFunction(LLVM::LLVMFuncOp llvmFunc, LLVM::DISubroutineTypeAttr::get(context, llvm::dwarf::DW_CC_normal, {}); StringAttr funcNameAttr = llvmFunc.getNameAttr(); - auto subprogramAttr = LLVM::DISubprogramAttr::get( - context, compileUnitAttr, fileAttr, funcNameAttr, funcNameAttr, fileAttr, - /*line=*/line, - /*scopeline=*/col, - LLVM::DISubprogramFlags::Definition | LLVM::DISubprogramFlags::Optimized, - subroutineTypeAttr); + mlir::LLVM::DISubprogramAttr subprogramAttr; + // Only definitions need a distinct identifier and a compilation unit. + if (!llvmFunc.isExternal()) { +auto id = DistinctAttr::create(UnitAttr::get(context)); +subprogramAttr = +LLVM::DISubprogramAttr::get(context, id, compileUnitAttr, fileAttr, +funcNameAttr, funcNameAttr, fileAttr, +/*line=*/line, +/*scopeline=*/col, +LLVM::DISubprogramFlags::Definition | +LLVM::DISubprogramFlags::Optimized, +subroutineTypeAttr); + } else { +subprogramAttr = LLVM::DISubprogramAttr::get( +context, DistinctAttr(), LLVM::DICompileUnitAttr(), fileAttr, +funcNameAttr, funcNameAttr, fileAttr, +/*line=*/line, +/*scopeline=*/col, +LLVM::DISubprogramFlags::Definition | +LLVM::DISubprogramFlags::Optimized, +subroutineTypeAttr); gysit wrote: nit: maybe consider hoisting the actual builder call outside the if else using some extra variables for the fields that differ? https://github.com/llvm/llvm-project/pull/77093 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [flang] [mlir] [MLIR][LLVM] Add distinct identifier to the DISubprogram attribute (PR #77093)
https://github.com/Dinistro updated https://github.com/llvm/llvm-project/pull/77093 >From 33ee6deadd6318adcfc45dba1d39bc38514bcd4b Mon Sep 17 00:00:00 2001 From: Christian Ulmann Date: Fri, 5 Jan 2024 13:20:10 + Subject: [PATCH 1/2] [MLIR][LLVM] Add distinct identifier to the DISubprogram attribute This commit adds an optional distinct attribute parameter to the DISubprogramAttr. This enables modeling of distinct subprograms, as required for LLVM IR. This change is required to avoid accidential uniquing of subprograms on functions that would lead to invalid LLVM IR post export. --- .../Transforms/AddDebugFoundation.cpp | 22 +--- .../Transforms/debug-line-table-inc-file.fir | 6 ++-- flang/test/Transforms/debug-line-table.fir| 12 +-- .../mlir/Dialect/LLVMIR/LLVMAttrDefs.td | 11 +++--- .../Transforms/DIScopeForLLVMFuncOp.cpp | 28 +++ mlir/lib/Target/LLVMIR/DebugImporter.cpp | 6 +++- .../LLVMIR/add-debuginfo-func-scope.mlir | 20 --- mlir/test/Target/LLVMIR/Import/debug-info.ll | 35 +-- .../Target/LLVMIR/Import/global-variables.ll | 4 +-- 9 files changed, 104 insertions(+), 40 deletions(-) diff --git a/flang/lib/Optimizer/Transforms/AddDebugFoundation.cpp b/flang/lib/Optimizer/Transforms/AddDebugFoundation.cpp index 9972961de29f25..e286e640b82eee 100644 --- a/flang/lib/Optimizer/Transforms/AddDebugFoundation.cpp +++ b/flang/lib/Optimizer/Transforms/AddDebugFoundation.cpp @@ -93,10 +93,24 @@ void AddDebugFoundationPass::runOnOperation() { context, llvm::dwarf::getCallingConvention("DW_CC_normal"), {bT, bT}); mlir::LLVM::DIFileAttr funcFileAttr = getFileAttr(funcFilePath); -mlir::LLVM::DISubprogramAttr spAttr = mlir::LLVM::DISubprogramAttr::get( -context, cuAttr, fileAttr, funcName, funcName, funcFileAttr, /*line=*/1, -/*scopeline=*/1, mlir::LLVM::DISubprogramFlags::Definition, -subTypeAttr); +mlir::LLVM::DISubprogramAttr spAttr; +// Only definitions need a distinct identifier and a compilation unit. +if (!funcOp.isExternal()) { + auto id = mlir::DistinctAttr::create(mlir::UnitAttr::get(context)); + spAttr = mlir::LLVM::DISubprogramAttr::get( + context, id, cuAttr, fileAttr, funcName, funcName, funcFileAttr, + /*line=*/1, + /*scopeline=*/1, mlir::LLVM::DISubprogramFlags::Definition, + subTypeAttr); +} else { + // TODO: Fix the subprogram flags once their modeling has been fixed. + spAttr = mlir::LLVM::DISubprogramAttr::get( + context, mlir::DistinctAttr(), mlir::LLVM::DICompileUnitAttr(), + fileAttr, funcName, funcName, funcFileAttr, + /*line=*/1, + /*scopeline=*/1, mlir::LLVM::DISubprogramFlags::Definition, + subTypeAttr); +} funcOp->setLoc(builder.getFusedLoc({funcOp->getLoc()}, spAttr)); }); } diff --git a/flang/test/Transforms/debug-line-table-inc-file.fir b/flang/test/Transforms/debug-line-table-inc-file.fir index 9ab4025a586268..f809ab99b47279 100644 --- a/flang/test/Transforms/debug-line-table-inc-file.fir +++ b/flang/test/Transforms/debug-line-table-inc-file.fir @@ -30,8 +30,8 @@ module attributes {} { // CHECK: #[[MODULE_LOC]] = loc("{{.*}}simple.f90":0:0) // CHECK: #[[LOC_INC_FILE:.*]] = loc("{{.*}}inc.f90":1:1) // CHECK: #[[LOC_FILE:.*]] = loc("{{.*}}simple.f90":3:1) -// CHECK: #[[DI_CU:.*]] = #llvm.di_compile_unit, sourceLanguage = DW_LANG_Fortran95, file = #[[DI_FILE]], producer = "Flang", isOptimized = false, emissionKind = LineTablesOnly> -// CHECK: #[[DI_SP_INC:.*]] = #llvm.di_subprogram -// CHECK: #[[DI_SP:.*]] = #llvm.di_subprogram +// CHECK: #[[DI_CU:.*]] = #llvm.di_compile_unit, sourceLanguage = DW_LANG_Fortran95, file = #[[DI_FILE]], producer = "Flang", isOptimized = false, emissionKind = LineTablesOnly> +// CHECK: #[[DI_SP_INC:.*]] = #llvm.di_subprogram, compileUnit = #[[DI_CU]], scope = #[[DI_FILE]], name = "_QPsinc", linkageName = "_QPsinc", file = #[[DI_INC_FILE]], {{.*}}> +// CHECK: #[[DI_SP:.*]] = #llvm.di_subprogram, compileUnit = #[[DI_CU]], scope = #[[DI_FILE]], name = "_QQmain", linkageName = "_QQmain", file = #[[DI_FILE]], {{.*}}> // CHECK: #[[FUSED_LOC_INC_FILE]] = loc(fused<#[[DI_SP_INC]]>[#[[LOC_INC_FILE]]]) // CHECK: #[[FUSED_LOC_FILE]] = loc(fused<#[[DI_SP]]>[#[[LOC_FILE]]]) diff --git a/flang/test/Transforms/debug-line-table.fir b/flang/test/Transforms/debug-line-table.fir index 115c6929778ec4..f091d97ce89eaa 100644 --- a/flang/test/Transforms/debug-line-table.fir +++ b/flang/test/Transforms/debug-line-table.fir @@ -5,20 +5,26 @@ module attributes { fir.defaultkind = "a1c4d8i4l4r4", fir.kindmap = "", llvm.dat func.func @_QPsb() { return loc(#loc_sb) } loc(#loc_sb) + func.func private @decl() -> i32 loc(#loc_decl) } loc(#loc_module) #loc_module = loc("./simple.f90":1:1) #loc_sb = loc("./simple.f90":2:1) +#loc_decl = loc("./simple.f90":10:1) // CHEC
[llvm-branch-commits] [libcxx] [libc++][modules] Increase clang-tidy version used. (PR #76268)
mordante wrote: > > Oh shit. I just realized that this is most likely a latent bug no matter > > what. We build the module with Clang 18, and then essentially try to load > > it with Clang 17 (aka Clang Tidy 17). AFAIK that's not guaranteed to work, > > and probably just happens to work currently with Clang 17 building and > > Clang 18 loading the module (assuming we even test that right now?). I > > think we may have to always match the Clang and Clang Tidy versions we use. > > I should probably keep out of these discussions but here I am: You're welcome participate in the discussion. This is a public forum. > Matching Clang with Clang-Tidy versions feels only natural. For instance > "Member visit" requires new syntax (deducing this) and fixes available in the > latest Clang 18 nightly, so it was surprising to find out the test failing > due to Clang-Tidy being used in the CI. I guess this case happens rarely but > this means working on library features dependant on newly implemented > language features might have to be postponed to the release after. +1 > This change doesn't actually help you in this regard. We still support Clang > 16 and 17, so the CI would have simply failed at a later stage, but for the > same reason. > > @mordante I'd much rather see this fixed properly than tape over it with this > patch. Then I can prohibit clang-16 and clang-17. IMO The biggest issue is that the clang-tidy version is hard-coded in CMake. This is something I mentioned in the past too. If it was a CMake option it would be trivial to change the value without changing CMakeList.txt. https://github.com/llvm/llvm-project/pull/76268 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [libcxx] [libc++][modules] Increase clang-tidy version used. (PR #76268)
philnik777 wrote: > > > Oh shit. I just realized that this is most likely a latent bug no matter > > > what. We build the module with Clang 18, and then essentially try to load > > > it with Clang 17 (aka Clang Tidy 17). AFAIK that's not guaranteed to > > > work, and probably just happens to work currently with Clang 17 building > > > and Clang 18 loading the module (assuming we even test that right now?). > > > I think we may have to always match the Clang and Clang Tidy versions we > > > use. > > > > > > I should probably keep out of these discussions but here I am: > > You're welcome participate in the discussion. This is a public forum. Definitely. @H-G-Hristov feel free to comment on things you have an opinion/question about. Having an outside view is often quite helpful. > Then I can prohibit clang-16 and clang-17. Yeah, that's the solution. clang-tidy defines the same version macros as clang does, so prohibiting it from clang-16 is the same as prohibiting it for clang-tidy 16. > IMO The biggest issue is that the clang-tidy version is hard-coded in CMake. > This is something I mentioned in the past too. If it was a CMake option it > would be trivial to change the value without changing CMakeList.txt. We could also extract the clang version used and search for a clang-tidy that fits this version. That would also avoid the matching problems for others. We would probably have to get a path to the corresponding clang-tidy too. I don't know whether that's trivially possible right now. https://github.com/llvm/llvm-project/pull/76268 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [libcxx] [libc++][modules] Increase clang-tidy version used. (PR #76268)
mordante wrote: > > Then I can prohibit clang-16 and clang-17. > > Yeah, that's the solution. clang-tidy defines the same version macros as > clang does, so prohibiting it from clang-16 is the same as prohibiting it for > clang-tidy 16. What makes it currently hard for modules is that in the current situation it would mean modules would have about 0% coverage. > > IMO The biggest issue is that the clang-tidy version is hard-coded in > > CMake. This is something I mentioned in the past too. If it was a CMake > > option it would be trivial to change the value without changing > > CMakeList.txt. > > We could also extract the clang version used and search for a clang-tidy that > fits this version. That would also avoid the matching problems for others. We > would probably have to get a path to the corresponding clang-tidy too. I > don't know whether that's trivially possible right now. I think matching the version would be trivial for the additional libraries. For the executable it might be harder, but there we can let the user specify an executable and if specified test that version. Then we can issue a diagnostic when the versions don't match. https://github.com/llvm/llvm-project/pull/76268 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] [NFC][tsan] `ptr != 0` to implicit check (PR #77144)
https://github.com/vitalybuka created https://github.com/llvm/llvm-project/pull/77144 None ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] [NFC][tsan] Move SkipInternalFrames into sanitizer_common (PR #77146)
https://github.com/vitalybuka created https://github.com/llvm/llvm-project/pull/77146 None ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] [tsan] Fallback to top frame (PR #77145)
https://github.com/vitalybuka created https://github.com/llvm/llvm-project/pull/77145 Probably it's not important, as it should not happen, but if all frames are internal we should pick top, not the bottom frame. ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] [NFC][tsan] `ptr != 0` to implicit check (PR #77144)
llvmbot wrote: @llvm/pr-subscribers-compiler-rt-sanitizer Author: Vitaly Buka (vitalybuka) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/77144.diff 1 Files Affected: - (modified) compiler-rt/lib/tsan/rtl/tsan_report.cpp (+3-3) ``diff diff --git a/compiler-rt/lib/tsan/rtl/tsan_report.cpp b/compiler-rt/lib/tsan/rtl/tsan_report.cpp index 167e4be4fc0e26..cdcc20b9758f48 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_report.cpp +++ b/compiler-rt/lib/tsan/rtl/tsan_report.cpp @@ -274,13 +274,13 @@ static ReportStack *ChooseSummaryStack(const ReportDesc *rep) { } static bool FrameIsInternal(const SymbolizedStack *frame) { - if (frame == 0) + if (!frame) return false; const char *file = frame->info.file; const char *module = frame->info.module; - if (file != 0 && (internal_strstr(file, "/compiler-rt/lib/"))) + if (file && (internal_strstr(file, "/compiler-rt/lib/"))) return true; - if (module != 0 && (internal_strstr(module, "libclang_rt."))) + if (module && (internal_strstr(module, "libclang_rt."))) return true; return false; } `` https://github.com/llvm/llvm-project/pull/77144 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] [NFC][tsan] Move SkipInternalFrames into sanitizer_common (PR #77146)
llvmbot wrote: @llvm/pr-subscribers-compiler-rt-sanitizer Author: Vitaly Buka (vitalybuka) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/77146.diff 3 Files Affected: - (modified) compiler-rt/lib/sanitizer_common/sanitizer_common.h (+3) - (modified) compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp (+20) - (modified) compiler-rt/lib/tsan/rtl/tsan_report.cpp (+2-15) ``diff diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common.h b/compiler-rt/lib/sanitizer_common/sanitizer_common.h index 6b327a4aa16f0b..7d9d61de8b6175 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_common.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_common.h @@ -32,6 +32,7 @@ struct AddressInfo; struct BufferedStackTrace; struct SignalContext; struct StackTrace; +struct SymbolizedStack; // Constants. const uptr kWordSize = SANITIZER_WORDSIZE / 8; @@ -393,6 +394,8 @@ void ReportErrorSummary(const char *error_type, const AddressInfo &info, // Same as above, but obtains AddressInfo by symbolizing top stack trace frame. void ReportErrorSummary(const char *error_type, const StackTrace *trace, const char *alt_tool_name = nullptr); +// Skips frames which we consider internal and not usefull to the users. +SymbolizedStack *SkipInternalFrames(SymbolizedStack *frames); void ReportMmapWriteExec(int prot, int mflags); diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp index 3e4417ae3f57e5..ec60dd3e0d6620 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp +++ b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp @@ -28,6 +28,26 @@ namespace __sanitizer { #if !SANITIZER_GO + +static bool FrameIsInternal(const SymbolizedStack *frame) { + if (!frame) +return true; + const char *file = frame->info.file; + const char *module = frame->info.module; + if (file && (internal_strstr(file, "/compiler-rt/lib/"))) +return true; + if (module && (internal_strstr(module, "libclang_rt."))) +return true; + return false; +} + +SymbolizedStack *SkipInternalFrames(SymbolizedStack *frames) { + for (SymbolizedStack *f = frames; f; f = f->next) +if (!FrameIsInternal(f)) + return f; + return nullptr; +} + void ReportErrorSummary(const char *error_type, const AddressInfo &info, const char *alt_tool_name) { if (!common_flags()->print_summary) return; diff --git a/compiler-rt/lib/tsan/rtl/tsan_report.cpp b/compiler-rt/lib/tsan/rtl/tsan_report.cpp index c6b764bd891752..b1cee7ac8cbf83 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_report.cpp +++ b/compiler-rt/lib/tsan/rtl/tsan_report.cpp @@ -273,22 +273,9 @@ static ReportStack *ChooseSummaryStack(const ReportDesc *rep) { return 0; } -static bool FrameIsInternal(const SymbolizedStack *frame) { - if (!frame) -return true; - const char *file = frame->info.file; - const char *module = frame->info.module; - if (file && (internal_strstr(file, "/compiler-rt/lib/"))) -return true; - if (module && (internal_strstr(module, "libclang_rt."))) -return true; - return false; -} - static SymbolizedStack *SkipTsanInternalFrames(SymbolizedStack *frames) { - for (SymbolizedStack *f = frames; f; f = f->next) -if (!FrameIsInternal(f)) - return f; + if (SymbolizedStack *f = SkipInternalFrames(frames)) +return f; return frames; // Fallback to the top frame. } `` https://github.com/llvm/llvm-project/pull/77146 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] [tsan] Fallback to top frame (PR #77145)
llvmbot wrote: @llvm/pr-subscribers-compiler-rt-sanitizer Author: Vitaly Buka (vitalybuka) Changes Probably it's not important, as it should not happen, but if all frames are internal we should pick top, not the bottom frame. --- Full diff: https://github.com/llvm/llvm-project/pull/77145.diff 1 Files Affected: - (modified) compiler-rt/lib/tsan/rtl/tsan_report.cpp (+5-4) ``diff diff --git a/compiler-rt/lib/tsan/rtl/tsan_report.cpp b/compiler-rt/lib/tsan/rtl/tsan_report.cpp index cdcc20b9758f48..c6b764bd891752 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_report.cpp +++ b/compiler-rt/lib/tsan/rtl/tsan_report.cpp @@ -275,7 +275,7 @@ static ReportStack *ChooseSummaryStack(const ReportDesc *rep) { static bool FrameIsInternal(const SymbolizedStack *frame) { if (!frame) -return false; +return true; const char *file = frame->info.file; const char *module = frame->info.module; if (file && (internal_strstr(file, "/compiler-rt/lib/"))) @@ -286,9 +286,10 @@ static bool FrameIsInternal(const SymbolizedStack *frame) { } static SymbolizedStack *SkipTsanInternalFrames(SymbolizedStack *frames) { - while (FrameIsInternal(frames) && frames->next) -frames = frames->next; - return frames; + for (SymbolizedStack *f = frames; f; f = f->next) +if (!FrameIsInternal(f)) + return f; + return frames; // Fallback to the top frame. } void PrintReport(const ReportDesc *rep) { `` https://github.com/llvm/llvm-project/pull/77145 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] [NFC][tsan] `ptr != 0` to implicit check (PR #77144)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/77144 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] [tsan] Fallback to top frame (PR #77145)
thurstond wrote: > Probably it's not important, as it should not happen, but if all frames are > internal we should pick top, not the bottom frame. If we encounter a case that "should not happen", wouldn't it be better to fail/assert? https://github.com/llvm/llvm-project/pull/77145 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [libcxx] [libunwind] [libc] [llvm] [compiler-rt] [clang] [tsan] Fallback to top frame (PR #77145)
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/77145 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] [llvm] [libunwind] [clang] [libcxx] [libc] [tsan] Fallback to top frame (PR #77145)
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/77145 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] [NFC][sanitizer] Move SymbolizedStackHolder into sanitizer_common (PR #77152)
https://github.com/vitalybuka created https://github.com/llvm/llvm-project/pull/77152 And replace most `ClearAll()` uses. ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [libunwind] [clang] [compiler-rt] [libc] [libcxx] [llvm] [NFC][tsan] Move SkipInternalFrames into sanitizer_common (PR #77146)
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/77146 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [compiler-rt] [libc] [libcxx] [libunwind] [llvm] [NFC][tsan] Move SkipInternalFrames into sanitizer_common (PR #77146)
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/77146 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] [NFC][sanitizer] Move SymbolizedStackHolder into sanitizer_common (PR #77152)
llvmbot wrote: @llvm/pr-subscribers-compiler-rt-sanitizer Author: Vitaly Buka (vitalybuka) Changes And replace most `ClearAll()` uses. --- Full diff: https://github.com/llvm/llvm-project/pull/77152.diff 7 Files Affected: - (modified) compiler-rt/lib/asan/asan_suppressions.cpp (+3-4) - (modified) compiler-rt/lib/hwasan/hwasan_report.cpp (+4-2) - (modified) compiler-rt/lib/lsan/lsan_common.cpp (+4-3) - (modified) compiler-rt/lib/sanitizer_common/sanitizer_stacktrace_libcdep.cpp (+6-6) - (modified) compiler-rt/lib/sanitizer_common/sanitizer_symbolizer.h (+20) - (modified) compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp (+3-2) - (modified) compiler-rt/lib/ubsan/ubsan_diag.h (-20) ``diff diff --git a/compiler-rt/lib/asan/asan_suppressions.cpp b/compiler-rt/lib/asan/asan_suppressions.cpp index 8cb2c3e3b9b6a4..e71d231821866a 100644 --- a/compiler-rt/lib/asan/asan_suppressions.cpp +++ b/compiler-rt/lib/asan/asan_suppressions.cpp @@ -81,9 +81,10 @@ bool IsStackTraceSuppressed(const StackTrace *stack) { } if (suppression_ctx->HasSuppressionType(kInterceptorViaFunction)) { - SymbolizedStack *frames = symbolizer->SymbolizePC(addr); + SymbolizedStackHolder symbolized_stack(symbolizer->SymbolizePC(addr)); + const SymbolizedStack *frames = symbolized_stack.get(); CHECK(frames); - for (SymbolizedStack *cur = frames; cur; cur = cur->next) { + for (const SymbolizedStack *cur = frames; cur; cur = cur->next) { const char *function_name = cur->info.function; if (!function_name) { continue; @@ -91,11 +92,9 @@ bool IsStackTraceSuppressed(const StackTrace *stack) { // Match "interceptor_via_fun" suppressions. if (suppression_ctx->Match(function_name, kInterceptorViaFunction, &s)) { - frames->ClearAll(); return true; } } - frames->ClearAll(); } } return false; diff --git a/compiler-rt/lib/hwasan/hwasan_report.cpp b/compiler-rt/lib/hwasan/hwasan_report.cpp index 1a018a891b56ee..784cfb904aa275 100644 --- a/compiler-rt/lib/hwasan/hwasan_report.cpp +++ b/compiler-rt/lib/hwasan/hwasan_report.cpp @@ -292,12 +292,14 @@ static void PrintStackAllocations(const StackAllocationsRingBuffer *sa, uptr pc = record & pc_mask; frame_desc.AppendF(" record_addr:0x%zx record:0x%zx", reinterpret_cast(record_addr), record); -if (SymbolizedStack *frame = Symbolizer::GetOrInit()->SymbolizePC(pc)) { +SymbolizedStackHolder symbolized_stack( +Symbolizer::GetOrInit()->SymbolizePC(pc)); +const SymbolizedStack *frame = symbolized_stack.get(); +if (frame) { StackTracePrinter::GetOrInit()->RenderFrame( &frame_desc, " %F %L", 0, frame->info.address, &frame->info, common_flags()->symbolize_vs_style, common_flags()->strip_path_prefix); - frame->ClearAll(); } Printf("%s\n", frame_desc.data()); frame_desc.clear(); diff --git a/compiler-rt/lib/lsan/lsan_common.cpp b/compiler-rt/lib/lsan/lsan_common.cpp index e24839c984b346..0ecded8b28cdb0 100644 --- a/compiler-rt/lib/lsan/lsan_common.cpp +++ b/compiler-rt/lib/lsan/lsan_common.cpp @@ -155,14 +155,15 @@ Suppression *LeakSuppressionContext::GetSuppressionForAddr(uptr addr) { return s; // Suppress by file or function name. - SymbolizedStack *frames = Symbolizer::GetOrInit()->SymbolizePC(addr); - for (SymbolizedStack *cur = frames; cur; cur = cur->next) { + SymbolizedStackHolder symbolized_stack( + Symbolizer::GetOrInit()->SymbolizePC(addr)); + const SymbolizedStack *frames = symbolized_stack.get(); + for (const SymbolizedStack *cur = frames; cur; cur = cur->next) { if (context.Match(cur->info.function, kSuppressionLeak, &s) || context.Match(cur->info.file, kSuppressionLeak, &s)) { break; } } - frames->ClearAll(); return s; } diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace_libcdep.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace_libcdep.cpp index 9a4c80fcfdd199..561eae9ab78065 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace_libcdep.cpp +++ b/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace_libcdep.cpp @@ -33,13 +33,14 @@ class StackTraceTextPrinter { stack_trace_fmt)) {} bool ProcessAddressFrames(uptr pc) { -SymbolizedStack *frames = symbolize_ - ? Symbolizer::GetOrInit()->SymbolizePC(pc) - : SymbolizedStack::New(pc); +SymbolizedStackHolder symbolized_stack( +symbolize_ ? Symbolizer::GetOrInit()->SymbolizePC(pc) + : SymbolizedStack::New(pc)); +const SymbolizedStack *frames = symbolized_stack.get(); if (!frames) return false; -for (SymbolizedStack *cur = frames; cur; cur = cur->next) { +for (const SymbolizedStack *cur = frames;
[llvm-branch-commits] [libc] [llvm] [libcxx] [libunwind] [clang] [compiler-rt] [tsan] Fallback to top frame (PR #77145)
https://github.com/vitalybuka edited https://github.com/llvm/llvm-project/pull/77145 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [libc] [llvm] [libcxx] [libunwind] [clang] [compiler-rt] [tsan] Fallback to top frame (PR #77145)
https://github.com/vitalybuka edited https://github.com/llvm/llvm-project/pull/77145 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [libc] [llvm] [libcxx] [libunwind] [clang] [compiler-rt] [tsan] Fallback to top frame (PR #77145)
vitalybuka wrote: > > Probably it's not important, as it should not happen, but if all frames are > > internal we should pick top, not the bottom frame. > > If we encounter a case that "should not happen", wouldn't it be better to > fail/assert? usually should not happen e.g. without symbolizer it can happen https://github.com/llvm/llvm-project/pull/77145 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [libc] [llvm] [libcxx] [libunwind] [clang] [compiler-rt] [tsan] Fallback to top frame (PR #77145)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/77145 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [libc] [libcxx] [compiler-rt] [libunwind] [llvm] [NFC][tsan] Move SkipInternalFrames into sanitizer_common (PR #77146)
https://github.com/kstoimenov approved this pull request. https://github.com/llvm/llvm-project/pull/77146 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] [llvm] [NFC][sanitizer] Move SymbolizedStackHolder into sanitizer_common (PR #77152)
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/77152 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] [NFC][sanitizer] Add consts to SkipInternalFrames (PR #77162)
https://github.com/vitalybuka created https://github.com/llvm/llvm-project/pull/77162 None ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] [llvm] [NFC][sanitizer] Move SymbolizedStackHolder into sanitizer_common (PR #77152)
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/77152 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] [ubsan] Drop terminal "in " from reports without functions (PR #77163)
https://github.com/vitalybuka created https://github.com/llvm/llvm-project/pull/77163 None ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] [ubsan] Drop terminal "in " from reports without functions (PR #77163)
llvmbot wrote: @llvm/pr-subscribers-compiler-rt-sanitizer Author: Vitaly Buka (vitalybuka) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/77163.diff 2 Files Affected: - (modified) compiler-rt/lib/ubsan/ubsan_diag.cpp (+1-1) - (modified) compiler-rt/test/ubsan/TestCases/Misc/print_summary.c (+2-2) ``diff diff --git a/compiler-rt/lib/ubsan/ubsan_diag.cpp b/compiler-rt/lib/ubsan/ubsan_diag.cpp index aac27041531851..67e884e4916c50 100644 --- a/compiler-rt/lib/ubsan/ubsan_diag.cpp +++ b/compiler-rt/lib/ubsan/ubsan_diag.cpp @@ -88,7 +88,7 @@ static void MaybeReportErrorSummary(Location Loc, ErrorType Type) { AI.file = internal_strdup(SLoc.getFilename()); AI.line = SLoc.getLine(); AI.column = SLoc.getColumn(); - AI.function = internal_strdup(""); // Avoid printing ?? as function name. + AI.function = nullptr; ReportErrorSummary(ErrorKind, AI, GetSanititizerToolName()); AI.Clear(); return; diff --git a/compiler-rt/test/ubsan/TestCases/Misc/print_summary.c b/compiler-rt/test/ubsan/TestCases/Misc/print_summary.c index b67a0614dd2f11..17885094b6ad76 100644 --- a/compiler-rt/test/ubsan/TestCases/Misc/print_summary.c +++ b/compiler-rt/test/ubsan/TestCases/Misc/print_summary.c @@ -2,8 +2,8 @@ // RUN: %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-DEFAULT // RUN: %env_ubsan_opts=print_summary=0 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-NO_SUMMARY -// CHECK-DEFAULT: SUMMARY: UndefinedBehaviorSanitizer: {{.*}} -// CHECK-NO_SUMMARY-NOT: SUMMARY: UndefinedBehaviorSanitizer: {{.*}} +// CHECK-DEFAULT: SUMMARY: UndefinedBehaviorSanitizer: {{.*}}print_summary.c{{[:0-9 ]*$}} +// CHECK-NO_SUMMARY-NOT: SUMMARY: UndefinedBehaviorSanitizer: int main(int argc, char **argv) { int arr[argc - 2]; `` https://github.com/llvm/llvm-project/pull/77163 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] [NFC][sanitizer] Add consts to SkipInternalFrames (PR #77162)
llvmbot wrote: @llvm/pr-subscribers-compiler-rt-sanitizer Author: Vitaly Buka (vitalybuka) Changes --- Full diff: https://github.com/llvm/llvm-project/pull/77162.diff 3 Files Affected: - (modified) compiler-rt/lib/sanitizer_common/sanitizer_common.h (+1-1) - (modified) compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp (+2-2) - (modified) compiler-rt/lib/tsan/rtl/tsan_report.cpp (+3-3) ``diff diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common.h b/compiler-rt/lib/sanitizer_common/sanitizer_common.h index 7d9d61de8b6175..b99c0cffcbb116 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_common.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_common.h @@ -395,7 +395,7 @@ void ReportErrorSummary(const char *error_type, const AddressInfo &info, void ReportErrorSummary(const char *error_type, const StackTrace *trace, const char *alt_tool_name = nullptr); // Skips frames which we consider internal and not usefull to the users. -SymbolizedStack *SkipInternalFrames(SymbolizedStack *frames); +const SymbolizedStack *SkipInternalFrames(const SymbolizedStack *frames); void ReportMmapWriteExec(int prot, int mflags); diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp index 26f015e70d0405..0cf250f7212943 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp +++ b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp @@ -41,8 +41,8 @@ static bool FrameIsInternal(const SymbolizedStack *frame) { return false; } -SymbolizedStack *SkipInternalFrames(SymbolizedStack *frames) { - for (SymbolizedStack *f = frames; f; f = f->next) +const SymbolizedStack *SkipInternalFrames(const SymbolizedStack *frames) { + for (const SymbolizedStack *f = frames; f; f = f->next) if (!FrameIsInternal(f)) return f; return nullptr; diff --git a/compiler-rt/lib/tsan/rtl/tsan_report.cpp b/compiler-rt/lib/tsan/rtl/tsan_report.cpp index b1cee7ac8cbf83..22ba428cc58b77 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_report.cpp +++ b/compiler-rt/lib/tsan/rtl/tsan_report.cpp @@ -273,8 +273,8 @@ static ReportStack *ChooseSummaryStack(const ReportDesc *rep) { return 0; } -static SymbolizedStack *SkipTsanInternalFrames(SymbolizedStack *frames) { - if (SymbolizedStack *f = SkipInternalFrames(frames)) +static const SymbolizedStack *SkipTsanInternalFrames(SymbolizedStack *frames) { + if (const SymbolizedStack *f = SkipInternalFrames(frames)) return f; return frames; // Fallback to the top frame. } @@ -350,7 +350,7 @@ void PrintReport(const ReportDesc *rep) { Printf(" And %d more similar thread leaks.\n\n", rep->count - 1); if (ReportStack *stack = ChooseSummaryStack(rep)) { -if (SymbolizedStack *frame = SkipTsanInternalFrames(stack->frames)) +if (const SymbolizedStack *frame = SkipTsanInternalFrames(stack->frames)) ReportErrorSummary(rep_typ_str, frame->info); } `` https://github.com/llvm/llvm-project/pull/77162 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] [ubsan] Drop terminal "in " from reports without functions (PR #77163)
https://github.com/MaskRay approved this pull request. https://github.com/llvm/llvm-project/pull/77163 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [mlir] [llvm] [compiler-rt] [clang-tools-extra] [libcxx] [clang] [NFC][sanitizer] Add consts to SkipInternalFrames (PR #77162)
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/77162 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [mlir] [clang-tools-extra] [clang] [compiler-rt] [llvm] [libcxx] [NFC][sanitizer] Add consts to SkipInternalFrames (PR #77162)
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/77162 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang-tools-extra] [llvm] [libcxx] [mlir] [compiler-rt] [clang] [ubsan] Drop terminal "in " from reports without functions (PR #77163)
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/77163 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [compiler-rt] [llvm] [mlir] [clang-tools-extra] [libcxx] [ubsan] Drop terminal "in " from reports without functions (PR #77163)
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/77163 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [mlir] [llvm] [compiler-rt] [clang-tools-extra] [libcxx] [clang] [NFC][sanitizer] Add consts to SkipInternalFrames (PR #77162)
https://github.com/kstoimenov approved this pull request. https://github.com/llvm/llvm-project/pull/77162 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] [mlir] [llvm] [flang] [libcxx] [clang-tools-extra] [clang] [NFC][sanitizer] Add consts to SkipInternalFrames (PR #77162)
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/77162 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [clang-tools-extra] [libcxx] [mlir] [flang] [compiler-rt] [llvm] [NFC][sanitizer] Add consts to SkipInternalFrames (PR #77162)
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/77162 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits