comparison gen/linker.cpp @ 244:a95056b3c996 trunk

[svn r261] Fixed debug info for integer and floating local variables, can now be inspected in GDB. Did a lot of smaller cleans up here and there. Replaced more llvm::Foo with LLFoo for common stuff. Split up tollvm.cpp.
author lindquist
date Mon, 09 Jun 2008 09:37:08 +0200
parents
children 21f85bac0b1a
comparison
equal deleted inserted replaced
243:4d006f7b2ada 244:a95056b3c996
1 #include "gen/llvm.h"
2 #include "llvm/Linker.h"
3
4 #include "root.h"
5 #include "mars.h"
6
7 typedef std::vector<llvm::Module*> Module_vector;
8
9 void linkModules(llvm::Module* dst, const Module_vector& MV)
10 {
11 if (MV.empty())
12 return;
13
14 llvm::Linker linker("llvmdc", dst);
15
16 std::string err;
17 for (Module_vector::const_iterator i=MV.begin(); i!=MV.end(); ++i)
18 {
19 if (!linker.LinkInModule(*i, &err))
20 {
21 error("%s", err.c_str());
22 fatal();
23 }
24 }
25 }