Skip to content

Commit 8ae76f9

Browse files
authored
fix: callback defines and missing install rule (#182)
1 parent af3caee commit 8ae76f9

File tree

5 files changed

+16
-5
lines changed

5 files changed

+16
-5
lines changed

.github/workflows/basic-ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ jobs:
109109
if: matrix.preset.coverage
110110
run: sudo apt-get install lcov
111111

112+
- name: Setup Mold Linker
113+
if: ${{ matrix.platform.llvm-version > 14 }}
114+
uses: rui314/setup-mold@v1
115+
112116
- name: Setup env
113117
run: |
114118
sudo ln -f -s /usr/bin/clang-${{ matrix.platform.llvm-version }} /usr/bin/clang

lib/runtime/AllocationTracking.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ void __typeart_alloc_global_mty(const void* addr, const void* info, size_t count
316316
rt.allocation_tracker().onAllocGlobal(addr, type_id, count, retAddr);
317317
}
318318

319-
void __typeart_alloc_omp_mty(const void* addr, const void* info, size_t count) {
319+
void __typeart_alloc_global_mty_omp(const void* addr, const void* info, size_t count) {
320320
TYPEART_RUNTIME_GUARD;
321321
const void* retAddr = __builtin_return_address(0);
322322
const auto type_id = reinterpret_cast<const typeart::global_types::GlobalTypeInfo*>(info)->type_id;
@@ -325,7 +325,7 @@ void __typeart_alloc_omp_mty(const void* addr, const void* info, size_t count) {
325325
rt.allocation_tracker().onAlloc(addr, type_id, count, retAddr);
326326
}
327327

328-
void __typeart_alloc_stack_omp_mty(const void* addr, const void* info, size_t count) {
328+
void __typeart_alloc_stack_mty_omp(const void* addr, const void* info, size_t count) {
329329
TYPEART_RUNTIME_GUARD;
330330
const void* retAddr = __builtin_return_address(0);
331331
const auto type_id = reinterpret_cast<const typeart::global_types::GlobalTypeInfo*>(info)->type_id;

lib/typelib/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,15 @@ target_include_directories(
5656

5757
typeart_target_coverage_options(${TYPEART_PREFIX}_TypesStatic)
5858

59+
install(FILES TypeInterface.h
60+
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}
61+
)
62+
5963
if(TYPEART_INSTALL_TYPES_LIB)
6064
set(CONFIG_NAME ${PROJECT_NAME}Types)
6165
set(TARGETS_EXPORT_NAME ${CONFIG_NAME}Targets)
6266

63-
install(FILES TypeInterface.h TypeDatabase.h
67+
install(FILES TypeDatabase.h
6468
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}
6569
)
6670

test/lit.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ config.substitutions.append(('%filecheck', filecheck))
108108
config.substitutions.append(('%llc', llc))
109109

110110
# Substitutions: executables use "-" separator, variables use underscore
111+
config.substitutions.append(('%base_path', config.typeart_project_dir))
111112
config.substitutions.append(('%base_lib_path', typeart_base_lib_dir))
112113
config.substitutions.append(('%script_path', typeart_script_dir))
113114
config.substitutions.append(('%plugin_path', typeart_lib_root))

test/pass/misc/05_make_all_callbacks.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
// RUN: %c-to-llvm %s -I%runtime_path | %apply-typeart --typeart-stack=true -S 2>&1 | %filecheck %s
1+
// RUN: %c-to-llvm -Wimplicit-function-declaration %s -I%runtime_path -I%base_path/lib/runtime | %apply-typeart --typeart-stack=true -S 2>&1 | \
2+
// RUN: %filecheck %s
23

3-
#include "../../../lib/runtime/CallbackInterface.h"
4+
#include "CallbackInterface.h"
45

56
int main(void) {
67
int count = 0;
@@ -32,4 +33,5 @@ int main(void) {
3233
return 0;
3334
}
3435

36+
// CHECK-NOT: error
3537
// CHECK: TypeArtPass [Heap & Stack]

0 commit comments

Comments
 (0)