0

I am writing an LLVM2.9 Function pass that inserts an instruction calling an external function that accepts a c string as an argument.

The c string that I want passed to the external function is generated at the beginning of the function pass.

Generally to pass values to the external function, I simply add their type to the CallInst argument list, and then insert the specific value I want when I actually create the CallInst. I am finding this difficult to do with a string.

Any tips?

Sam Coulter
  • 708
  • 1
  • 6
  • 27
  • 1
    What, exactly, are you having difficulty with? Also, I recommend taking a look at these two related questions: [how to create a string value](http://stackoverflow.com/questions/8377735/llvm-string-objects) and [passing a string to a function](http://stackoverflow.com/questions/1061753/how-can-i-implement-a-string-data-type-in-llvm). – Oak Jun 27 '13 at 18:35
  • That second link answered all my questions. It was really just a case of not being able to find the right documentation! Thank you for your quick answer. – Sam Coulter Jun 27 '13 at 18:48

0 Answers0