comparison gen/todebug.cpp @ 140:ffcc9a2f3d9d trunk

[svn r144] fixes
author lindquist
date Wed, 23 Jan 2008 12:56:09 +0100
parents 0ab29b838084
children 7f92f477ff53
comparison
equal deleted inserted replaced
139:0ab29b838084 140:ffcc9a2f3d9d
133 vals.push_back(dbgToArrTy(GetDwarfAnchor(DW_TAG_compile_unit))); 133 vals.push_back(dbgToArrTy(GetDwarfAnchor(DW_TAG_compile_unit)));
134 134
135 vals.push_back(DtoConstUint(DW_LANG_C));// _D)); // doesn't seem to work 135 vals.push_back(DtoConstUint(DW_LANG_C));// _D)); // doesn't seem to work
136 vals.push_back(DtoConstStringPtr(m->srcfile->name->toChars(), "llvm.metadata")); 136 vals.push_back(DtoConstStringPtr(m->srcfile->name->toChars(), "llvm.metadata"));
137 std::string srcpath(FileName::path(m->srcfile->name->toChars())); 137 std::string srcpath(FileName::path(m->srcfile->name->toChars()));
138 if (srcpath.empty()) 138 if (srcpath.empty()) {
139 srcpath = "."; 139 const char* str = get_current_dir_name();
140 assert(str != NULL);
141 srcpath = str;
142 }
140 vals.push_back(DtoConstStringPtr(srcpath.c_str(), "llvm.metadata")); 143 vals.push_back(DtoConstStringPtr(srcpath.c_str(), "llvm.metadata"));
141 vals.push_back(DtoConstStringPtr("LLVMDC (http://www.dsource.org/projects/llvmdc)", "llvm.metadata")); 144 vals.push_back(DtoConstStringPtr("LLVMDC (http://www.dsource.org/projects/llvmdc)", "llvm.metadata"));
142 145
143 c = llvm::ConstantStruct::get(GetDwarfCompileUnitType(), vals); 146 c = llvm::ConstantStruct::get(GetDwarfCompileUnitType(), vals);
144 147