MCPcopy Create free account
hub / github.com/apache/kudu / GetPointerValue

Method GetPointerValue

src/kudu/codegen/module_builder.cc:203–213  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201}
202
203Value* ModuleBuilder::GetPointerValue(void* ptr) const {
204 CHECK_EQ(state_, kBuilding);
205 // No direct way of creating constant pointer values in LLVM, so
206 // first a constant int has to be created and then casted to a pointer
207 IntegerType* llvm_uintptr_t = Type::getIntNTy(*context_, 8 * sizeof(ptr));
208 uintptr_t int_value = reinterpret_cast<uintptr_t>(ptr);
209 ConstantInt* llvm_int_value = ConstantInt::get(llvm_uintptr_t,
210 int_value, false);
211 Type* llvm_ptr_t = Type::getInt8PtrTy(*context_);
212 return ConstantExpr::getIntToPtr(llvm_int_value, llvm_ptr_t);
213}
214
215
216void ModuleBuilder::AddJITPromise(llvm::Function* llvm_f,

Callers 1

MakeProjectionFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected