diff options
author | Duncan Sands <baldrick@free.fr> | 2010-06-10 15:06:05 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2010-06-10 15:06:05 +0000 |
commit | 39dea6ff768098f33da8441b8323100f68999573 (patch) | |
tree | 1cff8aeb253ef1c042f8d38860ab8ea566d0257d /include/llvm/SymbolTableListTraits.h | |
parent | 345b378309eabd74a7a43f095dca9a4894bc371e (diff) | |
download | llvm-39dea6ff768098f33da8441b8323100f68999573.tar.gz llvm-39dea6ff768098f33da8441b8323100f68999573.tar.bz2 llvm-39dea6ff768098f33da8441b8323100f68999573.tar.xz |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105788 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/SymbolTableListTraits.h')
-rw-r--r-- | include/llvm/SymbolTableListTraits.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/include/llvm/SymbolTableListTraits.h b/include/llvm/SymbolTableListTraits.h index 39953e1a58..91a4eb99ff 100644 --- a/include/llvm/SymbolTableListTraits.h +++ b/include/llvm/SymbolTableListTraits.h @@ -47,9 +47,8 @@ public: /// of instructions, it returns the BasicBlock that owns them. ItemParentClass *getListOwner() { typedef iplist<ValueSubClass> ItemParentClass::*Sublist; - Sublist Sub(ItemParentClass:: - getSublistAccess(static_cast<ValueSubClass*>(0))); - size_t Offset(size_t(&((ItemParentClass*)0->*Sub))); + size_t Offset(size_t(&((ItemParentClass*)0->*ItemParentClass:: + getSublistAccess(static_cast<ValueSubClass*>(0))))); iplist<ValueSubClass>* Anchor(static_cast<iplist<ValueSubClass>*>(this)); return reinterpret_cast<ItemParentClass*>(reinterpret_cast<char*>(Anchor)- Offset); |