<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:10pt;color:#000000;"><div>Hi LLVM devs,<br><br>I work on a pass that creates multiple versions of a code region and switches between them. The decision about the version to be selected is taken by an external runtime system. I insert callbacks to this system in my code to pass the control of the execution.  All callbacks are written in inline assembly, in macros. <br>The problem comes when I need to send some information from the runtime system, back to the code. <br>I create one local variable : <br><br>lim = new AllocaInst(.......); <br><br>and I want the value of %lim to be set by the runtime system. For this, I want to create a macro that takes as parameter the address of this variable, such that the runtime system can put the value it computes in this address, at runtime. (Similar to sending a parameter
 by reference. )<br>If I send the address of the  Value* lim as a param to the macro, it puts the hardcoded address (as expected).  <br><br>std::stringstream out;<br>out.str(std::string()); out << &lim;<br><br><br>InlineAsm* IA = InlineAsm::get(asmFuncTy,   "camus_macro_decision" + out.str()   , "=r", true);<br>CallInst* cmp = CallInst::Create(IA,  ...);<br><br>creates the call:   <br>camus_macro_decision   0x7fffdf3172f0<br><br>I tried also by creating a pointer to the Value* lim, without any success.<br><br>I know this is not the good approach, but can you suggest a solution to retrieve information from the macro?<br><br>Thank you,<br>Alexandra<br></div>



</div></body></html>