diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-07-30 21:15:14 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-07-30 21:15:14 +0000 |
commit | 476518acc7d657131bab34d96554adfb2800ed89 (patch) | |
tree | 421514c2c7b5621c693bd9241d4563a8103fedd7 /include/llvm/ADT | |
parent | 63b64a72e52a9f4589759fcab8d940bc8f69685a (diff) | |
download | external_llvm-476518acc7d657131bab34d96554adfb2800ed89.zip external_llvm-476518acc7d657131bab34d96554adfb2800ed89.tar.gz external_llvm-476518acc7d657131bab34d96554adfb2800ed89.tar.bz2 |
Twine: Directly support int, long, and long long types.
- This should resolve Cygwin gcc ambiguities.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77624 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT')
-rw-r--r-- | include/llvm/ADT/Twine.h | 49 |
1 files changed, 33 insertions, 16 deletions
diff --git a/include/llvm/ADT/Twine.h b/include/llvm/ADT/Twine.h index cb5bb4d..2c6ba0b 100644 --- a/include/llvm/ADT/Twine.h +++ b/include/llvm/ADT/Twine.h @@ -99,19 +99,26 @@ namespace llvm { /// A pointer to a StringRef instance. StringRefKind, - /// A pointer to a uint64_t value, to render as an unsigned decimal + /// A pointer to an unsigned int value, to render as an unsigned decimal /// integer. - UDec32Kind, + DecUIKind, - /// A pointer to a uint64_t value, to render as a signed decimal integer. - SDec32Kind, + /// A pointer to an int value, to render as a signed decimal integer. + DecIKind, - /// A pointer to a uint64_t value, to render as an unsigned decimal + /// A pointer to an unsigned long value, to render as an unsigned decimal /// integer. - UDec64Kind, + DecULKind, - /// A pointer to a uint64_t value, to render as a signed decimal integer. - SDec64Kind, + /// A pointer to a long value, to render as a signed decimal integer. + DecLKind, + + /// A pointer to an unsigned long long value, to render as an unsigned + /// decimal integer. + DecULLKind, + + /// A pointer to a long long value, to render as a signed decimal integer. + DecLLKind, /// A pointer to a uint64_t value, to render as an unsigned hexadecimal /// integer. @@ -252,23 +259,33 @@ namespace llvm { } /// Construct a twine to print \arg Val as an unsigned decimal integer. - explicit Twine(const uint32_t &Val) - : LHS(&Val), LHSKind(UDec32Kind), RHSKind(EmptyKind) { + explicit Twine(const unsigned int &Val) + : LHS(&Val), LHSKind(DecUIKind), RHSKind(EmptyKind) { + } + + /// Construct a twine to print \arg Val as a signed decimal integer. + explicit Twine(const int &Val) + : LHS(&Val), LHSKind(DecIKind), RHSKind(EmptyKind) { + } + + /// Construct a twine to print \arg Val as an unsigned decimal integer. + explicit Twine(const unsigned long &Val) + : LHS(&Val), LHSKind(DecULKind), RHSKind(EmptyKind) { } /// Construct a twine to print \arg Val as a signed decimal integer. - explicit Twine(const int32_t &Val) - : LHS(&Val), LHSKind(SDec32Kind), RHSKind(EmptyKind) { + explicit Twine(const long &Val) + : LHS(&Val), LHSKind(DecLKind), RHSKind(EmptyKind) { } /// Construct a twine to print \arg Val as an unsigned decimal integer. - explicit Twine(const uint64_t &Val) - : LHS(&Val), LHSKind(UDec64Kind), RHSKind(EmptyKind) { + explicit Twine(const unsigned long long &Val) + : LHS(&Val), LHSKind(DecULLKind), RHSKind(EmptyKind) { } /// Construct a twine to print \arg Val as a signed decimal integer. - explicit Twine(const int64_t &Val) - : LHS(&Val), LHSKind(SDec64Kind), RHSKind(EmptyKind) { + explicit Twine(const long long &Val) + : LHS(&Val), LHSKind(DecLLKind), RHSKind(EmptyKind) { } // FIXME: Unfortunately, to make sure this is as efficient as possible we |