aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-03-10 02:49:29 +0000
committerTed Kremenek <kremenek@apple.com>2009-03-10 02:49:29 +0000
commit0008683bee5ab26c2a5a495adb2a894fc7e7c7c9 (patch)
tree41d74355ca6123b8d9038c55fa6e777fac861359 /lib/Frontend
parent9db8f5d743f9cb7fe3ec4167b28dad9cff3e4964 (diff)
Handle "Macro" PathDiagnosticPiece kind when getting string identifier.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66518 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend')
-rw-r--r--lib/Frontend/HTMLDiagnostics.cpp7
-rw-r--r--lib/Frontend/PlistDiagnostics.cpp12
2 files changed, 11 insertions, 8 deletions
diff --git a/lib/Frontend/HTMLDiagnostics.cpp b/lib/Frontend/HTMLDiagnostics.cpp
index 5fa5ab7f50..02b327db2a 100644
--- a/lib/Frontend/HTMLDiagnostics.cpp
+++ b/lib/Frontend/HTMLDiagnostics.cpp
@@ -159,8 +159,7 @@ void HTMLDiagnostics::ReportDiag(const PathDiagnostic& D) {
// Create a new rewriter to generate HTML.
Rewriter R(SMgr);
- // Process the path.
-
+ // Process the path.
unsigned n = D.size();
unsigned max = n;
@@ -376,7 +375,7 @@ void HTMLDiagnostics::HandlePiece(Rewriter& R, FileID BugFileID,
switch (*I) {
default:
++cnt;
- continue;
+ continue;
case ' ':
case '\t':
case '\n':
@@ -410,9 +409,9 @@ void HTMLDiagnostics::HandlePiece(Rewriter& R, FileID BugFileID,
// Now generate the message bubble.
const char *Kind = 0;
switch (P.getKind()) {
- default: break;
case PathDiagnosticPiece::Event: Kind = "Event"; break;
case PathDiagnosticPiece::ControlFlow: Kind = "Control"; break;
+ case PathDiagnosticPiece::Macro: Kind = "Macro"; break;
}
std::string sbuf;
diff --git a/lib/Frontend/PlistDiagnostics.cpp b/lib/Frontend/PlistDiagnostics.cpp
index c40794cef7..afd8b26e5f 100644
--- a/lib/Frontend/PlistDiagnostics.cpp
+++ b/lib/Frontend/PlistDiagnostics.cpp
@@ -136,10 +136,14 @@ static void ReportDiag(llvm::raw_ostream& o, const PathDiagnosticPiece& P,
#endif
// Output the PathDiagnosticPiece::Kind.
Indent(o, indent) << "<key>kind</key>\n";
- Indent(o, indent) << "<string>"
- << (P.getKind() == PathDiagnosticPiece::Event
- ? "Event" : "ControlFlow")
- << "</string>\n";
+ Indent(o, indent) << "<string>";
+
+ switch (P.getKind()) {
+ case PathDiagnosticPiece::Event: o << "Event"; break;
+ case PathDiagnosticPiece::ControlFlow: o << "ControlFlow"; break;
+ case PathDiagnosticPiece::Macro: o << "Macro"; break;
+ }
+ o << "</string>\n";
// Finish up.