Skip to content

Commit 8a3748c

Browse files
committed
Improve formatting, readability and add newlines
1 parent 27847e4 commit 8a3748c

15 files changed

+19
-29
lines changed

.codecov.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ parsers:
2222
comment:
2323
layout: "reach, diff, flags, tree, files"
2424
behavior: default
25-
require_changes: no
25+
require_changes: no

.readthedocs.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ build:
1313
- cmake
1414
- libclang-13-dev
1515
- llvm-13-dev
16-
- llvm-13-tools
16+
- llvm-13-tools

CMakeLists.txt

+5-15
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
6666

6767
include(GNUInstallDirs)
6868
## Define supported version of clang and llvm
69-
7069
set(CLANG_MIN_SUPPORTED 13.0)
7170
set(CLANG_MAX_SUPPORTED "19.1.x")
7271
set(CLANG_VERSION_UPPER_BOUND 20.0.0)
@@ -78,12 +77,10 @@ include(GNUInstallDirs)
7877
set(LLVM_VERSION_UPPER_BOUND 20.0.0)
7978

8079
## Set Cmake packages search order
81-
8280
set(CMAKE_FIND_PACKAGE_SORT_ORDER NATURAL)
8381
set(CMAKE_FIND_PACKAGE_SORT_DIRECTION DEC)
8482

8583
## Search packages HINTS and PATHS
86-
8784
if (DEFINED LLVM_DIR)
8885
set(llvm_search_hints PATHS ${LLVM_DIR} HINTS "${LLVM_DIR}/lib/cmake/llvm" "${LLVM_DIR}/cmake" "${LLVM_CONFIG_EXTRA_PATH_HINTS}")
8986
set(clang_search_hints PATHS ${LLVM_DIR} HINTS "${LLVM_DIR}/lib/cmake/clang" "${LLVM_DIR}/cmake")
@@ -102,7 +99,6 @@ include(GNUInstallDirs)
10299
endif()
103100

104101
## Find supported LLVM
105-
106102
if (CPPINTEROP_USE_CLING)
107103
message(STATUS "Mode CPPINTEROP_USE_CLING = ON")
108104
find_package(LLVM REQUIRED CONFIG ${llvm_search_hints} NO_DEFAULT_PATH)
@@ -154,8 +150,7 @@ include(GNUInstallDirs)
154150
message(STATUS "Found supported version: LLVM ${LLVM_PACKAGE_VERSION}")
155151
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
156152

157-
## Find supported LLD only while building for webassembly against emscripten
158-
153+
## Find supported LLD only while building for webassembly against emscripten
159154
if(EMSCRIPTEN)
160155
if (DEFINED LLD_VERSION)
161156
if (LLD_VERSION VERSION_GREATER_EQUAL LLD_VERSION_UPPER_BOUND)
@@ -194,7 +189,6 @@ if(EMSCRIPTEN)
194189
endif()
195190

196191
## Find supported Clang
197-
198192
if (DEFINED CLANG_VERSION)
199193
if (CLANG_VERSION VERSION_GREATER_EQUAL CLANG_VERSION_UPPER_BOUND)
200194
set(CLANG_VERSION ${CLANG_VERSION_UPPER_BOUND})
@@ -236,19 +230,18 @@ endif()
236230
set (CMAKE_CXX_STANDARD 17)
237231
endif()
238232
if (CMAKE_CXX_STANDARD LESS 17)
239-
message(fatal "LLVM/CppInterOp requires c++17 or later")
233+
message(fatal "LLVM/CppInterOp requires C++17 or later")
240234
endif()
241235
elseif (CLANG_VERSION_MAJOR GREATER_EQUAL 13)
242236
if (NOT CMAKE_CXX_STANDARD)
243237
set (CMAKE_CXX_STANDARD 14)
244238
endif()
245239
if (CMAKE_CXX_STANDARD LESS 14)
246-
message(fatal "LLVM/CppInterOp requires c++14 or later")
240+
message(fatal "LLVM/CppInterOp requires C++14 or later")
247241
endif()
248242
endif()
249243

250244
## Find supported Cling
251-
252245
if (CPPINTEROP_USE_CLING)
253246
if (NOT Cling_FOUND AND DEFINED Cling_DIR)
254247
find_package(Cling REQUIRED CONFIG ${cling_extra_hints} NO_DEFAULT_PATH)
@@ -274,8 +267,6 @@ endif()
274267
# For consistency we should set it to the correct value.
275268
set(LLVM_CONFIG_HAS_RTTI NO CACHE BOOL "" FORCE)
276269

277-
## Init
278-
279270
# In case this was a path to a build folder of llvm still try to find AddLLVM
280271
list(APPEND CMAKE_MODULE_PATH "${LLVM_DIR}")
281272

@@ -352,7 +343,7 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT MSVC_IDE )
352343
"`CMakeFiles'. Please delete them.")
353344
endif()
354345

355-
# Add appropriate flags for GCC
346+
## Add appropriate flags for GCC
356347
if (LLVM_COMPILER_IS_GCC_COMPATIBLE)
357348
if (APPLE OR EMSCRIPTEN)
358349
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-common -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings")
@@ -383,7 +374,7 @@ include_directories(BEFORE SYSTEM
383374
${CMAKE_CURRENT_SOURCE_DIR}/include
384375
)
385376

386-
#Removes flag due to issue with Google test download when LLVM_ENABLE_WERROR=On
377+
# Removes flag due to issue with Google test download when LLVM_ENABLE_WERROR=On
387378
string(REPLACE "-Wcovered-switch-default" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
388379

389380
file(STRINGS "VERSION" CPPINTEROP_VERSION)
@@ -406,7 +397,6 @@ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/CppInterOp/
406397
PATTERN "*.cmake"
407398
)
408399

409-
410400
install(DIRECTORY include/
411401
DESTINATION include
412402
FILES_MATCHING

docs/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/conf.py
2828
create_sphinx_target(
2929
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}
3030
TARGET_NAME sphinx-cppinterop
31-
)
31+
)

docs/FAQ.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ languages, which can make your applications more powerful and flexible.
2121

2222
- Installation And Usage Guide-:doc:`Installation and usage <InstallationAndUsage>`
2323

24-
- Tutorials-:doc:`Tutorials <tutorials>`
24+
- Tutorials-:doc:`Tutorials <tutorials>`

docs/reference.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ https: //www.boost.org/doc/libs/1_65_1/libs/python/doc/html/reference/index.html
3636
https://bitbucket.org/wlav/cppyy/issues/369/template-instantiation-not-happening-in (Visited August 2021).
3737

3838
[14] Extend clang AST to provide information for the type as written in template instantiations,
39-
https://llvm.org/OpenProjects.html#clang-template-instantiation-sugar (Visited August 2021).
39+
https://llvm.org/OpenProjects.html#clang-template-instantiation-sugar (Visited August 2021).

docs/tutorials.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -301,4 +301,4 @@ be under the extern C for the compiler to know the C++ code within.
301301
302302
303303
The complete example can found below:
304-
`Example <https://github.com/compiler-research/pldi-tutorials-2023/blob/main/examples/p3-ex4/p3-ex4.c>`_.
304+
`Example <https://github.com/compiler-research/pldi-tutorials-2023/blob/main/examples/p3-ex4/p3-ex4.c>`_.

environment-wasm.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ dependencies:
88
- xeus
99
- cpp-argparse
1010
- pugixml
11-
- doctest
11+
- doctest

include/clang-c/CXCppInterOp.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -370,4 +370,4 @@ CINDEX_LINKAGE void clang_destruct(CXObject This, CXScope S, bool withFree);
370370
LLVM_CLANG_C_EXTERN_C_END
371371

372372
#endif // LLVM_CLANG_C_CXCPPINTEROP_H
373-
// NOLINTEND()
373+
// NOLINTEND()

lib/Interpreter/CXCppInterOp.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -612,4 +612,4 @@ void Destruct(compat::Interpreter& interp, TCppObject_t This,
612612

613613
void clang_destruct(CXObject This, CXScope S, bool withFree) {
614614
Cpp::Destruct(*getInterpreter(S), This, getDecl(S), withFree);
615-
}
615+
}

lib/Interpreter/exports.ld

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@
4848
-Wl,--export=_ZNK5clang17ClassTemplateDecl18getSpecializationsEv
4949
-Wl,--export=_ZNK5clang4Sema15getStdNamespaceEv
5050
-Wl,--export=__clang_Interpreter_SetValueNoAlloc
51-
-Wl,--export=__clang_Interpreter_SetValueWithAlloc
51+
-Wl,--export=__clang_Interpreter_SetValueWithAlloc

unittests/CppInterOp/EnumReflectionTest.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -357,4 +357,4 @@ TEST(EnumReflectionTest, GetEnums) {
357357
EXPECT_TRUE(std::find(enumNames2.begin(), enumNames2.end(), "Months") != enumNames2.end());
358358
EXPECT_TRUE(std::find(enumNames3.begin(), enumNames3.end(), "Color") != enumNames3.end());
359359
EXPECT_TRUE(enumNames4.empty());
360-
}
360+
}

unittests/CppInterOp/FunctionReflectionTest.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1847,4 +1847,4 @@ TEST(FunctionReflectionTest, UndoTest) {
18471847
EXPECT_EQ(ret, 1);
18481848
#endif
18491849
#endif
1850-
}
1850+
}

unittests/CppInterOp/Utils.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ void dispose_string(CXString string) {
6868

6969
CXScope make_scope(const clang::Decl* D, const CXInterpreter I) {
7070
return {CXCursor_UnexposedDecl, 0, {D, nullptr, I}};
71-
}
71+
}

unittests/CppInterOp/main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
int main(int argc, char** argv) {
44
::testing::InitGoogleTest(&argc, argv);
55
return RUN_ALL_TESTS();
6-
}
6+
}

0 commit comments

Comments
 (0)