<div dir="ltr">Hi,<div><br></div><div style>I am executing a C program using JIT. When the program exits, the control </div><div style>comes back to my program which initiates the JIT. Now, I want to read </div><div style>
the value(not the LLVM nomenclature) of a global variable (not the LLVM</div><div style>nomenclature). I am able to get the global variable, using the following </div><div style>command:</div><div style>GlobalVariable *my_global = Mod->getNamedGlobal("MY_GLOBAL");<br>
</div><div style><br></div><div style>I want to know the value which was stored in this variable, I use the </div><div style>following command, but it gives error:</div><div style>APInt value = my_global->getValue();<br>
</div><div style><br></div><div style>Error is:</div><div style>llvm/lib/IR/Constants.cpp:1257: llvm::Constant *llvm::Constant::getSplatValue() const: Assertion `this->getType()->isVectorTy() && "Only valid for vectors!"' failed.<br>
</div><div style><br></div><div style><br>I am new to LLVM, so a lot of nomenclature is still not very familiar to me </div><div style>and I am trying to understand it as I go forward.</div><div style><br></div><div style>
Thanks,</div><div style>Varun Agrawal</div></div>