mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-03 16:41:06 +03: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:
parent
e23169d5d8
commit
8b83eda2a2
26 changed files with 2033 additions and 1995 deletions
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();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue