Changes in directory llvm/lib/Support:
APInt.cpp updated: 1.69 -> 1.70 --- Log message: For APInt::z/sext(width), if width == BitWidth, just return *this. --- Diffs of the changes: (+4 -0) APInt.cpp | 4 ++++ 1 files changed, 4 insertions(+) Index: llvm/lib/Support/APInt.cpp diff -u llvm/lib/Support/APInt.cpp:1.69 llvm/lib/Support/APInt.cpp:1.70 --- llvm/lib/Support/APInt.cpp:1.69 Sun Mar 4 18:00:42 2007 +++ llvm/lib/Support/APInt.cpp Mon Mar 12 12:47:45 2007 @@ -921,6 +921,8 @@ // Sign extend to a new width. APInt &APInt::sext(uint32_t width) { + if (width == BitWidth) + return *this; assert(width > BitWidth && "Invalid APInt SignExtend request"); assert(width <= IntegerType::MAX_INT_BITS && "Too many bits"); // If the sign bit isn't set, this is the same as zext. @@ -969,6 +971,8 @@ // Zero extend to a new width. APInt &APInt::zext(uint32_t width) { + if (width == BitWidth) + return *this; assert(width > BitWidth && "Invalid APInt ZeroExtend request"); assert(width <= IntegerType::MAX_INT_BITS && "Too many bits"); uint32_t wordsBefore = getNumWords(); _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits