File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 31
31
#include " llvm/Support/PointerLikeTypeTraits.h"
32
32
#include < algorithm>
33
33
#include < cctype>
34
+ #include < cinttypes>
34
35
#include < condition_variable>
35
36
#include < new>
36
37
#include < unordered_set>
@@ -3897,10 +3898,15 @@ void _swift_debug_verifyTypeLayoutAttribute(Metadata *type,
3897
3898
size_t size,
3898
3899
const char *description) {
3899
3900
auto presentValue = [&](const void *value) {
3900
- if (size < sizeof (long long )) {
3901
- long long intValue = 0 ;
3902
- memcpy (&intValue, value, size);
3903
- fprintf (stderr, " %lld (%#llx)\n " , intValue, intValue);
3901
+ if (size <= sizeof (uint64_t )) {
3902
+ uint64_t intValue = 0 ;
3903
+ auto ptr = reinterpret_cast <uint8_t *>(&intValue);
3904
+ #if defined(__BIG_ENDIAN__)
3905
+ ptr += sizeof (uint64_t ) - size;
3906
+ #endif
3907
+ memcpy (ptr, value, size);
3908
+ fprintf (stderr, " %" PRIu64 " (%#" PRIx64 " )\n " , intValue, intValue);
3909
+ fprintf (stderr, " " );
3904
3910
}
3905
3911
auto bytes = reinterpret_cast <const uint8_t *>(value);
3906
3912
for (unsigned i = 0 ; i < size; ++i) {
You can’t perform that action at this time.
0 commit comments