niyue commented on code in PR #38116:
URL: https://github.com/apache/arrow/pull/38116#discussion_r1364165193
##########
cpp/src/gandiva/engine.cc:
##########
@@ -274,6 +277,27 @@ Status Engine::LoadPreCompiledIR() {
return Status::OK();
}
+Status Engine::LoadExternalPreCompiledIR() {
+ auto const& buffers = LLVMExternalIRStore::GetIRBuffers();
+ for (auto const& buffer : buffers) {
+ auto module_or_error = llvm::parseBitcodeFile(buffer->getMemBufferRef(),
*context());
+ if (!module_or_error) {
+ std::string str;
+ llvm::raw_string_ostream stream(str);
+ stream << module_or_error.takeError();
+ return Status::CodeGenError("Failed to parse bitcode file, error: " +
stream.str());
Review Comment:
Thanks for pointing it out, I initially want to avoid the duplicated code
but forgot to do it later. Now I refactor this piece of code further, as well
as the code for module verification and linking to avoid duplicated code here.
Please check it out. Thanks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]