Heming Cui
2010-Mar-24 22:08 UTC
[LLVMdev] How to add extern function declaratioin to llvm bc?
Dear all, I am wondering if there is some API to add extern function declaration to bc file. For example, as given below, I want to add the line "extern void foo();" to my bc file with some llvm methods, how can I do this, please? extern void foo(); // the llvm bc code is: declare void @_Z3foov(). How can I add this line to llvm bc using some llvm methods? int main() { foo(); } -- Regards, Heming Cui -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100324/066a7274/attachment.html>
Jeffrey Yasskin
2010-Mar-25 04:24 UTC
[LLVMdev] How to add extern function declaratioin to llvm bc?
Module *M = ...; Function *foo = Function::Create( TypeBuilder<void(), false>::get(), GlobalValue::ExternalLinkage, "_Z3foov", M); // foo is now owned by M. On Wed, Mar 24, 2010 at 3:08 PM, Heming Cui <hc2428 at columbia.edu> wrote:> Dear all, > I am wondering if there is some API to add extern function declaration > to bc file. For example, as given below, I want to add the line "extern void > foo();" to my bc file with some llvm methods, how can I do this, please? > > > extern void foo(); // the llvm bc code is: declare void > @_Z3foov(). How can I add this line to llvm bc using some llvm > methods? > > int main() { > foo(); > } > > -- > Regards, > Heming Cui > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >
Seemingly Similar Threads
- [LLVMdev] Is it possible to map an LLVM instruction to x86 assembly instructions?
- [LLVMdev] How does JIT/lli work with bc file?
- [LLVMdev] How does JIT/lli work with bc file?
- [LLVMdev] How does JIT/lli work with bc file?
- [LLVMdev] How does JIT/lli work with bc file?