Mercurial > projects > ldc
diff gen/todebug.cpp @ 140:ffcc9a2f3d9d trunk
[svn r144] fixes
author | lindquist |
---|---|
date | Wed, 23 Jan 2008 12:56:09 +0100 |
parents | 0ab29b838084 |
children | 7f92f477ff53 |
line wrap: on
line diff
--- a/gen/todebug.cpp Tue Jan 22 00:01:16 2008 +0100 +++ b/gen/todebug.cpp Wed Jan 23 12:56:09 2008 +0100 @@ -135,8 +135,11 @@ vals.push_back(DtoConstUint(DW_LANG_C));// _D)); // doesn't seem to work vals.push_back(DtoConstStringPtr(m->srcfile->name->toChars(), "llvm.metadata")); std::string srcpath(FileName::path(m->srcfile->name->toChars())); - if (srcpath.empty()) - srcpath = "."; + if (srcpath.empty()) { + const char* str = get_current_dir_name(); + assert(str != NULL); + srcpath = str; + } vals.push_back(DtoConstStringPtr(srcpath.c_str(), "llvm.metadata")); vals.push_back(DtoConstStringPtr("LLVMDC (http://www.dsource.org/projects/llvmdc)", "llvm.metadata"));