mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
Avoid many "variable 'Sub' set but not used [-Wunused-but-set-variable]" warnings
with gcc-4.6. The warning is wrong, since Sub *is* used (perhaps gcc is confused because the use of Sub is constant folded away?), but since it is trivial to avoid, and massively reduces the amount of warning spew, just workaround the wrong warning. llvm-svn: 105788
This commit is contained in:
parent
78593d094f
commit
83a8bdd9b7
@ -47,9 +47,8 @@ public:
|
|||||||
/// of instructions, it returns the BasicBlock that owns them.
|
/// of instructions, it returns the BasicBlock that owns them.
|
||||||
ItemParentClass *getListOwner() {
|
ItemParentClass *getListOwner() {
|
||||||
typedef iplist<ValueSubClass> ItemParentClass::*Sublist;
|
typedef iplist<ValueSubClass> ItemParentClass::*Sublist;
|
||||||
Sublist Sub(ItemParentClass::
|
size_t Offset(size_t(&((ItemParentClass*)0->*ItemParentClass::
|
||||||
getSublistAccess(static_cast<ValueSubClass*>(0)));
|
getSublistAccess(static_cast<ValueSubClass*>(0)))));
|
||||||
size_t Offset(size_t(&((ItemParentClass*)0->*Sub)));
|
|
||||||
iplist<ValueSubClass>* Anchor(static_cast<iplist<ValueSubClass>*>(this));
|
iplist<ValueSubClass>* Anchor(static_cast<iplist<ValueSubClass>*>(this));
|
||||||
return reinterpret_cast<ItemParentClass*>(reinterpret_cast<char*>(Anchor)-
|
return reinterpret_cast<ItemParentClass*>(reinterpret_cast<char*>(Anchor)-
|
||||||
Offset);
|
Offset);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user