-
Notifications
You must be signed in to change notification settings - Fork 35
[interp] Register runtime symbols for clang-repl #726
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
b912765
9c6be69
e8a6b27
740bcb3
4ef7df9
8d91bcd
3c17a65
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -90,6 +90,9 @@ | |||||
| #include <unistd.h> | ||||||
| #endif // WIN32 | ||||||
|
|
||||||
| extern "C" void __clang_Interpreter_SetValueNoAlloc(void* This, void* OutVal, | ||||||
|
||||||
| void* OpaqueType, ...); | ||||||
|
|
||||||
| namespace Cpp { | ||||||
|
|
||||||
| using namespace clang; | ||||||
|
|
@@ -3330,6 +3333,37 @@ | |||||
| } | ||||||
|
|
||||||
| namespace { | ||||||
| #ifndef CPPINTEROP_USE_CLING | ||||||
| static bool DefineAbsoluteSymbol(compat::Interpreter& I, | ||||||
aaronj0 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| const char* linker_mangled_name, | ||||||
| uint64_t address) { | ||||||
|
||||||
| using namespace llvm; | ||||||
| using namespace llvm::orc; | ||||||
|
|
||||||
| llvm::orc::LLJIT& Jit = *compat::getExecutionEngine(I); | ||||||
| llvm::orc::ExecutionSession& ES = Jit.getExecutionSession(); | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: no header providing "llvm::orc::ExecutionSession" is directly included [misc-include-cleaner] lib/CppInterOp/CppInterOp.cpp:41: - #if CLANG_VERSION_MAJOR >= 19
+ #include <llvm/ExecutionEngine/Orc/Core.h>
+ #if CLANG_VERSION_MAJOR >= 19 |
||||||
| JITDylib& DyLib = *Jit.getProcessSymbolsJITDylib().get(); | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. warning: no header providing "llvm::orc::JITDylib" is directly included [misc-include-cleaner] JITDylib& DyLib = *Jit.getProcessSymbolsJITDylib().get();
^ |
||||||
|
|
||||||
| llvm::orc::SymbolMap InjectedSymbols; | ||||||
|
||||||
| auto& DL = compat::getExecutionEngine(I)->getDataLayout(); | ||||||
|
||||||
| auto& DL = compat::getExecutionEngine(I)->getDataLayout(); | |
| const auto& DL = compat::getExecutionEngine(I)->getDataLayout(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: no header providing "llvm::orc::absoluteSymbols" is directly included [misc-include-cleaner]
lib/CppInterOp/CppInterOp.cpp:41:
- #if CLANG_VERSION_MAJOR >= 19
+ #include <llvm/ExecutionEngine/Orc/AbsoluteSymbols.h>
+ #if CLANG_VERSION_MAJOR >= 19
aaronj0 marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: do not use C-style cast to convert between unrelated types [cppcoreguidelines-pro-type-cstyle-cast]
(uint64_t)&__clang_Interpreter_SetValueNoAlloc);
^There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: do not use C-style cast to convert between unrelated types [cppcoreguidelines-pro-type-cstyle-cast]
(uint64_t)&__clang_Interpreter_SetValueNoAlloc);
^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: declaration uses identifier '__clang_Interpreter_SetValueNoAlloc', which is a reserved identifier [bugprone-reserved-identifier]
this fix will not be applied because it overlaps with another fix