From: Chris Lattner Date: Fri, 20 Jul 2001 19:09:33 +0000 (+0000) Subject: Add an function to BinaryOperator to swap the two operands X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=781532e45bbf739b4776e8b4a4c388cf8ac3d087;p=oota-llvm.git 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 --- diff --git a/include/llvm/InstrTypes.h b/include/llvm/InstrTypes.h index fa0ce87c9ca..1f771e63501 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