Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: Apache-2.0
name: Build

on:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: Apache-2.0
name: clang-format

on:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/commit-check.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: Apache-2.0
name: Commit conventions

on:
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/license-compliance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# SPDX-License-Identifier: Apache-2.0
name: license-compliance

on:
push:
branches: [main, master]
pull_request:

jobs:
license-compliance:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Verify Apache-2.0 license compliance
run: bash ./scripts/check-license-compliance.sh
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,8 @@
*.exe
*.out
*.app

# Python cache and temporary files
__pycache__/
*.py[cod]
*.tmp
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: Apache-2.0
repos:
- repo: local
hooks:
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: Apache-2.0
cmake_minimum_required(VERSION 3.16)
project(cc)

Expand Down
875 changes: 201 additions & 674 deletions LICENSE

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
coretrace-concurrency-analyzer
Copyright 2026 Hugo Payet

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: Apache-2.0
cmake .. -DCMAKE_BUILD_TYPE=Release \
-DLLVM_DIR=$(brew --prefix llvm@20)/lib/cmake/llvm \
-DClang_DIR=$(brew --prefix llvm@20)/lib/cmake/clang \
Expand Down
1 change: 1 addition & 0 deletions extern-project/src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include "compilerlib/compiler.h"
#include <iostream>

Expand Down
1 change: 1 addition & 0 deletions extern-project/tests/hello.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <stdio.h>
int main(void) {
puts("hello");
Expand Down
1 change: 1 addition & 0 deletions extern-project/tests/hello.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <string>

int main() {
Expand Down
1 change: 1 addition & 0 deletions include/compilerlib/attributes.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#ifndef COMPILERLIB_ATTRIBUTES_HPP
#define COMPILERLIB_ATTRIBUTES_HPP

Expand Down
1 change: 1 addition & 0 deletions include/compilerlib/compiler.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#ifndef COMPILERLIB_COMPILER_H
#define COMPILERLIB_COMPILER_H

Expand Down
1 change: 1 addition & 0 deletions include/compilerlib/frontend/optnone_action.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#ifndef COMPILERLIB_FRONTEND_OPTNONE_ACTION_HPP
#define COMPILERLIB_FRONTEND_OPTNONE_ACTION_HPP

Expand Down
1 change: 1 addition & 0 deletions include/compilerlib/instrumentation/alloc.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#ifndef COMPILERLIB_INSTRUMENTATION_ALLOC_HPP
#define COMPILERLIB_INSTRUMENTATION_ALLOC_HPP

Expand Down
1 change: 1 addition & 0 deletions include/compilerlib/instrumentation/bounds.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#ifndef COMPILERLIB_INSTRUMENTATION_BOUNDS_HPP
#define COMPILERLIB_INSTRUMENTATION_BOUNDS_HPP

Expand Down
1 change: 1 addition & 0 deletions include/compilerlib/instrumentation/common.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#ifndef COMPILERLIB_INSTRUMENTATION_COMMON_HPP
#define COMPILERLIB_INSTRUMENTATION_COMMON_HPP

Expand Down
1 change: 1 addition & 0 deletions include/compilerlib/instrumentation/config.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#ifndef COMPILERLIB_INSTRUMENTATION_CONFIG_HPP
#define COMPILERLIB_INSTRUMENTATION_CONFIG_HPP

Expand Down
1 change: 1 addition & 0 deletions include/compilerlib/instrumentation/trace.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#ifndef COMPILERLIB_INSTRUMENTATION_TRACE_HPP
#define COMPILERLIB_INSTRUMENTATION_TRACE_HPP

Expand Down
1 change: 1 addition & 0 deletions include/compilerlib/instrumentation/vtable.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#ifndef COMPILERLIB_INSTRUMENTATION_VTABLE_HPP
#define COMPILERLIB_INSTRUMENTATION_VTABLE_HPP

Expand Down
1 change: 1 addition & 0 deletions include/compilerlib/toolchain.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#ifndef COMPILERLIB_TOOLCHAIN_HPP
#define COMPILERLIB_TOOLCHAIN_HPP

Expand Down
45 changes: 45 additions & 0 deletions scripts/check-license-compliance.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: Apache-2.0
set -euo pipefail

SCRIPT_DIR="$(cd -- "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd -- "${SCRIPT_DIR}/.." && pwd)"

cd "${REPO_ROOT}"

if [[ ! -f "LICENSE" ]]; then
echo "ERROR: Missing LICENSE file at repository root." >&2
exit 1
fi

if ! grep -Eq 'Apache License' LICENSE || ! grep -Eq 'Version 2\.0,[[:space:]]*January 2004' LICENSE; then
echo "ERROR: LICENSE file does not match Apache License 2.0 header markers." >&2
exit 1
fi

missing_spdx_headers=()

while IFS= read -r -d '' file; do
case "${file}" in
build/*|build-*/*|extern-project/build/*|extern-project/build-*/*|third_party/*|vendor/*|external/*)
continue
;;
CMakeLists.txt|main.cpp|*.c|*.cc|*.cpp|*.cxx|*.h|*.hh|*.hpp|*.hxx|*.ipp|*.tpp|*.cmake|*.sh|*.py|*.yml|*.yaml)
;;
*)
continue
;;
esac

if ! head -n 12 "${file}" | grep -Eq 'SPDX-License-Identifier:[[:space:]]*Apache-2\.0'; then
missing_spdx_headers+=("${file}")
fi
done < <(git ls-files -z)

if ((${#missing_spdx_headers[@]} > 0)); then
echo "ERROR: Missing Apache-2.0 SPDX headers in these files:" >&2
printf ' - %s\n' "${missing_spdx_headers[@]}" >&2
exit 1
fi

echo "License compliance checks passed."
1 change: 1 addition & 0 deletions scripts/ci/commit_checker.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations

import json
Expand Down
1 change: 1 addition & 0 deletions scripts/ci/semver_check.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations

import os
Expand Down
1 change: 1 addition & 0 deletions scripts/format-check.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: Apache-2.0
set -euo pipefail

SCRIPT_DIR="$(cd -- "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
Expand Down
1 change: 1 addition & 0 deletions scripts/format.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: Apache-2.0
set -euo pipefail

SCRIPT_DIR="$(cd -- "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
Expand Down
1 change: 1 addition & 0 deletions scripts/git/commit_msg_checker.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations

import re
Expand Down
1 change: 1 addition & 0 deletions scripts/setup-dev.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: Apache-2.0
set -euo pipefail

if ! command -v python3 >/dev/null 2>&1; then
Expand Down
1 change: 1 addition & 0 deletions src/cli/args.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include "cli/args.h"

namespace cli
Expand Down
1 change: 1 addition & 0 deletions src/cli/args.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#ifndef CORETRACE_CLI_ARGS_H
#define CORETRACE_CLI_ARGS_H

Expand Down
1 change: 1 addition & 0 deletions src/cli/help.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include "cli/help.h"

#include <filesystem>
Expand Down
1 change: 1 addition & 0 deletions src/cli/help.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#ifndef CORETRACE_CLI_HELP_H
#define CORETRACE_CLI_HELP_H

Expand Down
1 change: 1 addition & 0 deletions src/cli/main.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include "compilerlib/compiler.h"
#include <iostream>

Expand Down
1 change: 1 addition & 0 deletions src/compilerlib/compiler.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include "compilerlib/compiler.h"
#include "compilerlib/attributes.hpp"
#include "compilerlib/toolchain.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/compilerlib/emit/llvm_output.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include "llvm_output.hpp"

#include <clang/Frontend/CompilerInstance.h>
Expand Down
1 change: 1 addition & 0 deletions src/compilerlib/emit/llvm_output.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#pragma once

#include "compilerlib/attributes.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/compilerlib/frontend/optnone_action.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include "compilerlib/frontend/optnone_action.hpp"

#include <clang/AST/Attr.h>
Expand Down
1 change: 1 addition & 0 deletions src/compilerlib/instrumentation/alloc.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include "compilerlib/instrumentation/alloc.hpp"
#include "compilerlib/instrumentation/common.hpp"
#include "compilerlib/attributes.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/compilerlib/instrumentation/bounds.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include "compilerlib/instrumentation/bounds.hpp"
#include "compilerlib/instrumentation/common.hpp"
#include "compilerlib/attributes.hpp"
Expand Down
1 change: 1 addition & 0 deletions src/compilerlib/instrumentation/common.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include "compilerlib/instrumentation/common.hpp"
#include "compilerlib/attributes.hpp"

Expand Down
1 change: 1 addition & 0 deletions src/compilerlib/instrumentation/config.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include "compilerlib/instrumentation/config.hpp"
#include "compilerlib/attributes.hpp"

Expand Down
1 change: 1 addition & 0 deletions src/compilerlib/instrumentation/trace.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include "compilerlib/instrumentation/trace.hpp"
#include "compilerlib/instrumentation/common.hpp"

Expand Down
1 change: 1 addition & 0 deletions src/compilerlib/instrumentation/vtable.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include "compilerlib/instrumentation/vtable.hpp"
#include "compilerlib/instrumentation/common.hpp"

Expand Down
1 change: 1 addition & 0 deletions src/compilerlib/toolchain.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include "compilerlib/toolchain.hpp"

#include <clang/Driver/Driver.h>
Expand Down
1 change: 1 addition & 0 deletions src/runtime/ct_instrument_runtime.cpp
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
// SPDX-License-Identifier: Apache-2.0
// Runtime instrumentation implementation was split across ct_runtime_*.cpp files.
1 change: 1 addition & 0 deletions src/runtime/ct_runtime_alloc.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include "ct_runtime_internal.h"

#include <cstdlib>
Expand Down
1 change: 1 addition & 0 deletions src/runtime/ct_runtime_backtrace.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include "ct_runtime_internal.h"

#include <cstdlib>
Expand Down
1 change: 1 addition & 0 deletions src/runtime/ct_runtime_bounds.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include "ct_runtime_internal.h"

#include <cstdint>
Expand Down
1 change: 1 addition & 0 deletions src/runtime/ct_runtime_env.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include "ct_runtime_internal.h"

#include <cstdlib>
Expand Down
1 change: 1 addition & 0 deletions src/runtime/ct_runtime_helpers.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#pragma once

#include <cstddef>
Expand Down
1 change: 1 addition & 0 deletions src/runtime/ct_runtime_internal.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#ifndef CT_RUNTIME_INTERNAL_H
#define CT_RUNTIME_INTERNAL_H

Expand Down
1 change: 1 addition & 0 deletions src/runtime/ct_runtime_logging.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include "ct_runtime_internal.h"

// #############################################
Expand Down
1 change: 1 addition & 0 deletions src/runtime/ct_runtime_shadow.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include "ct_runtime_internal.h"

#include <cstdlib>
Expand Down
1 change: 1 addition & 0 deletions src/runtime/ct_runtime_state.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include "ct_runtime_internal.h"

#include <atomic>
Expand Down
1 change: 1 addition & 0 deletions src/runtime/ct_runtime_trace.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include "ct_runtime_internal.h"

#include "ct_runtime_helpers.h"
Expand Down
1 change: 1 addition & 0 deletions src/runtime/ct_runtime_vtable.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include "ct_runtime_internal.h"

#include "ct_runtime_helpers.h"
Expand Down
1 change: 1 addition & 0 deletions test/ct_alloc_basic.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <stdlib.h>

int main(void)
Expand Down
1 change: 1 addition & 0 deletions test/ct_alloc_growth.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <stdlib.h>
#include <stdio.h>

Expand Down
1 change: 1 addition & 0 deletions test/ct_autofree_aligned_alloc.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <stdlib.h>

int main(void)
Expand Down
1 change: 1 addition & 0 deletions test/ct_autofree_brk.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <unistd.h>

int main(void)
Expand Down
1 change: 1 addition & 0 deletions test/ct_autofree_inttoptr.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <stdlib.h>
#include <stdint.h>

Expand Down
1 change: 1 addition & 0 deletions test/ct_autofree_inttoptr_escape.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <stdlib.h>
#include <stdint.h>

Expand Down
1 change: 1 addition & 0 deletions test/ct_autofree_local.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
Expand Down
1 change: 1 addition & 0 deletions test/ct_autofree_mmap.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <sys/mman.h>
#include <unistd.h>

Expand Down
1 change: 1 addition & 0 deletions test/ct_autofree_new_nothrow.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// SPDX-License-Identifier: Apache-2.0
#include <new>

int main()
Expand Down
Loading
Loading