[llvm-commits] [llvm] r132668 - /llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
Benjamin Kramer
benny.kra at googlemail.com
Sun Jun 5 07:36:47 PDT 2011
Author: d0k
Date: Sun Jun 5 09:36:47 2011
New Revision: 132668
URL: http://llvm.org/viewvc/llvm-project?rev=132668&view=rev
Log:
Use path API for path concatenation.
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=132668&r1=132667&r2=132668&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Sun Jun 5 09:36:47 2011
@@ -819,11 +819,9 @@
return GetOrCreateSourceID("<stdin>", StringRef());
// MCStream expects full path name as filename.
- if (!DirName.empty() && !FileName.startswith("/")) {
- std::string FullPathName(DirName.data());
- if (!DirName.endswith("/"))
- FullPathName += "/";
- FullPathName += FileName.data();
+ if (!DirName.empty() && !sys::path::is_absolute(FileName)) {
+ SmallString<128> FullPathName = DirName;
+ sys::path::append(FullPathName, FileName);
// Here FullPathName will be copied into StringMap by GetOrCreateSourceID.
return GetOrCreateSourceID(StringRef(FullPathName), StringRef());
}
More information about the llvm-commits
mailing list