From: Matthias Braun Date: Sat, 17 Oct 2015 00:08:45 +0000 (+0000) Subject: StreamWriter: List basic types instead of derived ones in HexNumber X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=cc2082e98f780a1719383d7a7d5bcc997cc5b7c3;p=oota-llvm.git StreamWriter: List basic types instead of derived ones in HexNumber This avoids problems with different (u)intXX definition on different platforms. Specifically this fixes a case on OS/X which had uint64_t defined as unsigned long long. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250589 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/llvm-readobj/StreamWriter.h b/tools/llvm-readobj/StreamWriter.h index 9e88edc5a1e..d2dbb07af25 100644 --- a/tools/llvm-readobj/StreamWriter.h +++ b/tools/llvm-readobj/StreamWriter.h @@ -34,14 +34,17 @@ struct HexNumber { // unsigned type. The overloads are here so that every type that is implicitly // convertible to an integer (including enums and endian helpers) can be used // without requiring type traits or call-site changes. - HexNumber(int8_t Value) : Value(static_cast(Value)) { } - HexNumber(int16_t Value) : Value(static_cast(Value)) { } - HexNumber(int32_t Value) : Value(static_cast(Value)) { } - HexNumber(int64_t Value) : Value(static_cast(Value)) { } - HexNumber(uint8_t Value) : Value(Value) { } - HexNumber(uint16_t Value) : Value(Value) { } - HexNumber(uint32_t Value) : Value(Value) { } - HexNumber(uint64_t Value) : Value(Value) { } + HexNumber(char Value) : Value(static_cast(Value)) { } + HexNumber(signed char Value) : Value(static_cast(Value)) { } + HexNumber(signed short Value) : Value(static_cast(Value)) { } + HexNumber(signed int Value) : Value(static_cast(Value)) { } + HexNumber(signed long Value) : Value(static_cast(Value)) { } + HexNumber(signed long long Value) : Value(static_cast(Value)) { } + HexNumber(unsigned char Value) : Value(Value) { } + HexNumber(unsigned short Value) : Value(Value) { } + HexNumber(unsigned int Value) : Value(Value) { } + HexNumber(unsigned long Value) : Value(Value) { } + HexNumber(unsigned long long Value) : Value(Value) { } uint64_t Value; };