diff options
author | David Majnemer <david.majnemer@gmail.com> | 2014-06-21 18:46:07 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2014-06-21 18:46:07 +0000 |
commit | 65a407c2ceabcb6ff8f62c45ff8de2b473823e2c (patch) | |
tree | f28c8426cf8ea77f4f185b331ba104819bf0899b /clang/lib/AST/StmtPrinter.cpp | |
parent | 30d7731032d7c841b1dfa9ad0900d8ae987fab11 (diff) | |
download | bcm5719-llvm-65a407c2ceabcb6ff8f62c45ff8de2b473823e2c.tar.gz bcm5719-llvm-65a407c2ceabcb6ff8f62c45ff8de2b473823e2c.zip |
Lex: Use the correct types for MS integer suffixes
Something went wrong with r211426, it is an older version of this code
and should not have been committed. It was reverted with r211434.
Original commit message:
We didn't properly implement support for the sized integer suffixes.
Suffixes like i16 were essentially ignored instead of mapping them to
the appropriately sized integer type.
This fixes PR20008.
Differential Revision: http://reviews.llvm.org/D4132
llvm-svn: 211441
Diffstat (limited to 'clang/lib/AST/StmtPrinter.cpp')
-rw-r--r-- | clang/lib/AST/StmtPrinter.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/clang/lib/AST/StmtPrinter.cpp b/clang/lib/AST/StmtPrinter.cpp index 0f4fd552461..2d7c78a8859 100644 --- a/clang/lib/AST/StmtPrinter.cpp +++ b/clang/lib/AST/StmtPrinter.cpp @@ -944,11 +944,10 @@ 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::SChar: OS << "i8"; break; + case BuiltinType::UChar: OS << "Ui8"; break; + case BuiltinType::Short: OS << "i16"; break; + case BuiltinType::UShort: OS << "Ui16"; break; case BuiltinType::Int: break; // no suffix. case BuiltinType::UInt: OS << 'U'; break; case BuiltinType::Long: OS << 'L'; break; |