aboutsummaryrefslogtreecommitdiff
path: root/lib/Basic/Diagnostic.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-11-19 07:32:16 +0000
committerChris Lattner <sabre@nondot.org>2008-11-19 07:32:16 +0000
commit43b628cd47ecdc3caf640d79b3ad7ecef0f2c285 (patch)
tree128efac4ac9d423f5ac93b7ffdbce909e60fb1d4 /lib/Basic/Diagnostic.cpp
parent8365223e5498255a1285b6bb206f5894fe5b83c6 (diff)
Allow sending IdentifierInfo*'s into Diagnostics without turning them into strings
first. This should allow removal of a bunch of II->getName() calls. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59601 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/Diagnostic.cpp')
-rw-r--r--lib/Basic/Diagnostic.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Basic/Diagnostic.cpp b/lib/Basic/Diagnostic.cpp
index 9428b218e5..a25a790352 100644
--- a/lib/Basic/Diagnostic.cpp
+++ b/lib/Basic/Diagnostic.cpp
@@ -12,6 +12,7 @@
//===----------------------------------------------------------------------===//
#include "clang/Basic/Diagnostic.h"
+#include "clang/Basic/IdentifierTable.h"
#include "clang/Basic/SourceLocation.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
@@ -292,6 +293,11 @@ FormatDiagnostic(llvm::SmallVectorImpl<char> &OutStr) const {
OutStr.append(S.begin(), S.end());
break;
}
+ case DiagnosticInfo::ak_identifierinfo: {
+ const IdentifierInfo *II = getArgIdentifier(StrNo);
+ OutStr.append(II->getName(), II->getName() + II->getLength());
+ break;
+ }
}
DiagStr += 2;
}