[llvm-commits] [llvm] r95622 - /llvm/trunk/include/llvm/Support/CommandLine.h
Chris Lattner
sabre at nondot.org
Mon Feb 8 16:05:46 PST 2010
Author: lattner
Date: Mon Feb 8 18:05:45 2010
New Revision: 95622
URL: http://llvm.org/viewvc/llvm-project?rev=95622&view=rev
Log:
enhance bits_storage to work with enums by using a c-style
cast instead of reinterpret_cast, fixing PR6243. Apparently
reinterpret_cast and I aren't getting along today.
Modified:
llvm/trunk/include/llvm/Support/CommandLine.h
Modified: llvm/trunk/include/llvm/Support/CommandLine.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/CommandLine.h?rev=95622&r1=95621&r2=95622&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/CommandLine.h (original)
+++ llvm/trunk/include/llvm/Support/CommandLine.h Mon Feb 8 18:05:45 2010
@@ -1168,7 +1168,7 @@
template<class T>
static unsigned Bit(const T &V) {
- unsigned BitPos = reinterpret_cast<unsigned>(V);
+ unsigned BitPos = (unsigned)V;
assert(BitPos < sizeof(unsigned) * CHAR_BIT &&
"enum exceeds width of bit vector!");
return 1 << BitPos;
More information about the llvm-commits
mailing list