summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Language
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2019-01-29 22:55:21 +0000
committerZachary Turner <zturner@google.com>2019-01-29 22:55:21 +0000
commit52f8f34377452f8f2bce38b5add360f9dd84c95d (patch)
treedd88eb6f9f401c21f26cc9415aa926b29e68a6dd /lldb/source/Plugins/Language
parent7d2192ca7b9957cbc8968b792a7cfa49acefeaba (diff)
downloadbcm5719-llvm-52f8f34377452f8f2bce38b5add360f9dd84c95d.tar.gz
bcm5719-llvm-52f8f34377452f8f2bce38b5add360f9dd84c95d.zip
Fix some warnings in building LLDB.
Differential Revision: https://reviews.llvm.org/D57413 llvm-svn: 352557
Diffstat (limited to 'lldb/source/Plugins/Language')
-rw-r--r--lldb/source/Plugins/Language/ObjC/Cocoa.cpp12
-rw-r--r--lldb/source/Plugins/Language/ObjC/NSArray.cpp9
-rw-r--r--lldb/source/Plugins/Language/ObjC/NSDictionary.cpp34
-rw-r--r--lldb/source/Plugins/Language/ObjC/NSSet.cpp22
4 files changed, 24 insertions, 53 deletions
diff --git a/lldb/source/Plugins/Language/ObjC/Cocoa.cpp b/lldb/source/Plugins/Language/ObjC/Cocoa.cpp
index 4d77f0259c3..98fc1afd93e 100644
--- a/lldb/source/Plugins/Language/ObjC/Cocoa.cpp
+++ b/lldb/source/Plugins/Language/ObjC/Cocoa.cpp
@@ -754,7 +754,7 @@ typedef union {
uint64_t fraction:52; // unsigned
uint64_t exponent:11; // signed
uint64_t sign:1;
- };
+ } repr;
uint64_t i;
double d;
} DoubleBits;
@@ -764,7 +764,7 @@ typedef union {
uint64_t exponent:7; // signed
uint64_t sign:1;
uint64_t unused:4; // placeholder for pointer tag bits
- };
+ } repr;
uint64_t i;
} TaggedDoubleBits;
@@ -786,10 +786,10 @@ static uint64_t decodeTaggedTimeInterval(uint64_t encodedTimeInterval) {
// Sign and fraction are represented exactly.
// Exponent is encoded.
- assert(encodedBits.unused == 0);
- decodedBits.sign = encodedBits.sign;
- decodedBits.fraction = encodedBits.fraction;
- decodedBits.exponent = decodeExponent(encodedBits.exponent);
+ assert(encodedBits.repr.unused == 0);
+ decodedBits.repr.sign = encodedBits.repr.sign;
+ decodedBits.repr.fraction = encodedBits.repr.fraction;
+ decodedBits.repr.exponent = decodeExponent(encodedBits.repr.exponent);
return decodedBits.d;
}
diff --git a/lldb/source/Plugins/Language/ObjC/NSArray.cpp b/lldb/source/Plugins/Language/ObjC/NSArray.cpp
index 96212cf0363..9eec28bd2dc 100644
--- a/lldb/source/Plugins/Language/ObjC/NSArray.cpp
+++ b/lldb/source/Plugins/Language/ObjC/NSArray.cpp
@@ -171,13 +171,8 @@ namespace Foundation1437 {
PtrType _data;
uint32_t _offset;
uint32_t _size;
- union {
- PtrType _mutations;
- struct {
- uint32_t _muts;
- uint32_t _used;
- };
- };
+ uint32_t _muts;
+ uint32_t _used;
};
using NSArrayMSyntheticFrontEnd =
diff --git a/lldb/source/Plugins/Language/ObjC/NSDictionary.cpp b/lldb/source/Plugins/Language/ObjC/NSDictionary.cpp
index 125ecc6fd06..61e9de28b0e 100644
--- a/lldb/source/Plugins/Language/ObjC/NSDictionary.cpp
+++ b/lldb/source/Plugins/Language/ObjC/NSDictionary.cpp
@@ -281,18 +281,11 @@ namespace Foundation1437 {
struct DataDescriptor_32 {
uint32_t _buffer;
- union {
- struct {
- uint32_t _mutations;
- };
- struct {
- uint32_t _muts;
- uint32_t _used:25;
- uint32_t _kvo:1;
- uint32_t _szidx:6;
- };
- };
-
+ uint32_t _muts;
+ uint32_t _used : 25;
+ uint32_t _kvo : 1;
+ uint32_t _szidx : 6;
+
uint64_t GetSize() {
return (_szidx) >= NSDictionaryNumSizeBuckets ?
0 : NSDictionaryCapacities[_szidx];
@@ -301,18 +294,11 @@ namespace Foundation1437 {
struct DataDescriptor_64 {
uint64_t _buffer;
- union {
- struct {
- uint64_t _mutations;
- };
- struct {
- uint32_t _muts;
- uint32_t _used:25;
- uint32_t _kvo:1;
- uint32_t _szidx:6;
- };
- };
-
+ uint32_t _muts;
+ uint32_t _used : 25;
+ uint32_t _kvo : 1;
+ uint32_t _szidx : 6;
+
uint64_t GetSize() {
return (_szidx) >= NSDictionaryNumSizeBuckets ?
0 : NSDictionaryCapacities[_szidx];
diff --git a/lldb/source/Plugins/Language/ObjC/NSSet.cpp b/lldb/source/Plugins/Language/ObjC/NSSet.cpp
index a1b1b92a3ae..c824d6e2e43 100644
--- a/lldb/source/Plugins/Language/ObjC/NSSet.cpp
+++ b/lldb/source/Plugins/Language/ObjC/NSSet.cpp
@@ -154,28 +154,18 @@ namespace Foundation1437 {
uint32_t _cow;
// __table storage
uint32_t _objs_addr;
- union {
- uint32_t _mutations;
- struct {
- uint32_t _muts;
- uint32_t _used : 26;
- uint32_t _szidx : 6;
- };
- };
+ uint32_t _muts;
+ uint32_t _used : 26;
+ uint32_t _szidx : 6;
};
struct DataDescriptor_64 {
uint64_t _cow;
// __Table storage
uint64_t _objs_addr;
- union {
- uint64_t _mutations;
- struct {
- uint32_t _muts;
- uint32_t _used : 26;
- uint32_t _szidx : 6;
- };
- };
+ uint32_t _muts;
+ uint32_t _used : 26;
+ uint32_t _szidx : 6;
};
using NSSetMSyntheticFrontEnd =
OpenPOWER on IntegriCloud