comparison gen/todebug.cpp @ 729:50d01791859c

Always add trailing slash to source path for debug info.
author Christian Kamm <kamm incasoftware de>
date Sun, 26 Oct 2008 17:31:05 +0100
parents 72ee105be27b
children e4e50f4b58cd
comparison
equal deleted inserted replaced
728:635f91212b78 729:50d01791859c
139 std::string srcpath(FileName::path(m->srcfile->name->toChars())); 139 std::string srcpath(FileName::path(m->srcfile->name->toChars()));
140 if (!FileName::absolute(srcpath.c_str())) { 140 if (!FileName::absolute(srcpath.c_str())) {
141 llvm::sys::Path tmp = llvm::sys::Path::GetCurrentDirectory(); 141 llvm::sys::Path tmp = llvm::sys::Path::GetCurrentDirectory();
142 tmp.appendComponent(srcpath); 142 tmp.appendComponent(srcpath);
143 srcpath = tmp.toString(); 143 srcpath = tmp.toString();
144 if (*srcpath.rbegin() != '/' || *srcpath.rbegin() != '\\')
145 srcpath = srcpath + '/';
144 } 146 }
145 vals[4] = DtoConstStringPtr(srcpath.c_str(), "llvm.metadata"); 147 vals[4] = DtoConstStringPtr(srcpath.c_str(), "llvm.metadata");
146 vals[5] = DtoConstStringPtr("LDC (http://www.dsource.org/projects/ldc)", "llvm.metadata"); 148 vals[5] = DtoConstStringPtr("LDC (http://www.dsource.org/projects/ldc)", "llvm.metadata");
147 149
148 LLGlobalVariable* gv = emitDwarfGlobal(getDwarfCompileUnitType(), vals, "llvm.dbg.compile_unit"); 150 LLGlobalVariable* gv = emitDwarfGlobal(getDwarfCompileUnitType(), vals, "llvm.dbg.compile_unit");