<div dir="ltr"><div><div><div><div>Hello, <br>i parse the llvm IR (llvm-3.3 version) and when i meet a constant, i want to get it's value.<br></div>eg i32 5, i want to get the 5.<br></div>I am interested in ConstantInt-ConstantFP-ConstantArray-ConstantStruct subclasses.<br>
</div>Things are a bit easier with ConstantInt and ConstantFP constants but how <br>could i get the value of a ConstantArray?<br></div><div>The <a href="http://llvm.org/docs/ProgrammersManual.html#the-constant-class-and-subclasses">http://llvm.org/docs/ProgrammersManual.html#the-constant-class-and-subclasses</a> <br>
</div><div>says:<br>ConstantArray : This represents a constant array.<br>const std::vector<Use> &getValues() const: Returns a vector of
component constants that makeup this array.<br>But i cannot find this method, i think that it is not implemented in the 3.3 version.<br>There is the method 'Value::print()' but this gives me also the type which is not what i want.<br>
</div><div>I found also the 'static void WriteConstantInternal()' method in llvm/lib/IR/AsmWriter.cpp which is called <br>by 'Value::print()' but it is 'static' so i cannot access it. I need something like the 'WriteConstantInternal' method.<br>
</div><div>Any ideas?<br><br></div><div>Thanks <br><br></div><div>Eirini<br></div><div><br></div></div>