diff options
author | dim <dim@FreeBSD.org> | 2011-07-17 15:40:56 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2011-07-17 15:40:56 +0000 |
commit | 611ba3ea3300b71eb95dc4e45f20eee5dddd32e1 (patch) | |
tree | 2097d084eb235c0b12c0bff3445f4ec7bbaa8a12 /lib/Basic/Diagnostic.cpp | |
parent | c49018d9cce52d8c9f34b44865ec3ba8e89a1488 (diff) | |
download | FreeBSD-src-611ba3ea3300b71eb95dc4e45f20eee5dddd32e1.zip FreeBSD-src-611ba3ea3300b71eb95dc4e45f20eee5dddd32e1.tar.gz |
Vendor import of clang trunk r135360:
http://llvm.org/svn/llvm-project/cfe/trunk@135360
Diffstat (limited to 'lib/Basic/Diagnostic.cpp')
-rw-r--r-- | lib/Basic/Diagnostic.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/Basic/Diagnostic.cpp b/lib/Basic/Diagnostic.cpp index 11887ab..ae363a0 100644 --- a/lib/Basic/Diagnostic.cpp +++ b/lib/Basic/Diagnostic.cpp @@ -26,7 +26,8 @@ static void DummyArgToStringFn(Diagnostic::ArgumentKind AK, intptr_t QT, const Diagnostic::ArgumentValue *PrevArgs, unsigned NumPrevArgs, llvm::SmallVectorImpl<char> &Output, - void *Cookie) { + void *Cookie, + llvm::SmallVectorImpl<intptr_t> &QualTypeVals) { const char *Str = "<can't format argument>"; Output.append(Str, Str+strlen(Str)); } @@ -86,10 +87,12 @@ bool Diagnostic::popMappings(SourceLocation Loc) { void Diagnostic::Reset() { ErrorOccurred = false; FatalErrorOccurred = false; + UnrecoverableErrorOccurred = false; NumWarnings = 0; NumErrors = 0; NumErrorsSuppressed = 0; + CurDiagID = ~0U; // Set LastDiagLevel to an "unset" state. If we set it to 'Ignored', notes // using a Diagnostic associated to a translation unit that follow @@ -542,7 +545,14 @@ FormatDiagnostic(const char *DiagStr, const char *DiagEnd, /// ConvertArgToString, allowing the implementation to avoid redundancies in /// obvious cases. llvm::SmallVector<Diagnostic::ArgumentValue, 8> FormattedArgs; - + + /// QualTypeVals - Pass a vector of arrays so that QualType names can be + /// compared to see if more information is needed to be printed. + llvm::SmallVector<intptr_t, 2> QualTypeVals; + for (unsigned i = 0, e = getNumArgs(); i < e; ++i) + if (getArgKind(i) == Diagnostic::ak_qualtype) + QualTypeVals.push_back(getRawArg(i)); + while (DiagStr != DiagEnd) { if (DiagStr[0] != '%') { // Append non-%0 substrings to Str if we have one. @@ -673,7 +683,7 @@ FormatDiagnostic(const char *DiagStr, const char *DiagEnd, Modifier, ModifierLen, Argument, ArgumentLen, FormattedArgs.data(), FormattedArgs.size(), - OutStr); + OutStr, QualTypeVals); break; } |