summaryrefslogtreecommitdiffstats
path: root/clang/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
commita750e8e6d8aad0506b54a4be00cbfd9e666c6d75 (patch)
tree3ef5d02df2bc82f3ac854d4f70cb65002d870e40 /clang/lib
parent336021f758cebb1b6d0ab0e53350fd25e78ac893 (diff)
downloadbcm5719-llvm-a750e8e6d8aad0506b54a4be00cbfd9e666c6d75.tar.gz
bcm5719-llvm-a750e8e6d8aad0506b54a4be00cbfd9e666c6d75.zip
Extend the libclang diagnostic API to provide information about the
option name, category ID, and category name corresponding to a diagnostic. llvm-svn: 119802
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Basic/Diagnostic.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Basic/Diagnostic.cpp b/clang/lib/Basic/Diagnostic.cpp
index 858b70a7123..83ae2c5187e 100644
--- a/clang/lib/Basic/Diagnostic.cpp
+++ b/clang/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())
OpenPOWER on IntegriCloud