[cfe-commits] r48888 - /cfe/trunk/Driver/HTMLDiagnostics.cpp
Ted Kremenek
kremenek at apple.com
Thu Mar 27 10:25:28 PDT 2008
Author: kremenek
Date: Thu Mar 27 12:25:28 2008
New Revision: 48888
URL: http://llvm.org/viewvc/llvm-project?rev=48888&view=rev
Log:
For HTMLDiagnostics, when emitting the name of the directory, substitute the current working directory for "."
Modified:
cfe/trunk/Driver/HTMLDiagnostics.cpp
Modified: cfe/trunk/Driver/HTMLDiagnostics.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/HTMLDiagnostics.cpp?rev=48888&r1=48887&r2=48888&view=diff
==============================================================================
--- cfe/trunk/Driver/HTMLDiagnostics.cpp (original)
+++ cfe/trunk/Driver/HTMLDiagnostics.cpp Thu Mar 27 12:25:28 2008
@@ -115,10 +115,18 @@
{
std::ostringstream os;
+
+ os << "<h1>";
+
const FileEntry* Entry = SMgr.getFileEntryForID(FileID);
+ const char* dname = Entry->getDir()->getName();
+
+ if (strcmp(dname,".") == 0)
+ os << html::EscapeText(llvm::sys::Path::GetCurrentDirectory().toString());
+ else
+ os << html::EscapeText(dname);
- os << "<h1>" << html::EscapeText(Entry->getDir()->getName())
- << "/" << html::EscapeText(Entry->getName()) << "</h1>\n";
+ os << "/" << html::EscapeText(Entry->getName()) << "</h1>\n";
R.InsertStrBefore(SourceLocation::getFileLoc(FileID, 0), os.str());
}
More information about the cfe-commits
mailing list