From c1a87d4afc1f227d9e352fbe8ca947e5b13360bb Mon Sep 17 00:00:00 2001 From: Vipul Cariappa Date: Fri, 13 Dec 2024 18:46:01 +0530 Subject: [PATCH 1/2] fix cmake dependencies when building together with clang (#1168) --- CMakeLists.txt | 8 -------- tools/CMakeLists.txt | 9 +++++++++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 162944a26..338684756 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -286,14 +286,6 @@ if (NOT CLAD_BUILD_STATIC_ONLY AND NOT LLVM_ENABLE_PLUGINS) message(FATAL_ERROR "LLVM_ENABLE_PLUGINS is set to OFF. Please build clad with -DCLAD_BUILD_STATIC_ONLY=ON.") endif() -# Add clad deps if we build together with clang. -if (TARGET intrinsics_gen) - list(APPEND LLVM_COMMON_DEPENDS intrinsics_gen) -endif() -if (TARGET clang-headers) - list(APPEND LLVM_COMMON_DEPENDS clang-headers) -endif() - add_subdirectory(lib) add_subdirectory(tools) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index ecf61f4ae..5845b4a5d 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -132,6 +132,15 @@ if (NOT CLAD_BUILD_STATIC_ONLY) target_link_libraries(clad PUBLIC ${_enzyme_link_flags}) add_dependencies(clad LLVMEnzyme) + + # Add clad deps if we build together with clang. + if (TARGET intrinsics_gen) + add_dependencies(clad intrinsics_gen) + endif() + if (TARGET clang-headers) + add_dependencies(clad clang-headers) + endif() + endif(CLAD_ENABLE_ENZYME_BACKEND) endif() set_source_files_properties(ClangPlugin.cpp PROPERTIES COMPILE_DEFINITIONS CLANG_MAJOR_VERSION="${LLVM_VERSION_MAJOR}") From fbf11f11f9d518d68aad8b2932f9283a648f1c3a Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Fri, 13 Dec 2024 22:08:04 +0200 Subject: [PATCH 2/2] Remove extra semicolon from macro. Fixes a osx warning. (#1169) --- lib/Differentiator/StmtClone.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Differentiator/StmtClone.cpp b/lib/Differentiator/StmtClone.cpp index e430d4f03..789a1631c 100644 --- a/lib/Differentiator/StmtClone.cpp +++ b/lib/Differentiator/StmtClone.cpp @@ -247,7 +247,7 @@ DEFINE_CLONE_EXPR(SubstNonTypeTemplateParmExpr, (CloneType(Node->getType()), Node->getValueKind(), Node->getBeginLoc(), Node->getReplacement(), Node->getAssociatedDecl(), Node->getIndex(), - Node->getPackIndex(), Node->isReferenceParameter())); + Node->getPackIndex(), Node->isReferenceParameter())) #endif DEFINE_CREATE_EXPR(PseudoObjectExpr, (Ctx, Node->getSyntacticForm(), llvm::SmallVector(Node->semantics_begin(), Node->semantics_end()), Node->getResultExprIndex())) // NOLINTEND(modernize-use-auto)