aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-07-20 19:09:33 +0000
committerChris Lattner <sabre@nondot.org>2001-07-20 19:09:33 +0000
commit781532e45bbf739b4776e8b4a4c388cf8ac3d087 (patch)
treea2180b41ba321f94f421bdd85890bfc619bca23e
parent94572e0c931703fa3d27889ec50a568523150476 (diff)
downloadexternal_llvm-781532e45bbf739b4776e8b4a4c388cf8ac3d087.zip
external_llvm-781532e45bbf739b4776e8b4a4c388cf8ac3d087.tar.gz
external_llvm-781532e45bbf739b4776e8b4a4c388cf8ac3d087.tar.bz2
Add an function to BinaryOperator to swap the two operands
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/InstrTypes.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/llvm/InstrTypes.h b/include/llvm/InstrTypes.h
index fa0ce87..1f771e6 100644
--- a/include/llvm/InstrTypes.h
+++ b/include/llvm/InstrTypes.h
@@ -108,6 +108,11 @@ public:
}
virtual const char *getOpcodeName() const = 0;
+
+ // swapOperands - Exchange the two operands to this instruction
+ void swapOperands() {
+ swap(Operands[0], Operands[1]);
+ }
};
#endif