Mercurial > projects > ldc
comparison gen/todebug.cpp @ 285:297690b5d4a5 trunk
[svn r306] Fixed: it's now possible to compile and link llvmdc with MinGW32 and msys on Win32 :D I tried it myself ;) Building the runtime still needs some work, but it's a step in the right direction.
author | lindquist |
---|---|
date | Sat, 21 Jun 2008 03:14:49 +0200 |
parents | 23d0d9855cad |
children | a34078905d01 |
comparison
equal
deleted
inserted
replaced
284:70c370e97944 | 285:297690b5d4a5 |
---|---|
1 #include "gen/llvm.h" | 1 #include "gen/llvm.h" |
2 #include "llvm/Support/Dwarf.h" | 2 #include "llvm/Support/Dwarf.h" |
3 #include "llvm/CodeGen/MachineModuleInfo.h" | 3 #include "llvm/CodeGen/MachineModuleInfo.h" |
4 #include "llvm/System/Path.h" | |
4 | 5 |
5 #include "declaration.h" | 6 #include "declaration.h" |
6 #include "module.h" | 7 #include "module.h" |
7 #include "mars.h" | 8 #include "mars.h" |
8 | 9 |
134 vals[1] = DBG_CAST(getDwarfAnchor(DW_TAG_compile_unit)); | 135 vals[1] = DBG_CAST(getDwarfAnchor(DW_TAG_compile_unit)); |
135 | 136 |
136 vals[2] = DtoConstUint(DW_LANG_C);// _D)); // doesn't seem to work | 137 vals[2] = DtoConstUint(DW_LANG_C);// _D)); // doesn't seem to work |
137 vals[3] = DtoConstStringPtr(m->srcfile->name->toChars(), "llvm.metadata"); | 138 vals[3] = DtoConstStringPtr(m->srcfile->name->toChars(), "llvm.metadata"); |
138 std::string srcpath(FileName::path(m->srcfile->name->toChars())); | 139 std::string srcpath(FileName::path(m->srcfile->name->toChars())); |
139 if (srcpath.empty()) { | 140 if (srcpath.empty()) |
140 const char* str = get_current_dir_name(); | 141 srcpath = llvm::sys::Path::GetCurrentDirectory().toString(); |
141 assert(str != NULL); | |
142 srcpath = str; | |
143 } | |
144 vals[4] = DtoConstStringPtr(srcpath.c_str(), "llvm.metadata"); | 142 vals[4] = DtoConstStringPtr(srcpath.c_str(), "llvm.metadata"); |
145 vals[5] = DtoConstStringPtr("LLVMDC (http://www.dsource.org/projects/llvmdc)", "llvm.metadata"); | 143 vals[5] = DtoConstStringPtr("LLVMDC (http://www.dsource.org/projects/llvmdc)", "llvm.metadata"); |
146 | 144 |
147 LLGlobalVariable* gv = emitDwarfGlobal(getDwarfCompileUnitType(), vals, "llvm.dbg.compile_unit"); | 145 LLGlobalVariable* gv = emitDwarfGlobal(getDwarfCompileUnitType(), vals, "llvm.dbg.compile_unit"); |
148 m->ir.irModule->dwarfCompileUnit = gv; | 146 m->ir.irModule->dwarfCompileUnit = gv; |