search for: gcdmain

Displaying 4 results from an estimated 4 matches for "gcdmain".

Did you mean: dmain
2011 Aug 31
2
[LLVMdev] How to place call(s) to functions found in other llvm modules ???
Hi, I tried this as well, using the following line to add function declaration to the caller module. Function::Create(FT, Function::ExternalLinkage, "gcd", mod); Where "FT" is the same as before. And the output produced by the PrintModulePass becomes: ; ModuleID = 'GCDMain' declare i32 @gcd(i32, i32) define i32 @main() { EntryBlock: %tmp = call i32 @gcd(i32 30, i32 50) ret i32 %tmp } But it still fails to WriteBitcodeToFile, and produces the same error as before. I guess I might be missing some attribute, like "extern" in C ... Any Comments?...
2011 Aug 31
2
[LLVMdev] How to place call(s) to functions found in other llvm modules ???
...tion of a function, gcd in this example and another module contains a call to this function. My example is based on the following tutorial, with a few changes. http://llvm.org/releases/2.6/docs/tutorial/JITTutorial2.html When I execute the verifier pass on my modules, it complains that the 'GCDMain' module is malformed and aborts when I try to write this module as a bitcode file. Here is the output of my example. ---------------------------------------------------------------------- Referencing function in another module! %tmp = call i32 @gcd(i32 30, i32 50) Instruction does not dom...
2011 Aug 31
0
[LLVMdev] How to place call(s) to functions found in other llvm modules ???
...g the following line to add function declaration > to the caller module. > > Function::Create(FT, Function::ExternalLinkage, "gcd", mod); > > Where "FT" is the same as before. And the output produced by the > PrintModulePass becomes: > > ; ModuleID = 'GCDMain' > > declare i32 @gcd(i32, i32) > > define i32 @main() { > EntryBlock: >  %tmp = call i32 @gcd(i32 30, i32 50) >  ret i32 %tmp > } > > But it still fails to WriteBitcodeToFile, and produces the same error as > before. If you're still getting the "Refer...
2011 Aug 31
0
[LLVMdev] How to place call(s) to functions found in other llvm modules ???
On Wed, Aug 31, 2011 at 10:00 AM, Mian M. Hamayun <mian-muhammad.hamayun at imag.fr> wrote: > Hello Everyone, > > I am trying to create two modules in LLVM, where first module contains the > definition of a function, gcd in this example and another module contains a > call to this function. You can't reference a global in one module in another module. Either stick with