<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">IRBuilder -> CreateGlobalStringPtr<br><br><div id="AppleMailSignature">Zhang</div><div><br>在 2018年7月27日,10:54,SANGEETA CHOWDHARY via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> 写道:<br><br></div><blockquote type="cite"><div><div dir="ltr"><span style="color:rgb(0,0,0);font-family:Helvetica;font-size:14px">Hi,</span><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px"><span style="font-size:14px"><br></span></div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px">I am trying to pass name of the file to external function but I am not able to figure out how I can do it. Below is the code -</div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px"><br></div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px"><div style="margin:0px;font-stretch:normal;line-height:normal;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(52,188,38)">auto</span><span style="font-variant-ligatures:no-common-ligatures"><span class="gmail-Apple-converted-space"> </span>*Scope = cast<DIScope>(Loc->getScope());</span></div><div style="margin:0px;font-stretch:normal;line-height:normal;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures"> StringRef fileName  = Scope->getFilename();</span></div><div style="margin:0px;font-stretch:normal;line-height:normal;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures"> errs()<<</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(195,55,32)">"fileName:"</span><span style="font-variant-ligatures:no-common-ligatures"><<fileName<<</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(195,55,32)">"</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(213,59,211)">\n</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(195,55,32)">"</span><span style="font-variant-ligatures:no-common-ligatures">;</span></div><p style="margin:0px;font-stretch:normal;line-height:normal;background-color:rgb(255,255,255);min-height:21px"><span style="font-variant-ligatures:no-common-ligatures"> </span><br class="gmail-webkit-block-placeholder"></p><div style="margin:0px;font-stretch:normal;line-height:normal;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures"> Finish = M->getOrInsertFunction(</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(195,55,32)">"finish"</span><span style="font-variant-ligatures:no-common-ligatures">,<span class="gmail-Apple-converted-space"> </span></span><span style="font-variant-ligatures:no-common-ligatures;background-color:rgb(230,230,0)">VoidTy</span><span style="font-variant-ligatures:no-common-ligatures">);</span></div><div style="margin:0px;font-stretch:normal;line-height:normal;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures"> IRB.CreateCall(Finish, {}); </span></div></div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures"><br></span></div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures">How should I pass </span>fileName to “finish” call?</div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;margin:0px;font-stretch:normal;line-height:normal"><br></div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;margin:0px;font-stretch:normal;line-height:normal">Regards,</div><div style="color:rgb(0,0,0);font-family:Helvetica;font-size:12px;margin:0px;font-stretch:normal;line-height:normal">Sangeeta</div><br></div>

</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>LLVM Developers mailing list</span><br><span><a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a></span><br><span><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a></span><br></div></blockquote></body></html>