ldc/gen/linker.cpp
Tomas Lindquist Olsen 8b83eda2a2 [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.
2008-06-09 09:37:08 +02:00

25 lines
506 B
C++

#include "gen/llvm.h"
#include "llvm/Linker.h"
#include "root.h"
#include "mars.h"
typedef std::vector<llvm::Module*> Module_vector;
void linkModules(llvm::Module* dst, const Module_vector& MV)
{
if (MV.empty())
return;
llvm::Linker linker("llvmdc", dst);
std::string err;
for (Module_vector::const_iterator i=MV.begin(); i!=MV.end(); ++i)
{
if (!linker.LinkInModule(*i, &err))
{
error("%s", err.c_str());
fatal();
}
}
}