Skip to content

Commit 2b580d6

Browse files
authored
Merge branch 'main' into maximusron/ubu24
2 parents 7b2804c + b2d787b commit 2b580d6

File tree

6 files changed

+132
-103
lines changed

6 files changed

+132
-103
lines changed

.clang-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ IncludeCategories:
1414
- Regex: '^"llvm/'
1515
Priority: 40
1616
- Regex: '^<'
17-
Priority: 50
17+
Priority: 50

.github/workflows/ci.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ jobs:
3434
clang-runtime: '18'
3535
cling: Off
3636
cppyy: On
37-
coverage: true
3837
- name: ubu24-x86-gcc13-clang-repl-17
3938
os: ubuntu-24.04
4039
compiler: gcc-13
@@ -56,7 +55,6 @@ jobs:
5655
cling: On
5756
cling-version: '1.0'
5857
cppyy: On
59-
coverage: true
6058
- name: win2022-msvc-clang-repl-19
6159
os: windows-2022
6260
compiler: msvc
@@ -494,7 +492,6 @@ jobs:
494492
clang-runtime: '18'
495493
cling: Off
496494
cppyy: On
497-
coverage: true
498495
- name: ubu24-x86-gcc13-clang-repl-17-cppyy
499496
os: ubuntu-24.04
500497
compiler: gcc-13

.gitignore

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@
1616
*.dylib
1717
*.dll
1818

19-
# Fortran module files
20-
*.mod
21-
*.smod
22-
2319
# Compiled Static libraries
2420
*.lai
2521
*.la
@@ -36,4 +32,4 @@ build
3632
install
3733

3834
# CLion files
39-
.idea
35+
.idea

CMakeLists.txt

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,6 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
4545
option(USE_CLING "Use Cling as backend" OFF)
4646
option(USE_REPL "Use clang-repl as backend" OFF)
4747

48-
if (USE_CLING)
49-
add_definitions(-DUSE_CLING)
50-
endif()
51-
if (USE_REPL)
52-
add_definitions(-DUSE_REPL)
53-
endif()
54-
5548
if (USE_CLING AND USE_REPL)
5649
message(FATAL_ERROR "We can only use Cling (USE_CLING=On) or Repl (USE_REPL=On), but not both of them.")
5750
endif()
@@ -226,53 +219,60 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
226219
# Fix bug in some AddLLVM.cmake implementation (-rpath "" problem)
227220
set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})
228221

229-
include(AddLLVM)
230-
include(HandleLLVMOptions)
231-
232-
set(CMAKE_INCLUDE_CURRENT_DIR ON)
222+
set( CPPINTEROP_BUILT_STANDALONE 1 )
223+
endif()
233224

234-
# In rare cases we might want to have clang installed in a different place
235-
# than llvm and the header files should be found first (even though the
236-
# LLVM_INCLUDE_DIRS) contain clang headers, too.
237-
if (USE_CLING)
238-
include_directories(SYSTEM ${CLING_INCLUDE_DIRS})
239-
endif(USE_CLING)
240-
include_directories(SYSTEM ${CLANG_INCLUDE_DIRS})
241-
include_directories(SYSTEM ${LLVM_INCLUDE_DIRS})
242-
separate_arguments(LLVM_DEFINITIONS_LIST NATIVE_COMMAND ${LLVM_DEFINITIONS})
243-
add_definitions(${LLVM_DEFINITIONS_LIST})
225+
include(AddLLVM)
226+
include(HandleLLVMOptions)
244227

245-
if (USE_CLING)
246-
message(STATUS "CLING_INCLUDE_DIRS: ${CLING_INCLUDE_DIRS}")
247-
endif(USE_CLING)
248-
message(STATUS "CLANG_INCLUDE_DIRS: ${CLANG_INCLUDE_DIRS}")
249-
message(STATUS "LLVM_INCLUDE_DIRS: ${LLVM_INCLUDE_DIRS}")
250-
message(STATUS "LLVM_DEFINITIONS_LIST: ${LLVM_DEFINITIONS_LIST}")
251-
252-
# If the llvm sources are present add them with higher priority.
253-
if (LLVM_BUILD_MAIN_SRC_DIR)
254-
# LLVM_INCLUDE_DIRS contains the include paths to both LLVM's source and
255-
# build directories. Since we cannot just include ClangConfig.cmake (see
256-
# fixme above) we have to do a little more work to get the right include
257-
# paths for clang.
258-
#
259-
# FIXME: We only support in-tree builds of clang, that is clang being built
260-
# in llvm_src/tools/clang.
261-
include_directories(SYSTEM ${LLVM_BUILD_MAIN_SRC_DIR}/tools/clang/include/)
262-
263-
if (NOT LLVM_BUILD_BINARY_DIR)
264-
message(FATAL "LLVM_BUILD_* values should be available for the build tree")
265-
endif()
228+
set(CMAKE_INCLUDE_CURRENT_DIR ON)
266229

267-
include_directories(SYSTEM ${LLVM_BUILD_BINARY_DIR}/tools/clang/include/)
230+
# In rare cases we might want to have clang installed in a different place
231+
# than llvm and the header files should be found first (even though the
232+
# LLVM_INCLUDE_DIRS) contain clang headers, too.
233+
if (USE_CLING)
234+
add_definitions(-DUSE_CLING)
235+
include_directories(SYSTEM ${CLING_INCLUDE_DIRS})
236+
else()
237+
if (NOT USE_REPL)
238+
message(FATAL_ERROR "We need either USE_CLING or USE_REPL")
239+
endif()
240+
add_definitions(-DUSE_REPL)
241+
242+
endif(USE_CLING)
243+
include_directories(SYSTEM ${CLANG_INCLUDE_DIRS})
244+
include_directories(SYSTEM ${LLVM_INCLUDE_DIRS})
245+
separate_arguments(LLVM_DEFINITIONS_LIST NATIVE_COMMAND ${LLVM_DEFINITIONS})
246+
add_definitions(${LLVM_DEFINITIONS_LIST})
247+
248+
if (USE_CLING)
249+
message(STATUS "CLING_INCLUDE_DIRS: ${CLING_INCLUDE_DIRS}")
250+
endif(USE_CLING)
251+
message(STATUS "CLANG_INCLUDE_DIRS: ${CLANG_INCLUDE_DIRS}")
252+
message(STATUS "LLVM_INCLUDE_DIRS: ${LLVM_INCLUDE_DIRS}")
253+
message(STATUS "LLVM_DEFINITIONS_LIST: ${LLVM_DEFINITIONS_LIST}")
254+
255+
# If the llvm sources are present add them with higher priority.
256+
if (LLVM_BUILD_MAIN_SRC_DIR)
257+
# LLVM_INCLUDE_DIRS contains the include paths to both LLVM's source and
258+
# build directories. Since we cannot just include ClangConfig.cmake (see
259+
# fixme above) we have to do a little more work to get the right include
260+
# paths for clang.
261+
#
262+
# FIXME: We only support in-tree builds of clang, that is clang being built
263+
# in llvm_src/tools/clang.
264+
include_directories(SYSTEM ${LLVM_BUILD_MAIN_SRC_DIR}/tools/clang/include/)
265+
266+
if (NOT LLVM_BUILD_BINARY_DIR)
267+
message(FATAL "LLVM_BUILD_* values should be available for the build tree")
268268
endif()
269269

270-
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/)
271-
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/)
272-
273-
set( CPPINTEROP_BUILT_STANDALONE 1 )
270+
include_directories(SYSTEM ${LLVM_BUILD_BINARY_DIR}/tools/clang/include/)
274271
endif()
275272

273+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/)
274+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/)
275+
276276
## Code Coverage Configuration
277277
add_library(coverage_config INTERFACE)
278278
option(CODE_COVERAGE "Enable coverage reporting" OFF)

include/clang/Interpreter/CppInterOp.h

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ namespace Cpp {
7777
/// function, constructor or destructor.
7878
class JitCall {
7979
public:
80-
friend CPPINTEROP_API JitCall MakeFunctionCallable(TCppConstFunction_t);
80+
friend CPPINTEROP_API JitCall
81+
MakeFunctionCallable(TInterp_t I, TCppConstFunction_t func);
8182
enum Kind : char {
8283
kUnknown = 0,
8384
kGenericCall,
@@ -262,16 +263,16 @@ namespace Cpp {
262263

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

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

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

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

308309
/// Gets the number of Base Classes for the Derived Class that
309310
/// is passed as a parameter.
310-
CPPINTEROP_API TCppIndex_t GetNumBases(TCppType_t klass);
311+
CPPINTEROP_API TCppIndex_t GetNumBases(TCppScope_t klass);
311312

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

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

500+
CPPINTEROP_API JitCall MakeFunctionCallable(TInterp_t I,
501+
TCppConstFunction_t func);
502+
499503
/// Checks if a function declared is of const type or not.
500504
CPPINTEROP_API bool IsConstMethod(TCppFunction_t method);
501505

0 commit comments

Comments
 (0)