aboutsummaryrefslogtreecommitdiff
path: root/Driver/HTMLDiagnostics.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-04-03 17:55:57 +0000
committerTed Kremenek <kremenek@apple.com>2008-04-03 17:55:57 +0000
commit344f7e3759cad217b0c3f7ff849e906f5970f554 (patch)
tree69757cfa6e989a21737badb0e1bd6376c0332436 /Driver/HTMLDiagnostics.cpp
parent1758b07ef7c554b06c48a43df2edaba85e918031 (diff)
Use logical line number for BUGLINE.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49178 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Driver/HTMLDiagnostics.cpp')
-rw-r--r--Driver/HTMLDiagnostics.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/Driver/HTMLDiagnostics.cpp b/Driver/HTMLDiagnostics.cpp
index c29096d0f6..8c89e6270a 100644
--- a/Driver/HTMLDiagnostics.cpp
+++ b/Driver/HTMLDiagnostics.cpp
@@ -74,18 +74,17 @@ void HTMLDiagnostics::HandlePathDiagnostic(const PathDiagnostic& D) {
if (D.empty())
return;
- if (!D.back()->getLocation().isFileID())
- return;
-
// Create the HTML directory if it is missing.
if (!createdDir) {
createdDir = true;
- Directory.createDirectoryOnDisk(true, NULL);
+ std::string ErrorMsg;
+ Directory.createDirectoryOnDisk(true, &ErrorMsg);
if (!Directory.isDirectory()) {
llvm::cerr << "warning: could not create directory '"
- << FilePrefix.toString() << "'\n";
+ << Directory.toString() << "'\n"
+ << "reason: " << ErrorMsg << '\n';
noDir = true;
@@ -154,8 +153,7 @@ void HTMLDiagnostics::HandlePathDiagnostic(const PathDiagnostic& D) {
{
std::ostringstream os;
- FullSourceLoc L = D.back()->getLocation();
- os << "\n<!-- BUGLINE " << L.getLineNumber()
+ os << "\n<!-- BUGLINE " << D.back()->getLocation().getLogicalLineNumber()
<< " -->\n";
R.InsertStrBefore(SourceLocation::getFileLoc(FileID, 0), os.str());
}