Skip to content

Rename common_clang to opencl_clang #404

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ else (WIN32)
endif (WIN32)

# set that name of the main output file as a target name
if (NOT DEFINED COMMON_CLANG_LIBRARY_NAME)
set(COMMON_CLANG_LIBRARY_NAME "opencl-clang")
if (NOT DEFINED OPENCL_CLANG_LIBRARY_NAME)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we rename this macro. Do we need to notify IGC compiler team? Maybe they use "COMMON_CLANG_LIBRARY_NAME" during their compilation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

library name in igc build is libopencl-clang.so

set(OPENCL_CLANG_LIBRARY_NAME "opencl-clang")
endif()
set(TARGET_NAME ${COMMON_CLANG_LIBRARY_NAME}${BUILD_PLATFORM} )
set(TARGET_NAME ${OPENCL_CLANG_LIBRARY_NAME}${BUILD_PLATFORM} )

if(NOT USE_PREBUILT_LLVM)

Expand Down Expand Up @@ -180,7 +180,7 @@ add_public_tablegen_target(CClangCompileOptions)
# Source code
#
set(TARGET_INCLUDE_FILES
common_clang.h
opencl_clang.h
options.h
binary_result.h
pch_mgr.h
Expand All @@ -189,7 +189,7 @@ set(TARGET_INCLUDE_FILES
)

set(TARGET_SOURCE_FILES
common_clang.cpp
opencl_clang.cpp
options.cpp
pch_mgr.cpp
options_compile.cpp
Expand All @@ -206,7 +206,7 @@ set (LLVM_VER_MINOR ${LLVM_VERSION_MINOR} )

add_definitions( -D__STDC_LIMIT_MACROS )
add_definitions( -D__STDC_CONSTANT_MACROS )
add_definitions( -DCOMMON_CLANG_EXPORTS )
add_definitions( -DOPENCL_CLANG_EXPORTS )

#
# Include directories
Expand Down Expand Up @@ -301,7 +301,7 @@ if (WIN32)

elseif(UNIX)
set_property(TARGET ${TARGET_NAME} APPEND_STRING PROPERTY
COMPILE_DEFINITIONS LIBCOMMON_CLANG_NAME="$<TARGET_SONAME_FILE_NAME:${TARGET_NAME}>")
COMPILE_DEFINITIONS LIBOPENCL_CLANG_NAME="$<TARGET_SONAME_FILE_NAME:${TARGET_NAME}>")

set_property(TARGET ${TARGET_NAME} APPEND_STRING PROPERTY
LINK_FLAGS " -Wl,--no-undefined")
Expand Down Expand Up @@ -352,7 +352,7 @@ target_link_libraries( ${TARGET_NAME}
${OTHER_LIBRARIES}
)

install(FILES common_clang.h
install(FILES opencl_clang.h
DESTINATION include/cclang
COMPONENT ${TARGET_NAME})

Expand All @@ -377,5 +377,5 @@ if (WIN32)
endif(INSTALL_PDBS)
install(FILES ${RT_OUTPUT_DIRECTORY}/\${BUILD_TYPE}/${TARGET_NAME}_stripped.pdb DESTINATION bin)
else (WIN32)
SET_LINUX_EXPORTS_FILE( ${TARGET_NAME} common_clang.map )
SET_LINUX_EXPORTS_FILE( ${TARGET_NAME} opencl_clang.map )
endif(WIN32)
2 changes: 1 addition & 1 deletion binary_result.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Copyright (c) Intel Corporation (2009-2017).

#pragma once

#include "common_clang.h"
#include "opencl_clang.h"
#include "llvm/ADT/SmallVector.h"
#include <string>

Expand Down
4 changes: 2 additions & 2 deletions common_clang.cpp → opencl_clang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ Copyright (c) Intel Corporation (2009-2017).
use of the code. No license, express or implied, by estoppel or otherwise,
to any intellectual property rights is granted herein.

\file common_clang.cpp
\file opencl_clang.cpp

\*****************************************************************************/

#include "common_clang.h"
#include "opencl_clang.h"
#include "pch_mgr.h"
#include "cl_headers/resource.h"
#include "binary_result.h"
Expand Down
4 changes: 2 additions & 2 deletions common_clang.h → opencl_clang.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Copyright (c) Intel Corporation (2009-2017).
use of the code. No license, express or implied, by estoppel or otherwise,
to any intellectual property rights is granted herein.

\file common_clang.h
\file opencl_clang.h

\*****************************************************************************/

Expand All @@ -21,7 +21,7 @@ Copyright (c) Intel Corporation (2009-2017).
#include "cstddef" // size_t

#if defined(_WIN32)
#if defined(COMMON_CLANG_EXPORTS)
#if defined(OPENCL_CLANG_EXPORTS)
#define CC_DLL_EXPORT _declspec(dllexport)
#else
#define CC_DLL_EXPORT _declspec(dllimport)
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion opencl_clang_options.td
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//===----------------------------------------------------------------------===//
//
// This file defines the options accepted by common_clang.
// This file defines the options accepted by opencl_clang.
//
//===----------------------------------------------------------------------===//

Expand Down
6 changes: 3 additions & 3 deletions options.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ Copyright (c) Intel Corporation (2009-2017).
use of the code. No license, express or implied, by estoppel or otherwise,
to any intellectual property rights is granted herein.

\file common_clang.h
\file opencl_clang.h

\brief Defines the common structures for both compile and link options parsing

\*****************************************************************************/

#ifndef COMMON_CLANG_OPTIONS_H
#define COMMON_CLANG_OPTIONS_H
#ifndef OPENCL_CLANG_OPTIONS_H
#define OPENCL_CLANG_OPTIONS_H

#include "llvm/Option/Arg.h"
#include "llvm/ADT/ArrayRef.h"
Expand Down
2 changes: 1 addition & 1 deletion options_compile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Copyright (c) Intel Corporation (2009-2017).

\*****************************************************************************/

#include "common_clang.h"
#include "opencl_clang.h"
#include "options.h"

#include "clang/Driver/Options.h"
Expand Down
2 changes: 1 addition & 1 deletion pch_mgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ bool ResourceManager::load_resource(const char *id, const char *pszType,
#ifdef WIN32
bool ok = GetResourceWin32(id, pszType, res, size);
#else
bool ok = GetResourceUnix(id, pszType, LIBCOMMON_CLANG_NAME,
bool ok = GetResourceUnix(id, pszType, LIBOPENCL_CLANG_NAME,
false, res, size);
#endif

Expand Down