aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-11-19 16:18:16 +0000
committerDouglas Gregor <dgregor@apple.com>2010-11-19 16:18:16 +0000
commitaa5f135f8db82b5e5fb1640fd51f8078e0b2d82d (patch)
treeab00b5c254a28d1098901e7f783eaee4c189d72f /lib
parent3ffe6293123b8fe59bd9d6ed8e3ec755d68e7fac (diff)
Extend the libclang diagnostic API to provide information about the
option name, category ID, and category name corresponding to a diagnostic. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119802 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Basic/Diagnostic.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Basic/Diagnostic.cpp b/lib/Basic/Diagnostic.cpp
index 858b70a712..83ae2c5187 100644
--- a/lib/Basic/Diagnostic.cpp
+++ b/lib/Basic/Diagnostic.cpp
@@ -547,13 +547,14 @@ FormatDiagnostic(const char *DiagStr, const char *DiagEnd,
StoredDiagnostic::StoredDiagnostic() { }
-StoredDiagnostic::StoredDiagnostic(Diagnostic::Level Level,
+StoredDiagnostic::StoredDiagnostic(Diagnostic::Level Level, unsigned ID,
llvm::StringRef Message)
- : Level(Level), Loc(), Message(Message) { }
+ : Level(Level), ID(ID), Loc(), Message(Message) { }
StoredDiagnostic::StoredDiagnostic(Diagnostic::Level Level,
const DiagnosticInfo &Info)
- : Level(Level) {
+ : ID(Info.getID()), Level(Level)
+{
assert((Info.getLocation().isInvalid() || Info.hasSourceManager()) &&
"Valid source location without setting a source manager for diagnostic");
if (Info.getLocation().isValid())