Skip to content

Commit df7264a

Browse files
committed
Enable the CppInterOp library
[CppInterOp](https://github.com/compiler-research/CppInterOp) exposes API from Clang and LLVM in a mostly backward compatibe way. The API support downstream tools that utilize interactive C++ by using the compiler as a service. Adopting more of CppInterOp in ROOT will help simplify the LLVM migration process and allow us to upstream more patches to either CppInterOp or LLVM.
1 parent 3dbc5f7 commit df7264a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+20156
-0
lines changed

Diff for: interpreter/CMakeLists.txt

+18
Original file line numberDiff line numberDiff line change
@@ -599,3 +599,21 @@ mark_as_advanced(FORCE BUG_REPORT_URL BUILD_CLANG_FORMAT_VS_PLUGIN BUILD_SHARED_
599599
C_INCLUDE_DIRS DEFAULT_SYSROOT FFI_INCLUDE_DIR FFI_LIBRARY_DIR
600600
GCC_INSTALL_PREFIX LIBCLANG_BUILD_STATIC TOOL_INFO_PLIST)
601601
mark_as_advanced(CLEAR LLVM_ENABLE_ASSERTIONS LLVM_BUILD_TYPE)
602+
603+
604+
##################### LIBINTEROP ###########################
605+
# Set the paths to Cling, Clang, and LLVM directories
606+
607+
608+
set(LLVM_DIR "${CMAKE_BINARY_DIR}/interpreter/llvm-project/llvm/lib/cmake/llvm")
609+
set(Clang_DIR "${CMAKE_BINARY_DIR}/interpreter/llvm-project/llvm/tools/clang/lib/cmake/clang")
610+
set(Cling_DIR "${CMAKE_BINARY_DIR}/interpreter/cling")
611+
set(CPPINTEROP_INCLUDE_DIRS
612+
${CMAKE_SOURCE_DIR}/interpreter/CppInterOp/include
613+
CACHE STRING "CppInterOp include directories.")
614+
615+
616+
set(USE_CLING ON CACHE BOOL "Use Cling as backend" FORCE)
617+
set(USE_REPL OFF CACHE BOOL "Use Clang-repl as backend" FORCE)
618+
619+
add_subdirectory(CppInterOp)

Diff for: interpreter/CppInterOp/.clang-format

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
BasedOnStyle: LLVM
2+
3+
Language: Cpp
4+
Standard: Cpp11
5+
PointerAlignment: Left
6+
7+
IncludeCategories:
8+
- Regex: '^"[^/]+\"'
9+
Priority: 10
10+
- Regex: '^"cling/'
11+
Priority: 20
12+
- Regex: '^"clang/'
13+
Priority: 30
14+
- Regex: '^"llvm/'
15+
Priority: 40
16+
- Regex: '^<'
17+
Priority: 50

Diff for: interpreter/CppInterOp/.clang-tidy

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
Checks: >
2+
-*,
3+
bugprone-*,
4+
clang-diagnostic-*,
5+
clang-analyzer-*,
6+
cppcoreguidelines-*,
7+
llvm-*,
8+
misc-*,
9+
modernize-*,
10+
performance-*,
11+
portability-*,
12+
readability-*,
13+
-bugprone-narrowing-conversions,
14+
-bugprone-easily-swappable-parameters,
15+
-bugprone-implicit-widening-of-multiplication-result,
16+
-bugprone-unchecked-optional-access,
17+
-misc-const-correctness,
18+
-misc-unused-parameters,
19+
-misc-non-private-member-variables-in-classes,
20+
-misc-no-recursion,
21+
-misc-use-anonymous-namespace,
22+
-modernize-return-braced-init-list,
23+
-modernize-use-trailing-return-type,
24+
-readability-braces-around-statements,
25+
-readability-identifier-length,
26+
-readability-implicit-bool-conversion,
27+
-readability-magic-numbers,
28+
-readability-named-parameter,
29+
-readability-function-cognitive-complexity,
30+
-readability-redundant-access-specifiers,
31+
-cppcoreguidelines-avoid-magic-numbers,
32+
-cppcoreguidelines-init-variables,
33+
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
34+
-cppcoreguidelines-pro-type-member-init,
35+
-llvm-namespace-comment
36+
37+
CheckOptions:
38+
- key: readability-identifier-naming.ClassCase
39+
value: aNy_CasE
40+
- key: readability-identifier-naming.FunctionCase
41+
value: aNy_CasE
42+
- key: readability-identifier-naming.MemberCase
43+
value: aNy_CasE
44+
- key: readability-identifier-naming.ParameterCase
45+
value: aNy_CasE
46+
- key: readability-identifier-naming.UnionCase
47+
value: CamelCase
48+
- key: readability-identifier-naming.VariableCase
49+
value: aNy_CasE
50+
- key: readability-identifier-naming.IgnoreMainLikeFunctions
51+
value: 1
52+
- key: cppcoreguidelines-avoid-magic-numbers.IgnoreMacros
53+
value: 1
54+
- key: cppcoreguidelines-pro-bounds-pointer-arithmetic.Pessimistic
55+
value: 1
56+
- key: cppcoreguidelines-pro-type-member-init.InitWithEquals
57+
value: 1
58+
- key: llvm-namespace-comment.Spaces
59+
value: 2

Diff for: interpreter/CppInterOp/.codecov.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
codecov:
2+
require_ci_to_pass: no
3+
4+
coverage:
5+
precision: 2
6+
round: down
7+
range: "70...100"
8+
9+
status:
10+
project: yes
11+
patch: yes
12+
changes: no
13+
14+
parsers:
15+
gcov:
16+
branch_detection:
17+
conditional: yes
18+
loop: yes
19+
method: no
20+
macro: no
21+
22+
comment:
23+
layout: "reach, diff, flags, tree, files"
24+
behavior: default
25+
require_changes: no

Diff for: interpreter/CppInterOp/.gitignore

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Prerequisites
2+
*.d
3+
4+
# Compiled Object files
5+
*.slo
6+
*.lo
7+
*.o
8+
*.obj
9+
10+
# Precompiled Headers
11+
*.gch
12+
*.pch
13+
14+
# Compiled Dynamic libraries
15+
*.so
16+
*.dylib
17+
*.dll
18+
19+
# Fortran module files
20+
*.mod
21+
*.smod
22+
23+
# Compiled Static libraries
24+
*.lai
25+
*.la
26+
*.a
27+
*.lib
28+
29+
# Executables
30+
*.exe
31+
*.out
32+
*.app
33+
34+
# Directories
35+
build
36+
install
37+
38+
# CLion files
39+
.idea

Diff for: interpreter/CppInterOp/.readthedocs.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 2
2+
3+
sphinx:
4+
configuration: docs/conf.py
5+
builder: html
6+
7+
build:
8+
os: "ubuntu-22.04"
9+
tools:
10+
python: "3.11"
11+
apt_packages:
12+
- clang-13
13+
- cmake
14+
- libclang-13-dev
15+
- llvm-13-dev
16+
- llvm-13-tools

0 commit comments

Comments
 (0)