SANGEETA CHOWDHARY via llvm-dev
2018-Jul-27 02:54 UTC
[llvm-dev] How to pass StringRef or std::string type to external function
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 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180726/8947bbeb/attachment.html>
mayuyu.io via llvm-dev
2018-Jul-27 03:08 UTC
[llvm-dev] How to pass StringRef or std::string type to external function
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>