diff options
author | Alkis Evlogimenos <alkis@evlogimenos.com> | 2004-02-22 06:54:26 +0000 |
---|---|---|
committer | Alkis Evlogimenos <alkis@evlogimenos.com> | 2004-02-22 06:54:26 +0000 |
commit | f216421181393fd3993b47960de44ad448710fb9 (patch) | |
tree | ae500df3a6ec6e27fc001ca49de19f2734bc30a1 /include/llvm/CodeGen/MachineInstr.h | |
parent | 2425f8c62931f6ab127784adbf6f52bc8c684113 (diff) | |
download | external_llvm-f216421181393fd3993b47960de44ad448710fb9.zip external_llvm-f216421181393fd3993b47960de44ad448710fb9.tar.gz external_llvm-f216421181393fd3993b47960de44ad448710fb9.tar.bz2 |
When folding memory operands in machine instructions be careful to
leave register operands with the same use/def flags as the original
instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11709 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineInstr.h')
-rw-r--r-- | include/llvm/CodeGen/MachineInstr.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h index a90f133..65d5cca 100644 --- a/include/llvm/CodeGen/MachineInstr.h +++ b/include/llvm/CodeGen/MachineInstr.h @@ -197,6 +197,13 @@ public: /// MachineOperandType getType() const { return opType; } + /// getUseType - Returns the MachineOperandUseType of this operand. + /// + MOTy::UseType getUseType() const { + return isUse() ^ isDef() ? MOTy::UseAndDef : + (isUse() ? MOTy::Use : MOTy::Def); + } + /// isPCRelative - This returns the value of the PCRELATIVE flag, which /// indicates whether this operand should be emitted as a PC relative value /// instead of a global address. This is used for operands of the forms: |