Skip to content

Commit

Permalink
♻️ Rename project
Browse files Browse the repository at this point in the history
  • Loading branch information
Sharp0802 committed Dec 16, 2024
1 parent 1c5c0d3 commit dfda0f2
Show file tree
Hide file tree
Showing 20 changed files with 51 additions and 51 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
cmake_minimum_required(VERSION 3.26)
project(polyglat)
project(mllic)

set(ENABLE_LLVM_SHARED ON)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/build/bin/")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/build/lib/")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/build/lib/")

set(POLYGLAT_PATH "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
set(MLLIC_PATH "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
include(Polyglat)
include(UseMLLIC)
include(UseClang)
include(UseLLVM)
include(CTest)
Expand Down
4 changes: 2 additions & 2 deletions Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#---------------------------------------------------------------------------

DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = "Polyglat"
PROJECT_NAME = "MLLIC"
PROJECT_NUMBER =
PROJECT_BRIEF = "Cross-language integration system"
PROJECT_LOGO =
Expand Down Expand Up @@ -194,7 +194,7 @@ FILE_PATTERNS = *.c \
RECURSIVE = YES
EXCLUDE =
EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS = */polyglat-test/* */test/*
EXCLUDE_PATTERNS = */mllic-test/* */test/*
EXCLUDE_SYMBOLS =
EXAMPLE_PATH =
EXAMPLE_PATTERNS = *
Expand Down
4 changes: 2 additions & 2 deletions cmake/Polyglat.cmake → cmake/UseMLLIC.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function(add_polyglat_library target language)
function(add_mllic_library target language)
foreach (SOURCE ${ARGN})
string(REGEX REPLACE "[.][^.]*$" ".cir" CIR "${SOURCE}")
string(REGEX REPLACE "[.][^.]*$" ".mlir" MLIR "${SOURCE}")
Expand All @@ -22,7 +22,7 @@ function(add_polyglat_library target language)
add_custom_command(
OUTPUT ${LL}
COMMAND ${${COMPILER}}
-fplugin="${POLYGLAT_PATH}/polyglat-c.so"
-fplugin="${MLLIC_PATH}/mllic-c.so"
-emit-cir
$<TARGET_PROPERTY:${target},COMPILE_OPTIONS>
"${INPUT}" -o "${CIR}"
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

include_directories(${CMAKE_CURRENT_LIST_DIR})

file(GLOB DIRS LIST_DIRECTORIES true "polyglat*")
file(GLOB DIRS LIST_DIRECTORIES true "mllic*")
foreach (DIR IN LISTS DIRS)
add_subdirectory(${DIR})
endforeach ()
9 changes: 9 additions & 0 deletions src/mllic-c/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
project(mllic-c LANGUAGES CXX)

file(GLOB_RECURSE SOURCES src/*.*)

add_llvm_library(mllic-c MODULE ${SOURCES} PLUGIN_TOOL clang)
target_link_libraries(mllic-c PUBLIC mllic-shared)
target_precompile_headers(mllic-c PUBLIC pch.h)

add_test(NAME mllic-c COMMAND "${CMAKE_CURRENT_LIST_DIR}/test/test.sh" "${CMAKE_BINARY_DIR}")
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
*/

#include "polyglat-c/pch.h"
#include "polyglat-shared/annotation.h"
#include "mllic-c/pch.h"
#include "mllic-shared/annotation.h"

namespace {
class ExportAttrInfo final : public clang::ParsedAttrInfo {
Expand All @@ -25,15 +25,15 @@ namespace {
static constexpr std::array<Spelling, 3> S = {{
{
.Syntax = clang::ParsedAttr::AS_GNU,
.NormalizedFullName = "polyglat_export",
.NormalizedFullName = "mllic_export",
},
{
.Syntax = clang::ParsedAttr::AS_C23,
.NormalizedFullName = "polyglat::export",
.NormalizedFullName = "mllic::export",
},
{
.Syntax = clang::ParsedAttr::AS_CXX11,
.NormalizedFullName = "polyglat::export",
.NormalizedFullName = "mllic::export",
},
}};
Spellings = S;
Expand All @@ -51,11 +51,11 @@ namespace {
if (const auto record = clang::dyn_cast<clang::CXXRecordDecl>(D)) {
for (const auto method : record->methods()) {
if (method->getVisibility() != clang::Visibility::HiddenVisibility) {
polyglat::shared::CreateAnnotation(method);
mllic::shared::CreateAnnotation(method);
}
}
} else if (const auto fn = clang::dyn_cast<clang::FunctionDecl>(D)) {
polyglat::shared::CreateAnnotation(fn); // just mark a symbol to process it later
mllic::shared::CreateAnnotation(fn); // just mark a symbol to process it later
} else {
const auto id = S.Diags.getCustomDiagID(
clang::DiagnosticsEngine::Warning,
Expand All @@ -82,5 +82,5 @@ namespace {
namespace {
[[maybe_unused]]
//NOLINTNEXTLINE(cert-err58-cpp) : Initialization of 'Y' with static storage duration may throw an exception that cannot be caught
const clang::ParsedAttrInfoRegistry::Add<ExportAttrInfo> Y("polyglat", "");
const clang::ParsedAttrInfoRegistry::Add<ExportAttrInfo> Y("mllic", "");
}
File renamed without changes.
2 changes: 1 addition & 1 deletion src/polyglat-c/test/main.cxx → src/mllic-c/test/main.cxx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

namespace TestNS
{
struct [[polyglat::export]] TestStruct {
struct [[mllic::export]] TestStruct {
int A;
int B;

Expand Down
2 changes: 1 addition & 1 deletion src/polyglat-c/test/test.sh → src/mllic-c/test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PREDIR="$(pwd)"
cd "$(dirname $(realpath $0))"

# Compile test source with plugin
(clang++ -fplugin="$1/build/lib/polyglat-c.so" -g -S -emit-llvm -Werror main.cxx -o main.ll) || exit 1
(clang++ -fplugin="$1/build/lib/mllic-c.so" -g -S -emit-llvm -Werror main.cxx -o main.ll) || exit 1

# Restore environment
cd "$PREDIR"
5 changes: 5 additions & 0 deletions src/mllic-shared/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
project(mllic-shared LANGUAGES CXX)

file(GLOB_RECURSE SOURCES src/*.*)
add_library(mllic-shared STATIC ${SOURCES})
target_precompile_headers(mllic-shared PUBLIC pch.h)
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ namespace clang {
class FunctionDecl;
} // namespace clang

namespace polyglat::shared {
constexpr std::string Namespace = "$pg";
namespace mllic::shared {
constexpr std::string Namespace = "$mllic";

namespace prefix {
constexpr std::string Path = "path";
Expand All @@ -17,4 +17,4 @@ namespace polyglat::shared {
}

void CreateAnnotation(clang::FunctionDecl *decl);
} // namespace polyglat::shared
} // namespace mllic::shared
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "polyglat-shared/annotation.h"
#include "polyglat-shared/pch.h"
#include "mllic-shared/annotation.h"
#include "mllic-shared/pch.h"

namespace {
template<typename T>
Expand Down Expand Up @@ -42,7 +42,7 @@ namespace {

decl->addAttr(clang::AnnotateAttr::CreateImplicit(
decl->getASTContext(),
polyglat::shared::Namespace + '.' + key,
mllic::shared::Namespace + '.' + key,
args.data(),
args.size()));
}
Expand All @@ -59,7 +59,7 @@ namespace {
}
} // namespace

void polyglat::shared::CreateAnnotation(clang::FunctionDecl *decl) {
void mllic::shared::CreateAnnotation(clang::FunctionDecl *decl) {
const auto dirs = GetPath(decl);
ApplyAnnotation(decl, prefix::Path, dirs);

Expand Down
11 changes: 11 additions & 0 deletions src/mllic-test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
project(mllic-test LANGUAGES CXX)

file(GLOB_RECURSE SOURCES src/*.cxx)
add_mllic_library(mllic-test CXX ${SOURCES})
add_dependencies(mllic-test mllic-c)

set_target_properties(mllic-test PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
)

add_test(NAME mllic-test COMMAND xmllint --noout "$<TARGET_GENEX_EVAL:mllic-test,$<TARGET_PROPERTY:mllic-test,TARGET_PSM_FILE>>")
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

namespace ns {
struct record {
[[polyglat::export]] int foo(int a);
[[mllic::export]] int foo(int a);
};
}

Expand Down
File renamed without changes.
9 changes: 0 additions & 9 deletions src/polyglat-c/CMakeLists.txt

This file was deleted.

5 changes: 0 additions & 5 deletions src/polyglat-shared/CMakeLists.txt

This file was deleted.

11 changes: 0 additions & 11 deletions src/polyglat-test/CMakeLists.txt

This file was deleted.

0 comments on commit dfda0f2

Please sign in to comment.