<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 10/17/13 8:42 AM, Eirini Psallida
wrote:<br>
</div>
<blockquote
cite="mid:CANiXDLVXcCJ6aLC8zZiX6G2GPHWcAktnbdLRpYfhdsArCMP8Hw@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<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 moz-do-not-send="true"
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>
</div>
</div>
</blockquote>
<br>
ConstantArray is a subclass of Constant. Constant, in turn, has a
method called getAggregateElement() that will return the Constant *
value at the specified offset within the aggregate constant (be it
an array, vector, etc.).<br>
<br>
For more information, consult the Constant class doxygen page:<br>
<br>
<a class="moz-txt-link-freetext" href="http://llvm.org/doxygen/classllvm_1_1Constant.html">http://llvm.org/doxygen/classllvm_1_1Constant.html</a><br>
<br>
-- John T.<br>
<br>
</body>
</html>