[llvm-dev] How to pass a StringRef to a function call inserted as instrumentation?

陳韋任 via llvm-dev
Fri, 28 Apr 2017 23:37:13 -0000

StringRef::str().c_str() or StringRef::data()?

2017-04-29 7:32 GMT+08:00 Dipanjan Das via llvm-dev <llvm-dev at
lists.llvm.org
>:

>
> I am wriitng an LLVM pass to insert instrumentation at certain points of
> the program. I want to pass the `StringRef` obtained from `getName()` as a
> parameter to a function `func(char* s)`. I can allocate some space on stack
> using `AllocaInst` to generate an `alloca` instruction. But, how can I copy
> the `StringRef` to the stack space?
>
> --
>
> Thanks & Regards,
> Dipanjan
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>


--
Wei-Ren Chen (陳韋任)
Homepage: https://people.cs.nctu.edu.tw/~chenwj
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20170429/9cccca0c/attachment.html>