diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-02-04 13:45:25 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-02-04 13:45:25 +0000 |
commit | 8fe83e1df954d72c0f4ffc15d20a5222ec151c21 (patch) | |
tree | a561c3e9db8038c5c71260fcc664f56b643d2d17 /lib/AST | |
parent | fdd15602a42bbe26185978ef1e17019f6d969aa7 (diff) |
Move a method from IdentifierTable.h out of line and remove the SmallString include.
Fix all the transitive include users.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149783 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST')
-rw-r--r-- | lib/AST/DumpXML.cpp | 3 | ||||
-rw-r--r-- | lib/AST/StmtPrinter.cpp | 5 | ||||
-rw-r--r-- | lib/AST/TemplateBase.cpp | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/lib/AST/DumpXML.cpp b/lib/AST/DumpXML.cpp index c5e23ccc6e..3ce02b0c55 100644 --- a/lib/AST/DumpXML.cpp +++ b/lib/AST/DumpXML.cpp @@ -39,8 +39,7 @@ #include "clang/AST/TypeVisitor.h" #include "clang/AST/Expr.h" #include "clang/AST/ExprCXX.h" -#include "llvm/ADT/SmallVector.h" -#include "llvm/ADT/StringRef.h" +#include "llvm/ADT/SmallString.h" using namespace clang; diff --git a/lib/AST/StmtPrinter.cpp b/lib/AST/StmtPrinter.cpp index 141cb2900f..df8ddb50fe 100644 --- a/lib/AST/StmtPrinter.cpp +++ b/lib/AST/StmtPrinter.cpp @@ -17,9 +17,9 @@ #include "clang/AST/DeclObjC.h" #include "clang/AST/DeclTemplate.h" #include "clang/AST/PrettyPrinter.h" -#include "llvm/Support/Format.h" #include "clang/AST/Expr.h" #include "clang/AST/ExprCXX.h" +#include "llvm/ADT/SmallString.h" using namespace clang; //===----------------------------------------------------------------------===// @@ -666,7 +666,8 @@ void StmtPrinter::VisitCharacterLiteral(CharacterLiteral *Node) { if (value < 256 && isprint(value)) { OS << "'" << (char)value << "'"; } else if (value < 256) { - OS << "'\\x" << llvm::format("%x", value) << "'"; + OS << "'\\x"; + OS.write_hex(value) << "'"; } else { // FIXME what to really do here? OS << value; diff --git a/lib/AST/TemplateBase.cpp b/lib/AST/TemplateBase.cpp index beb77d6774..0eaf760e25 100644 --- a/lib/AST/TemplateBase.cpp +++ b/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 <algorithm> #include <cctype> @@ -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); |