diff options
author | Richard Trieu <rtrieu@google.com> | 2011-11-07 18:40:31 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2011-11-07 18:40:31 +0000 |
commit | 8b626ba6debca8648eb2f6a3cc679cc12597c9c9 (patch) | |
tree | 012a64481393b4c145932e313a5316898bdb86b9 /clang/lib/AST/StmtPrinter.cpp | |
parent | e80d4f228c8d0d42cd9a85d461f01d96c14f4137 (diff) | |
download | bcm5719-llvm-8b626ba6debca8648eb2f6a3cc679cc12597c9c9.tar.gz bcm5719-llvm-8b626ba6debca8648eb2f6a3cc679cc12597c9c9.zip |
Add support for printing integer literals of type short, unsigned short,
__int128_t and __uint128_t. Short and unsigned short integer literals support
is only to work around a crasher as reported in PR11179 and will be removed
once Clang no longer builds short integer literals.
llvm-svn: 143977
Diffstat (limited to 'clang/lib/AST/StmtPrinter.cpp')
-rw-r--r-- | clang/lib/AST/StmtPrinter.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/AST/StmtPrinter.cpp b/clang/lib/AST/StmtPrinter.cpp index 04617bf9ac8..807d35875f6 100644 --- a/clang/lib/AST/StmtPrinter.cpp +++ b/clang/lib/AST/StmtPrinter.cpp @@ -675,12 +675,19 @@ void StmtPrinter::VisitIntegerLiteral(IntegerLiteral *Node) { // Emit suffixes. Integer literals are always a builtin integer type. switch (Node->getType()->getAs<BuiltinType>()->getKind()) { default: llvm_unreachable("Unexpected type for integer literal!"); + // FIXME: The Short and UShort cases are to handle cases where a short + // integeral literal is formed during template instantiation. They should + // be removed when template instantiation no longer needs integer literals. + case BuiltinType::Short: + case BuiltinType::UShort: case BuiltinType::Int: break; // no suffix. case BuiltinType::UInt: OS << 'U'; break; case BuiltinType::Long: OS << 'L'; break; case BuiltinType::ULong: OS << "UL"; break; case BuiltinType::LongLong: OS << "LL"; break; case BuiltinType::ULongLong: OS << "ULL"; break; + case BuiltinType::Int128: OS << "i128"; break; + case BuiltinType::UInt128: OS << "Ui128"; break; } } void StmtPrinter::VisitFloatingLiteral(FloatingLiteral *Node) { |