aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-09-17 19:29:56 +0000
committerChris Lattner <sabre@nondot.org>2006-09-17 19:29:56 +0000
commit2f463865c2f03b8835e35d3499fcd95eed922bc6 (patch)
tree2ca93b6d504bd0d1dc7084c66310549314824962 /lib
parenta5b07404f79036727ba47624050040defe59a5fa (diff)
downloadexternal_llvm-2f463865c2f03b8835e35d3499fcd95eed922bc6.zip
external_llvm-2f463865c2f03b8835e35d3499fcd95eed922bc6.tar.gz
external_llvm-2f463865c2f03b8835e35d3499fcd95eed922bc6.tar.bz2
Add ShiftInst::isLogical/ArithmeticShift methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30445 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/VMCore/Instructions.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp
index c6730e1..393858c 100644
--- a/lib/VMCore/Instructions.cpp
+++ b/lib/VMCore/Instructions.cpp
@@ -1142,6 +1142,17 @@ bool BinaryOperator::swapOperands() {
//===----------------------------------------------------------------------===//
+// ShiftInst Class
+//===----------------------------------------------------------------------===//
+
+/// isLogicalShift - Return true if this is a logical shift left or a logical
+/// shift right.
+bool ShiftInst::isLogicalShift() const {
+ return getOpcode() == Instruction::Shl || getType()->isUnsigned();
+}
+
+
+//===----------------------------------------------------------------------===//
// SetCondInst Class
//===----------------------------------------------------------------------===//