Allocate a class member variable and store in it

Hi

I am working on Clang CodeGen to modify the class constructor LLVM IR. I want to create a class member variable for every class and store a randomly generated constant int onto it. My first question is how is it possible to allocate the space for a class member variable when constructor IR is building (I know where to do it)? Second, How can I use Builder.CreateStore to store some constantI nt (I know how to create it) to that member variable? I have tried to follow the initializeVtablePointer() code to understand how class vptr is being allocated and stored, but it is too complicated. Moreover, I don’t need to a pointer like vptr, but just a simple member variable to hold a constant int. Can you suggest me how to resolve these two issues?