compiler-research / CppInterOp

A Clang-based C++ Interoperability Library
Other
38 stars 20 forks source link

Debug flags passed as extra args are parsed incorrectly #237

Open maximusron opened 2 months ago

maximusron commented 2 months ago

Enabling debugging output using export CPPINTEROP_EXTRA_INTERPRETER_ARGS="-mllvm -debug-only=jitcall" causes the compiler instance creation to fail with:

>>> import cppyy
error: error reading 'new'
1 error generated.
python: llvm-project/clang/include/clang/Frontend/CompilerInstance.h:506: 
clang::Sema& clang::CompilerInstance::getSema() const: Assertion 
`TheSema && "Compiler instance has no Sema object!"' failed.

This is specific to when running cppyy, while running it directly works :

CPPINTEROP_EXTRA_INTERPRETER_ARGS="-mllvm -debug-only=jitcall" 
CppInterOp/build/unittests/CppInterOp/CppInterOpTests --gtest_filter=FunctionReflectionTest.JitCallAdvanced