From 93808675dfd0c7dddc0109b67710371f7894fba7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20H=C3=BCck?= Date: Sat, 4 Apr 2026 17:47:07 +0200 Subject: [PATCH 1/7] LLVM 22 support, update dimeta --- externals/dimeta/CMakeLists.txt | 2 +- lib/passes/TypeARTPass.cpp | 4 +++ lib/passes/analysis/MemOpVisitor.cpp | 25 ++++++++++++------- .../instrumentation/MemOpInstrumentation.cpp | 7 +++++- lib/runtime/RuntimeInterface.h | 3 --- 5 files changed, 27 insertions(+), 14 deletions(-) diff --git a/externals/dimeta/CMakeLists.txt b/externals/dimeta/CMakeLists.txt index 6dcdf0bd..8ff1632e 100644 --- a/externals/dimeta/CMakeLists.txt +++ b/externals/dimeta/CMakeLists.txt @@ -1,7 +1,7 @@ FetchContent_Declare( llvm-dimeta GIT_REPOSITORY https://github.com/ahueck/llvm-dimeta - GIT_TAG v0.4.0 + GIT_TAG v0.5.0 GIT_SHALLOW 1 ) diff --git a/lib/passes/TypeARTPass.cpp b/lib/passes/TypeARTPass.cpp index 3d7a8b3c..cdf24c62 100644 --- a/lib/passes/TypeARTPass.cpp +++ b/lib/passes/TypeARTPass.cpp @@ -44,7 +44,11 @@ #include "llvm/IR/PassManager.h" #include "llvm/Pass.h" #include "llvm/Passes/PassBuilder.h" +#if LLVM_VERSION_MAJOR < 22 #include "llvm/Passes/PassPlugin.h" +#else +#include "llvm/Plugins/PassPlugin.h" +#endif #include "llvm/Support/CommandLine.h" #include "llvm/Support/raw_ostream.h" diff --git a/lib/passes/analysis/MemOpVisitor.cpp b/lib/passes/analysis/MemOpVisitor.cpp index 7c11a58c..0e8e4294 100644 --- a/lib/passes/analysis/MemOpVisitor.cpp +++ b/lib/passes/analysis/MemOpVisitor.cpp @@ -374,19 +374,26 @@ void MemOpVisitor::visitAllocaInst(llvm::AllocaInst& ai) { } void MemOpVisitor::visitIntrinsicInst(llvm::IntrinsicInst& inst) { - if (inst.getIntrinsicID() == Intrinsic::lifetime_start) { -#if LLVM_VERSION_MAJOR >= 12 - auto alloca = llvm::findAllocaForValue(inst.getOperand(1)); + if (inst.getIntrinsicID() != Intrinsic::lifetime_start) { + return; + } + AllocaInst* alloca{nullptr}; +#if LLVM_VERSION_MAJOR > 21 + auto* operand = inst.getArgOperand(0); + alloca = llvm::findAllocaForValue(operand); +#elif LLVM_VERSION_MAJOR >= 12 + auto* operand = inst.getOperand(1); + alloca = llvm::findAllocaForValue(operand); #else - DenseMap alloca_for_value; - auto* alloca = llvm::findAllocaForValue(inst.getOperand(1), alloca_for_value); + auto* operand = inst.getOperand(1); + DenseMap alloca_for_value; + alloca = llvm::findAllocaForValue(operand, alloca_for_value); #endif - if (alloca != nullptr) { - lifetime_starts.emplace_back(&inst, alloca); - } + + if (alloca != nullptr) { + lifetime_starts.emplace_back(&inst, alloca); } } - void MemOpVisitor::clear() { allocas.clear(); mallocs.clear(); diff --git a/lib/passes/instrumentation/MemOpInstrumentation.cpp b/lib/passes/instrumentation/MemOpInstrumentation.cpp index b50f1fc2..ba64511e 100644 --- a/lib/passes/instrumentation/MemOpInstrumentation.cpp +++ b/lib/passes/instrumentation/MemOpInstrumentation.cpp @@ -233,7 +233,12 @@ InstrCount MemOpInstrumentation::instrumentStack(const StackArgList& stack) { } else { for (auto* lifetime_s : lifetime_starts) { IRBuilder<> IRB(lifetime_s->getNextNode()); - instrument_stack(IRB, lifetime_s->getOperand(1), lifetime_s->getNextNode()); +#if LLVM_VERSION_MAJOR < 22 + auto ptr = lifetime_s->getOperand(1); +#else + auto ptr = lifetime_s->getArgOperand(0); +#endif + instrument_stack(IRB, ptr, lifetime_s->getNextNode()); } } } diff --git a/lib/runtime/RuntimeInterface.h b/lib/runtime/RuntimeInterface.h index e625ea2c..e6190b34 100644 --- a/lib/runtime/RuntimeInterface.h +++ b/lib/runtime/RuntimeInterface.h @@ -136,9 +136,6 @@ TYPEART_EXPORT typeart_status typeart_get_type(const void* addr, typeart_type_in * - TYPEART_OK: The query was successful. * - TYPEART_UNKNOWN_ADDRESS: The given address is either not allocated, or was not correctly recorded by the runtime. */ -// typeart_status typeart_get_containing_type(const void* addr, int* type_id, size_t* count, const void** base_address, -// size_t* byte_offset); - TYPEART_EXPORT typeart_status typeart_get_containing_type(const typeart_type_info* type_info, typeart_base_type_info* containing_type, size_t* byte_offset); From 7ccc0df93145a20f4ce3a0368d0081f9c766e849 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20H=C3=BCck?= Date: Sat, 4 Apr 2026 18:23:51 +0200 Subject: [PATCH 2/7] CI for LLVM 22 --- .github/workflows/basic-ci.yml | 3 ++- .github/workflows/ext-ci.yml | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/basic-ci.yml b/.github/workflows/basic-ci.yml index 852ff663..730a9ae8 100644 --- a/.github/workflows/basic-ci.yml +++ b/.github/workflows/basic-ci.yml @@ -74,6 +74,7 @@ jobs: - { os: ubuntu-24.04, llvm-version: 19, typeart-typegen-legacy: 0 } - { os: ubuntu-24.04, llvm-version: 20, typeart-typegen-legacy: 0 } - { os: ubuntu-24.04, llvm-version: 21, typeart-typegen-legacy: 0 } + - { os: ubuntu-24.04, llvm-version: 22, typeart-typegen-legacy: 0 } runs-on: ${{ matrix.platform.os }} @@ -150,7 +151,7 @@ jobs: finish-coverage: needs: lit-suite - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Coveralls Finished uses: coverallsapp/github-action@master diff --git a/.github/workflows/ext-ci.yml b/.github/workflows/ext-ci.yml index 45e37ea5..d55a9dc3 100644 --- a/.github/workflows/ext-ci.yml +++ b/.github/workflows/ext-ci.yml @@ -24,6 +24,7 @@ jobs: - { os: ubuntu-24.04, llvm-version: 19 } - { os: ubuntu-24.04, llvm-version: 20 } - { os: ubuntu-24.04, llvm-version: 21 } + - { os: ubuntu-24.04, llvm-version: 22 } runs-on: ${{ matrix.platform.os }} @@ -119,6 +120,7 @@ jobs: - { os: ubuntu-24.04, llvm-version: 19 } - { os: ubuntu-24.04, llvm-version: 20 } - { os: ubuntu-24.04, llvm-version: 21 } + - { os: ubuntu-24.04, llvm-version: 22 } runs-on: ${{ matrix.platform.os }} @@ -202,6 +204,7 @@ jobs: - { os: ubuntu-24.04, llvm-version: 19 } - { os: ubuntu-24.04, llvm-version: 20 } - { os: ubuntu-24.04, llvm-version: 21 } + - { os: ubuntu-24.04, llvm-version: 22 } runs-on: ${{ matrix.platform.os }} From fb44bfbbc81634bd1b1dbf02f6e283210eb1a58d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20H=C3=BCck?= Date: Sat, 4 Apr 2026 19:13:53 +0200 Subject: [PATCH 3/7] Deprecations, abseil update --- cmake/modules/llvm-util.cmake | 11 ++++++++++- externals/abseil/CMakeLists.txt | 2 +- externals/dimeta/CMakeLists.txt | 1 + lib/passes/TypeARTPass.cpp | 4 ++++ lib/passes/analysis/MemInstFinder.cpp | 4 ++++ 5 files changed, 20 insertions(+), 2 deletions(-) diff --git a/cmake/modules/llvm-util.cmake b/cmake/modules/llvm-util.cmake index 21eb2444..1a67ab33 100644 --- a/cmake/modules/llvm-util.cmake +++ b/cmake/modules/llvm-util.cmake @@ -40,9 +40,18 @@ function(typeart_make_llvm_module name sources) typeart_target_define_file_basename(${name}) + set(LLVM_DEFINITIONS_LIST "${LLVM_DEFINITIONS}") + separate_arguments(LLVM_DEFINITIONS_LIST) + + set(CLEAN_LLVM_DEFINITIONS "") + foreach(definition ${LLVM_DEFINITIONS_LIST}) + string(REGEX REPLACE "^-D" "" clean_definition ${definition}) + list(APPEND CLEAN_LLVM_DEFINITIONS ${clean_definition}) + endforeach() + target_compile_definitions(${name} PRIVATE - ${LLVM_DEFINITIONS} + ${CLEAN_LLVM_DEFINITIONS} ) make_tidy_check(${name} diff --git a/externals/abseil/CMakeLists.txt b/externals/abseil/CMakeLists.txt index c47f6890..fe914405 100644 --- a/externals/abseil/CMakeLists.txt +++ b/externals/abseil/CMakeLists.txt @@ -3,7 +3,7 @@ set(ABSL_PROPAGATE_CXX_STD ON) FetchContent_Declare( cpp-abseil GIT_REPOSITORY https://github.com/abseil/abseil-cpp.git - GIT_TAG 20250814.1 + GIT_TAG 20250814.2 GIT_SHALLOW 1 ) diff --git a/externals/dimeta/CMakeLists.txt b/externals/dimeta/CMakeLists.txt index 8ff1632e..6fd8e39b 100644 --- a/externals/dimeta/CMakeLists.txt +++ b/externals/dimeta/CMakeLists.txt @@ -19,6 +19,7 @@ mark_as_advanced( DIMETA_ENABLE_COVERAGE DIMETA_TEST_CONFIG DIMETA_LOG_LEVEL + DIMETA_ENABLE_FLANG FETCHCONTENT_UPDATES_DISCONNECTED_LLVM-DIMETA FETCHCONTENT_SOURCE_DIR_LLVM-DIMETA ) diff --git a/lib/passes/TypeARTPass.cpp b/lib/passes/TypeARTPass.cpp index cdf24c62..4113331a 100644 --- a/lib/passes/TypeARTPass.cpp +++ b/lib/passes/TypeARTPass.cpp @@ -217,7 +217,11 @@ class TypeArtPass : public llvm::PassInfoMixin { } void printStats(llvm::raw_ostream& out) { +#if LLVM_VERSION_MAJOR < 22 const auto scope_exit_cleanup_counter = llvm::make_scope_exit([&]() { +#else + llvm::scope_exit scope_exit_cleanup_counter([&]() { +#endif NumInstrumentedAlloca = 0; NumInstrumentedFrees = 0; NumInstrumentedGlobal = 0; diff --git a/lib/passes/analysis/MemInstFinder.cpp b/lib/passes/analysis/MemInstFinder.cpp index 1260db13..c5911101 100644 --- a/lib/passes/analysis/MemInstFinder.cpp +++ b/lib/passes/analysis/MemInstFinder.cpp @@ -391,7 +391,11 @@ bool MemInstFinderPass::runOnFunction(llvm::Function& function) { } // namespace typeart void MemInstFinderPass::printStats(llvm::raw_ostream& out) const { +#if LLVM_VERSION_MAJOR < 22 const auto scope_exit_cleanup_counter = llvm::make_scope_exit([&]() { +#else + llvm::scope_exit scope_exit_cleanup_counter([&]() { +#endif NumDetectedAllocs = 0; NumFilteredNonArrayAllocs = 0; NumFilteredMallocAllocs = 0; From 4d4b66acd170f07d12bf65475f6cf4bd44b179ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20H=C3=BCck?= Date: Sat, 4 Apr 2026 19:15:28 +0200 Subject: [PATCH 4/7] Format --- lib/passes/TypeARTPass.cpp | 245 +++++++++++++------------- lib/passes/analysis/MemInstFinder.cpp | 10 +- 2 files changed, 128 insertions(+), 127 deletions(-) diff --git a/lib/passes/TypeARTPass.cpp b/lib/passes/TypeARTPass.cpp index 4113331a..7780f43b 100644 --- a/lib/passes/TypeARTPass.cpp +++ b/lib/passes/TypeARTPass.cpp @@ -216,160 +216,161 @@ class TypeArtPass : public llvm::PassInfoMixin { functions = declare_instrumentation_functions(m, configuration()); } - void printStats(llvm::raw_ostream& out) { + void printStats(llvm::raw_ostream& out){ #if LLVM_VERSION_MAJOR < 22 - const auto scope_exit_cleanup_counter = llvm::make_scope_exit([&]() { + const auto scope_exit_cleanup_counter = llvm::make_scope_exit([&]() { #else - llvm::scope_exit scope_exit_cleanup_counter([&]() { + llvm::scope_exit scope_exit_cleanup_counter([&]() { #endif - NumInstrumentedAlloca = 0; - NumInstrumentedFrees = 0; - NumInstrumentedGlobal = 0; - NumInstrumentedMallocs = 0; - }); - meminst_finder->printStats(out); - - const auto get_ta_mode = [&]() { - const bool heap = configuration()[config::ConfigStdArgs::heap]; - const bool stack = configuration()[config::ConfigStdArgs::stack]; - const bool global = configuration()[config::ConfigStdArgs::global]; - - if (heap) { - if (stack) { - return " [Heap & Stack]"; - } - return " [Heap]"; - } + NumInstrumentedAlloca = 0; + NumInstrumentedFrees = 0; + NumInstrumentedGlobal = 0; + NumInstrumentedMallocs = 0; + }); + meminst_finder->printStats(out); - if (stack) { - return " [Stack]"; - } + const auto get_ta_mode = [&]() { + const bool heap = configuration()[config::ConfigStdArgs::heap]; + const bool stack = configuration()[config::ConfigStdArgs::stack]; + const bool global = configuration()[config::ConfigStdArgs::global]; - if (global) { - return " [Global]"; + if (heap) { + if (stack) { + return " [Heap & Stack]"; } + return " [Heap]"; + } - LOG_ERROR("Did not find heap or stack, or combination thereof!"); - assert((heap || stack || global) && "Needs stack, heap, global or combination thereof"); - return " [Unknown]"; - }; + if (stack) { + return " [Stack]"; + } - Table stats("TypeArtPass"); - stats.wrap_header_ = true; - stats.title_ += get_ta_mode(); - stats.put(Row::make("Malloc", NumInstrumentedMallocs.getValue())); - stats.put(Row::make("Free", NumInstrumentedFrees.getValue())); - stats.put(Row::make("Alloca", NumInstrumentedAlloca.getValue())); - stats.put(Row::make("Global", NumInstrumentedGlobal.getValue())); - - std::ostringstream stream; - stats.print(stream); - out << stream.str(); - } + if (global) { + return " [Global]"; + } - llvm::PreservedAnalyses run(llvm::Module& m, llvm::ModuleAnalysisManager&) { - bool changed{false}; - changed |= doInitialization(m); - const bool heap = configuration()[config::ConfigStdArgs::heap]; // Must happen after doInit - dump_module(m, heap ? util::module::ModulePhase::kBase : util::module::ModulePhase::kOpt); - changed |= runOnModule(m); - dump_module(m, heap ? util::module::ModulePhase::kHeap : util::module::ModulePhase::kStack); - changed |= doFinalization(); - return changed ? llvm::PreservedAnalyses::none() : llvm::PreservedAnalyses::all(); - } + LOG_ERROR("Did not find heap or stack, or combination thereof!"); + assert((heap || stack || global) && "Needs stack, heap, global or combination thereof"); + return " [Unknown]"; + }; - bool runOnModule(llvm::Module& m) { - meminst_finder->runOnModule(m); - const bool instrument_global = configuration()[config::ConfigStdArgs::global]; - bool globals_were_instrumented{false}; - if (instrument_global) { - // declareInstrumentationFunctions(m); - - const auto& globalsList = meminst_finder->getModuleGlobals(); - if (!globalsList.empty()) { - const auto global_count = instrumentation_context->handleGlobal(globalsList); - NumInstrumentedGlobal += global_count; - globals_were_instrumented = global_count > 0; - } - } + Table stats("TypeArtPass"); + stats.wrap_header_ = true; + stats.title_ += get_ta_mode(); + stats.put(Row::make("Malloc", NumInstrumentedMallocs.getValue())); + stats.put(Row::make("Free", NumInstrumentedFrees.getValue())); + stats.put(Row::make("Alloca", NumInstrumentedAlloca.getValue())); + stats.put(Row::make("Global", NumInstrumentedGlobal.getValue())); + + std::ostringstream stream; + stats.print(stream); + out << stream.str(); +} - llvm::DenseSet tor_funcs; - { - const auto collect_funcs = [&tor_funcs](const auto* constant) -> bool { - if (llvm::isa(constant)) { - tor_funcs.insert(constant); - } - return false; - }; +llvm::PreservedAnalyses +run(llvm::Module& m, llvm::ModuleAnalysisManager&) { + bool changed{false}; + changed |= doInitialization(m); + const bool heap = configuration()[config::ConfigStdArgs::heap]; // Must happen after doInit + dump_module(m, heap ? util::module::ModulePhase::kBase : util::module::ModulePhase::kOpt); + changed |= runOnModule(m); + dump_module(m, heap ? util::module::ModulePhase::kHeap : util::module::ModulePhase::kStack); + changed |= doFinalization(); + return changed ? llvm::PreservedAnalyses::none() : llvm::PreservedAnalyses::all(); +} - util::for_each_cdtor("llvm.global_ctors", m, collect_funcs); - util::for_each_cdtor("llvm.global_dtors", m, collect_funcs); +bool runOnModule(llvm::Module& m) { + meminst_finder->runOnModule(m); + const bool instrument_global = configuration()[config::ConfigStdArgs::global]; + bool globals_were_instrumented{false}; + if (instrument_global) { + // declareInstrumentationFunctions(m); + + const auto& globalsList = meminst_finder->getModuleGlobals(); + if (!globalsList.empty()) { + const auto global_count = instrumentation_context->handleGlobal(globalsList); + NumInstrumentedGlobal += global_count; + globals_were_instrumented = global_count > 0; } + } - const auto instrumented_function = llvm::count_if(m.functions(), [&](auto& f) { - if (tor_funcs.contains(&f)) { - LOG_DEBUG("Function is in LLVM global ctor or dtor " << f.getName()) - return false; - } - return runOnFunc(f); - }) > 0; - return instrumented_function || globals_were_instrumented; + llvm::DenseSet tor_funcs; + { + const auto collect_funcs = [&tor_funcs](const auto* constant) -> bool { + if (llvm::isa(constant)) { + tor_funcs.insert(constant); + } + return false; + }; + + util::for_each_cdtor("llvm.global_ctors", m, collect_funcs); + util::for_each_cdtor("llvm.global_dtors", m, collect_funcs); } - bool runOnFunc(llvm::Function& f) { - using namespace typeart; + const auto instrumented_function = llvm::count_if(m.functions(), [&](auto& f) { + if (tor_funcs.contains(&f)) { + LOG_DEBUG("Function is in LLVM global ctor or dtor " << f.getName()) + return false; + } + return runOnFunc(f); + }) > 0; + return instrumented_function || globals_were_instrumented; +} - if (f.isDeclaration() || util::starts_with_any_of(f.getName(), "__typeart", "typeart", "__sanitizer", "__tysan")) { - return false; - } +bool runOnFunc(llvm::Function& f) { + using namespace typeart; - if (!meminst_finder->hasFunctionData(f)) { - LOG_WARNING("No allocation data could be retrieved for function: " << f.getName()); - return false; - } + if (f.isDeclaration() || util::starts_with_any_of(f.getName(), "__typeart", "typeart", "__sanitizer", "__tysan")) { + return false; + } - LOG_DEBUG("Running on function: " << f.getName()) + if (!meminst_finder->hasFunctionData(f)) { + LOG_WARNING("No allocation data could be retrieved for function: " << f.getName()); + return false; + } + + LOG_DEBUG("Running on function: " << f.getName()) - // FIXME this is required when "PassManagerBuilder::EP_OptimizerLast" is used as the function (constant) pointer are - // nullpointer/invalidated - // declareInstrumentationFunctions(*f.getParent()); + // FIXME this is required when "PassManagerBuilder::EP_OptimizerLast" is used as the function (constant) pointer are + // nullpointer/invalidated + // declareInstrumentationFunctions(*f.getParent()); - bool mod{false}; + bool mod{false}; // auto& c = f.getContext(); #if LLVM_VERSION_MAJOR > 19 - DataLayout dl(f.getParent()->getDataLayout()); + DataLayout dl(f.getParent()->getDataLayout()); #else - DataLayout dl(f.getParent()); + DataLayout dl(f.getParent()); #endif - const auto& fData = meminst_finder->getFunctionData(f); - const auto& mallocs = fData.mallocs; - const auto& allocas = fData.allocas; - const auto& frees = fData.frees; + const auto& fData = meminst_finder->getFunctionData(f); + const auto& mallocs = fData.mallocs; + const auto& allocas = fData.allocas; + const auto& frees = fData.frees; - const bool instrument_heap = configuration()[config::ConfigStdArgs::heap]; - const bool instrument_stack = configuration()[config::ConfigStdArgs::stack]; + const bool instrument_heap = configuration()[config::ConfigStdArgs::heap]; + const bool instrument_stack = configuration()[config::ConfigStdArgs::stack]; - if (instrument_heap) { - // instrument collected calls of bb: - const auto heap_count = instrumentation_context->handleHeap(mallocs); - const auto free_count = instrumentation_context->handleFree(frees); + if (instrument_heap) { + // instrument collected calls of bb: + const auto heap_count = instrumentation_context->handleHeap(mallocs); + const auto free_count = instrumentation_context->handleFree(frees); - NumInstrumentedMallocs += heap_count; - NumInstrumentedFrees += free_count; - - mod |= heap_count > 0 || free_count > 0; - } + NumInstrumentedMallocs += heap_count; + NumInstrumentedFrees += free_count; - if (instrument_stack) { - const auto stack_count = instrumentation_context->handleStack(allocas); - NumInstrumentedAlloca += stack_count; - mod |= stack_count > 0; - } + mod |= heap_count > 0 || free_count > 0; + } - return mod; + if (instrument_stack) { + const auto stack_count = instrumentation_context->handleStack(allocas); + NumInstrumentedAlloca += stack_count; + mod |= stack_count > 0; } -}; + + return mod; +} +}; // namespace typeart::pass class LegacyTypeArtPass : public llvm::ModulePass { private: diff --git a/lib/passes/analysis/MemInstFinder.cpp b/lib/passes/analysis/MemInstFinder.cpp index c5911101..1de001e3 100644 --- a/lib/passes/analysis/MemInstFinder.cpp +++ b/lib/passes/analysis/MemInstFinder.cpp @@ -405,11 +405,11 @@ void MemInstFinderPass::printStats(llvm::raw_ostream& out) const { NumFilteredGlobals = 0; NumDetectedGlobals = 0; }); - auto all_stack = double(NumDetectedAllocs); - auto nonarray_stack = double(NumFilteredNonArrayAllocs); - auto malloc_alloc_stack = double(NumFilteredMallocAllocs); - auto call_filter_stack = double(NumCallFilteredAllocs); - auto filter_pointer_stack = double(NumFilteredPointerAllocs); + auto all_stack = double(NumDetectedAllocs); + auto nonarray_stack = double(NumFilteredNonArrayAllocs); + auto malloc_alloc_stack = double(NumFilteredMallocAllocs); + auto call_filter_stack = double(NumCallFilteredAllocs); + auto filter_pointer_stack = double(NumFilteredPointerAllocs); const auto call_filter_stack_p = (call_filter_stack / From 00a1c6cb618f214450756b4f4f1a631c0a596370 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20H=C3=BCck?= Date: Sat, 4 Apr 2026 20:33:26 +0200 Subject: [PATCH 5/7] Update dimeta --- externals/dimeta/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/externals/dimeta/CMakeLists.txt b/externals/dimeta/CMakeLists.txt index 6fd8e39b..85d23e22 100644 --- a/externals/dimeta/CMakeLists.txt +++ b/externals/dimeta/CMakeLists.txt @@ -1,7 +1,7 @@ FetchContent_Declare( llvm-dimeta GIT_REPOSITORY https://github.com/ahueck/llvm-dimeta - GIT_TAG v0.5.0 + GIT_TAG v0.5.1 GIT_SHALLOW 1 ) From baebfc1d515f702b9cdd05c7b734611399c55482 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20H=C3=BCck?= Date: Sat, 4 Apr 2026 20:52:26 +0200 Subject: [PATCH 6/7] Update actions --- .github/workflows/basic-ci.yml | 10 +++++----- .github/workflows/ext-ci.yml | 18 +++++++++--------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/basic-ci.yml b/.github/workflows/basic-ci.yml index 730a9ae8..8c420922 100644 --- a/.github/workflows/basic-ci.yml +++ b/.github/workflows/basic-ci.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - run: | wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - @@ -47,7 +47,7 @@ jobs: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - uses: codespell-project/actions-codespell@v2.2 lit-suite: @@ -79,7 +79,7 @@ jobs: runs-on: ${{ matrix.platform.os }} steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: LLVM apt if: ${{ matrix.platform.llvm-version >= 19 }} @@ -142,7 +142,7 @@ jobs: - name: Coveralls (parallel) if: matrix.preset.coverage - uses: coverallsapp/github-action@master + uses: coverallsapp/github-action@v2.3.6 with: github-token: ${{ secrets.GITHUB_TOKEN }} path-to-lcov: build/typeart.coverage @@ -154,7 +154,7 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Coveralls Finished - uses: coverallsapp/github-action@master + uses: coverallsapp/github-action@v2.3.6 with: github-token: ${{ secrets.GITHUB_TOKEN }} parallel-finished: true \ No newline at end of file diff --git a/.github/workflows/ext-ci.yml b/.github/workflows/ext-ci.yml index d55a9dc3..47e24d5e 100644 --- a/.github/workflows/ext-ci.yml +++ b/.github/workflows/ext-ci.yml @@ -29,10 +29,10 @@ jobs: runs-on: ${{ matrix.platform.os }} steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Checkout test-bench - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: repository: tudasc/typeart-bench ssh-key: ${{ secrets.AUTH_SSH_CI_EXT }} @@ -102,7 +102,7 @@ jobs: mv test-bench/artifact-${{ matrix.platform.llvm-version }}/* artifact - name: Upload test-bench artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: typeart-ci-ext-${{ matrix.platform.llvm-version }}-${{ matrix.preset.name }} path: artifact @@ -125,10 +125,10 @@ jobs: runs-on: ${{ matrix.platform.os }} steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Checkout AD test-bench - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: repository: ahueck/typeart-ad-benchmarks ssh-key: ${{ secrets.AUTH_SSH_CI_EXT_AD }} @@ -183,7 +183,7 @@ jobs: mv ad-test-bench/artifact-${{ matrix.platform.llvm-version }}/* artifact - name: Upload AD test-bench artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: typeart-ci-ext-ad-${{ matrix.platform.llvm-version }}-${{ matrix.preset.name }} path: artifact @@ -209,10 +209,10 @@ jobs: runs-on: ${{ matrix.platform.os }} steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Checkout OMP test-bench - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: repository: tudasc/typeart-bench ssh-key: ${{ secrets.AUTH_SSH_CI_EXT }} @@ -274,7 +274,7 @@ jobs: mv omp-test-bench/artifact-${{ matrix.platform.llvm-version }}/* artifact - name: Upload omp-test-bench artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: typeart-ci-ext-omp-${{ matrix.platform.llvm-version }}-${{ matrix.preset.name }} path: artifact From ceddf298a9f5c19fb0c61745f8acceb7696771cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20H=C3=BCck?= Date: Sun, 5 Apr 2026 15:48:04 +0200 Subject: [PATCH 7/7] Fix some warnings --- CMakeLists.txt | 2 +- lib/mpi_interceptor/wrap.py | 24 ++++++++++++------------ lib/runtime/Runtime.cpp | 12 +++++------- lib/runtime/RuntimeData.h | 4 ++-- test/runtime/45_default_types.c | 2 +- test/runtime/49_default_types_udef.c | 2 +- 6 files changed, 22 insertions(+), 24 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 09fc3856..623502e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,7 +15,7 @@ endif() if(TYPEART_IS_TOP_LEVEL) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) - set(CMAKE_VERBOSE_MAKEFILE ON) + # set(CMAKE_VERBOSE_MAKEFILE ON) endif() set(CMAKE_CXX_STANDARD 17) diff --git a/lib/mpi_interceptor/wrap.py b/lib/mpi_interceptor/wrap.py index 6aa6a3af..d98996e0 100644 --- a/lib/mpi_interceptor/wrap.py +++ b/lib/mpi_interceptor/wrap.py @@ -85,21 +85,21 @@ # Regular expressions for start and end of declarations in mpi.h. These are # used to get the declaration strings out for parsing with formal_re below. -begin_decl_re = re.compile("(" + "|".join(rtypes) + ")\s+(MPI_\w+)\s*\(") +begin_decl_re = re.compile(r"(" + "|".join(rtypes) + r")\s+(MPI_\w+)\s*\(") exclude_re = re.compile("|".join(exclude_strings)) -end_decl_re = re.compile("\).*\;") +end_decl_re = re.compile(r"\).*\;") # Regular Expression for splitting up args. Matching against this # returns three groups: type info, arg name, and array info formal_re = re.compile( - "\s*(" + # Start type - "(?:const)?\s*" + # Initial const - "\w+" # Type name (note: doesn't handle 'long long', etc. right now) - ")\s*(" + # End type, begin pointers - "(?:\s*\*(?:\s*const)?)*" + # Look for 0 or more pointers with optional 'const' - ")\s*" # End pointers - "(?:(\w+)\s*)?" + # Argument name. Optional. - "(\[.*\])?\s*$" # Array type. Also optional. Works for multidimensions b/c it's greedy. + r"\s*(" + # Start type + r"(?:const)?\s*" + # Initial const + r"\w+" # Type name (note: doesn't handle 'long long', etc. right now) + r")\s*(" + # End type, begin pointers + r"(?:\s*\*(?:\s*const)?)*" + # Look for 0 or more pointers with optional 'const' + r")\s*" # End pointers + r"(?:(\w+)\s*)?" + # Argument name. Optional. + r"(\[.*\])?\s*$" # Array type. Also optional. Works for multidimensions b/c it's greedy. ) # Fortran wrapper suffix @@ -724,12 +724,12 @@ def cFormal(self): def castType(self): arr = self.array or '' pointers = self.pointers or '' - if re.search('\[\s*\]', arr): + if re.search(r'\[\s*\]', arr): if arr.count('[') > 1: pointers += '(*)' # need extra parens for, e.g., int[][3] -> int(*)[3] else: pointers += '*' # justa single array; can pass pointer. - arr = re.sub('\[\s*\]', '', arr) + arr = re.sub(r'\[\s*\]', '', arr) return "%s%s%s" % (self.type, pointers, arr) def __str__(self): diff --git a/lib/runtime/Runtime.cpp b/lib/runtime/Runtime.cpp index 441f41cc..e53bf9dd 100644 --- a/lib/runtime/Runtime.cpp +++ b/lib/runtime/Runtime.cpp @@ -90,12 +90,10 @@ RuntimeSystem::RuntimeSystem() } } else { if (!loadTypes(defaultTypeFileName, error)) { - LOG_WARNING( - "No type file with default name \"" - << defaultTypeFileName - << "\" in current directory. Using default built-in types only. To specify a different file, edit the " - "TYPEART_TYPE_FILE environment variable. Reason: " - << error.message()); + LOG_DEBUG("No type file with default name \"" + << defaultTypeFileName + << "\" in current directory. Using default built-in types only. To specify a different file, edit the " + << config::EnvironmentStdArgs::types << " environment variable. Reason: " << error.message()); } } @@ -105,7 +103,7 @@ RuntimeSystem::RuntimeSystem() ss << structInfo.name << ", "; } recorder.incUDefTypes(typeList.size()); - LOG_INFO("Recorded types: " << ss.str()); + LOG_DEBUG("Recorded types: " << ss.str()); rtScopeInit.reset(); } diff --git a/lib/runtime/RuntimeData.h b/lib/runtime/RuntimeData.h index e62ef524..b3b3f41f 100644 --- a/lib/runtime/RuntimeData.h +++ b/lib/runtime/RuntimeData.h @@ -51,8 +51,8 @@ #endif #if defined(__has_feature) -#if __has_feature(address_sanitizer) -#define __SANITIZE_ADDRESS__ +#if __has_feature(address_sanitizer) && !defined(__SANITIZE_ADDRESS__) +#define __SANITIZE_ADDRESS__ 1 #endif #endif diff --git a/test/runtime/45_default_types.c b/test/runtime/45_default_types.c index 82d44d7c..24b87721 100644 --- a/test/runtime/45_default_types.c +++ b/test/runtime/45_default_types.c @@ -5,7 +5,7 @@ int main(int argc, char** argv) { const int n = 42; // CHECK: [Trace] TypeART Runtime Trace - // CHECK: [Warning]{{.*}}No type file with default name + // CHECK: [Debug]{{.*}}No type file with default name // CHECK: [Trace] Alloc 0x{{.*}} {{(int8_t|char)}} 1 42 char* a = malloc(n * sizeof(char)); // CHECK: [Trace] Free 0x{{.*}} diff --git a/test/runtime/49_default_types_udef.c b/test/runtime/49_default_types_udef.c index cd35a0e0..f22804e5 100644 --- a/test/runtime/49_default_types_udef.c +++ b/test/runtime/49_default_types_udef.c @@ -9,7 +9,7 @@ struct Datastruct { int main(int argc, char** argv) { // CHECK: [Trace] TypeART Runtime Trace - // CHECK: [Warning]{{.*}}No type file with default name + // CHECK: [Debug]{{.*}}No type file with default name // CHECK: [Trace] Alloc [[POINTER:0x[0-9a-fA-F]+]] 256 typeart_unknown_struct 0 1 struct Datastruct data = {0};