Displaying 5 results from an estimated 5 matches for "constantarrayval".
2015 Jul 29
1
[LLVMdev] How to get the const argument data from Function?
...ntArray>::const_iterator, it can’t success. But if I get the
raw pointer out of it, the program will simply crash.
While Argument inherits Value, ConstantArray inherits Value as well. But *how
should I cast one into another*? It is worth nothing that, hen I used
getType()->getTypeID(), it is ConstantArrayVal, and that seems to be the
right direction.
Thanks for any help!
- Zhen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150729/9535c88a/attachment.html>
2013 Feb 27
3
[LLVMdev] llvm get annotations
...g name = gv->getName().str();
// assumption: the zeroth operand of a Value::GlobalVariableVal is the
actual Value
//Module* module = ; //can I use Module& llvm::CallGraph::getModule() ?
Value *v = module->getNamedValue(name)->getOperand(0);
if(v->getValueID() == Value::ConstantArrayVal)
{
ConstantArray *ca = (ConstantArray *)v;
std::cout << " argument " << a->getType()->getDescription() << "
"<<a->getName().str()
<< " has annotation \"" << ca->getAsString() <&l...
2013 Mar 01
0
[LLVMdev] llvm get annotations
Hi Sebastian,
Thanks for the response.
I already did this :
I cast the entire annotated expression to Value*. Then, in order to avoid
ugly things like getAsString(), I check if V->getValueID() ==
Value::ConstantArrayVal in order to cast it to ConstantArray. Because it
contains only array[0], I cast array0>getOperand(0) to ConstantStruct.
Therefore, from ConstantStruct you can get all the four operands. Now, as a
TODO, is only to get the names of @f, @str from every field.
But right now I have only a small step...
2013 Mar 01
1
[LLVMdev] llvm get annotations
...druionutdiaconescu at gmail.com> wrote:
>
> Hi Sebastian,
>
> Thanks for the response.
>
> I already did this :
>
> I cast the entire annotated expression to Value*. Then, in order to avoid
> ugly things like getAsString(), I check if V->getValueID() ==
> Value::ConstantArrayVal in order to cast it to ConstantArray. Because it
> contains only array[0], I cast array0>getOperand(0) to ConstantStruct.
> Therefore, from ConstantStruct you can get all the four operands. Now, as
> a TODO, is only to get the names of @f, @str from every field.
>
> But right now...
2013 Feb 28
0
[LLVMdev] how can I parse a Value* ?
...t (i32* @f
to i8*), i8* getelementptr inbounds ([3 x i8]* @.str, i32 0, i32 0), i8*
getelementptr inbounds ([9 x i8]* @.str1, i32 0, i32 0), i32 18 }]
[1 x { i8*, i8*, i8*, i32 }]
2.
errs()<<"\n "<<(V->getValueID())<<"\n";
if(V->getValueID() == Value::ConstantArrayVal) {
ConstantArray *ca = (ConstantArray *)V;
errs()<<"\n "<<(ca[0])<<"\n"; }
RESULT :
[1 x { i8*, i8*, i8*, i32 }] [{ i8*, i8*, i8*, i32 } { i8* bitcast (i32* @f
to i8*), i8* getelementptr inbounds ([3 x i8]* @.str, i32 0, i32 0), i8*
g...