Skip to content

Commit

Permalink
Merge branch 'main' into maximusron/ubu24
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronj0 authored Oct 30, 2024
2 parents 7b2804c + b2d787b commit 2b580d6
Show file tree
Hide file tree
Showing 6 changed files with 132 additions and 103 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ IncludeCategories:
- Regex: '^"llvm/'
Priority: 40
- Regex: '^<'
Priority: 50
Priority: 50
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ jobs:
clang-runtime: '18'
cling: Off
cppyy: On
coverage: true
- name: ubu24-x86-gcc13-clang-repl-17
os: ubuntu-24.04
compiler: gcc-13
Expand All @@ -56,7 +55,6 @@ jobs:
cling: On
cling-version: '1.0'
cppyy: On
coverage: true
- name: win2022-msvc-clang-repl-19
os: windows-2022
compiler: msvc
Expand Down Expand Up @@ -494,7 +492,6 @@ jobs:
clang-runtime: '18'
cling: Off
cppyy: On
coverage: true
- name: ubu24-x86-gcc13-clang-repl-17-cppyy
os: ubuntu-24.04
compiler: gcc-13
Expand Down
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
Expand All @@ -36,4 +32,4 @@ build
install

# CLion files
.idea
.idea
94 changes: 47 additions & 47 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,6 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
option(USE_CLING "Use Cling as backend" OFF)
option(USE_REPL "Use clang-repl as backend" OFF)

if (USE_CLING)
add_definitions(-DUSE_CLING)
endif()
if (USE_REPL)
add_definitions(-DUSE_REPL)
endif()

if (USE_CLING AND USE_REPL)
message(FATAL_ERROR "We can only use Cling (USE_CLING=On) or Repl (USE_REPL=On), but not both of them.")
endif()
Expand Down Expand Up @@ -226,53 +219,60 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
# Fix bug in some AddLLVM.cmake implementation (-rpath "" problem)
set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})

include(AddLLVM)
include(HandleLLVMOptions)

set(CMAKE_INCLUDE_CURRENT_DIR ON)
set( CPPINTEROP_BUILT_STANDALONE 1 )
endif()

# In rare cases we might want to have clang installed in a different place
# than llvm and the header files should be found first (even though the
# LLVM_INCLUDE_DIRS) contain clang headers, too.
if (USE_CLING)
include_directories(SYSTEM ${CLING_INCLUDE_DIRS})
endif(USE_CLING)
include_directories(SYSTEM ${CLANG_INCLUDE_DIRS})
include_directories(SYSTEM ${LLVM_INCLUDE_DIRS})
separate_arguments(LLVM_DEFINITIONS_LIST NATIVE_COMMAND ${LLVM_DEFINITIONS})
add_definitions(${LLVM_DEFINITIONS_LIST})
include(AddLLVM)
include(HandleLLVMOptions)

if (USE_CLING)
message(STATUS "CLING_INCLUDE_DIRS: ${CLING_INCLUDE_DIRS}")
endif(USE_CLING)
message(STATUS "CLANG_INCLUDE_DIRS: ${CLANG_INCLUDE_DIRS}")
message(STATUS "LLVM_INCLUDE_DIRS: ${LLVM_INCLUDE_DIRS}")
message(STATUS "LLVM_DEFINITIONS_LIST: ${LLVM_DEFINITIONS_LIST}")

# If the llvm sources are present add them with higher priority.
if (LLVM_BUILD_MAIN_SRC_DIR)
# LLVM_INCLUDE_DIRS contains the include paths to both LLVM's source and
# build directories. Since we cannot just include ClangConfig.cmake (see
# fixme above) we have to do a little more work to get the right include
# paths for clang.
#
# FIXME: We only support in-tree builds of clang, that is clang being built
# in llvm_src/tools/clang.
include_directories(SYSTEM ${LLVM_BUILD_MAIN_SRC_DIR}/tools/clang/include/)

if (NOT LLVM_BUILD_BINARY_DIR)
message(FATAL "LLVM_BUILD_* values should be available for the build tree")
endif()
set(CMAKE_INCLUDE_CURRENT_DIR ON)

include_directories(SYSTEM ${LLVM_BUILD_BINARY_DIR}/tools/clang/include/)
# In rare cases we might want to have clang installed in a different place
# than llvm and the header files should be found first (even though the
# LLVM_INCLUDE_DIRS) contain clang headers, too.
if (USE_CLING)
add_definitions(-DUSE_CLING)
include_directories(SYSTEM ${CLING_INCLUDE_DIRS})
else()
if (NOT USE_REPL)
message(FATAL_ERROR "We need either USE_CLING or USE_REPL")
endif()
add_definitions(-DUSE_REPL)

endif(USE_CLING)
include_directories(SYSTEM ${CLANG_INCLUDE_DIRS})
include_directories(SYSTEM ${LLVM_INCLUDE_DIRS})
separate_arguments(LLVM_DEFINITIONS_LIST NATIVE_COMMAND ${LLVM_DEFINITIONS})
add_definitions(${LLVM_DEFINITIONS_LIST})

if (USE_CLING)
message(STATUS "CLING_INCLUDE_DIRS: ${CLING_INCLUDE_DIRS}")
endif(USE_CLING)
message(STATUS "CLANG_INCLUDE_DIRS: ${CLANG_INCLUDE_DIRS}")
message(STATUS "LLVM_INCLUDE_DIRS: ${LLVM_INCLUDE_DIRS}")
message(STATUS "LLVM_DEFINITIONS_LIST: ${LLVM_DEFINITIONS_LIST}")

# If the llvm sources are present add them with higher priority.
if (LLVM_BUILD_MAIN_SRC_DIR)
# LLVM_INCLUDE_DIRS contains the include paths to both LLVM's source and
# build directories. Since we cannot just include ClangConfig.cmake (see
# fixme above) we have to do a little more work to get the right include
# paths for clang.
#
# FIXME: We only support in-tree builds of clang, that is clang being built
# in llvm_src/tools/clang.
include_directories(SYSTEM ${LLVM_BUILD_MAIN_SRC_DIR}/tools/clang/include/)

if (NOT LLVM_BUILD_BINARY_DIR)
message(FATAL "LLVM_BUILD_* values should be available for the build tree")
endif()

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

set( CPPINTEROP_BUILT_STANDALONE 1 )
include_directories(SYSTEM ${LLVM_BUILD_BINARY_DIR}/tools/clang/include/)
endif()

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

## Code Coverage Configuration
add_library(coverage_config INTERFACE)
option(CODE_COVERAGE "Enable coverage reporting" OFF)
Expand Down
16 changes: 10 additions & 6 deletions include/clang/Interpreter/CppInterOp.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ namespace Cpp {
/// function, constructor or destructor.
class JitCall {
public:
friend CPPINTEROP_API JitCall MakeFunctionCallable(TCppConstFunction_t);
friend CPPINTEROP_API JitCall
MakeFunctionCallable(TInterp_t I, TCppConstFunction_t func);
enum Kind : char {
kUnknown = 0,
kGenericCall,
Expand Down Expand Up @@ -262,16 +263,16 @@ namespace Cpp {

/// This is similar to GetName() function, but besides
/// the name, it also gets the template arguments.
CPPINTEROP_API std::string GetCompleteName(TCppType_t klass);
CPPINTEROP_API std::string GetCompleteName(TCppScope_t klass);

/// Gets the "qualified" name (including the namespace) of any
/// named decl (a class, namespace, variable, or a function).
CPPINTEROP_API std::string GetQualifiedName(TCppType_t klass);
CPPINTEROP_API std::string GetQualifiedName(TCppScope_t klass);

/// This is similar to GetQualifiedName() function, but besides
/// the "qualified" name (including the namespace), it also
/// gets the template arguments.
CPPINTEROP_API std::string GetQualifiedCompleteName(TCppType_t klass);
CPPINTEROP_API std::string GetQualifiedCompleteName(TCppScope_t klass);

/// Gets the list of namespaces utilized in the supplied scope.
CPPINTEROP_API std::vector<TCppScope_t> GetUsingNamespaces(TCppScope_t scope);
Expand Down Expand Up @@ -307,13 +308,13 @@ namespace Cpp {

/// Gets the number of Base Classes for the Derived Class that
/// is passed as a parameter.
CPPINTEROP_API TCppIndex_t GetNumBases(TCppType_t klass);
CPPINTEROP_API TCppIndex_t GetNumBases(TCppScope_t klass);

/// Gets a specific Base Class using its index. Typically GetNumBases()
/// is used to get the number of Base Classes, and then that number
/// can be used to iterate through the index value to get each specific
/// base class.
CPPINTEROP_API TCppScope_t GetBaseClass(TCppType_t klass, TCppIndex_t ibase);
CPPINTEROP_API TCppScope_t GetBaseClass(TCppScope_t klass, TCppIndex_t ibase);

/// Checks if the supplied Derived Class is a sub-class of the
/// provided Base Class.
Expand Down Expand Up @@ -496,6 +497,9 @@ namespace Cpp {
/// uniform interface to call it from compiled code.
CPPINTEROP_API JitCall MakeFunctionCallable(TCppConstFunction_t func);

CPPINTEROP_API JitCall MakeFunctionCallable(TInterp_t I,
TCppConstFunction_t func);

/// Checks if a function declared is of const type or not.
CPPINTEROP_API bool IsConstMethod(TCppFunction_t method);

Expand Down
Loading

0 comments on commit 2b580d6

Please sign in to comment.