Mercurial > projects > ldc
diff 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 |
line wrap: on
line diff
--- a/gen/todebug.cpp Sat Jun 21 02:48:53 2008 +0200 +++ b/gen/todebug.cpp Sat Jun 21 03:14:49 2008 +0200 @@ -1,6 +1,7 @@ #include "gen/llvm.h" #include "llvm/Support/Dwarf.h" #include "llvm/CodeGen/MachineModuleInfo.h" +#include "llvm/System/Path.h" #include "declaration.h" #include "module.h" @@ -136,11 +137,8 @@ vals[2] = DtoConstUint(DW_LANG_C);// _D)); // doesn't seem to work vals[3] = DtoConstStringPtr(m->srcfile->name->toChars(), "llvm.metadata"); std::string srcpath(FileName::path(m->srcfile->name->toChars())); - if (srcpath.empty()) { - const char* str = get_current_dir_name(); - assert(str != NULL); - srcpath = str; - } + if (srcpath.empty()) + srcpath = llvm::sys::Path::GetCurrentDirectory().toString(); vals[4] = DtoConstStringPtr(srcpath.c_str(), "llvm.metadata"); vals[5] = DtoConstStringPtr("LLVMDC (http://www.dsource.org/projects/llvmdc)", "llvm.metadata");