[llvm-dev] How to pass StringRef or std::string type to external function

mayuyu.io via llvm-dev llvm-dev at lists.llvm.org
Thu Jul 26 20:08:37 PDT 2018


IRBuilder -> CreateGlobalStringPtr

Zhang

> 在 2018年7月27日,10:54,SANGEETA CHOWDHARY via llvm-dev <llvm-dev at lists.llvm.org> 写道:
> 
> Hi,
> 
> 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 -
> 
>  auto *Scope = cast<DIScope>(Loc->getScope());
>  StringRef fileName  = Scope->getFilename();
>  errs()<<"fileName:"<<fileName<<"\n";
>  
>  Finish = M->getOrInsertFunction("finish", VoidTy);
>  IRB.CreateCall(Finish, {}); 
> 
> How should I pass fileName to “finish” call?
> 
> Regards,
> Sangeeta
> 
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180727/9246b5bb/attachment.html>


More information about the llvm-dev mailing list