mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-27 00:53:23 +01:00
[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.
This commit is contained in:
25
gen/linker.cpp
Normal file
25
gen/linker.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user