Displaying 1 result from an estimated 1 matches for "constint1".
Did you mean:
constint
2020 Jan 14
2
sizeof implementation: how to get size as a constantInt?
...id as
http://nondot.org/sabre/LLVMNotes/SizeOf-OffsetOf-VariableSizedStructs.txt
illuarstrated,
and it works find, here's an example of my implementation:
auto *p = builder.CreateGEP(structTy,
llvm::ConstantPointerNull::get(pointerTy),
constint1);
auto *size = builder.CreatePtrToInt(p, llvm::IntegerType::get(context,
64));
and type definitions:
auto *constint1 = llvm::ConstantInt::get(context, llvm::APInt(64, 1));
auto *int64Ty = llvm::IntegerType::get(context, 64);
auto *doubleTy = llvm::Type::getDoubleTy(context);
auto *structTy = ll...