Skip to content

Commit

Permalink
Copyright and CMake project setup (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahueck authored Jan 1, 2025
1 parent 348dc7f commit 5461084
Show file tree
Hide file tree
Showing 37 changed files with 66 additions and 35 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
cmake_minimum_required(VERSION 3.20)

project(dimeta
VERSION 0.1
VERSION 0.1.0
HOMEPAGE_URL https://github.com/ahueck/llvm-dimeta
LANGUAGES C CXX
)

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2022, Alexander Hück
Copyright (c) 2022-2025 llvm-dimeta authors
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion lib/pass/DimetaPass.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// llvm-dimeta library
// Copyright (c) 2022-2024 llvm-dimeta authors
// Copyright (c) 2022-2025 llvm-dimeta authors
// Distributed under the BSD 3-Clause license.
// (See accompanying file LICENSE)
// SPDX-License-Identifier: BSD-3-Clause
Expand Down
2 changes: 1 addition & 1 deletion lib/pass/DimetaPass.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// llvm-dimeta library
// Copyright (c) 2022-2024 llvm-dimeta authors
// Copyright (c) 2022-2025 llvm-dimeta authors
// Distributed under the BSD 3-Clause license.
// (See accompanying file LICENSE)
// SPDX-License-Identifier: BSD-3-Clause
Expand Down
2 changes: 1 addition & 1 deletion lib/support/Logger.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// llvm-dimeta library
// Copyright (c) 2022-2024 llvm-dimeta authors
// Copyright (c) 2022-2025 llvm-dimeta authors
// Distributed under the BSD 3-Clause license.
// (See accompanying file LICENSE)
// SPDX-License-Identifier: BSD-3-Clause
Expand Down
2 changes: 1 addition & 1 deletion lib/type/DIFinder.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// llvm-dimeta library
// Copyright (c) 2022-2024 llvm-dimeta authors
// Copyright (c) 2022-2025 llvm-dimeta authors
// Distributed under the BSD 3-Clause license.
// (See accompanying file LICENSE)
// SPDX-License-Identifier: BSD-3-Clause
Expand Down
2 changes: 1 addition & 1 deletion lib/type/DIFinder.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// llvm-dimeta library
// Copyright (c) 2022-2024 llvm-dimeta authors
// Copyright (c) 2022-2025 llvm-dimeta authors
// Distributed under the BSD 3-Clause license.
// (See accompanying file LICENSE)
// SPDX-License-Identifier: BSD-3-Clause
Expand Down
2 changes: 1 addition & 1 deletion lib/type/DIParser.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// llvm-dimeta library
// Copyright (c) 2022-2024 llvm-dimeta authors
// Copyright (c) 2022-2025 llvm-dimeta authors
// Distributed under the BSD 3-Clause license.
// (See accompanying file LICENSE)
// SPDX-License-Identifier: BSD-3-Clause
Expand Down
2 changes: 1 addition & 1 deletion lib/type/DIParser.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// llvm-dimeta library
// Copyright (c) 2022-2024 llvm-dimeta authors
// Copyright (c) 2022-2025 llvm-dimeta authors
// Distributed under the BSD 3-Clause license.
// (See accompanying file LICENSE)
// SPDX-License-Identifier: BSD-3-Clause
Expand Down
2 changes: 1 addition & 1 deletion lib/type/DIRootType.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// llvm-dimeta library
// Copyright (c) 2022-2024 llvm-dimeta authors
// Copyright (c) 2022-2025 llvm-dimeta authors
// Distributed under the BSD 3-Clause license.
// (See accompanying file LICENSE)
// SPDX-License-Identifier: BSD-3-Clause
Expand Down
2 changes: 1 addition & 1 deletion lib/type/DIRootType.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// llvm-dimeta library
// Copyright (c) 2022-2024 llvm-dimeta authors
// Copyright (c) 2022-2025 llvm-dimeta authors
// Distributed under the BSD 3-Clause license.
// (See accompanying file LICENSE)
// SPDX-License-Identifier: BSD-3-Clause
Expand Down
2 changes: 1 addition & 1 deletion lib/type/DITypeExtractor.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

// llvm-dimeta library
// Copyright (c) 2022-2024 llvm-dimeta authors
// Copyright (c) 2022-2025 llvm-dimeta authors
// Distributed under the BSD 3-Clause license.
// (See accompanying file LICENSE)
// SPDX-License-Identifier: BSD-3-Clause
Expand Down
2 changes: 1 addition & 1 deletion lib/type/DITypeExtractor.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// llvm-dimeta library
// Copyright (c) 2022-2024 llvm-dimeta authors
// Copyright (c) 2022-2025 llvm-dimeta authors
// Distributed under the BSD 3-Clause license.
// (See accompanying file LICENSE)
// SPDX-License-Identifier: BSD-3-Clause
Expand Down
2 changes: 1 addition & 1 deletion lib/type/DIVisitor.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// llvm-dimeta library
// Copyright (c) 2022-2024 llvm-dimeta authors
// Copyright (c) 2022-2025 llvm-dimeta authors
// Distributed under the BSD 3-Clause license.
// (See accompanying file LICENSE)
// SPDX-License-Identifier: BSD-3-Clause
Expand Down
2 changes: 1 addition & 1 deletion lib/type/DIVisitorUtil.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// llvm-dimeta library
// Copyright (c) 2022-2024 Alexander Hück
// Copyright (c) 2022-2025 llvm-dimeta authors
// Distributed under the BSD 3-Clause license.
// (See accompanying file LICENSE)
// SPDX-License-Identifier: BSD-3-Clause
Expand Down
2 changes: 1 addition & 1 deletion lib/type/DIVisitorUtil.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// llvm-dimeta library
// Copyright (c) 2022-2024 Alexander Hück
// Copyright (c) 2022-2025 llvm-dimeta authors
// Distributed under the BSD 3-Clause license.
// (See accompanying file LICENSE)
// SPDX-License-Identifier: BSD-3-Clause
Expand Down
2 changes: 1 addition & 1 deletion lib/type/DataflowAnalysis.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// llvm-dimeta library
// Copyright (c) 2022-2024 llvm-dimeta authors
// Copyright (c) 2022-2025 llvm-dimeta authors
// Distributed under the BSD 3-Clause license.
// (See accompanying file LICENSE)
// SPDX-License-Identifier: BSD-3-Clause
Expand Down
2 changes: 1 addition & 1 deletion lib/type/DataflowAnalysis.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// llvm-dimeta library
// Copyright (c) 2022-2024 llvm-dimeta authors
// Copyright (c) 2022-2025 llvm-dimeta authors
// Distributed under the BSD 3-Clause license.
// (See accompanying file LICENSE)
// SPDX-License-Identifier: BSD-3-Clause
Expand Down
2 changes: 1 addition & 1 deletion lib/type/DefUseAnalysis.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// llvm-dimeta library
// Copyright (c) 2022-2024 llvm-dimeta authors
// Copyright (c) 2022-2025 llvm-dimeta authors
// Distributed under the BSD 3-Clause license.
// (See accompanying file LICENSE)
// SPDX-License-Identifier: BSD-3-Clause
Expand Down
2 changes: 1 addition & 1 deletion lib/type/Dimeta.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// llvm-dimeta library
// Copyright (c) 2022-2024 llvm-dimeta authors
// Copyright (c) 2022-2025 llvm-dimeta authors
// Distributed under the BSD 3-Clause license.
// (See accompanying file LICENSE)
// SPDX-License-Identifier: BSD-3-Clause
Expand Down
2 changes: 1 addition & 1 deletion lib/type/Dimeta.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// llvm-dimeta library
// Copyright (c) 2022-2024 llvm-dimeta authors
// Copyright (c) 2022-2025 llvm-dimeta authors
// Distributed under the BSD 3-Clause license.
// (See accompanying file LICENSE)
// SPDX-License-Identifier: BSD-3-Clause
Expand Down
2 changes: 1 addition & 1 deletion lib/type/DimetaData.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// llvm-dimeta library
// Copyright (c) 2022-2024 llvm-dimeta authors
// Copyright (c) 2022-2025 llvm-dimeta authors
// Distributed under the BSD 3-Clause license.
// (See accompanying file LICENSE)
// SPDX-License-Identifier: BSD-3-Clause
Expand Down
2 changes: 1 addition & 1 deletion lib/type/DimetaIO.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// llvm-dimeta library
// Copyright (c) 2022-2024 llvm-dimeta authors
// Copyright (c) 2022-2025 llvm-dimeta authors
// Distributed under the BSD 3-Clause license.
// (See accompanying file LICENSE)
// SPDX-License-Identifier: BSD-3-Clause
Expand Down
2 changes: 1 addition & 1 deletion lib/type/DimetaIO.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// llvm-dimeta library
// Copyright (c) 2022-2024 llvm-dimeta authors
// Copyright (c) 2022-2025 llvm-dimeta authors
// Distributed under the BSD 3-Clause license.
// (See accompanying file LICENSE)
// SPDX-License-Identifier: BSD-3-Clause
Expand Down
2 changes: 1 addition & 1 deletion lib/type/DimetaParse.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// llvm-dimeta library
// Copyright (c) 2022-2024 llvm-dimeta authors
// Copyright (c) 2022-2025 llvm-dimeta authors
// Distributed under the BSD 3-Clause license.
// (See accompanying file LICENSE)
// SPDX-License-Identifier: BSD-3-Clause
Expand Down
2 changes: 1 addition & 1 deletion lib/type/DimetaParse.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// llvm-dimeta library
// Copyright (c) 2022-2024 llvm-dimeta authors
// Copyright (c) 2022-2025 llvm-dimeta authors
// Distributed under the BSD 3-Clause license.
// (See accompanying file LICENSE)
// SPDX-License-Identifier: BSD-3-Clause
Expand Down
2 changes: 1 addition & 1 deletion lib/type/GEP.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// llvm-dimeta library
// Copyright (c) 2022-2024 llvm-dimeta authors
// Copyright (c) 2022-2025 llvm-dimeta authors
// Distributed under the BSD 3-Clause license.
// (See accompanying file LICENSE)
// SPDX-License-Identifier: BSD-3-Clause
Expand Down
2 changes: 1 addition & 1 deletion lib/type/GEP.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// llvm-dimeta library
// Copyright (c) 2022-2024 llvm-dimeta authors
// Copyright (c) 2022-2025 llvm-dimeta authors
// Distributed under the BSD 3-Clause license.
// (See accompanying file LICENSE)
// SPDX-License-Identifier: BSD-3-Clause
Expand Down
2 changes: 1 addition & 1 deletion lib/type/MemoryOps.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// llvm-dimeta library
// Copyright (c) 2022-2024 llvm-dimeta authors
// Copyright (c) 2022-2025 llvm-dimeta authors
// Distributed under the BSD 3-Clause license.
// (See accompanying file LICENSE)
// SPDX-License-Identifier: BSD-3-Clause
Expand Down
2 changes: 1 addition & 1 deletion lib/type/SourceLocType.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// llvm-dimeta library
// Copyright (c) 2022-2024 llvm-dimeta authors
// Copyright (c) 2022-2025 llvm-dimeta authors
// Distributed under the BSD 3-Clause license.
// (See accompanying file LICENSE)
// SPDX-License-Identifier: BSD-3-Clause
Expand Down
2 changes: 1 addition & 1 deletion lib/type/TBAA.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// llvm-dimeta library
// Copyright (c) 2022-2024 llvm-dimeta authors
// Copyright (c) 2022-2025 llvm-dimeta authors
// Distributed under the BSD 3-Clause license.
// (See accompanying file LICENSE)
// SPDX-License-Identifier: BSD-3-Clause
Expand Down
2 changes: 1 addition & 1 deletion lib/type/TBAA.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// llvm-dimeta library
// Copyright (c) 2022-2024 llvm-dimeta authors
// Copyright (c) 2022-2025 llvm-dimeta authors
// Distributed under the BSD 3-Clause license.
// (See accompanying file LICENSE)
// SPDX-License-Identifier: BSD-3-Clause
Expand Down
2 changes: 1 addition & 1 deletion lib/type/Util.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// llvm-dimeta library
// Copyright (c) 2022-2024 llvm-dimeta authors
// Copyright (c) 2022-2025 llvm-dimeta authors
// Distributed under the BSD 3-Clause license.
// (See accompanying file LICENSE)
// SPDX-License-Identifier: BSD-3-Clause
Expand Down
2 changes: 1 addition & 1 deletion lib/type/ValuePath.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// llvm-dimeta library
// Copyright (c) 2022-2024 llvm-dimeta authors
// Copyright (c) 2022-2025 llvm-dimeta authors
// Distributed under the BSD 3-Clause license.
// (See accompanying file LICENSE)
// SPDX-License-Identifier: BSD-3-Clause
Expand Down
19 changes: 19 additions & 0 deletions test/pass/c/heap_lhs_obj_opt_pad.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// RUN: %c-to-llvm %s | %opt -O1 -S | %apply-verifier 2>&1 | %filecheck %s

#include <stdlib.h>

struct Data {
double padding;
int* data_;
};

int** get_data(struct Data* d) {
return &d->data_;
}

void foo(struct Data** d) {
// CHECK: Extracted Type: {{.*}} = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: [[DIREF:![0-9]+]], size: 64)
// CHECK: Final Type: [[DIREF]] = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
// CHECK-NEXT: Pointer level: 1
*get_data(*d) = (int*)malloc(sizeof(int));
}
10 changes: 10 additions & 0 deletions test/pass/c/heap_return_malloc.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// RUN: %c-to-llvm %s | %apply-verifier 2>&1 | %filecheck %s
// RUN: %c-to-llvm %s | %opt -O1 -S | %apply-verifier 2>&1 | %filecheck %s

#include <stdlib.h>
int n;
int* foo() {
// CHECK: Extracted Type: {{.*}} = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: [[DIREF:![0-9]+]], size: 64)
// CHECK: Final Type: [[DIREF]] = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
return (int*)malloc(sizeof(int) * n);
}
2 changes: 1 addition & 1 deletion test/verifier/TestPass.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Dimeta library
// Copyright (c) 2022-2023 Alexander Hück
// Copyright (c) 2022-2025 llvm-dimeta authors
// Distributed under the BSD 3-Clause license.
// (See accompanying file LICENSE)
// SPDX-License-Identifier: BSD-3-Clause
Expand Down

0 comments on commit 5461084

Please sign in to comment.