<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>How is this done? Everything logical I have
tried has failed, here was one attempt:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> Constant *C = (Constant*)
ConstantArray::get(inst2string(I)); //fucnction defined
elsewhere</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>//generates a correct Global string</FONT></DIV>
<DIV><FONT face=Arial size=2> GlobalVariable *str = new
GlobalVariable(C->getType(), true,
<BR> GlobalValue::InternalLinkage,
<BR> C, mkStrName( strNumber++ ),
&M);<BR> </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> std::vector<Value*>
params; //params to
a CallInst<BR> std::vector<Value*> indices;
//indices to gep<BR> indices.push_back((Value*)
(ConstantInt::get(Type::IntTy,
0)));<BR> indices.push_back((Value*)
(ConstantInt::get(Type::IntTy, 0)));<BR> Constant *gep =
ConstantExpr::getGetElementPtr( (Constant*) str,
indices);<BR> params.push_back((Value*) gep );</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> </FONT><FONT face=Arial
size=2> CallInst *CI = new CallInst(printf, params, std::string(""),
I);<BR></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> This resulted in a "no such type plane"
assertion. Currently I am doing this as two seperate instructions, which
works, but slows down the rest of my pass.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>~Patrick</DIV></FONT></BODY></HTML>