search for: firstop

Displaying 3 results from an estimated 3 matches for "firstop".

Did you mean: firstep
2012 Jan 28
1
[LLVMdev] How to get the string value?
Hey Duncan, Thanks! I figured out this piece of code finally: Value *gep = call->getArgOperand(0); if ( ConstantExpr *pCE = dyn_cast<ConstantExpr>(gep) ) { Value *firstop = pCE->getOperand(0); if (GlobalVariable *GV = dyn_cast<GlobalVariable>(firstop)){ Constant *v = GV->getInitializer(); if (ConstantArray *CA = dyn_cast<ConstantArray>(v)) { StringRef portName(CA->getAsString()); T...
2012 Jan 28
0
[LLVMdev] How to get the string value?
Hi Welson, > Yes, it is a ConstantExpr! Thank you! > > Now trying to find a clue in ConstantExpr's functions to get that string :-) you can get the pointer operand by doing: getOperand(0) The i'th index is getOperand(i+1). Ciao, Duncan. > > Regards, > Welson > > On Thu, Jan 26, 2012 at 9:04 PM, Duncan Sands <baldrick at free.fr > <mailto:baldrick at
2012 Jan 27
3
[LLVMdev] How to get the string value?
Thanks Duncan, Yes, it is a ConstantExpr! Thank you! Now trying to find a clue in ConstantExpr's functions to get that string :-) Regards, Welson On Thu, Jan 26, 2012 at 9:04 PM, Duncan Sands <baldrick at free.fr> wrote: > Hi Welson Sun, > > > Hi, if I have some LLVM code like this: > > > > @.str = private unnamed_addr constant [7 x i8]