From 4903802fbfff23b27f0a030f6103818f6edb2a16 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Sat, 4 Feb 2012 13:45:25 +0000 Subject: Move a method from IdentifierTable.h out of line and remove the SmallString include. Fix all the transitive include users. llvm-svn: 149783 --- clang/lib/AST/TemplateBase.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'clang/lib/AST/TemplateBase.cpp') diff --git a/clang/lib/AST/TemplateBase.cpp b/clang/lib/AST/TemplateBase.cpp index beb77d6774d..0eaf760e257 100644 --- a/clang/lib/AST/TemplateBase.cpp +++ b/clang/lib/AST/TemplateBase.cpp @@ -22,6 +22,7 @@ #include "clang/AST/TypeLoc.h" #include "clang/Basic/Diagnostic.h" #include "llvm/ADT/FoldingSet.h" +#include "llvm/ADT/SmallString.h" #include #include @@ -40,10 +41,9 @@ static void printIntegral(const TemplateArgument &TemplArg, if (T->isBooleanType()) { Out << (Val->getBoolValue() ? "true" : "false"); } else if (T->isCharType()) { - const unsigned char Ch = Val->getZExtValue(); - const std::string Str(1, Ch); + const char Ch = Val->getZExtValue(); Out << ((Ch == '\'') ? "'\\" : "'"); - Out.write_escaped(Str, /*UseHexEscapes=*/ true); + Out.write_escaped(StringRef(&Ch, 1), /*UseHexEscapes=*/ true); Out << "'"; } else { Out << Val->toString(10); -- cgit v1.2.3