[llvm-commits] CVS: llvm/lib/VMCore/Type.cpp
Reid Spencer
reid at x10sys.com
Wed Jan 17 19:00:13 PST 2007
Changes in directory llvm/lib/VMCore:
Type.cpp updated: 1.161 -> 1.162
---
Log message:
Provide an isPowerOf2ByteWidth method for the IntegerType class. This will
mostly be used by back ends that wish to distinguish between integer types
that fit evenly within a natural integer type and those that don't.
---
Diffs of the changes: (+5 -0)
Type.cpp | 5 +++++
1 files changed, 5 insertions(+)
Index: llvm/lib/VMCore/Type.cpp
diff -u llvm/lib/VMCore/Type.cpp:1.161 llvm/lib/VMCore/Type.cpp:1.162
--- llvm/lib/VMCore/Type.cpp:1.161 Sun Jan 14 20:27:26 2007
+++ llvm/lib/VMCore/Type.cpp Wed Jan 17 20:59:54 2007
@@ -975,6 +975,11 @@
return ITy;
}
+bool IntegerType::isPowerOf2ByteWidth() const {
+ unsigned BitWidth = getBitWidth();
+ return (BitWidth > 7 && Log2_32(BitWidth) == Log2_32_Ceil(BitWidth));
+}
+
// FunctionValType - Define a class to hold the key that goes into the TypeMap
//
namespace llvm {
More information about the llvm-commits
mailing list