diff options
| author | Douglas Gregor <dgregor@apple.com> | 2010-11-19 16:18:16 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2010-11-19 16:18:16 +0000 |
| commit | a750e8e6d8aad0506b54a4be00cbfd9e666c6d75 (patch) | |
| tree | 3ef5d02df2bc82f3ac854d4f70cb65002d870e40 /clang/lib | |
| parent | 336021f758cebb1b6d0ab0e53350fd25e78ac893 (diff) | |
| download | bcm5719-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.cpp | 7 |
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()) |

