Now I am trying to develop a compiler.I want a "print" function.It can be used like this:
print(90, "hello world")
Before,I use a list(or vector) to hold the arguments.But now I want to use LLVM.And I don't know how to make llvm ir to call this.In my mind,maybe I should build a dynamic or static library to store my std library,but if I use declare print(...) in llvm ir.I will miss the type infomation.Is there any way to record the type infomation?Or there is any better way.
I will appreciate it if anyone can help me!
Functions with variable number of parameters in LLVM are handled in the same way, as they are handled in C.
To handle it, LLVM IR has special opcodes:
VASTART,VAARG,VACOPYandVAEND, see ISD docs for details.