From c51e64110f7997f66dbab1370b0f78c2ff874b70 Mon Sep 17 00:00:00 2001 From: Micah Snyder Date: Tue, 13 Feb 2024 13:07:36 -0500 Subject: [PATCH] Restructure libclambcc directory to fix unit tests The unit tests rely on all of the opt pass libraries being located in the same directory as libclambccommon.so, as specified using LD_LIBRARY_PATH. One solution would have been to specify a path for each opt pass library in LD_LIBRARY_PATH and then search for each library in each of those LD_LIBRARY_PATH paths. However this felt very clunky. Instead, this commit solves the problem by placing the source for all opt passes in the same directory, which will mean that the .so's created in the build directory will also be co-located and thus using a single path for LD_LIBRARY_PATH will suffice. To make present and future copy-pasting easy, I also renamed the libraries to be camel-case. --- Dockerfile | 55 --- clambcc/clambc-compiler.py | 57 ++- libclambcc/CMakeLists.txt | 419 ++++++++++++++++-- .../{ClamBCAnalyzer => }/ClamBCAnalyzer.cpp | 0 .../{ClamBCAnalyzer => }/ClamBCAnalyzer.h | 0 libclambcc/ClamBCAnalyzer/CMakeLists.txt | 44 -- .../ClamBCChangeMallocArgSize.cpp | 0 .../ClamBCChangeMallocArgSize/CMakeLists.txt | 44 -- libclambcc/{Common => }/ClamBCCommon.h | 0 .../ClamBCConvertIntrinsicsTo32Bit.cpp | 0 .../CMakeLists.txt | 43 -- libclambcc/{Common => }/ClamBCDiagnostics.cpp | 0 libclambcc/{Common => }/ClamBCDiagnostics.h | 0 .../ClamBCExtendPHIsTo64Bit.cpp | 0 .../ClamBCExtendPHIsTo64Bit/CMakeLists.txt | 44 -- .../ClamBCLogicalCompiler.cpp | 0 .../ClamBCLogicalCompiler/CMakeLists.txt | 43 -- .../ClamBCLogicalCompilerHelper.cpp | 0 .../CMakeLists.txt | 44 -- .../{ClamBCLowering => }/ClamBCLowering.cpp | 0 .../{ClamBCLowering => }/ClamBCLowering.h | 0 libclambcc/ClamBCLowering/CMakeLists.txt | 89 ---- .../{ClamBCLowering => }/ClamBCLoweringF.cpp | 0 .../{ClamBCLowering => }/ClamBCLoweringNF.cpp | 0 libclambcc/{Common => }/ClamBCModule.h | 0 .../ClamBCOutlineEndiannessCalls.cpp | 0 .../CMakeLists.txt | 45 -- .../ClamBCPrepareGEPsForWriter.cpp | 2 +- .../ClamBCPrepareGEPsForWriter/CMakeLists.txt | 44 -- .../ClamBCPreserveABIs.cpp | 0 libclambcc/ClamBCPreserveABIs/CMakeLists.txt | 43 -- .../{ClamBCRebuild => }/ClamBCRebuild.cpp | 0 libclambcc/ClamBCRebuild/CMakeLists.txt | 44 -- .../{ClamBCRegAlloc => }/ClamBCRegAlloc.cpp | 0 .../{ClamBCRegAlloc => }/ClamBCRegAlloc.h | 0 libclambcc/ClamBCRegAlloc/CMakeLists.txt | 43 -- .../ClamBCRemoveFSHL.cpp | 0 libclambcc/ClamBCRemoveFSHL/CMakeLists.txt | 42 -- .../ClamBCRemoveFreezeInsts.cpp | 0 .../ClamBCRemoveFreezeInsts/CMakeLists.txt | 43 -- .../ClamBCRemoveICMPSLE.cpp | 0 libclambcc/ClamBCRemoveICMPSLE/CMakeLists.txt | 43 -- .../ClamBCRemovePointerPHIs.cpp | 0 .../ClamBCRemovePointerPHIs/CMakeLists.txt | 43 -- .../ClamBCRemoveUSUB.cpp | 0 libclambcc/ClamBCRemoveUSUB/CMakeLists.txt | 44 -- .../ClamBCRemoveUndefs.cpp | 0 libclambcc/ClamBCRemoveUndefs/CMakeLists.txt | 42 -- .../ClamBCRemoveUnsupportedICMPIntrinsics.cpp | 0 .../CMakeLists.txt | 42 -- libclambcc/{ClamBCTrace => }/ClamBCTrace.cpp | 0 libclambcc/ClamBCTrace/CMakeLists.txt | 43 -- libclambcc/{Common => }/ClamBCUtilities.cpp | 0 libclambcc/{Common => }/ClamBCUtilities.h | 0 .../{ClamBCVerifier => }/ClamBCVerifier.cpp | 0 libclambcc/ClamBCVerifier/CMakeLists.txt | 43 -- .../{ClamBCWriter => }/ClamBCWriter.cpp | 4 +- libclambcc/ClamBCWriter/CMakeLists.txt | 43 -- libclambcc/Common/CMakeLists.txt | 42 -- libclambcc/{Common => }/bytecode_api.h | 0 libclambcc/{Common => }/clambc.h | 0 libclambcc/{Common => }/version.c | 0 test/CMakeLists.txt | 2 +- 63 files changed, 421 insertions(+), 1158 deletions(-) delete mode 100644 Dockerfile rename libclambcc/{ClamBCAnalyzer => }/ClamBCAnalyzer.cpp (100%) rename libclambcc/{ClamBCAnalyzer => }/ClamBCAnalyzer.h (100%) delete mode 100644 libclambcc/ClamBCAnalyzer/CMakeLists.txt rename libclambcc/{ClamBCChangeMallocArgSize => }/ClamBCChangeMallocArgSize.cpp (100%) delete mode 100644 libclambcc/ClamBCChangeMallocArgSize/CMakeLists.txt rename libclambcc/{Common => }/ClamBCCommon.h (100%) rename libclambcc/{ClamBCConvertIntrinsicsTo32Bit => }/ClamBCConvertIntrinsicsTo32Bit.cpp (100%) delete mode 100644 libclambcc/ClamBCConvertIntrinsicsTo32Bit/CMakeLists.txt rename libclambcc/{Common => }/ClamBCDiagnostics.cpp (100%) rename libclambcc/{Common => }/ClamBCDiagnostics.h (100%) rename libclambcc/{ClamBCExtendPHIsTo64Bit => }/ClamBCExtendPHIsTo64Bit.cpp (100%) delete mode 100644 libclambcc/ClamBCExtendPHIsTo64Bit/CMakeLists.txt rename libclambcc/{ClamBCLogicalCompiler => }/ClamBCLogicalCompiler.cpp (100%) delete mode 100644 libclambcc/ClamBCLogicalCompiler/CMakeLists.txt rename libclambcc/{ClamBCLogicalCompilerHelper => }/ClamBCLogicalCompilerHelper.cpp (100%) delete mode 100644 libclambcc/ClamBCLogicalCompilerHelper/CMakeLists.txt rename libclambcc/{ClamBCLowering => }/ClamBCLowering.cpp (100%) rename libclambcc/{ClamBCLowering => }/ClamBCLowering.h (100%) delete mode 100644 libclambcc/ClamBCLowering/CMakeLists.txt rename libclambcc/{ClamBCLowering => }/ClamBCLoweringF.cpp (100%) rename libclambcc/{ClamBCLowering => }/ClamBCLoweringNF.cpp (100%) rename libclambcc/{Common => }/ClamBCModule.h (100%) rename libclambcc/{ClamBCOutlineEndiannessCalls => }/ClamBCOutlineEndiannessCalls.cpp (100%) delete mode 100644 libclambcc/ClamBCOutlineEndiannessCalls/CMakeLists.txt rename libclambcc/{ClamBCPrepareGEPsForWriter => }/ClamBCPrepareGEPsForWriter.cpp (99%) delete mode 100644 libclambcc/ClamBCPrepareGEPsForWriter/CMakeLists.txt rename libclambcc/{ClamBCPreserveABIs => }/ClamBCPreserveABIs.cpp (100%) delete mode 100644 libclambcc/ClamBCPreserveABIs/CMakeLists.txt rename libclambcc/{ClamBCRebuild => }/ClamBCRebuild.cpp (100%) delete mode 100644 libclambcc/ClamBCRebuild/CMakeLists.txt rename libclambcc/{ClamBCRegAlloc => }/ClamBCRegAlloc.cpp (100%) rename libclambcc/{ClamBCRegAlloc => }/ClamBCRegAlloc.h (100%) delete mode 100644 libclambcc/ClamBCRegAlloc/CMakeLists.txt rename libclambcc/{ClamBCRemoveFSHL => }/ClamBCRemoveFSHL.cpp (100%) delete mode 100644 libclambcc/ClamBCRemoveFSHL/CMakeLists.txt rename libclambcc/{ClamBCRemoveFreezeInsts => }/ClamBCRemoveFreezeInsts.cpp (100%) delete mode 100644 libclambcc/ClamBCRemoveFreezeInsts/CMakeLists.txt rename libclambcc/{ClamBCRemoveICMPSLE => }/ClamBCRemoveICMPSLE.cpp (100%) delete mode 100644 libclambcc/ClamBCRemoveICMPSLE/CMakeLists.txt rename libclambcc/{ClamBCRemovePointerPHIs => }/ClamBCRemovePointerPHIs.cpp (100%) delete mode 100644 libclambcc/ClamBCRemovePointerPHIs/CMakeLists.txt rename libclambcc/{ClamBCRemoveUSUB => }/ClamBCRemoveUSUB.cpp (100%) delete mode 100644 libclambcc/ClamBCRemoveUSUB/CMakeLists.txt rename libclambcc/{ClamBCRemoveUndefs => }/ClamBCRemoveUndefs.cpp (100%) delete mode 100644 libclambcc/ClamBCRemoveUndefs/CMakeLists.txt rename libclambcc/{ClamBCRemoveUnsupportedICMPIntrinsics => }/ClamBCRemoveUnsupportedICMPIntrinsics.cpp (100%) delete mode 100644 libclambcc/ClamBCRemoveUnsupportedICMPIntrinsics/CMakeLists.txt rename libclambcc/{ClamBCTrace => }/ClamBCTrace.cpp (100%) delete mode 100644 libclambcc/ClamBCTrace/CMakeLists.txt rename libclambcc/{Common => }/ClamBCUtilities.cpp (100%) rename libclambcc/{Common => }/ClamBCUtilities.h (100%) rename libclambcc/{ClamBCVerifier => }/ClamBCVerifier.cpp (100%) delete mode 100644 libclambcc/ClamBCVerifier/CMakeLists.txt rename libclambcc/{ClamBCWriter => }/ClamBCWriter.cpp (99%) delete mode 100644 libclambcc/ClamBCWriter/CMakeLists.txt delete mode 100644 libclambcc/Common/CMakeLists.txt rename libclambcc/{Common => }/bytecode_api.h (100%) rename libclambcc/{Common => }/clambc.h (100%) rename libclambcc/{Common => }/version.c (100%) diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 8cc8664addc..00000000000 --- a/Dockerfile +++ /dev/null @@ -1,55 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-or-later -# -# Copyright (C) 2021 Cisco Systems, Inc. and/or its affiliates. All rights reserved. -FROM registry.hub.docker.com/library/ubuntu:20.04 AS builder - -LABEL Maintainer="ClamAV bugs " - -WORKDIR /src -COPY . /src - -ENV DEBIAN_FRONTEND=noninteractive -ENV CC=clang-8 -ENV CXX=clang++-8 - -RUN apt-get update -y && \ - apt-get install -y \ - wget \ - libncurses5 \ - binutils \ - git \ - python3 \ - python3-distutils \ - python3-pip \ - cmake \ - make \ - clang-8 \ - clamav \ - && \ - rm -rf /var/lib/apt/lists/* && \ - python3 -m pip install pytest && \ - mkdir build && \ - cd build && \ - cmake .. -G "Unix Makefiles" \ - -D CMAKE_INSTALL_PREFIX=/usr \ - -D CMAKE_BUILD_TYPE=Release \ - -D ENABLE_EXAMPLES=OFF \ - && \ - make DESTDIR="/clambc" -j$(($(nproc) - 1)) && \ - make DESTDIR="/clambc" install && \ - ctest -V - -FROM registry.hub.docker.com/library/ubuntu:20.04 - -ENV DEBIAN_FRONTEND=noninteractive -ENV CC=clang-8 -ENV CXX=clang++-8 - -COPY --from=builder "/clambc" "/" - -RUN apt-get -y update && \ - apt install -y \ - python3 \ - clang-8 \ - && \ - rm -rf /var/lib/apt/lists/* diff --git a/clambcc/clambc-compiler.py b/clambcc/clambc-compiler.py index b0ee9f60217..164e2fac8b6 100755 --- a/clambcc/clambc-compiler.py +++ b/clambcc/clambc-compiler.py @@ -50,19 +50,16 @@ FOUND_SHARED_OBJ = False SHARED_OBJ_DIR = Path(__file__).parent / '..' / 'lib' -if (SHARED_OBJ_DIR / 'libclambccommon.so').exists(): - #SHARED_OBJ_FILE = SHARED_OBJ_DIR / 'libclambcc.so' +if (SHARED_OBJ_DIR / 'libClamBCCommon.so').exists(): FOUND_SHARED_OBJ = True elif 'LD_LIBRARY_PATH' in os.environ: # Use LD_LIBRARY_PATH to try to find it. ld_library_paths = os.environ['LD_LIBRARY_PATH'].strip(' :').split(':') for lib_path in ld_library_paths: - if (Path(lib_path) / 'libclambcccommon.so').exists(): - #SHARED_OBJ_FILE = Path(lib_path) / 'libclambcccommon.so' + if (Path(lib_path) / 'libClamBCCommon.so').exists(): SHARED_OBJ_DIR = Path(lib_path) FOUND_SHARED_OBJ = True - break VERBOSE=False @@ -516,7 +513,7 @@ def createInputSourceFile(clangLLVM: ClangLLVM, name: str, args: list, options: , "__clambc_match_counts" , "__clambc_match_offsets" , "__clambc_pedata" - , "__Copyright" + , "__Copyright" ] OPTIMIZE_OPTIONS = ["-S" @@ -600,34 +597,32 @@ def createInputSourceFile(clangLLVM: ClangLLVM, name: str, args: list, options: , 'verify' ] -OPTIMIZE_LOADS=[ f"--load {SHARED_OBJ_DIR}/libclambccommon.so" +OPTIMIZE_LOADS=[ f"--load {SHARED_OBJ_DIR}/libClamBCCommon.so" # , f"--load-pass-plugin {SHARED_OBJ_DIR}/libclambcremoveundefs.so" #Not needed, since clambc-remove-undefs is not being used. - , f"--load-pass-plugin {SHARED_OBJ_DIR}/libclambcpreserveabis.so" - , f"--load-pass-plugin {SHARED_OBJ_DIR}/libclambcremoveunsupportedicmpintrinsics.so" - , f"--load-pass-plugin {SHARED_OBJ_DIR}/libclambcremoveusub.so" - , f"--load-pass-plugin {SHARED_OBJ_DIR}/libclambcremovefshl.so" -# , f"--load-pass-plugin {SHARED_OBJ_DIR}/libclambcremovepointerphis.so" #Not needed, since clambc-remove-pointer-phis is not being used. - , f"--load-pass-plugin {SHARED_OBJ_DIR}/libclambcloweringnf.so" - , f"--load-pass-plugin {SHARED_OBJ_DIR}/libclambcremoveicmpsle.so" - , f"--load-pass-plugin {SHARED_OBJ_DIR}/libclambcverifier.so" - , f"--load-pass-plugin {SHARED_OBJ_DIR}/libclambcremovefreezeinsts.so" - , f"--load-pass-plugin {SHARED_OBJ_DIR}/libclambcloweringf.so" - , f"--load-pass-plugin {SHARED_OBJ_DIR}/libclambclogicalcompilerhelper.so" - , f"--load-pass-plugin {SHARED_OBJ_DIR}/libclambclogicalcompiler.so" - , f"--load-pass-plugin {SHARED_OBJ_DIR}/libclambcrebuild.so" - , f"--load-pass-plugin {SHARED_OBJ_DIR}/libclambctrace.so" - , f"--load-pass-plugin {SHARED_OBJ_DIR}/libclambcoutlineendiannesscalls.so" - , f"--load-pass-plugin {SHARED_OBJ_DIR}/libclambcchangemallocargsize.so" - , f"--load-pass-plugin {SHARED_OBJ_DIR}/libclambcextendphisto64bit.so" - , f"--load-pass-plugin {SHARED_OBJ_DIR}/libclambcconvertintrinsicsto32bit.so" - , f"--load-pass-plugin {SHARED_OBJ_DIR}/libclambcpreparegepsforwriter.so" - , f"--load-pass-plugin {SHARED_OBJ_DIR}/libclambcanalyzer.so" - , f"--load-pass-plugin {SHARED_OBJ_DIR}/libclambcregalloc.so" - , f"--load-pass-plugin {SHARED_OBJ_DIR}/libclambcwriter.so" + , f"--load-pass-plugin {SHARED_OBJ_DIR}/libClamBCPreserveABIs.so" + , f"--load-pass-plugin {SHARED_OBJ_DIR}/libClamBCRemoveUnsupportedICMPIntrinsics.so" + , f"--load-pass-plugin {SHARED_OBJ_DIR}/libClamBCRemoveUSUB.so" + , f"--load-pass-plugin {SHARED_OBJ_DIR}/libClamBCRemoveFSHL.so" +# , f"--load-pass-plugin {SHARED_OBJ_DIR}/libClamBCRemovePointerPHIs.so" #Not needed, since clambc-remove-pointer-phis is not being used. + , f"--load-pass-plugin {SHARED_OBJ_DIR}/libClamBCLoweringNF.so" + , f"--load-pass-plugin {SHARED_OBJ_DIR}/libClamBCRemoveICMPSLE.so" + , f"--load-pass-plugin {SHARED_OBJ_DIR}/libClamBCVerifier.so" + , f"--load-pass-plugin {SHARED_OBJ_DIR}/libClamBCRemoveFreezeInsts.so" + , f"--load-pass-plugin {SHARED_OBJ_DIR}/libClamBCLoweringF.so" + , f"--load-pass-plugin {SHARED_OBJ_DIR}/libClamBCLogicalCompilerHelper.so" + , f"--load-pass-plugin {SHARED_OBJ_DIR}/libClamBCLogicalCompiler.so" + , f"--load-pass-plugin {SHARED_OBJ_DIR}/libClamBCRebuild.so" + , f"--load-pass-plugin {SHARED_OBJ_DIR}/libClamBCTrace.so" + , f"--load-pass-plugin {SHARED_OBJ_DIR}/libClamBCOutlineEndiannessCalls.so" + , f"--load-pass-plugin {SHARED_OBJ_DIR}/libClamBCChangeMallocArgSize.so" + , f"--load-pass-plugin {SHARED_OBJ_DIR}/libClamBCExtendPHIsTo64Bit.so" + , f"--load-pass-plugin {SHARED_OBJ_DIR}/libClamBCConvertIntrinsicsTo32Bit.so" + , f"--load-pass-plugin {SHARED_OBJ_DIR}/libClamBCPrepareGEPsForWriter.so" + , f"--load-pass-plugin {SHARED_OBJ_DIR}/libClamBCAnalyzer.so" + , f"--load-pass-plugin {SHARED_OBJ_DIR}/libClamBCRegAlloc.so" + , f"--load-pass-plugin {SHARED_OBJ_DIR}/libClamBCWriter.so" ] - - def optimize(clangLLVM: ClangLLVM, inFile: str, outFile: str, sigFile: str, inputSourceFile: str, standardCompiler: bool) -> int: cmd = [] diff --git a/libclambcc/CMakeLists.txt b/libclambcc/CMakeLists.txt index def262f64c9..dd09b2560bf 100644 --- a/libclambcc/CMakeLists.txt +++ b/libclambcc/CMakeLists.txt @@ -1,28 +1,391 @@ -# Copyright (C) 2021 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - - -set (CLAMBC_LIB_DIR ${CMAKE_CURRENT_SOURCE_DIR}) - -add_subdirectory(ClamBCLogicalCompiler) -add_subdirectory(ClamBCLogicalCompilerHelper) -#add_subdirectory(ClamBCRemoveUndefs) -add_subdirectory(ClamBCPreserveABIs) -add_subdirectory(ClamBCAnalyzer) -add_subdirectory(Common) -add_subdirectory(ClamBCVerifier) -#add_subdirectory(ClamBCRemovePointerPHIs) -add_subdirectory(ClamBCLowering) -add_subdirectory(ClamBCRemoveFreezeInsts) -add_subdirectory(ClamBCWriter) -add_subdirectory(ClamBCTrace) -add_subdirectory(ClamBCOutlineEndiannessCalls) -add_subdirectory(ClamBCChangeMallocArgSize) -add_subdirectory(ClamBCExtendPHIsTo64Bit) -add_subdirectory(ClamBCRebuild) -add_subdirectory(ClamBCRegAlloc) -add_subdirectory(ClamBCConvertIntrinsicsTo32Bit) -add_subdirectory(ClamBCPrepareGEPsForWriter) -add_subdirectory(ClamBCRemoveICMPSLE) -add_subdirectory(ClamBCRemoveUSUB) -add_subdirectory(ClamBCRemoveUnsupportedICMPIntrinsics) -add_subdirectory(ClamBCRemoveFSHL) +# Copyright (C) 2021-2024 Cisco Systems, Inc. and/or its affiliates. All rights reserved. + +# +# The common shared library. +# +add_library(ClamBCCommon SHARED + ClamBCDiagnostics.cpp + ClamBCUtilities.cpp + version.c) +target_include_directories(ClamBCCommon PRIVATE + ${CMAKE_BINARY_DIR} # For clambc-version.h (generated file) + ${LLVM_INCLUDE_DIRS}) +set_target_properties(ClamBCCommon PROPERTIES + COMPILE_FLAGS "${WARNCXXFLAGS}" + VERSION ${LIBCLAMBC_VERSION} + SOVERSION ${LIBCLAMBC_SOVERSION}) +#target_compile_definitions(ClamBCCommon -DLOG_BEFORE_AFTER=1) # For testing +target_link_directories(ClamBCCommon PRIVATE ${LLVM_LIBRARY_DIRS}) +target_link_libraries(ClamBCCommon PUBLIC ${LLVM_LIBS}) +install(TARGETS ClamBCCommon DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +# +# The ClamBCAnalyzer shared library. +# +add_library(ClamBCAnalyzer SHARED + ClamBCAnalyzer.cpp) +target_include_directories(ClamBCAnalyzer PRIVATE + ${LLVM_INCLUDE_DIRS}) +set_target_properties(ClamBCAnalyzer PROPERTIES + COMPILE_FLAGS "${WARNCXXFLAGS}" + VERSION ${LIBCLAMBC_VERSION} + SOVERSION ${LIBCLAMBC_SOVERSION}) +#target_compile_definitions(ClamBCAnalyzer -DLOG_BEFORE_AFTER=1) # For testing +target_link_directories(ClamBCAnalyzer PRIVATE ${LLVM_LIBRARY_DIRS}) +target_link_libraries(ClamBCAnalyzer PUBLIC ${LLVM_LIBS}) +install(TARGETS ClamBCAnalyzer DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +# +# The ClamBCChangeMallocArgSize shared library. +# +add_library(ClamBCChangeMallocArgSize SHARED + ClamBCChangeMallocArgSize.cpp) +target_include_directories(ClamBCChangeMallocArgSize PRIVATE + ${LLVM_INCLUDE_DIRS}) +set_target_properties(ClamBCChangeMallocArgSize PROPERTIES + COMPILE_FLAGS "${WARNCXXFLAGS}" + VERSION ${LIBCLAMBC_VERSION} + SOVERSION ${LIBCLAMBC_SOVERSION}) +#target_compile_definitions(ClamBCChangeMallocArgSize -DLOG_BEFORE_AFTER=1) # For testing +target_link_directories(ClamBCChangeMallocArgSize PRIVATE ${LLVM_LIBRARY_DIRS}) +target_link_libraries(ClamBCChangeMallocArgSize PUBLIC ${LLVM_LIBS}) +install(TARGETS ClamBCChangeMallocArgSize DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +# +# The ClamBCConvertIntrinsicsTo32Bit shared library. +# +add_library(ClamBCConvertIntrinsicsTo32Bit SHARED + ClamBCConvertIntrinsicsTo32Bit.cpp) +target_include_directories(ClamBCConvertIntrinsicsTo32Bit PRIVATE + ${LLVM_INCLUDE_DIRS}) +set_target_properties(ClamBCConvertIntrinsicsTo32Bit PROPERTIES + COMPILE_FLAGS "${WARNCXXFLAGS}" + VERSION ${LIBCLAMBC_VERSION} + SOVERSION ${LIBCLAMBC_SOVERSION}) +#target_compile_definitions(ClamBCConvertIntrinsicsTo32Bit -DLOG_BEFORE_AFTER=1) # For testing +target_link_directories(ClamBCConvertIntrinsicsTo32Bit PRIVATE ${LLVM_LIBRARY_DIRS}) +target_link_libraries(ClamBCConvertIntrinsicsTo32Bit PUBLIC ${LLVM_LIBS}) +install(TARGETS ClamBCConvertIntrinsicsTo32Bit DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +# +# The ClamBCExtendPHIsTo64Bit shared library. +# +add_library(ClamBCExtendPHIsTo64Bit SHARED + ClamBCExtendPHIsTo64Bit.cpp) +target_include_directories(ClamBCExtendPHIsTo64Bit PRIVATE + ${LLVM_INCLUDE_DIRS}) +set_target_properties(ClamBCExtendPHIsTo64Bit PROPERTIES + COMPILE_FLAGS "${WARNCXXFLAGS}" + VERSION ${LIBCLAMBC_VERSION} + SOVERSION ${LIBCLAMBC_SOVERSION}) +#target_compile_definitions(ClamBCExtendPHIsTo64Bit -DLOG_BEFORE_AFTER=1) # For testing +target_link_directories(ClamBCExtendPHIsTo64Bit PRIVATE ${LLVM_LIBRARY_DIRS}) +target_link_libraries(ClamBCExtendPHIsTo64Bit PUBLIC ${LLVM_LIBS}) +install(TARGETS ClamBCExtendPHIsTo64Bit DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +# +# The ClamBCLogicalCompiler shared library. +# +add_library(ClamBCLogicalCompiler SHARED + ClamBCLogicalCompiler.cpp) +target_include_directories(ClamBCLogicalCompiler PRIVATE + ${LLVM_INCLUDE_DIRS}) +set_target_properties(ClamBCLogicalCompiler PROPERTIES + COMPILE_FLAGS "${WARNCXXFLAGS}" + VERSION ${LIBCLAMBC_VERSION} + SOVERSION ${LIBCLAMBC_SOVERSION}) +#target_compile_definitions(ClamBCLogicalCompiler -DLOG_BEFORE_AFTER=1) # For testing +target_link_directories(ClamBCLogicalCompiler PRIVATE ${LLVM_LIBRARY_DIRS}) +target_link_libraries(ClamBCLogicalCompiler PUBLIC ${LLVM_LIBS}) +install(TARGETS ClamBCLogicalCompiler DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +# +# The ClamBCLogicalCompilerHelper shared library. +# +add_library(ClamBCLogicalCompilerHelper SHARED + ClamBCLogicalCompilerHelper.cpp) +target_include_directories(ClamBCLogicalCompilerHelper PRIVATE + ${LLVM_INCLUDE_DIRS}) +set_target_properties(ClamBCLogicalCompilerHelper PROPERTIES + COMPILE_FLAGS "${WARNCXXFLAGS}" + VERSION ${LIBCLAMBC_VERSION} + SOVERSION ${LIBCLAMBC_SOVERSION}) +#target_compile_definitions(ClamBCLogicalCompilerHelper -DLOG_BEFORE_AFTER=1) # For testing +target_link_directories(ClamBCLogicalCompilerHelper PRIVATE ${LLVM_LIBRARY_DIRS}) +target_link_libraries(ClamBCLogicalCompilerHelper PUBLIC ${LLVM_LIBS}) +install(TARGETS ClamBCLogicalCompilerHelper DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +# +# The ClamBCLoweringF shared library. +# +add_library(ClamBCLoweringF SHARED + ClamBCLowering.cpp + ClamBCLoweringF.cpp) +target_include_directories(ClamBCLoweringF PRIVATE + ${LLVM_INCLUDE_DIRS}) +set_target_properties(ClamBCLoweringF PROPERTIES + COMPILE_FLAGS "${WARNCXXFLAGS}" + VERSION ${LIBCLAMBC_VERSION} + SOVERSION ${LIBCLAMBC_SOVERSION}) +#target_compile_definitions(ClamBCLoweringF -DLOG_BEFORE_AFTER=1) # For testing +target_link_directories(ClamBCLoweringF PRIVATE ${LLVM_LIBRARY_DIRS}) +target_link_libraries(ClamBCLoweringF PUBLIC ${LLVM_LIBS}) +install(TARGETS ClamBCLoweringF DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +# +# The ClamBCLoweringNF shared library. +# +add_library(ClamBCLoweringNF SHARED + ClamBCLowering.cpp + ClamBCLoweringNF.cpp) +target_include_directories(ClamBCLoweringNF PRIVATE + ${LLVM_INCLUDE_DIRS}) +set_target_properties(ClamBCLoweringNF PROPERTIES + COMPILE_FLAGS "${WARNCXXFLAGS}" + VERSION ${LIBCLAMBC_VERSION} + SOVERSION ${LIBCLAMBC_SOVERSION}) +#target_compile_definitions(ClamBCLoweringNF -DLOG_BEFORE_AFTER=1) # For testing +target_link_directories(ClamBCLoweringNF PRIVATE ${LLVM_LIBRARY_DIRS}) +target_link_libraries(ClamBCLoweringNF PUBLIC ${LLVM_LIBS}) +install(TARGETS ClamBCLoweringNF DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +# +# The ClamBCOutlineEndiannessCalls shared library. +# +add_library(ClamBCOutlineEndiannessCalls SHARED + ClamBCOutlineEndiannessCalls.cpp) +target_include_directories(ClamBCOutlineEndiannessCalls PRIVATE + ${LLVM_INCLUDE_DIRS}) +set_target_properties(ClamBCOutlineEndiannessCalls PROPERTIES + COMPILE_FLAGS "${WARNCXXFLAGS}" + VERSION ${LIBCLAMBC_VERSION} + SOVERSION ${LIBCLAMBC_SOVERSION}) +#target_compile_definitions(ClamBCOutlineEndiannessCalls -DLOG_BEFORE_AFTER=1) # For testing +target_link_directories(ClamBCOutlineEndiannessCalls PRIVATE ${LLVM_LIBRARY_DIRS}) +target_link_libraries(ClamBCOutlineEndiannessCalls PUBLIC ${LLVM_LIBS}) +install(TARGETS ClamBCOutlineEndiannessCalls DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +# +# The ClamBCPrepareGEPsForWriter shared library. +# +add_library(ClamBCPrepareGEPsForWriter SHARED + ClamBCPrepareGEPsForWriter.cpp) +target_include_directories(ClamBCPrepareGEPsForWriter PRIVATE + ${LLVM_INCLUDE_DIRS}) +set_target_properties(ClamBCPrepareGEPsForWriter PROPERTIES + COMPILE_FLAGS "${WARNCXXFLAGS}" + VERSION ${LIBCLAMBC_VERSION} + SOVERSION ${LIBCLAMBC_SOVERSION}) +#target_compile_definitions(ClamBCPrepareGEPsForWriter -DLOG_BEFORE_AFTER=1) # For testing +target_link_directories(ClamBCPrepareGEPsForWriter PRIVATE ${LLVM_LIBRARY_DIRS}) +target_link_libraries(ClamBCPrepareGEPsForWriter PUBLIC ${LLVM_LIBS}) +install(TARGETS ClamBCPrepareGEPsForWriter DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +# +# The ClamBCPreserveABIs shared library. +# +add_library(ClamBCPreserveABIs SHARED + ClamBCPreserveABIs.cpp) +target_include_directories(ClamBCPreserveABIs PRIVATE + ${LLVM_INCLUDE_DIRS}) +set_target_properties(ClamBCPreserveABIs PROPERTIES + COMPILE_FLAGS "${WARNCXXFLAGS}" + VERSION ${LIBCLAMBC_VERSION} + SOVERSION ${LIBCLAMBC_SOVERSION}) +#target_compile_definitions(ClamBCPreserveABIs -DLOG_BEFORE_AFTER=1) # For testing +target_link_directories(ClamBCPreserveABIs PRIVATE ${LLVM_LIBRARY_DIRS}) +target_link_libraries(ClamBCPreserveABIs PUBLIC ${LLVM_LIBS}) +install(TARGETS ClamBCPreserveABIs DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +# +# The ClamBCRebuild shared library. +# +add_library(ClamBCRebuild SHARED + ClamBCRebuild.cpp) +target_include_directories(ClamBCRebuild PRIVATE + ${LLVM_INCLUDE_DIRS}) +set_target_properties(ClamBCRebuild PROPERTIES + COMPILE_FLAGS "${WARNCXXFLAGS}" + VERSION ${LIBCLAMBC_VERSION} + SOVERSION ${LIBCLAMBC_SOVERSION}) +#target_compile_definitions(ClamBCRebuild -DLOG_BEFORE_AFTER=1) # For testing +target_link_directories(ClamBCRebuild PRIVATE ${LLVM_LIBRARY_DIRS}) +target_link_libraries(ClamBCRebuild PUBLIC ${LLVM_LIBS}) +install(TARGETS ClamBCRebuild DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +# +# The ClamBCRegAlloc shared library. +# +add_library(ClamBCRegAlloc SHARED + ClamBCRegAlloc.cpp) +target_include_directories(ClamBCRegAlloc PRIVATE + ${LLVM_INCLUDE_DIRS}) +set_target_properties(ClamBCRegAlloc PROPERTIES + COMPILE_FLAGS "${WARNCXXFLAGS}" + VERSION ${LIBCLAMBC_VERSION} + SOVERSION ${LIBCLAMBC_SOVERSION}) +#target_compile_definitions(ClamBCRegAlloc -DLOG_BEFORE_AFTER=1) # For testing +target_link_directories(ClamBCRegAlloc PRIVATE ${LLVM_LIBRARY_DIRS}) +target_link_libraries(ClamBCRegAlloc PUBLIC ${LLVM_LIBS}) +install(TARGETS ClamBCRegAlloc DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +# +# The ClamBCRemoveFreezeInsts shared library. +# +add_library(ClamBCRemoveFreezeInsts SHARED + ClamBCRemoveFreezeInsts.cpp) +target_include_directories(ClamBCRemoveFreezeInsts PRIVATE + ${LLVM_INCLUDE_DIRS}) +set_target_properties(ClamBCRemoveFreezeInsts PROPERTIES + COMPILE_FLAGS "${WARNCXXFLAGS}" + VERSION ${LIBCLAMBC_VERSION} + SOVERSION ${LIBCLAMBC_SOVERSION}) +#target_compile_definitions(ClamBCRemoveFreezeInsts -DLOG_BEFORE_AFTER=1) # For testing +target_link_directories(ClamBCRemoveFreezeInsts PRIVATE ${LLVM_LIBRARY_DIRS}) +target_link_libraries(ClamBCRemoveFreezeInsts PUBLIC ${LLVM_LIBS}) +install(TARGETS ClamBCRemoveFreezeInsts DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +# +# The ClamBCRemoveFSHL shared library. +# +add_library(ClamBCRemoveFSHL SHARED + ClamBCRemoveFSHL.cpp) +target_include_directories(ClamBCRemoveFSHL PRIVATE + ${LLVM_INCLUDE_DIRS}) +set_target_properties(ClamBCRemoveFSHL PROPERTIES + COMPILE_FLAGS "${WARNCXXFLAGS}" + VERSION ${LIBCLAMBC_VERSION} + SOVERSION ${LIBCLAMBC_SOVERSION}) +#target_compile_definitions(ClamBCRemoveFSHL -DLOG_BEFORE_AFTER=1) # For testing +target_link_directories(ClamBCRemoveFSHL PRIVATE ${LLVM_LIBRARY_DIRS}) +target_link_libraries(ClamBCRemoveFSHL PUBLIC ${LLVM_LIBS}) +install(TARGETS ClamBCRemoveFSHL DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +# +# The ClamBCRemoveICMPSLE shared library. +# +add_library(ClamBCRemoveICMPSLE SHARED + ClamBCRemoveICMPSLE.cpp) +target_include_directories(ClamBCRemoveICMPSLE PRIVATE + ${LLVM_INCLUDE_DIRS}) +set_target_properties(ClamBCRemoveICMPSLE PROPERTIES + COMPILE_FLAGS "${WARNCXXFLAGS}" + VERSION ${LIBCLAMBC_VERSION} + SOVERSION ${LIBCLAMBC_SOVERSION}) +#target_compile_definitions(ClamBCRemoveICMPSLE -DLOG_BEFORE_AFTER=1) # For testing +target_link_directories(ClamBCRemoveICMPSLE PRIVATE ${LLVM_LIBRARY_DIRS}) +target_link_libraries(ClamBCRemoveICMPSLE PUBLIC ${LLVM_LIBS}) +install(TARGETS ClamBCRemoveICMPSLE DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +# # +# # The ClamBCRemovePointerPHIs shared library. +# # +# add_library(ClamBCRemovePointerPHIs SHARED +# ClamBCRemovePointerPHIs.cpp) +# target_include_directories(ClamBCRemovePointerPHIs PRIVATE +# ${LLVM_INCLUDE_DIRS}) +# set_target_properties(ClamBCRemovePointerPHIs PROPERTIES +# COMPILE_FLAGS "${WARNCXXFLAGS}" +# VERSION ${LIBCLAMBC_VERSION} +# SOVERSION ${LIBCLAMBC_SOVERSION}) +# #target_compile_definitions(ClamBCRemovePointerPHIs -DLOG_BEFORE_AFTER=1) # For testing +# target_link_directories(ClamBCRemovePointerPHIs PRIVATE ${LLVM_LIBRARY_DIRS}) +# target_link_libraries(ClamBCRemovePointerPHIs PUBLIC ${LLVM_LIBS}) +# install(TARGETS ClamBCRemovePointerPHIs DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +# # +# # The ClamBCRemoveUndefs shared library. +# # +# add_library(ClamBCRemoveUndefs SHARED +# ClamBCRemoveUndefs.cpp) +# target_include_directories(ClamBCRemoveUndefs PRIVATE +# ${LLVM_INCLUDE_DIRS}) +# set_target_properties(ClamBCRemoveUndefs PROPERTIES +# COMPILE_FLAGS "${WARNCXXFLAGS}" +# VERSION ${LIBCLAMBC_VERSION} +# SOVERSION ${LIBCLAMBC_SOVERSION}) +# #target_compile_definitions(ClamBCRemoveUndefs -DLOG_BEFORE_AFTER=1) # For testing +# target_link_directories(ClamBCRemoveUndefs PRIVATE ${LLVM_LIBRARY_DIRS}) +# target_link_libraries(ClamBCRemoveUndefs PUBLIC ${LLVM_LIBS}) +# install(TARGETS ClamBCRemoveUndefs DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +# +# The ClamBCRemoveUnsupportedICMPIntrinsics shared library. +# +add_library(ClamBCRemoveUnsupportedICMPIntrinsics SHARED + ClamBCRemoveUnsupportedICMPIntrinsics.cpp) +target_include_directories(ClamBCRemoveUnsupportedICMPIntrinsics PRIVATE + ${LLVM_INCLUDE_DIRS}) +set_target_properties(ClamBCRemoveUnsupportedICMPIntrinsics PROPERTIES + COMPILE_FLAGS "${WARNCXXFLAGS}" + VERSION ${LIBCLAMBC_VERSION} + SOVERSION ${LIBCLAMBC_SOVERSION}) +#target_compile_definitions(ClamBCRemoveUnsupportedICMPIntrinsics -DLOG_BEFORE_AFTER=1) # For testing +target_link_directories(ClamBCRemoveUnsupportedICMPIntrinsics PRIVATE ${LLVM_LIBRARY_DIRS}) +target_link_libraries(ClamBCRemoveUnsupportedICMPIntrinsics PUBLIC ${LLVM_LIBS}) +install(TARGETS ClamBCRemoveUnsupportedICMPIntrinsics DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +# +# The ClamBCRemoveUSUB shared library. +# +add_library(ClamBCRemoveUSUB SHARED + ClamBCRemoveUSUB.cpp) +target_include_directories(ClamBCRemoveUSUB PRIVATE + ${LLVM_INCLUDE_DIRS}) +set_target_properties(ClamBCRemoveUSUB PROPERTIES + COMPILE_FLAGS "${WARNCXXFLAGS}" + VERSION ${LIBCLAMBC_VERSION} + SOVERSION ${LIBCLAMBC_SOVERSION}) +#target_compile_definitions(ClamBCRemoveUSUB -DLOG_BEFORE_AFTER=1) # For testing +target_link_directories(ClamBCRemoveUSUB PRIVATE ${LLVM_LIBRARY_DIRS}) +target_link_libraries(ClamBCRemoveUSUB PUBLIC ${LLVM_LIBS}) +install(TARGETS ClamBCRemoveUSUB DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +# +# The ClamBCTrace shared library. +# +add_library(ClamBCTrace SHARED + ClamBCTrace.cpp) +target_include_directories(ClamBCTrace PRIVATE + ${LLVM_INCLUDE_DIRS}) +set_target_properties(ClamBCTrace PROPERTIES + COMPILE_FLAGS "${WARNCXXFLAGS}" + VERSION ${LIBCLAMBC_VERSION} + SOVERSION ${LIBCLAMBC_SOVERSION}) +#target_compile_definitions(ClamBCTrace -DLOG_BEFORE_AFTER=1) # For testing +target_link_directories(ClamBCTrace PRIVATE ${LLVM_LIBRARY_DIRS}) +target_link_libraries(ClamBCTrace PUBLIC ${LLVM_LIBS}) +install(TARGETS ClamBCTrace DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +# +# The ClamBCVerifier shared library. +# +add_library(ClamBCVerifier SHARED + ClamBCVerifier.cpp) +target_include_directories(ClamBCVerifier PRIVATE + ${LLVM_INCLUDE_DIRS}) +set_target_properties(ClamBCVerifier PROPERTIES + COMPILE_FLAGS "${WARNCXXFLAGS}" + VERSION ${LIBCLAMBC_VERSION} + SOVERSION ${LIBCLAMBC_SOVERSION}) +#target_compile_definitions(ClamBCVerifier -DLOG_BEFORE_AFTER=1) # For testing +target_link_directories(ClamBCVerifier PRIVATE ${LLVM_LIBRARY_DIRS}) +target_link_libraries(ClamBCVerifier PUBLIC ${LLVM_LIBS}) +install(TARGETS ClamBCVerifier DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +# +# The ClamBCWriter shared library. +# +add_library(ClamBCWriter SHARED + ClamBCWriter.cpp) +target_include_directories(ClamBCWriter PRIVATE + ${LLVM_INCLUDE_DIRS}) +set_target_properties(ClamBCWriter PROPERTIES + COMPILE_FLAGS "${WARNCXXFLAGS}" + VERSION ${LIBCLAMBC_VERSION} + SOVERSION ${LIBCLAMBC_SOVERSION}) +#target_compile_definitions(ClamBCWriter -DLOG_BEFORE_AFTER=1) # For testing +target_link_directories(ClamBCWriter PRIVATE ${LLVM_LIBRARY_DIRS}) +target_link_libraries(ClamBCWriter PUBLIC ${LLVM_LIBS}) +install(TARGETS ClamBCWriter DESTINATION ${CMAKE_INSTALL_LIBDIR}) + diff --git a/libclambcc/ClamBCAnalyzer/ClamBCAnalyzer.cpp b/libclambcc/ClamBCAnalyzer.cpp similarity index 100% rename from libclambcc/ClamBCAnalyzer/ClamBCAnalyzer.cpp rename to libclambcc/ClamBCAnalyzer.cpp diff --git a/libclambcc/ClamBCAnalyzer/ClamBCAnalyzer.h b/libclambcc/ClamBCAnalyzer.h similarity index 100% rename from libclambcc/ClamBCAnalyzer/ClamBCAnalyzer.h rename to libclambcc/ClamBCAnalyzer.h diff --git a/libclambcc/ClamBCAnalyzer/CMakeLists.txt b/libclambcc/ClamBCAnalyzer/CMakeLists.txt deleted file mode 100644 index e5692d8e731..00000000000 --- a/libclambcc/ClamBCAnalyzer/CMakeLists.txt +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (C) 2021 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - -# -# The clambcanalyzer object library -# -add_library(clambcanalyzer_obj OBJECT) -target_sources(clambcanalyzer_obj - PRIVATE - ClamBCAnalyzer.cpp -) - -target_include_directories(clambcanalyzer_obj - PRIVATE - ${CMAKE_BINARY_DIR} # For clambc-version.h (generated file) - .. - ${CLAMBC_LIB_DIR}/Common # For anything in 'Common' - ${LLVM_INCLUDE_DIRS} -) - -set_target_properties(clambcanalyzer_obj PROPERTIES COMPILE_FLAGS "${WARNCXXFLAGS}") - -# -# For testing -# -#target_compile_definitions(clambcanalyzer_obj -DLOG_BEFORE_AFTER=1) - -# -# The clambcanalyzer shared library. -# -add_library( clambcanalyzer SHARED ) -target_link_libraries( clambcanalyzer - PUBLIC - clambcanalyzer_obj ) -set_target_properties( clambcanalyzer PROPERTIES - VERSION ${LIBCLAMBC_VERSION} - SOVERSION ${LIBCLAMBC_SOVERSION} ) - -target_link_directories(clambcanalyzer PRIVATE ${LLVM_LIBRARY_DIRS}) -target_link_libraries(clambcanalyzer PUBLIC ${LLVM_LIBS}) - -install(TARGETS clambcanalyzer DESTINATION ${CMAKE_INSTALL_LIBDIR}) - - - diff --git a/libclambcc/ClamBCChangeMallocArgSize/ClamBCChangeMallocArgSize.cpp b/libclambcc/ClamBCChangeMallocArgSize.cpp similarity index 100% rename from libclambcc/ClamBCChangeMallocArgSize/ClamBCChangeMallocArgSize.cpp rename to libclambcc/ClamBCChangeMallocArgSize.cpp diff --git a/libclambcc/ClamBCChangeMallocArgSize/CMakeLists.txt b/libclambcc/ClamBCChangeMallocArgSize/CMakeLists.txt deleted file mode 100644 index 354336d8c39..00000000000 --- a/libclambcc/ClamBCChangeMallocArgSize/CMakeLists.txt +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (C) 2021 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - -# -# The clambcchangemallocargsize object library -# -add_library(clambcchangemallocargsize_obj OBJECT) -target_sources(clambcchangemallocargsize_obj - PRIVATE - ClamBCChangeMallocArgSize.cpp -) - -target_include_directories(clambcchangemallocargsize_obj - PRIVATE - ${CMAKE_BINARY_DIR} # For clambc-version.h (generated file) - .. - ${CLAMBC_LIB_DIR}/Common # For anything in 'Common' - ${LLVM_INCLUDE_DIRS} -) - -set_target_properties(clambcchangemallocargsize_obj PROPERTIES COMPILE_FLAGS "${WARNCXXFLAGS}") - -# -# For testing -# -#target_compile_definitions(clambcchangemallocargsize_obj -DLOG_BEFORE_AFTER=1) - -# -# The clambcchangemallocargsize shared library. -# -add_library( clambcchangemallocargsize SHARED ) -target_link_libraries( clambcchangemallocargsize - PUBLIC - clambcchangemallocargsize_obj ) -set_target_properties( clambcchangemallocargsize PROPERTIES - VERSION ${LIBCLAMBC_VERSION} - SOVERSION ${LIBCLAMBC_SOVERSION} ) - -target_link_directories(clambcchangemallocargsize PRIVATE ${LLVM_LIBRARY_DIRS}) -target_link_libraries(clambcchangemallocargsize PUBLIC ${LLVM_LIBS}) - -install(TARGETS clambcchangemallocargsize DESTINATION ${CMAKE_INSTALL_LIBDIR}) - - - diff --git a/libclambcc/Common/ClamBCCommon.h b/libclambcc/ClamBCCommon.h similarity index 100% rename from libclambcc/Common/ClamBCCommon.h rename to libclambcc/ClamBCCommon.h diff --git a/libclambcc/ClamBCConvertIntrinsicsTo32Bit/ClamBCConvertIntrinsicsTo32Bit.cpp b/libclambcc/ClamBCConvertIntrinsicsTo32Bit.cpp similarity index 100% rename from libclambcc/ClamBCConvertIntrinsicsTo32Bit/ClamBCConvertIntrinsicsTo32Bit.cpp rename to libclambcc/ClamBCConvertIntrinsicsTo32Bit.cpp diff --git a/libclambcc/ClamBCConvertIntrinsicsTo32Bit/CMakeLists.txt b/libclambcc/ClamBCConvertIntrinsicsTo32Bit/CMakeLists.txt deleted file mode 100644 index 8972bc30bc1..00000000000 --- a/libclambcc/ClamBCConvertIntrinsicsTo32Bit/CMakeLists.txt +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (C) 2021 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - -# -# The clambcconvertintrinsicsto32bit object library -# -add_library(clambcconvertintrinsicsto32bit_obj OBJECT) -target_sources(clambcconvertintrinsicsto32bit_obj - PRIVATE - ClamBCConvertIntrinsicsTo32Bit.cpp -) - -target_include_directories(clambcconvertintrinsicsto32bit_obj - PRIVATE - ${CMAKE_BINARY_DIR} # For clambc-version.h (generated file) - .. - ${CLAMBC_LIB_DIR}/Common # For anything in 'Common' - ${LLVM_INCLUDE_DIRS} -) - -set_target_properties(clambcconvertintrinsicsto32bit_obj PROPERTIES COMPILE_FLAGS "${WARNCXXFLAGS}") - -# -# For testing -# -#target_compile_definitions(clambcconvertintrinsicsto32bit_obj -DLOG_BEFORE_AFTER=1) - -# -# The clambcconvertintrinsicsto32bit shared library. -# -add_library( clambcconvertintrinsicsto32bit SHARED ) -target_link_libraries( clambcconvertintrinsicsto32bit - PUBLIC - clambcconvertintrinsicsto32bit_obj ) -set_target_properties( clambcconvertintrinsicsto32bit PROPERTIES - VERSION ${LIBCLAMBC_VERSION} - SOVERSION ${LIBCLAMBC_SOVERSION} ) - -target_link_directories(clambcconvertintrinsicsto32bit PRIVATE ${LLVM_LIBRARY_DIRS}) -target_link_libraries(clambcconvertintrinsicsto32bit PUBLIC ${LLVM_LIBS}) - -install(TARGETS clambcconvertintrinsicsto32bit DESTINATION ${CMAKE_INSTALL_LIBDIR}) - - diff --git a/libclambcc/Common/ClamBCDiagnostics.cpp b/libclambcc/ClamBCDiagnostics.cpp similarity index 100% rename from libclambcc/Common/ClamBCDiagnostics.cpp rename to libclambcc/ClamBCDiagnostics.cpp diff --git a/libclambcc/Common/ClamBCDiagnostics.h b/libclambcc/ClamBCDiagnostics.h similarity index 100% rename from libclambcc/Common/ClamBCDiagnostics.h rename to libclambcc/ClamBCDiagnostics.h diff --git a/libclambcc/ClamBCExtendPHIsTo64Bit/ClamBCExtendPHIsTo64Bit.cpp b/libclambcc/ClamBCExtendPHIsTo64Bit.cpp similarity index 100% rename from libclambcc/ClamBCExtendPHIsTo64Bit/ClamBCExtendPHIsTo64Bit.cpp rename to libclambcc/ClamBCExtendPHIsTo64Bit.cpp diff --git a/libclambcc/ClamBCExtendPHIsTo64Bit/CMakeLists.txt b/libclambcc/ClamBCExtendPHIsTo64Bit/CMakeLists.txt deleted file mode 100644 index 01084a3fcc7..00000000000 --- a/libclambcc/ClamBCExtendPHIsTo64Bit/CMakeLists.txt +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (C) 2021 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - -# -# The clambcextendphisto64bit object library -# -add_library(clambcextendphisto64bit_obj OBJECT) -target_sources(clambcextendphisto64bit_obj - PRIVATE - ClamBCExtendPHIsTo64Bit.cpp -) - -target_include_directories(clambcextendphisto64bit_obj - PRIVATE - ${CMAKE_BINARY_DIR} # For clambc-version.h (generated file) - .. - ${CLAMBC_LIB_DIR}/Common # For anything in 'Common' - ${LLVM_INCLUDE_DIRS} -) - -set_target_properties(clambcextendphisto64bit_obj PROPERTIES COMPILE_FLAGS "${WARNCXXFLAGS}") - -# -# For testing -# -#target_compile_definitions(clambcextendphisto64bit_obj -DLOG_BEFORE_AFTER=1) - -# -# The clambcextendphisto64bit shared library. -# -add_library( clambcextendphisto64bit SHARED ) -target_link_libraries( clambcextendphisto64bit - PUBLIC - clambcextendphisto64bit_obj ) -set_target_properties( clambcextendphisto64bit PROPERTIES - VERSION ${LIBCLAMBC_VERSION} - SOVERSION ${LIBCLAMBC_SOVERSION} ) - -target_link_directories(clambcextendphisto64bit PRIVATE ${LLVM_LIBRARY_DIRS}) -target_link_libraries(clambcextendphisto64bit PUBLIC ${LLVM_LIBS}) - -install(TARGETS clambcextendphisto64bit DESTINATION ${CMAKE_INSTALL_LIBDIR}) - - - diff --git a/libclambcc/ClamBCLogicalCompiler/ClamBCLogicalCompiler.cpp b/libclambcc/ClamBCLogicalCompiler.cpp similarity index 100% rename from libclambcc/ClamBCLogicalCompiler/ClamBCLogicalCompiler.cpp rename to libclambcc/ClamBCLogicalCompiler.cpp diff --git a/libclambcc/ClamBCLogicalCompiler/CMakeLists.txt b/libclambcc/ClamBCLogicalCompiler/CMakeLists.txt deleted file mode 100644 index 391b8a6a4f9..00000000000 --- a/libclambcc/ClamBCLogicalCompiler/CMakeLists.txt +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (C) 2021 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - -# -# The clambclogicalcompiler object library -# -add_library(clambclogicalcompiler_obj OBJECT) -target_sources(clambclogicalcompiler_obj - PRIVATE - ClamBCLogicalCompiler.cpp -) - -target_include_directories(clambclogicalcompiler_obj - PRIVATE - ${CMAKE_BINARY_DIR} # For clambc-version.h (generated file) - .. - ${CLAMBC_LIB_DIR}/Common # For anything in 'Common' - ${LLVM_INCLUDE_DIRS} -) - -set_target_properties(clambclogicalcompiler_obj PROPERTIES COMPILE_FLAGS "${WARNCXXFLAGS}") - -# -# For testing -# -#target_compile_definitions(clambclogicalcompiler_obj -DLOG_BEFORE_AFTER=1) - -# -# The clambclogicalcompiler shared library. -# -add_library( clambclogicalcompiler SHARED ) -target_link_libraries( clambclogicalcompiler - PUBLIC - clambclogicalcompiler_obj ) -set_target_properties( clambclogicalcompiler PROPERTIES - VERSION ${LIBCLAMBC_VERSION} - SOVERSION ${LIBCLAMBC_SOVERSION} ) - -target_link_directories(clambclogicalcompiler PRIVATE ${LLVM_LIBRARY_DIRS}) -target_link_libraries(clambclogicalcompiler PUBLIC ${LLVM_LIBS}) - -install(TARGETS clambclogicalcompiler DESTINATION ${CMAKE_INSTALL_LIBDIR}) - - diff --git a/libclambcc/ClamBCLogicalCompilerHelper/ClamBCLogicalCompilerHelper.cpp b/libclambcc/ClamBCLogicalCompilerHelper.cpp similarity index 100% rename from libclambcc/ClamBCLogicalCompilerHelper/ClamBCLogicalCompilerHelper.cpp rename to libclambcc/ClamBCLogicalCompilerHelper.cpp diff --git a/libclambcc/ClamBCLogicalCompilerHelper/CMakeLists.txt b/libclambcc/ClamBCLogicalCompilerHelper/CMakeLists.txt deleted file mode 100644 index 0cc815c218f..00000000000 --- a/libclambcc/ClamBCLogicalCompilerHelper/CMakeLists.txt +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (C) 2021 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - -# -# The clambclogicalcompilerhelper object library -# -add_library(clambclogicalcompilerhelper_obj OBJECT) -target_sources(clambclogicalcompilerhelper_obj - PRIVATE - ClamBCLogicalCompilerHelper.cpp -) - -target_include_directories(clambclogicalcompilerhelper_obj - PRIVATE - ${CMAKE_BINARY_DIR} # For clambc-version.h (generated file) - .. - ${CLAMBC_LIB_DIR}/Common # For anything in 'Common' - ${LLVM_INCLUDE_DIRS} -) - -set_target_properties(clambclogicalcompilerhelper_obj PROPERTIES COMPILE_FLAGS "${WARNCXXFLAGS}") - -# -# For testing -# -#target_compile_definitions(clambclogicalcompilerhelper_obj -DLOG_BEFORE_AFTER=1) - -# -# The clambclogicalcompilerhelper shared library. -# -add_library( clambclogicalcompilerhelper SHARED ) -target_link_libraries( clambclogicalcompilerhelper - PUBLIC - clambclogicalcompilerhelper_obj ) -set_target_properties( clambclogicalcompilerhelper PROPERTIES - VERSION ${LIBCLAMBC_VERSION} - SOVERSION ${LIBCLAMBC_SOVERSION} ) - -target_link_directories(clambclogicalcompilerhelper PRIVATE ${LLVM_LIBRARY_DIRS}) -target_link_libraries(clambclogicalcompilerhelper PUBLIC ${LLVM_LIBS}) - -install(TARGETS clambclogicalcompilerhelper DESTINATION ${CMAKE_INSTALL_LIBDIR}) - - - diff --git a/libclambcc/ClamBCLowering/ClamBCLowering.cpp b/libclambcc/ClamBCLowering.cpp similarity index 100% rename from libclambcc/ClamBCLowering/ClamBCLowering.cpp rename to libclambcc/ClamBCLowering.cpp diff --git a/libclambcc/ClamBCLowering/ClamBCLowering.h b/libclambcc/ClamBCLowering.h similarity index 100% rename from libclambcc/ClamBCLowering/ClamBCLowering.h rename to libclambcc/ClamBCLowering.h diff --git a/libclambcc/ClamBCLowering/CMakeLists.txt b/libclambcc/ClamBCLowering/CMakeLists.txt deleted file mode 100644 index d6d46c149bb..00000000000 --- a/libclambcc/ClamBCLowering/CMakeLists.txt +++ /dev/null @@ -1,89 +0,0 @@ -# Copyright (C) 2021 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - -# -# The clambcloweringf object library -# -add_library(clambcloweringf_obj OBJECT) -target_sources(clambcloweringf_obj - PRIVATE - ClamBCLowering.cpp - ClamBCLoweringF.cpp -) - -target_include_directories(clambcloweringf_obj - PRIVATE - ${CMAKE_BINARY_DIR} # For clambc-version.h (generated file) - .. - ${CLAMBC_LIB_DIR}/Common # For anything in 'Common' - ${LLVM_INCLUDE_DIRS} -) - -set_target_properties(clambcloweringf_obj PROPERTIES COMPILE_FLAGS "${WARNCXXFLAGS}") - -# -# For testing -# -#target_compile_definitions(clambcloweringf_obj -DLOG_BEFORE_AFTER=1) - -# -# The clambcloweringf shared library. -# -add_library( clambcloweringf SHARED ) -target_link_libraries( clambcloweringf - PUBLIC - clambcloweringf_obj ) -set_target_properties( clambcloweringf PROPERTIES - VERSION ${LIBCLAMBC_VERSION} - SOVERSION ${LIBCLAMBC_SOVERSION} ) - -target_link_directories(clambcloweringf PRIVATE ${LLVM_LIBRARY_DIRS}) -target_link_libraries(clambcloweringf PUBLIC ${LLVM_LIBS}) - -install(TARGETS clambcloweringf DESTINATION ${CMAKE_INSTALL_LIBDIR}) - - - - - -# -# The clambcloweringnf object library -# -add_library(clambcloweringnf_obj OBJECT) -target_sources(clambcloweringnf_obj - PRIVATE - ClamBCLowering.cpp - ClamBCLoweringNF.cpp -) - -target_include_directories(clambcloweringnf_obj - PRIVATE - ${CMAKE_BINARY_DIR} # For clambc-version.h (generated file) - .. - ${CLAMBC_LIB_DIR}/Common # For anything in 'Common' - ${LLVM_INCLUDE_DIRS} -) - -set_target_properties(clambcloweringnf_obj PROPERTIES COMPILE_FLAGS "${WARNCXXFLAGS}") - -# -# For testing -# -#target_compile_definitions(clambcloweringnf_obj -DLOG_BEFORE_AFTER=1) - -# -# The clambcloweringnf shared library. -# -add_library( clambcloweringnf SHARED ) -target_link_libraries( clambcloweringnf - PUBLIC - clambcloweringnf_obj ) -set_target_properties( clambcloweringnf PROPERTIES - VERSION ${LIBCLAMBC_VERSION} - SOVERSION ${LIBCLAMBC_SOVERSION} ) - -target_link_directories(clambcloweringnf PRIVATE ${LLVM_LIBRARY_DIRS}) -target_link_libraries(clambcloweringnf PUBLIC ${LLVM_LIBS}) - -install(TARGETS clambcloweringnf DESTINATION ${CMAKE_INSTALL_LIBDIR}) - - diff --git a/libclambcc/ClamBCLowering/ClamBCLoweringF.cpp b/libclambcc/ClamBCLoweringF.cpp similarity index 100% rename from libclambcc/ClamBCLowering/ClamBCLoweringF.cpp rename to libclambcc/ClamBCLoweringF.cpp diff --git a/libclambcc/ClamBCLowering/ClamBCLoweringNF.cpp b/libclambcc/ClamBCLoweringNF.cpp similarity index 100% rename from libclambcc/ClamBCLowering/ClamBCLoweringNF.cpp rename to libclambcc/ClamBCLoweringNF.cpp diff --git a/libclambcc/Common/ClamBCModule.h b/libclambcc/ClamBCModule.h similarity index 100% rename from libclambcc/Common/ClamBCModule.h rename to libclambcc/ClamBCModule.h diff --git a/libclambcc/ClamBCOutlineEndiannessCalls/ClamBCOutlineEndiannessCalls.cpp b/libclambcc/ClamBCOutlineEndiannessCalls.cpp similarity index 100% rename from libclambcc/ClamBCOutlineEndiannessCalls/ClamBCOutlineEndiannessCalls.cpp rename to libclambcc/ClamBCOutlineEndiannessCalls.cpp diff --git a/libclambcc/ClamBCOutlineEndiannessCalls/CMakeLists.txt b/libclambcc/ClamBCOutlineEndiannessCalls/CMakeLists.txt deleted file mode 100644 index 3fba904bca6..00000000000 --- a/libclambcc/ClamBCOutlineEndiannessCalls/CMakeLists.txt +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (C) 2021 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - -# -# The clambcoutlineendiannesscalls object library -# -add_library(clambcoutlineendiannesscalls_obj OBJECT) -target_sources(clambcoutlineendiannesscalls_obj - PRIVATE - ClamBCOutlineEndiannessCalls.cpp -) - -target_include_directories(clambcoutlineendiannesscalls_obj - PRIVATE - ${CMAKE_BINARY_DIR} # For clambc-version.h (generated file) - .. - ${CLAMBC_LIB_DIR}/Common # For anything in 'Common' - ${LLVM_INCLUDE_DIRS} -) - -set_target_properties(clambcoutlineendiannesscalls_obj PROPERTIES COMPILE_FLAGS "${WARNCXXFLAGS}") - -# -# For testing -# -#target_compile_definitions(clambcoutlineendiannesscalls_obj -DLOG_BEFORE_AFTER=1) - -# -# The clambcoutlineendiannesscalls shared library. -# -add_library( clambcoutlineendiannesscalls SHARED ) -target_link_libraries( clambcoutlineendiannesscalls - PUBLIC - clambcoutlineendiannesscalls_obj ) -set_target_properties( clambcoutlineendiannesscalls PROPERTIES - VERSION ${LIBCLAMBC_VERSION} - SOVERSION ${LIBCLAMBC_SOVERSION} ) - -target_link_directories(clambcoutlineendiannesscalls PRIVATE ${LLVM_LIBRARY_DIRS}) -target_link_libraries(clambcoutlineendiannesscalls PUBLIC ${LLVM_LIBS}) - -install(TARGETS clambcoutlineendiannesscalls DESTINATION ${CMAKE_INSTALL_LIBDIR}) - - - - diff --git a/libclambcc/ClamBCPrepareGEPsForWriter/ClamBCPrepareGEPsForWriter.cpp b/libclambcc/ClamBCPrepareGEPsForWriter.cpp similarity index 99% rename from libclambcc/ClamBCPrepareGEPsForWriter/ClamBCPrepareGEPsForWriter.cpp rename to libclambcc/ClamBCPrepareGEPsForWriter.cpp index 948a2b7a820..a35e266edbf 100644 --- a/libclambcc/ClamBCPrepareGEPsForWriter/ClamBCPrepareGEPsForWriter.cpp +++ b/libclambcc/ClamBCPrepareGEPsForWriter.cpp @@ -24,7 +24,7 @@ #include "ClamBCModule.h" #include "ClamBCUtilities.h" -#include "ClamBCAnalyzer/ClamBCAnalyzer.h" +#include "ClamBCAnalyzer.h" #include #include diff --git a/libclambcc/ClamBCPrepareGEPsForWriter/CMakeLists.txt b/libclambcc/ClamBCPrepareGEPsForWriter/CMakeLists.txt deleted file mode 100644 index ad914a0d63d..00000000000 --- a/libclambcc/ClamBCPrepareGEPsForWriter/CMakeLists.txt +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (C) 2021 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - -# -# The clambcpreparegepsforwriter object library -# -add_library(clambcpreparegepsforwriter_obj OBJECT) -target_sources(clambcpreparegepsforwriter_obj - PRIVATE - ClamBCPrepareGEPsForWriter.cpp -) - -target_include_directories(clambcpreparegepsforwriter_obj - PRIVATE - ${CMAKE_BINARY_DIR} # For clambc-version.h (generated file) - .. - ${CLAMBC_LIB_DIR}/Common # For anything in 'Common' - ${LLVM_INCLUDE_DIRS} -) - -set_target_properties(clambcpreparegepsforwriter_obj PROPERTIES COMPILE_FLAGS "${WARNCXXFLAGS}") - -# -# For testing -# -#target_compile_definitions(clambcpreparegepsforwriter_obj -DLOG_BEFORE_AFTER=1) - -# -# The clambcpreparegepsforwriter shared library. -# -add_library( clambcpreparegepsforwriter SHARED ) -target_link_libraries( clambcpreparegepsforwriter - PUBLIC - clambcpreparegepsforwriter_obj ) -set_target_properties( clambcpreparegepsforwriter PROPERTIES - VERSION ${LIBCLAMBC_VERSION} - SOVERSION ${LIBCLAMBC_SOVERSION} ) - -target_link_directories(clambcpreparegepsforwriter PRIVATE ${LLVM_LIBRARY_DIRS}) -target_link_libraries(clambcpreparegepsforwriter PUBLIC ${LLVM_LIBS}) - -install(TARGETS clambcpreparegepsforwriter DESTINATION ${CMAKE_INSTALL_LIBDIR}) - - - diff --git a/libclambcc/ClamBCPreserveABIs/ClamBCPreserveABIs.cpp b/libclambcc/ClamBCPreserveABIs.cpp similarity index 100% rename from libclambcc/ClamBCPreserveABIs/ClamBCPreserveABIs.cpp rename to libclambcc/ClamBCPreserveABIs.cpp diff --git a/libclambcc/ClamBCPreserveABIs/CMakeLists.txt b/libclambcc/ClamBCPreserveABIs/CMakeLists.txt deleted file mode 100644 index e9a928c4804..00000000000 --- a/libclambcc/ClamBCPreserveABIs/CMakeLists.txt +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (C) 2021 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - -# -# The clambcpreserveabis object library -# -add_library(clambcpreserveabis_obj OBJECT) -target_sources(clambcpreserveabis_obj - PRIVATE - ClamBCPreserveABIs.cpp -) - -target_include_directories(clambcpreserveabis_obj - PRIVATE - ${CMAKE_BINARY_DIR} # For clambc-version.h (generated file) - .. - ${CLAMBC_LIB_DIR}/Common # For anything in 'Common' - ${LLVM_INCLUDE_DIRS} -) - -set_target_properties(clambcpreserveabis_obj PROPERTIES COMPILE_FLAGS "${WARNCXXFLAGS}") - -# -# For testing -# -#target_compile_definitions(clambcpreserveabis_obj -DLOG_BEFORE_AFTER=1) - -# -# The clambcpreserveabis shared library. -# -add_library( clambcpreserveabis SHARED ) -target_link_libraries( clambcpreserveabis - PUBLIC - clambcpreserveabis_obj ) -set_target_properties( clambcpreserveabis PROPERTIES - VERSION ${LIBCLAMBC_VERSION} - SOVERSION ${LIBCLAMBC_SOVERSION} ) - -target_link_directories(clambcpreserveabis PRIVATE ${LLVM_LIBRARY_DIRS}) -target_link_libraries(clambcpreserveabis PUBLIC ${LLVM_LIBS}) - -install(TARGETS clambcpreserveabis DESTINATION ${CMAKE_INSTALL_LIBDIR}) - - diff --git a/libclambcc/ClamBCRebuild/ClamBCRebuild.cpp b/libclambcc/ClamBCRebuild.cpp similarity index 100% rename from libclambcc/ClamBCRebuild/ClamBCRebuild.cpp rename to libclambcc/ClamBCRebuild.cpp diff --git a/libclambcc/ClamBCRebuild/CMakeLists.txt b/libclambcc/ClamBCRebuild/CMakeLists.txt deleted file mode 100644 index 3020913e036..00000000000 --- a/libclambcc/ClamBCRebuild/CMakeLists.txt +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (C) 2021 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - -# -# The clambcrebuild object library -# -add_library(clambcrebuild_obj OBJECT) -target_sources(clambcrebuild_obj - PRIVATE - ClamBCRebuild.cpp -) - -target_include_directories(clambcrebuild_obj - PRIVATE - ${CMAKE_BINARY_DIR} # For clambc-version.h (generated file) - .. - ${CLAMBC_LIB_DIR}/Common # For anything in 'Common' - ${LLVM_INCLUDE_DIRS} -) - -set_target_properties(clambcrebuild_obj PROPERTIES COMPILE_FLAGS "${WARNCXXFLAGS}") - -# -# For testing -# -#target_compile_definitions(clambcrebuild_obj -DLOG_BEFORE_AFTER=1) - -# -# The clambcrebuild shared library. -# -add_library( clambcrebuild SHARED ) -target_link_libraries( clambcrebuild - PUBLIC - clambcrebuild_obj ) -set_target_properties( clambcrebuild PROPERTIES - VERSION ${LIBCLAMBC_VERSION} - SOVERSION ${LIBCLAMBC_SOVERSION} ) - -target_link_directories(clambcrebuild PRIVATE ${LLVM_LIBRARY_DIRS}) -target_link_libraries(clambcrebuild PUBLIC ${LLVM_LIBS}) - -install(TARGETS clambcrebuild DESTINATION ${CMAKE_INSTALL_LIBDIR}) - - - diff --git a/libclambcc/ClamBCRegAlloc/ClamBCRegAlloc.cpp b/libclambcc/ClamBCRegAlloc.cpp similarity index 100% rename from libclambcc/ClamBCRegAlloc/ClamBCRegAlloc.cpp rename to libclambcc/ClamBCRegAlloc.cpp diff --git a/libclambcc/ClamBCRegAlloc/ClamBCRegAlloc.h b/libclambcc/ClamBCRegAlloc.h similarity index 100% rename from libclambcc/ClamBCRegAlloc/ClamBCRegAlloc.h rename to libclambcc/ClamBCRegAlloc.h diff --git a/libclambcc/ClamBCRegAlloc/CMakeLists.txt b/libclambcc/ClamBCRegAlloc/CMakeLists.txt deleted file mode 100644 index 2fc89551537..00000000000 --- a/libclambcc/ClamBCRegAlloc/CMakeLists.txt +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (C) 2021 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - -# -# The clambcregalloc object library -# -add_library(clambcregalloc_obj OBJECT) -target_sources(clambcregalloc_obj - PRIVATE - ClamBCRegAlloc.cpp -) - -target_include_directories(clambcregalloc_obj - PRIVATE - ${CMAKE_BINARY_DIR} # For clambc-version.h (generated file) - .. - ${CLAMBC_LIB_DIR}/Common # For anything in 'Common' - ${LLVM_INCLUDE_DIRS} -) - -set_target_properties(clambcregalloc_obj PROPERTIES COMPILE_FLAGS "${WARNCXXFLAGS}") - -# -# For testing -# -#target_compile_definitions(clambcregalloc_obj -DLOG_BEFORE_AFTER=1) - -# -# The clambcregalloc shared library. -# -add_library( clambcregalloc SHARED ) -target_link_libraries( clambcregalloc - PUBLIC - clambcregalloc_obj ) -set_target_properties( clambcregalloc PROPERTIES - VERSION ${LIBCLAMBC_VERSION} - SOVERSION ${LIBCLAMBC_SOVERSION} ) - -target_link_directories(clambcregalloc PRIVATE ${LLVM_LIBRARY_DIRS}) -target_link_libraries(clambcregalloc PUBLIC ${LLVM_LIBS}) - -install(TARGETS clambcregalloc DESTINATION ${CMAKE_INSTALL_LIBDIR}) - - diff --git a/libclambcc/ClamBCRemoveFSHL/ClamBCRemoveFSHL.cpp b/libclambcc/ClamBCRemoveFSHL.cpp similarity index 100% rename from libclambcc/ClamBCRemoveFSHL/ClamBCRemoveFSHL.cpp rename to libclambcc/ClamBCRemoveFSHL.cpp diff --git a/libclambcc/ClamBCRemoveFSHL/CMakeLists.txt b/libclambcc/ClamBCRemoveFSHL/CMakeLists.txt deleted file mode 100644 index 80739edcf04..00000000000 --- a/libclambcc/ClamBCRemoveFSHL/CMakeLists.txt +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (C) 2021 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - -# -# The clambcremovefshl object library -# -add_library(clambcremovefshl_obj OBJECT) -target_sources(clambcremovefshl_obj - PRIVATE - ClamBCRemoveFSHL.cpp -) - -target_include_directories(clambcremovefshl_obj - PRIVATE - ${CMAKE_BINARY_DIR} # For clambc-version.h (generated file) - .. - ${CLAMBC_LIB_DIR}/Common # For anything in 'Common' - ${LLVM_INCLUDE_DIRS} -) - -set_target_properties(clambcremovefshl_obj PROPERTIES COMPILE_FLAGS "${WARNCXXFLAGS}") - -# -# For testing -# -#target_compile_definitions(clambcremovefshl_obj -DLOG_BEFORE_AFTER=1) - -# -# The clambcremovefshl shared library. -# -add_library( clambcremovefshl SHARED ) -target_link_libraries( clambcremovefshl - PUBLIC - clambcremovefshl_obj ) -set_target_properties( clambcremovefshl PROPERTIES - VERSION ${LIBCLAMBC_VERSION} - SOVERSION ${LIBCLAMBC_SOVERSION} ) - -target_link_directories(clambcremovefshl PRIVATE ${LLVM_LIBRARY_DIRS}) -target_link_libraries(clambcremovefshl PUBLIC ${LLVM_LIBS}) - -install(TARGETS clambcremovefshl DESTINATION ${CMAKE_INSTALL_LIBDIR}) - diff --git a/libclambcc/ClamBCRemoveFreezeInsts/ClamBCRemoveFreezeInsts.cpp b/libclambcc/ClamBCRemoveFreezeInsts.cpp similarity index 100% rename from libclambcc/ClamBCRemoveFreezeInsts/ClamBCRemoveFreezeInsts.cpp rename to libclambcc/ClamBCRemoveFreezeInsts.cpp diff --git a/libclambcc/ClamBCRemoveFreezeInsts/CMakeLists.txt b/libclambcc/ClamBCRemoveFreezeInsts/CMakeLists.txt deleted file mode 100644 index 2148e721c50..00000000000 --- a/libclambcc/ClamBCRemoveFreezeInsts/CMakeLists.txt +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (C) 2021 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - -# -# The clambcremovefreezeinsts object library -# -add_library(clambcremovefreezeinsts_obj OBJECT) -target_sources(clambcremovefreezeinsts_obj - PRIVATE - ClamBCRemoveFreezeInsts.cpp -) - -target_include_directories(clambcremovefreezeinsts_obj - PRIVATE - ${CMAKE_BINARY_DIR} # For clambc-version.h (generated file) - .. - ${CLAMBC_LIB_DIR}/Common # For anything in 'Common' - ${LLVM_INCLUDE_DIRS} -) - -set_target_properties(clambcremovefreezeinsts_obj PROPERTIES COMPILE_FLAGS "${WARNCXXFLAGS}") - -# -# For testing -# -#target_compile_definitions(clambcremovefreezeinsts_obj -DLOG_BEFORE_AFTER=1) - -# -# The clambcremovefreezeinsts shared library. -# -add_library( clambcremovefreezeinsts SHARED ) -target_link_libraries( clambcremovefreezeinsts - PUBLIC - clambcremovefreezeinsts_obj ) -set_target_properties( clambcremovefreezeinsts PROPERTIES - VERSION ${LIBCLAMBC_VERSION} - SOVERSION ${LIBCLAMBC_SOVERSION} ) - -target_link_directories(clambcremovefreezeinsts PRIVATE ${LLVM_LIBRARY_DIRS}) -target_link_libraries(clambcremovefreezeinsts PUBLIC ${LLVM_LIBS}) - -install(TARGETS clambcremovefreezeinsts DESTINATION ${CMAKE_INSTALL_LIBDIR}) - - diff --git a/libclambcc/ClamBCRemoveICMPSLE/ClamBCRemoveICMPSLE.cpp b/libclambcc/ClamBCRemoveICMPSLE.cpp similarity index 100% rename from libclambcc/ClamBCRemoveICMPSLE/ClamBCRemoveICMPSLE.cpp rename to libclambcc/ClamBCRemoveICMPSLE.cpp diff --git a/libclambcc/ClamBCRemoveICMPSLE/CMakeLists.txt b/libclambcc/ClamBCRemoveICMPSLE/CMakeLists.txt deleted file mode 100644 index 27a20ce2884..00000000000 --- a/libclambcc/ClamBCRemoveICMPSLE/CMakeLists.txt +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (C) 2021 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - -# -# The clambcremoveicmpsle object library -# -add_library(clambcremoveicmpsle_obj OBJECT) -target_sources(clambcremoveicmpsle_obj - PRIVATE - ClamBCRemoveICMPSLE.cpp -) - -target_include_directories(clambcremoveicmpsle_obj - PRIVATE - ${CMAKE_BINARY_DIR} # For clambc-version.h (generated file) - .. - ${CLAMBC_LIB_DIR}/Common # For anything in 'Common' - ${LLVM_INCLUDE_DIRS} -) - -set_target_properties(clambcremoveicmpsle_obj PROPERTIES COMPILE_FLAGS "${WARNCXXFLAGS}") - -# -# For testing -# -#target_compile_definitions(clambcremoveicmpsle_obj -DLOG_BEFORE_AFTER=1) - -# -# The clambcremoveicmpsle shared library. -# -add_library( clambcremoveicmpsle SHARED ) -target_link_libraries( clambcremoveicmpsle - PUBLIC - clambcremoveicmpsle_obj ) -set_target_properties( clambcremoveicmpsle PROPERTIES - VERSION ${LIBCLAMBC_VERSION} - SOVERSION ${LIBCLAMBC_SOVERSION} ) - -target_link_directories(clambcremoveicmpsle PRIVATE ${LLVM_LIBRARY_DIRS}) -target_link_libraries(clambcremoveicmpsle PUBLIC ${LLVM_LIBS}) - -install(TARGETS clambcremoveicmpsle DESTINATION ${CMAKE_INSTALL_LIBDIR}) - - diff --git a/libclambcc/ClamBCRemovePointerPHIs/ClamBCRemovePointerPHIs.cpp b/libclambcc/ClamBCRemovePointerPHIs.cpp similarity index 100% rename from libclambcc/ClamBCRemovePointerPHIs/ClamBCRemovePointerPHIs.cpp rename to libclambcc/ClamBCRemovePointerPHIs.cpp diff --git a/libclambcc/ClamBCRemovePointerPHIs/CMakeLists.txt b/libclambcc/ClamBCRemovePointerPHIs/CMakeLists.txt deleted file mode 100644 index 74d9a9efd06..00000000000 --- a/libclambcc/ClamBCRemovePointerPHIs/CMakeLists.txt +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (C) 2021 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - -# -# The clambcremovepointerphis object library -# -add_library(clambcremovepointerphis_obj OBJECT) -target_sources(clambcremovepointerphis_obj - PRIVATE - ClamBCRemovePointerPHIs.cpp -) - -target_include_directories(clambcremovepointerphis_obj - PRIVATE - ${CMAKE_BINARY_DIR} # For clambc-version.h (generated file) - .. - ${CLAMBC_LIB_DIR}/Common # For anything in 'Common' - ${LLVM_INCLUDE_DIRS} -) - -set_target_properties(clambcremovepointerphis_obj PROPERTIES COMPILE_FLAGS "${WARNCXXFLAGS}") - -# -# For testing -# -#target_compile_definitions(clambcremovepointerphis_obj -DLOG_BEFORE_AFTER=1) - -# -# The clambcremovepointerphis shared library. -# -add_library( clambcremovepointerphis SHARED ) -target_link_libraries( clambcremovepointerphis - PUBLIC - clambcremovepointerphis_obj ) -set_target_properties( clambcremovepointerphis PROPERTIES - VERSION ${LIBCLAMBC_VERSION} - SOVERSION ${LIBCLAMBC_SOVERSION} ) - -target_link_directories(clambcremovepointerphis PRIVATE ${LLVM_LIBRARY_DIRS}) -target_link_libraries(clambcremovepointerphis PUBLIC ${LLVM_LIBS}) - -install(TARGETS clambcremovepointerphis DESTINATION ${CMAKE_INSTALL_LIBDIR}) - - diff --git a/libclambcc/ClamBCRemoveUSUB/ClamBCRemoveUSUB.cpp b/libclambcc/ClamBCRemoveUSUB.cpp similarity index 100% rename from libclambcc/ClamBCRemoveUSUB/ClamBCRemoveUSUB.cpp rename to libclambcc/ClamBCRemoveUSUB.cpp diff --git a/libclambcc/ClamBCRemoveUSUB/CMakeLists.txt b/libclambcc/ClamBCRemoveUSUB/CMakeLists.txt deleted file mode 100644 index f024437198a..00000000000 --- a/libclambcc/ClamBCRemoveUSUB/CMakeLists.txt +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (C) 2021 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - -# -# The clambcremoveusub object library -# -add_library(clambcremoveusub_obj OBJECT) -target_sources(clambcremoveusub_obj - PRIVATE - ClamBCRemoveUSUB.cpp -) - -target_include_directories(clambcremoveusub_obj - PRIVATE - ${CMAKE_BINARY_DIR} # For clambc-version.h (generated file) - .. - ${CLAMBC_LIB_DIR}/Common # For anything in 'Common' - ${LLVM_INCLUDE_DIRS} -) - -set_target_properties(clambcremoveusub_obj PROPERTIES COMPILE_FLAGS "${WARNCXXFLAGS}") - -# -# For testing -# -#target_compile_definitions(clambcremoveusub_obj -DLOG_BEFORE_AFTER=1) - -# -# The clambcremoveusub shared library. -# -add_library( clambcremoveusub SHARED ) -target_link_libraries( clambcremoveusub - PUBLIC - clambcremoveusub_obj ) -set_target_properties( clambcremoveusub PROPERTIES - VERSION ${LIBCLAMBC_VERSION} - SOVERSION ${LIBCLAMBC_SOVERSION} ) - -target_link_directories(clambcremoveusub PRIVATE ${LLVM_LIBRARY_DIRS}) -target_link_libraries(clambcremoveusub PUBLIC ${LLVM_LIBS}) - -install(TARGETS clambcremoveusub DESTINATION ${CMAKE_INSTALL_LIBDIR}) - - - diff --git a/libclambcc/ClamBCRemoveUndefs/ClamBCRemoveUndefs.cpp b/libclambcc/ClamBCRemoveUndefs.cpp similarity index 100% rename from libclambcc/ClamBCRemoveUndefs/ClamBCRemoveUndefs.cpp rename to libclambcc/ClamBCRemoveUndefs.cpp diff --git a/libclambcc/ClamBCRemoveUndefs/CMakeLists.txt b/libclambcc/ClamBCRemoveUndefs/CMakeLists.txt deleted file mode 100644 index 950a74e576f..00000000000 --- a/libclambcc/ClamBCRemoveUndefs/CMakeLists.txt +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (C) 2021 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - -# -# The clambcremoveundefs object library -# -add_library(clambcremoveundefs_obj OBJECT) -target_sources(clambcremoveundefs_obj - PRIVATE - ClamBCRemoveUndefs.cpp -) - -target_include_directories(clambcremoveundefs_obj - PRIVATE - ${CMAKE_BINARY_DIR} # For clambc-version.h (generated file) - .. - ${CLAMBC_LIB_DIR}/Common # For anything in 'Common' - ${LLVM_INCLUDE_DIRS} -) - -set_target_properties(clambcremoveundefs_obj PROPERTIES COMPILE_FLAGS "${WARNCXXFLAGS}") - -# -# For testing -# -#target_compile_definitions(clambcremoveundefs_obj -DLOG_BEFORE_AFTER=1) - -# -# The clambcremoveundefs shared library. -# -add_library( clambcremoveundefs SHARED ) -target_link_libraries( clambcremoveundefs - PUBLIC - clambcremoveundefs_obj ) -set_target_properties( clambcremoveundefs PROPERTIES - VERSION ${LIBCLAMBC_VERSION} - SOVERSION ${LIBCLAMBC_SOVERSION} ) - -target_link_directories(clambcremoveundefs PRIVATE ${LLVM_LIBRARY_DIRS}) -target_link_libraries(clambcremoveundefs PUBLIC ${LLVM_LIBS}) - -install(TARGETS clambcremoveundefs DESTINATION ${CMAKE_INSTALL_LIBDIR}) - diff --git a/libclambcc/ClamBCRemoveUnsupportedICMPIntrinsics/ClamBCRemoveUnsupportedICMPIntrinsics.cpp b/libclambcc/ClamBCRemoveUnsupportedICMPIntrinsics.cpp similarity index 100% rename from libclambcc/ClamBCRemoveUnsupportedICMPIntrinsics/ClamBCRemoveUnsupportedICMPIntrinsics.cpp rename to libclambcc/ClamBCRemoveUnsupportedICMPIntrinsics.cpp diff --git a/libclambcc/ClamBCRemoveUnsupportedICMPIntrinsics/CMakeLists.txt b/libclambcc/ClamBCRemoveUnsupportedICMPIntrinsics/CMakeLists.txt deleted file mode 100644 index 7a03f1b74e2..00000000000 --- a/libclambcc/ClamBCRemoveUnsupportedICMPIntrinsics/CMakeLists.txt +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (C) 2021 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - -# -# The clambcremoveunsupportedicmpintrinsics object library -# -add_library(clambcremoveunsupportedicmpintrinsics_obj OBJECT) -target_sources(clambcremoveunsupportedicmpintrinsics_obj - PRIVATE - ClamBCRemoveUnsupportedICMPIntrinsics.cpp -) - -target_include_directories(clambcremoveunsupportedicmpintrinsics_obj - PRIVATE - ${CMAKE_BINARY_DIR} # For clambc-version.h (generated file) - .. - ${CLAMBC_LIB_DIR}/Common # For anything in 'Common' - ${LLVM_INCLUDE_DIRS} -) - -set_target_properties(clambcremoveunsupportedicmpintrinsics_obj PROPERTIES COMPILE_FLAGS "${WARNCXXFLAGS}") - -# -# For testing -# -#target_compile_definitions(clambcremoveunsupportedicmpintrinsics_obj -DLOG_BEFORE_AFTER=1) - -# -# The clambcremoveunsupportedicmpintrinsics shared library. -# -add_library( clambcremoveunsupportedicmpintrinsics SHARED ) -target_link_libraries( clambcremoveunsupportedicmpintrinsics - PUBLIC - clambcremoveunsupportedicmpintrinsics_obj ) -set_target_properties( clambcremoveunsupportedicmpintrinsics PROPERTIES - VERSION ${LIBCLAMBC_VERSION} - SOVERSION ${LIBCLAMBC_SOVERSION} ) - -target_link_directories(clambcremoveunsupportedicmpintrinsics PRIVATE ${LLVM_LIBRARY_DIRS}) -target_link_libraries(clambcremoveunsupportedicmpintrinsics PUBLIC ${LLVM_LIBS}) - -install(TARGETS clambcremoveunsupportedicmpintrinsics DESTINATION ${CMAKE_INSTALL_LIBDIR}) - diff --git a/libclambcc/ClamBCTrace/ClamBCTrace.cpp b/libclambcc/ClamBCTrace.cpp similarity index 100% rename from libclambcc/ClamBCTrace/ClamBCTrace.cpp rename to libclambcc/ClamBCTrace.cpp diff --git a/libclambcc/ClamBCTrace/CMakeLists.txt b/libclambcc/ClamBCTrace/CMakeLists.txt deleted file mode 100644 index d209e736664..00000000000 --- a/libclambcc/ClamBCTrace/CMakeLists.txt +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (C) 2021 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - -# -# The clambctrace object library -# -add_library(clambctrace_obj OBJECT) -target_sources(clambctrace_obj - PRIVATE - ClamBCTrace.cpp -) - -target_include_directories(clambctrace_obj - PRIVATE - ${CMAKE_BINARY_DIR} # For clambc-version.h (generated file) - .. - ${CLAMBC_LIB_DIR}/Common # For anything in 'Common' - ${LLVM_INCLUDE_DIRS} -) - -set_target_properties(clambctrace_obj PROPERTIES COMPILE_FLAGS "${WARNCXXFLAGS}") - -# -# For testing -# -#target_compile_definitions(clambctrace_obj -DLOG_BEFORE_AFTER=1) - -# -# The clambctrace shared library. -# -add_library( clambctrace SHARED ) -target_link_libraries( clambctrace - PUBLIC - clambctrace_obj ) -set_target_properties( clambctrace PROPERTIES - VERSION ${LIBCLAMBC_VERSION} - SOVERSION ${LIBCLAMBC_SOVERSION} ) - -target_link_directories(clambctrace PRIVATE ${LLVM_LIBRARY_DIRS}) -target_link_libraries(clambctrace PUBLIC ${LLVM_LIBS}) - -install(TARGETS clambctrace DESTINATION ${CMAKE_INSTALL_LIBDIR}) - - diff --git a/libclambcc/Common/ClamBCUtilities.cpp b/libclambcc/ClamBCUtilities.cpp similarity index 100% rename from libclambcc/Common/ClamBCUtilities.cpp rename to libclambcc/ClamBCUtilities.cpp diff --git a/libclambcc/Common/ClamBCUtilities.h b/libclambcc/ClamBCUtilities.h similarity index 100% rename from libclambcc/Common/ClamBCUtilities.h rename to libclambcc/ClamBCUtilities.h diff --git a/libclambcc/ClamBCVerifier/ClamBCVerifier.cpp b/libclambcc/ClamBCVerifier.cpp similarity index 100% rename from libclambcc/ClamBCVerifier/ClamBCVerifier.cpp rename to libclambcc/ClamBCVerifier.cpp diff --git a/libclambcc/ClamBCVerifier/CMakeLists.txt b/libclambcc/ClamBCVerifier/CMakeLists.txt deleted file mode 100644 index ca3bf30ec84..00000000000 --- a/libclambcc/ClamBCVerifier/CMakeLists.txt +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (C) 2021 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - -# -# The clambcverifier object library -# -add_library(clambcverifier_obj OBJECT) -target_sources(clambcverifier_obj - PRIVATE - ClamBCVerifier.cpp -) - -target_include_directories(clambcverifier_obj - PRIVATE - ${CMAKE_BINARY_DIR} # For clambc-version.h (generated file) - .. - ${CLAMBC_LIB_DIR}/Common # For anything in 'Common' - ${LLVM_INCLUDE_DIRS} -) - -set_target_properties(clambcverifier_obj PROPERTIES COMPILE_FLAGS "${WARNCXXFLAGS}") - -# -# For testing -# -#target_compile_definitions(clambcverifier_obj -DLOG_BEFORE_AFTER=1) - -# -# The clambcverifier shared library. -# -add_library( clambcverifier SHARED ) -target_link_libraries( clambcverifier - PUBLIC - clambcverifier_obj ) -set_target_properties( clambcverifier PROPERTIES - VERSION ${LIBCLAMBC_VERSION} - SOVERSION ${LIBCLAMBC_SOVERSION} ) - -target_link_directories(clambcverifier PRIVATE ${LLVM_LIBRARY_DIRS}) -target_link_libraries(clambcverifier PUBLIC ${LLVM_LIBS}) - -install(TARGETS clambcverifier DESTINATION ${CMAKE_INSTALL_LIBDIR}) - - diff --git a/libclambcc/ClamBCWriter/ClamBCWriter.cpp b/libclambcc/ClamBCWriter.cpp similarity index 99% rename from libclambcc/ClamBCWriter/ClamBCWriter.cpp rename to libclambcc/ClamBCWriter.cpp index 1a2d33c8e98..0a1f4d20d94 100644 --- a/libclambcc/ClamBCWriter/ClamBCWriter.cpp +++ b/libclambcc/ClamBCWriter.cpp @@ -24,8 +24,8 @@ #include "ClamBCModule.h" #include "ClamBCUtilities.h" -#include "ClamBCAnalyzer/ClamBCAnalyzer.h" -#include "ClamBCRegAlloc/ClamBCRegAlloc.h" +#include "ClamBCAnalyzer.h" +#include "ClamBCRegAlloc.h" #include #include diff --git a/libclambcc/ClamBCWriter/CMakeLists.txt b/libclambcc/ClamBCWriter/CMakeLists.txt deleted file mode 100644 index a3d1fc3b65f..00000000000 --- a/libclambcc/ClamBCWriter/CMakeLists.txt +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (C) 2021 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - -# -# The clambcwriter object library -# -add_library(clambcwriter_obj OBJECT) -target_sources(clambcwriter_obj - PRIVATE - ClamBCWriter.cpp -) - -target_include_directories(clambcwriter_obj - PRIVATE - ${CMAKE_BINARY_DIR} # For clambc-version.h (generated file) - .. - ${CLAMBC_LIB_DIR}/Common # For anything in 'Common' - ${LLVM_INCLUDE_DIRS} -) - -set_target_properties(clambcwriter_obj PROPERTIES COMPILE_FLAGS "${WARNCXXFLAGS}") - -# -# For testing -# -#target_compile_definitions(clambcwriter_obj -DLOG_BEFORE_AFTER=1) - -# -# The clambcwriter shared library. -# -add_library( clambcwriter SHARED ) -target_link_libraries( clambcwriter - PUBLIC - clambcwriter_obj ) -set_target_properties( clambcwriter PROPERTIES - VERSION ${LIBCLAMBC_VERSION} - SOVERSION ${LIBCLAMBC_SOVERSION} ) - -target_link_directories(clambcwriter PRIVATE ${LLVM_LIBRARY_DIRS}) -target_link_libraries(clambcwriter PUBLIC ${LLVM_LIBS}) - -install(TARGETS clambcwriter DESTINATION ${CMAKE_INSTALL_LIBDIR}) - - diff --git a/libclambcc/Common/CMakeLists.txt b/libclambcc/Common/CMakeLists.txt deleted file mode 100644 index f5938d51c0f..00000000000 --- a/libclambcc/Common/CMakeLists.txt +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright (C) 2021 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - -# -# The clambccommon object library -# -add_library(clambccommon_obj OBJECT) -target_sources(clambccommon_obj - PRIVATE - ClamBCDiagnostics.cpp - ClamBCUtilities.cpp - version.c -) - -target_include_directories(clambccommon_obj - PRIVATE - ${CMAKE_BINARY_DIR} # For clambc-version.h (generated file) - .. - ${LLVM_INCLUDE_DIRS} -) - -set_target_properties(clambccommon_obj PROPERTIES COMPILE_FLAGS "${WARNCXXFLAGS}") - -# -# For testing -# -#target_compile_definitions(clambccommon_obj -DLOG_BEFORE_AFTER=1) - -# -# The clambccommon shared library. -# -add_library( clambccommon SHARED ) -target_link_libraries( clambccommon - PUBLIC - clambccommon_obj ) -set_target_properties( clambccommon PROPERTIES - VERSION ${LIBCLAMBC_VERSION} - SOVERSION ${LIBCLAMBC_SOVERSION} ) - -target_link_directories(clambccommon PRIVATE ${LLVM_LIBRARY_DIRS}) -target_link_libraries(clambccommon PUBLIC ${LLVM_LIBS}) - -install(TARGETS clambccommon DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/libclambcc/Common/bytecode_api.h b/libclambcc/bytecode_api.h similarity index 100% rename from libclambcc/Common/bytecode_api.h rename to libclambcc/bytecode_api.h diff --git a/libclambcc/Common/clambc.h b/libclambcc/clambc.h similarity index 100% rename from libclambcc/Common/clambc.h rename to libclambcc/clambc.h diff --git a/libclambcc/Common/version.c b/libclambcc/version.c similarity index 100% rename from libclambcc/Common/version.c rename to libclambcc/version.c diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index ee03ea2c101..17b1901dc08 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -14,7 +14,7 @@ if(WIN32) file(TO_NATIVE_PATH ${sigtool_EXECUTABLE} SIGTOOL) file(TO_NATIVE_PATH ${clambc_headers_DIRECTORY} HEADERS) else() - set(LD_LIBRARY_PATH $:$ENV{LD_LIBRARY_PATH}) + set(LD_LIBRARY_PATH $:$ENV{LD_LIBRARY_PATH}) set(SOURCE ${CMAKE_SOURCE_DIR}) set(BUILD ${CMAKE_BINARY_DIR})