kou commented on code in PR #45697:
URL: https://github.com/apache/arrow/pull/45697#discussion_r1985999249
##########
cpp/src/gandiva/decimal_ir.cc:
##########
@@ -79,13 +79,22 @@ void DecimalIR::AddGlobals(Engine* engine) {
globalScaleMultipliers->setAlignment(LLVM_ALIGN(16));
}
+#if LLVM_VERSION_MAJOR < 20
+namespace {
+inline llvm::Function* getOrInsertDeclaration(llvm::Module* M,
llvm::Intrinsic::ID id,
+ llvm::ArrayRef<llvm::Type*> Tys)
{
+ return llvm::Intrinsic::getDeclaration(M, id, Tys);
+}
+} // namespace
+#endif
+
// Lookup intrinsic functions
void DecimalIR::InitializeIntrinsics() {
- sadd_with_overflow_fn_ = llvm::Intrinsic::getDeclaration(
+ sadd_with_overflow_fn_ = getOrInsertDeclaration(
Review Comment:
Because we have `llvm::Intrinsic::sadd_with_overflow` in arguments. C++
searches a target function based on argument types. See also:
https://en.cppreference.com/w/cpp/language/adl
--
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]