1c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot//===-- llvm/CodeGen/MachineOperand.h - MachineOperand class ----*- C++ -*-===// 2c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot// 3c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot// The LLVM Compiler Infrastructure 4c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot// 5c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot// This file is distributed under the University of Illinois Open Source 6c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot// License. See LICENSE.TXT for details. 7c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot// 8c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot//===----------------------------------------------------------------------===// 9c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot// 10c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot// This file contains the declaration of the MachineOperand class. 11c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot// 12c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot//===----------------------------------------------------------------------===// 13c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 14c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot#ifndef LLVM_CODEGEN_MACHINEOPERAND_H 15c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot#define LLVM_CODEGEN_MACHINEOPERAND_H 16c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 17c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot#include "llvm/IR/Intrinsics.h" 18c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot#include "llvm/Support/DataTypes.h" 19c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot#include <cassert> 20c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 21c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robotnamespace llvm { 22c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 23c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robotclass BlockAddress; 24c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robotclass ConstantFP; 25c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robotclass ConstantInt; 26c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robotclass GlobalValue; 27c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robotclass MachineBasicBlock; 28c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robotclass MachineInstr; 29c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robotclass MachineRegisterInfo; 30c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robotclass MDNode; 31c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robotclass ModuleSlotTracker; 32c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robotclass TargetMachine; 33c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robotclass TargetIntrinsicInfo; 34c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robotclass TargetRegisterInfo; 35c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robotclass hash_code; 36c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robotclass raw_ostream; 37c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robotclass MCSymbol; 38c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 39c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot/// MachineOperand class - Representation of each machine instruction operand. 40c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot/// 41c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot/// This class isn't a POD type because it has a private constructor, but its 42c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot/// destructor must be trivial. Functions like MachineInstr::addOperand(), 43c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot/// MachineRegisterInfo::moveOperands(), and MF::DeleteMachineInstr() depend on 44c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot/// not having to call the MachineOperand destructor. 45c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot/// 46c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robotclass MachineOperand { 47c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robotpublic: 48c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot enum MachineOperandType : unsigned char { 49c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MO_Register, ///< Register operand. 50c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MO_Immediate, ///< Immediate operand 51c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MO_CImmediate, ///< Immediate >64bit operand 52c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MO_FPImmediate, ///< Floating-point immediate operand 53c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MO_MachineBasicBlock, ///< MachineBasicBlock reference 54c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MO_FrameIndex, ///< Abstract Stack Frame Index 55c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MO_ConstantPoolIndex, ///< Address of indexed Constant in Constant Pool 56c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MO_TargetIndex, ///< Target-dependent index+offset operand. 57c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MO_JumpTableIndex, ///< Address of indexed Jump Table for switch 58c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MO_ExternalSymbol, ///< Name of external global symbol 59c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MO_GlobalAddress, ///< Address of a global value 60c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MO_BlockAddress, ///< Address of a basic block 61c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MO_RegisterMask, ///< Mask of preserved registers. 62c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MO_RegisterLiveOut, ///< Mask of live-out registers. 63c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MO_Metadata, ///< Metadata reference (for debug info) 64c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MO_MCSymbol, ///< MCSymbol reference (for debug/eh info) 65c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MO_CFIIndex, ///< MCCFIInstruction index. 66c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MO_IntrinsicID, ///< Intrinsic ID for ISel 67c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MO_Predicate, ///< Generic predicate for ISel 68c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot }; 69c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 70c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robotprivate: 71c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// OpKind - Specify what kind of operand this is. This discriminates the 72c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// union. 73c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MachineOperandType OpKind : 8; 74c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 75c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// Subregister number for MO_Register. A value of 0 indicates the 76c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// MO_Register has no subReg. 77c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// 78c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// For all other kinds of operands, this field holds target-specific flags. 79c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot unsigned SubReg_TargetFlags : 12; 80c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 81c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// TiedTo - Non-zero when this register operand is tied to another register 82c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// operand. The encoding of this field is described in the block comment 83c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// before MachineInstr::tieOperands(). 84c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot unsigned char TiedTo : 4; 85c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 86c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// IsDef/IsImp/IsKill/IsDead flags - These are only valid for MO_Register 87c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// operands. 88c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 89c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// IsDef - True if this is a def, false if this is a use of the register. 90c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// 91c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool IsDef : 1; 92c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 93c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// IsImp - True if this is an implicit def or use, false if it is explicit. 94c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// 95c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool IsImp : 1; 96c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 97c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// IsKill - True if this instruction is the last use of the register on this 98c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// path through the function. This is only valid on uses of registers. 99c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool IsKill : 1; 100c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 101c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// IsDead - True if this register is never used by a subsequent instruction. 102c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// This is only valid on definitions of registers. 103c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool IsDead : 1; 104c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 105c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// IsUndef - True if this register operand reads an "undef" value, i.e. the 106c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// read value doesn't matter. This flag can be set on both use and def 107c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// operands. On a sub-register def operand, it refers to the part of the 108c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// register that isn't written. On a full-register def operand, it is a 109c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// noop. See readsReg(). 110c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// 111c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// This is only valid on registers. 112c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// 113c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// Note that an instruction may have multiple <undef> operands referring to 114c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// the same register. In that case, the instruction may depend on those 115c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// operands reading the same dont-care value. For example: 116c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// 117c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// %vreg1<def> = XOR %vreg2<undef>, %vreg2<undef> 118c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// 119c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// Any register can be used for %vreg2, and its value doesn't matter, but 120c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// the two operands must be the same register. 121c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// 122c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool IsUndef : 1; 123c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 124c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// IsInternalRead - True if this operand reads a value that was defined 125c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// inside the same instruction or bundle. This flag can be set on both use 126c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// and def operands. On a sub-register def operand, it refers to the part 127c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// of the register that isn't written. On a full-register def operand, it 128c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// is a noop. 129c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// 130c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// When this flag is set, the instruction bundle must contain at least one 131c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// other def of the register. If multiple instructions in the bundle define 132c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// the register, the meaning is target-defined. 133c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool IsInternalRead : 1; 134c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 135c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// IsEarlyClobber - True if this MO_Register 'def' operand is written to 136c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// by the MachineInstr before all input registers are read. This is used to 137c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// model the GCC inline asm '&' constraint modifier. 138c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool IsEarlyClobber : 1; 139c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 140c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// IsDebug - True if this MO_Register 'use' operand is in a debug pseudo, 141c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// not a real instruction. Such uses should be ignored during codegen. 142c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool IsDebug : 1; 143c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 144c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// SmallContents - This really should be part of the Contents union, but 145c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// lives out here so we can get a better packed struct. 146c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// MO_Register: Register number. 147c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// OffsetedInfo: Low bits of offset. 148c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot union { 149c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot unsigned RegNo; // For MO_Register. 150c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot unsigned OffsetLo; // Matches Contents.OffsetedInfo.OffsetHi. 151c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } SmallContents; 152c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 153c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// ParentMI - This is the instruction that this operand is embedded into. 154c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// This is valid for all operand types, when the operand is in an instr. 155c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MachineInstr *ParentMI; 156c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 157c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// Contents union - This contains the payload for the various operand types. 158c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot union { 159c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MachineBasicBlock *MBB; // For MO_MachineBasicBlock. 160c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot const ConstantFP *CFP; // For MO_FPImmediate. 161c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot const ConstantInt *CI; // For MO_CImmediate. Integers > 64bit. 162c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot int64_t ImmVal; // For MO_Immediate. 163c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot const uint32_t *RegMask; // For MO_RegisterMask and MO_RegisterLiveOut. 164c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot const MDNode *MD; // For MO_Metadata. 165c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MCSymbol *Sym; // For MO_MCSymbol. 166c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot unsigned CFIIndex; // For MO_CFI. 167c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Intrinsic::ID IntrinsicID; // For MO_IntrinsicID. 168c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot unsigned Pred; // For MO_Predicate 169c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 170c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot struct { // For MO_Register. 171c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot // Register number is in SmallContents.RegNo. 172c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MachineOperand *Prev; // Access list for register. See MRI. 173c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MachineOperand *Next; 174c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } Reg; 175c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 176c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// OffsetedInfo - This struct contains the offset and an object identifier. 177c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// this represent the object as with an optional offset from it. 178c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot struct { 179c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot union { 180c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot int Index; // For MO_*Index - The index itself. 181c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot const char *SymbolName; // For MO_ExternalSymbol. 182c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot const GlobalValue *GV; // For MO_GlobalAddress. 183c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot const BlockAddress *BA; // For MO_BlockAddress. 184c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } Val; 185c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot // Low bits of offset are in SmallContents.OffsetLo. 186c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot int OffsetHi; // An offset from the object, high 32 bits. 187c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } OffsetedInfo; 188c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } Contents; 189c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 190c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot explicit MachineOperand(MachineOperandType K) 191c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot : OpKind(K), SubReg_TargetFlags(0), ParentMI(nullptr) {} 192c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robotpublic: 193c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// getType - Returns the MachineOperandType for this operand. 194c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// 195c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MachineOperandType getType() const { return (MachineOperandType)OpKind; } 196c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 197c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot unsigned getTargetFlags() const { 198c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return isReg() ? 0 : SubReg_TargetFlags; 199c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 200c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot void setTargetFlags(unsigned F) { 201c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(!isReg() && "Register operands can't have target flags"); 202c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot SubReg_TargetFlags = F; 203c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(SubReg_TargetFlags == F && "Target flags out of range"); 204c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 205c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot void addTargetFlag(unsigned F) { 206c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(!isReg() && "Register operands can't have target flags"); 207c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot SubReg_TargetFlags |= F; 208c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert((SubReg_TargetFlags & F) && "Target flags out of range"); 209c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 210c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 211c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 212c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// getParent - Return the instruction that this operand belongs to. 213c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// 214c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MachineInstr *getParent() { return ParentMI; } 215c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot const MachineInstr *getParent() const { return ParentMI; } 216c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 217c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// clearParent - Reset the parent pointer. 218c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// 219c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// The MachineOperand copy constructor also copies ParentMI, expecting the 220c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// original to be deleted. If a MachineOperand is ever stored outside a 221c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// MachineInstr, the parent pointer must be cleared. 222c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// 223c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// Never call clearParent() on an operand in a MachineInstr. 224c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// 225c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot void clearParent() { ParentMI = nullptr; } 226c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 227c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot void print(raw_ostream &os, const TargetRegisterInfo *TRI = nullptr, 228c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot const TargetIntrinsicInfo *IntrinsicInfo = nullptr) const; 229c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot void print(raw_ostream &os, ModuleSlotTracker &MST, 230c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot const TargetRegisterInfo *TRI = nullptr, 231c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot const TargetIntrinsicInfo *IntrinsicInfo = nullptr) const; 232c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot void dump() const; 233c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 234c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot //===--------------------------------------------------------------------===// 235c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot // Accessors that tell you what kind of MachineOperand you're looking at. 236c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot //===--------------------------------------------------------------------===// 237c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 238c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// isReg - Tests if this is a MO_Register operand. 239c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isReg() const { return OpKind == MO_Register; } 240c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// isImm - Tests if this is a MO_Immediate operand. 241c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isImm() const { return OpKind == MO_Immediate; } 242c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// isCImm - Test if this is a MO_CImmediate operand. 243c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isCImm() const { return OpKind == MO_CImmediate; } 244c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// isFPImm - Tests if this is a MO_FPImmediate operand. 245c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isFPImm() const { return OpKind == MO_FPImmediate; } 246c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// isMBB - Tests if this is a MO_MachineBasicBlock operand. 247c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isMBB() const { return OpKind == MO_MachineBasicBlock; } 248c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// isFI - Tests if this is a MO_FrameIndex operand. 249c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isFI() const { return OpKind == MO_FrameIndex; } 250c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// isCPI - Tests if this is a MO_ConstantPoolIndex operand. 251c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isCPI() const { return OpKind == MO_ConstantPoolIndex; } 252c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// isTargetIndex - Tests if this is a MO_TargetIndex operand. 253c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isTargetIndex() const { return OpKind == MO_TargetIndex; } 254c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// isJTI - Tests if this is a MO_JumpTableIndex operand. 255c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isJTI() const { return OpKind == MO_JumpTableIndex; } 256c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// isGlobal - Tests if this is a MO_GlobalAddress operand. 257c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isGlobal() const { return OpKind == MO_GlobalAddress; } 258c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// isSymbol - Tests if this is a MO_ExternalSymbol operand. 259c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isSymbol() const { return OpKind == MO_ExternalSymbol; } 260c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// isBlockAddress - Tests if this is a MO_BlockAddress operand. 261c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isBlockAddress() const { return OpKind == MO_BlockAddress; } 262c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// isRegMask - Tests if this is a MO_RegisterMask operand. 263c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isRegMask() const { return OpKind == MO_RegisterMask; } 264c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// isRegLiveOut - Tests if this is a MO_RegisterLiveOut operand. 265c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isRegLiveOut() const { return OpKind == MO_RegisterLiveOut; } 266c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// isMetadata - Tests if this is a MO_Metadata operand. 267c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isMetadata() const { return OpKind == MO_Metadata; } 268c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isMCSymbol() const { return OpKind == MO_MCSymbol; } 269c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isCFIIndex() const { return OpKind == MO_CFIIndex; } 270c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isIntrinsicID() const { return OpKind == MO_IntrinsicID; } 271c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isPredicate() const { return OpKind == MO_Predicate; } 272c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot //===--------------------------------------------------------------------===// 273c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot // Accessors for Register Operands 274c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot //===--------------------------------------------------------------------===// 275c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 276c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// getReg - Returns the register number. 277c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot unsigned getReg() const { 278c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isReg() && "This is not a register operand!"); 279c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return SmallContents.RegNo; 280c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 281c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 282c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot unsigned getSubReg() const { 283c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isReg() && "Wrong MachineOperand accessor"); 284c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return SubReg_TargetFlags; 285c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 286c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 287c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isUse() const { 288c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isReg() && "Wrong MachineOperand accessor"); 289c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return !IsDef; 290c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 291c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 292c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isDef() const { 293c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isReg() && "Wrong MachineOperand accessor"); 294c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return IsDef; 295c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 296c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 297c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isImplicit() const { 298c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isReg() && "Wrong MachineOperand accessor"); 299c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return IsImp; 300c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 301c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 302c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isDead() const { 303c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isReg() && "Wrong MachineOperand accessor"); 304c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return IsDead; 305c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 306c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 307c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isKill() const { 308c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isReg() && "Wrong MachineOperand accessor"); 309c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return IsKill; 310c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 311c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 312c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isUndef() const { 313c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isReg() && "Wrong MachineOperand accessor"); 314c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return IsUndef; 315c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 316c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 317c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isInternalRead() const { 318c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isReg() && "Wrong MachineOperand accessor"); 319c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return IsInternalRead; 320c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 321c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 322c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isEarlyClobber() const { 323c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isReg() && "Wrong MachineOperand accessor"); 324c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return IsEarlyClobber; 325c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 326c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 327c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isTied() const { 328c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isReg() && "Wrong MachineOperand accessor"); 329c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return TiedTo; 330c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 331c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 332c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isDebug() const { 333c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isReg() && "Wrong MachineOperand accessor"); 334c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return IsDebug; 335c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 336c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 337c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// readsReg - Returns true if this operand reads the previous value of its 338c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// register. A use operand with the <undef> flag set doesn't read its 339c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// register. A sub-register def implicitly reads the other parts of the 340c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// register being redefined unless the <undef> flag is set. 341c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// 342c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// This refers to reading the register value from before the current 343c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// instruction or bundle. Internal bundle reads are not included. 344c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool readsReg() const { 345c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isReg() && "Wrong MachineOperand accessor"); 346c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return !isUndef() && !isInternalRead() && (isUse() || getSubReg()); 347c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 348c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 349c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot //===--------------------------------------------------------------------===// 350c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot // Mutators for Register Operands 351c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot //===--------------------------------------------------------------------===// 352c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 353c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// Change the register this operand corresponds to. 354c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// 355c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot void setReg(unsigned Reg); 356c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 357c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot void setSubReg(unsigned subReg) { 358c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isReg() && "Wrong MachineOperand mutator"); 359c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot SubReg_TargetFlags = subReg; 360c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(SubReg_TargetFlags == subReg && "SubReg out of range"); 361c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 362c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 363c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// substVirtReg - Substitute the current register with the virtual 364c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// subregister Reg:SubReg. Take any existing SubReg index into account, 365c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// using TargetRegisterInfo to compose the subreg indices if necessary. 366c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// Reg must be a virtual register, SubIdx can be 0. 367c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// 368c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot void substVirtReg(unsigned Reg, unsigned SubIdx, const TargetRegisterInfo&); 369c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 370c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// substPhysReg - Substitute the current register with the physical register 371c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// Reg, taking any existing SubReg into account. For instance, 372c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// substPhysReg(%EAX) will change %reg1024:sub_8bit to %AL. 373c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// 374c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot void substPhysReg(unsigned Reg, const TargetRegisterInfo&); 375c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 376c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot void setIsUse(bool Val = true) { setIsDef(!Val); } 377c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 378c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot void setIsDef(bool Val = true); 379c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 380c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot void setImplicit(bool Val = true) { 381c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isReg() && "Wrong MachineOperand mutator"); 382c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot IsImp = Val; 383c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 384c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 385c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot void setIsKill(bool Val = true) { 386c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isReg() && !IsDef && "Wrong MachineOperand mutator"); 387c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert((!Val || !isDebug()) && "Marking a debug operation as kill"); 388c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot IsKill = Val; 389c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 390c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 391c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot void setIsDead(bool Val = true) { 392c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isReg() && IsDef && "Wrong MachineOperand mutator"); 393c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot IsDead = Val; 394c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 395c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 396c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot void setIsUndef(bool Val = true) { 397c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isReg() && "Wrong MachineOperand mutator"); 398c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot IsUndef = Val; 399c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 400c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 401c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot void setIsInternalRead(bool Val = true) { 402c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isReg() && "Wrong MachineOperand mutator"); 403c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot IsInternalRead = Val; 404c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 405c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 406c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot void setIsEarlyClobber(bool Val = true) { 407c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isReg() && IsDef && "Wrong MachineOperand mutator"); 408c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot IsEarlyClobber = Val; 409c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 410c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 411c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot void setIsDebug(bool Val = true) { 412c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isReg() && !IsDef && "Wrong MachineOperand mutator"); 413c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot IsDebug = Val; 414c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 415c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 416c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot //===--------------------------------------------------------------------===// 417c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot // Accessors for various operand types. 418c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot //===--------------------------------------------------------------------===// 419c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 420c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot int64_t getImm() const { 421c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isImm() && "Wrong MachineOperand accessor"); 422c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return Contents.ImmVal; 423c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 424c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 425c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot const ConstantInt *getCImm() const { 426c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isCImm() && "Wrong MachineOperand accessor"); 427c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return Contents.CI; 428c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 429c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 430c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot const ConstantFP *getFPImm() const { 431c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isFPImm() && "Wrong MachineOperand accessor"); 432c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return Contents.CFP; 433c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 434c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 435c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MachineBasicBlock *getMBB() const { 436c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isMBB() && "Wrong MachineOperand accessor"); 437c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return Contents.MBB; 438c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 439c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 440c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot int getIndex() const { 441c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert((isFI() || isCPI() || isTargetIndex() || isJTI()) && 442c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot "Wrong MachineOperand accessor"); 443c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return Contents.OffsetedInfo.Val.Index; 444c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 445c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 446c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot const GlobalValue *getGlobal() const { 447c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isGlobal() && "Wrong MachineOperand accessor"); 448c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return Contents.OffsetedInfo.Val.GV; 449c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 450c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 451c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot const BlockAddress *getBlockAddress() const { 452c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isBlockAddress() && "Wrong MachineOperand accessor"); 453c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return Contents.OffsetedInfo.Val.BA; 454c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 455c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 456c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MCSymbol *getMCSymbol() const { 457c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isMCSymbol() && "Wrong MachineOperand accessor"); 458c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return Contents.Sym; 459c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 460c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 461c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot unsigned getCFIIndex() const { 462c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isCFIIndex() && "Wrong MachineOperand accessor"); 463c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return Contents.CFIIndex; 464c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 465c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 466c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Intrinsic::ID getIntrinsicID() const { 467c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isIntrinsicID() && "Wrong MachineOperand accessor"); 468c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return Contents.IntrinsicID; 469c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 470c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 471c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot unsigned getPredicate() const { 472c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isPredicate() && "Wrong MachineOperand accessor"); 473c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return Contents.Pred; 474c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 475c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 476c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// Return the offset from the symbol in this operand. This always returns 0 477c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// for ExternalSymbol operands. 478c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot int64_t getOffset() const { 479c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert((isGlobal() || isSymbol() || isMCSymbol() || isCPI() || 480c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot isTargetIndex() || isBlockAddress()) && 481c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot "Wrong MachineOperand accessor"); 482c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return int64_t(uint64_t(Contents.OffsetedInfo.OffsetHi) << 32) | 483c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot SmallContents.OffsetLo; 484c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 485c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 486c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot const char *getSymbolName() const { 487c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isSymbol() && "Wrong MachineOperand accessor"); 488c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return Contents.OffsetedInfo.Val.SymbolName; 489c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 490c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 491c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// clobbersPhysReg - Returns true if this RegMask clobbers PhysReg. 492c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// It is sometimes necessary to detach the register mask pointer from its 493c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// machine operand. This static method can be used for such detached bit 494c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// mask pointers. 495c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot static bool clobbersPhysReg(const uint32_t *RegMask, unsigned PhysReg) { 496c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot // See TargetRegisterInfo.h. 497c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(PhysReg < (1u << 30) && "Not a physical register"); 498c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return !(RegMask[PhysReg / 32] & (1u << PhysReg % 32)); 499c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 500c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 501c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// clobbersPhysReg - Returns true if this RegMask operand clobbers PhysReg. 502c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool clobbersPhysReg(unsigned PhysReg) const { 503c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return clobbersPhysReg(getRegMask(), PhysReg); 504c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 505c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 506c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// getRegMask - Returns a bit mask of registers preserved by this RegMask 507c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// operand. 508c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot const uint32_t *getRegMask() const { 509c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isRegMask() && "Wrong MachineOperand accessor"); 510c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return Contents.RegMask; 511c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 512c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 513c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// getRegLiveOut - Returns a bit mask of live-out registers. 514c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot const uint32_t *getRegLiveOut() const { 515c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isRegLiveOut() && "Wrong MachineOperand accessor"); 516c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return Contents.RegMask; 517c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 518c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 519c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot const MDNode *getMetadata() const { 520c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isMetadata() && "Wrong MachineOperand accessor"); 521c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return Contents.MD; 522c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 523c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 524c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot //===--------------------------------------------------------------------===// 525c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot // Mutators for various operand types. 526c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot //===--------------------------------------------------------------------===// 527c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 528c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot void setImm(int64_t immVal) { 529c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isImm() && "Wrong MachineOperand mutator"); 530c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Contents.ImmVal = immVal; 531c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 532c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 533c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot void setFPImm(const ConstantFP *CFP) { 534c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isFPImm() && "Wrong MachineOperand mutator"); 535c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Contents.CFP = CFP; 536c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 537c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 538c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot void setOffset(int64_t Offset) { 539c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert((isGlobal() || isSymbol() || isMCSymbol() || isCPI() || 540c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot isTargetIndex() || isBlockAddress()) && 541c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot "Wrong MachineOperand mutator"); 542c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot SmallContents.OffsetLo = unsigned(Offset); 543c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Contents.OffsetedInfo.OffsetHi = int(Offset >> 32); 544c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 545c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 546c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot void setIndex(int Idx) { 547c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert((isFI() || isCPI() || isTargetIndex() || isJTI()) && 548c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot "Wrong MachineOperand mutator"); 549c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Contents.OffsetedInfo.Val.Index = Idx; 550c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 551c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 552c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot void setMBB(MachineBasicBlock *MBB) { 553c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isMBB() && "Wrong MachineOperand mutator"); 554c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Contents.MBB = MBB; 555c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 556c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 557c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// Sets value of register mask operand referencing Mask. The 558c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// operand does not take ownership of the memory referenced by Mask, it must 559c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// remain valid for the lifetime of the operand. See CreateRegMask(). 560c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// Any physreg with a 0 bit in the mask is clobbered by the instruction. 561c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot void setRegMask(const uint32_t *RegMaskPtr) { 562c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isRegMask() && "Wrong MachineOperand mutator"); 563c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Contents.RegMask = RegMaskPtr; 564c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 565c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 566c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot //===--------------------------------------------------------------------===// 567c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot // Other methods. 568c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot //===--------------------------------------------------------------------===// 569c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 570c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// Returns true if this operand is identical to the specified operand except 571c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// for liveness related flags (isKill, isUndef and isDead). 572c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isIdenticalTo(const MachineOperand &Other) const; 573c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 574c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// \brief MachineOperand hash_value overload. 575c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// 576c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// Note that this includes the same information in the hash that 577c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// isIdenticalTo uses for comparison. It is thus suited for use in hash 578c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// tables which use that function for equality comparisons only. 579c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot friend hash_code hash_value(const MachineOperand &MO); 580c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 581c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// ChangeToImmediate - Replace this operand with a new immediate operand of 582c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// the specified value. If an operand is known to be an immediate already, 583c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// the setImm method should be used. 584c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot void ChangeToImmediate(int64_t ImmVal); 585c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 586c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// ChangeToFPImmediate - Replace this operand with a new FP immediate operand 587c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// of the specified value. If an operand is known to be an FP immediate 588c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// already, the setFPImm method should be used. 589c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot void ChangeToFPImmediate(const ConstantFP *FPImm); 590c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 591c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// ChangeToES - Replace this operand with a new external symbol operand. 592c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot void ChangeToES(const char *SymName, unsigned char TargetFlags = 0); 593c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 594c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// ChangeToMCSymbol - Replace this operand with a new MC symbol operand. 595c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot void ChangeToMCSymbol(MCSymbol *Sym); 596c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 597c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// Replace this operand with a frame index. 598c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot void ChangeToFrameIndex(int Idx); 599c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 600c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// ChangeToRegister - Replace this operand with a new register operand of 601c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// the specified value. If an operand is known to be an register already, 602c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// the setReg method should be used. 603c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot void ChangeToRegister(unsigned Reg, bool isDef, bool isImp = false, 604c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isKill = false, bool isDead = false, 605c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isUndef = false, bool isDebug = false); 606c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 607c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot //===--------------------------------------------------------------------===// 608c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot // Construction methods. 609c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot //===--------------------------------------------------------------------===// 610c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 611c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot static MachineOperand CreateImm(int64_t Val) { 612c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MachineOperand Op(MachineOperand::MO_Immediate); 613c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.setImm(Val); 614c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return Op; 615c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 616c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 617c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot static MachineOperand CreateCImm(const ConstantInt *CI) { 618c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MachineOperand Op(MachineOperand::MO_CImmediate); 619c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.Contents.CI = CI; 620c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return Op; 621c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 622c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 623c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot static MachineOperand CreateFPImm(const ConstantFP *CFP) { 624c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MachineOperand Op(MachineOperand::MO_FPImmediate); 625c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.Contents.CFP = CFP; 626c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return Op; 627c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 628c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 629c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot static MachineOperand CreateReg(unsigned Reg, bool isDef, bool isImp = false, 630c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isKill = false, bool isDead = false, 631c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isUndef = false, 632c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isEarlyClobber = false, 633c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot unsigned SubReg = 0, 634c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isDebug = false, 635c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isInternalRead = false) { 636c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(!(isDead && !isDef) && "Dead flag on non-def"); 637c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(!(isKill && isDef) && "Kill flag on def"); 638c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MachineOperand Op(MachineOperand::MO_Register); 639c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.IsDef = isDef; 640c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.IsImp = isImp; 641c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.IsKill = isKill; 642c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.IsDead = isDead; 643c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.IsUndef = isUndef; 644c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.IsInternalRead = isInternalRead; 645c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.IsEarlyClobber = isEarlyClobber; 646c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.TiedTo = 0; 647c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.IsDebug = isDebug; 648c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.SmallContents.RegNo = Reg; 649c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.Contents.Reg.Prev = nullptr; 650c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.Contents.Reg.Next = nullptr; 651c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.setSubReg(SubReg); 652c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return Op; 653c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 654c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot static MachineOperand CreateMBB(MachineBasicBlock *MBB, 655c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot unsigned char TargetFlags = 0) { 656c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MachineOperand Op(MachineOperand::MO_MachineBasicBlock); 657c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.setMBB(MBB); 658c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.setTargetFlags(TargetFlags); 659c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return Op; 660c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 661c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot static MachineOperand CreateFI(int Idx) { 662c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MachineOperand Op(MachineOperand::MO_FrameIndex); 663c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.setIndex(Idx); 664c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return Op; 665c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 666c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot static MachineOperand CreateCPI(unsigned Idx, int Offset, 667c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot unsigned char TargetFlags = 0) { 668c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MachineOperand Op(MachineOperand::MO_ConstantPoolIndex); 669c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.setIndex(Idx); 670c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.setOffset(Offset); 671c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.setTargetFlags(TargetFlags); 672c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return Op; 673c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 674c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot static MachineOperand CreateTargetIndex(unsigned Idx, int64_t Offset, 675c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot unsigned char TargetFlags = 0) { 676c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MachineOperand Op(MachineOperand::MO_TargetIndex); 677c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.setIndex(Idx); 678c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.setOffset(Offset); 679c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.setTargetFlags(TargetFlags); 680c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return Op; 681c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 682c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot static MachineOperand CreateJTI(unsigned Idx, 683c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot unsigned char TargetFlags = 0) { 684c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MachineOperand Op(MachineOperand::MO_JumpTableIndex); 685c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.setIndex(Idx); 686c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.setTargetFlags(TargetFlags); 687c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return Op; 688c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 689c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot static MachineOperand CreateGA(const GlobalValue *GV, int64_t Offset, 690c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot unsigned char TargetFlags = 0) { 691c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MachineOperand Op(MachineOperand::MO_GlobalAddress); 692c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.Contents.OffsetedInfo.Val.GV = GV; 693c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.setOffset(Offset); 694c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.setTargetFlags(TargetFlags); 695c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return Op; 696c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 697c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot static MachineOperand CreateES(const char *SymName, 698c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot unsigned char TargetFlags = 0) { 699c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MachineOperand Op(MachineOperand::MO_ExternalSymbol); 700c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.Contents.OffsetedInfo.Val.SymbolName = SymName; 701c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.setOffset(0); // Offset is always 0. 702c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.setTargetFlags(TargetFlags); 703c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return Op; 704c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 705c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot static MachineOperand CreateBA(const BlockAddress *BA, int64_t Offset, 706c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot unsigned char TargetFlags = 0) { 707c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MachineOperand Op(MachineOperand::MO_BlockAddress); 708c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.Contents.OffsetedInfo.Val.BA = BA; 709c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.setOffset(Offset); 710c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.setTargetFlags(TargetFlags); 711c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return Op; 712c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 713c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// CreateRegMask - Creates a register mask operand referencing Mask. The 714c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// operand does not take ownership of the memory referenced by Mask, it must 715c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// remain valid for the lifetime of the operand. 716c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// 717c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// A RegMask operand represents a set of non-clobbered physical registers on 718c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// an instruction that clobbers many registers, typically a call. The bit 719c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// mask has a bit set for each physreg that is preserved by this 720c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// instruction, as described in the documentation for 721c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// TargetRegisterInfo::getCallPreservedMask(). 722c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// 723c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// Any physreg with a 0 bit in the mask is clobbered by the instruction. 724c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// 725c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot static MachineOperand CreateRegMask(const uint32_t *Mask) { 726c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(Mask && "Missing register mask"); 727c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MachineOperand Op(MachineOperand::MO_RegisterMask); 728c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.Contents.RegMask = Mask; 729c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return Op; 730c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 731c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot static MachineOperand CreateRegLiveOut(const uint32_t *Mask) { 732c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(Mask && "Missing live-out register mask"); 733c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MachineOperand Op(MachineOperand::MO_RegisterLiveOut); 734c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.Contents.RegMask = Mask; 735c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return Op; 736c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 737c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot static MachineOperand CreateMetadata(const MDNode *Meta) { 738c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MachineOperand Op(MachineOperand::MO_Metadata); 739c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.Contents.MD = Meta; 740c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return Op; 741c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 742c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 743c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot static MachineOperand CreateMCSymbol(MCSymbol *Sym, 744c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot unsigned char TargetFlags = 0) { 745c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MachineOperand Op(MachineOperand::MO_MCSymbol); 746c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.Contents.Sym = Sym; 747c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.setOffset(0); 748c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.setTargetFlags(TargetFlags); 749c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return Op; 750c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 751c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 752c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot static MachineOperand CreateCFIIndex(unsigned CFIIndex) { 753c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MachineOperand Op(MachineOperand::MO_CFIIndex); 754c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.Contents.CFIIndex = CFIIndex; 755c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return Op; 756c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 757c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 758c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot static MachineOperand CreateIntrinsicID(Intrinsic::ID ID) { 759c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MachineOperand Op(MachineOperand::MO_IntrinsicID); 760c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.Contents.IntrinsicID = ID; 761c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return Op; 762c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 763c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 764c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot static MachineOperand CreatePredicate(unsigned Pred) { 765c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MachineOperand Op(MachineOperand::MO_Predicate); 766c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot Op.Contents.Pred = Pred; 767c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return Op; 768c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 769c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 770c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot friend class MachineInstr; 771c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot friend class MachineRegisterInfo; 772c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robotprivate: 773c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot void removeRegFromUses(); 774c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 775c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot //===--------------------------------------------------------------------===// 776c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot // Methods for handling register use/def lists. 777c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot //===--------------------------------------------------------------------===// 778c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 779c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// isOnRegUseList - Return true if this operand is on a register use/def list 780c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// or false if not. This can only be called for register operands that are 781c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot /// part of a machine instruction. 782c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot bool isOnRegUseList() const { 783c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot assert(isReg() && "Can only add reg operand to use lists"); 784c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return Contents.Reg.Prev != nullptr; 785c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot } 786c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot}; 787c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 788c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robotinline raw_ostream &operator<<(raw_ostream &OS, const MachineOperand& MO) { 789c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot MO.print(OS, nullptr); 790c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot return OS; 791c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot} 792c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 793c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot // See friend declaration above. This additional declaration is required in 794c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot // order to compile LLVM with IBM xlC compiler. 795c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot hash_code hash_value(const MachineOperand &MO); 796c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot} // End llvm namespace 797c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot 798c9cc9e7d29b8970d8ddb734c88fb62d01e0b727android-build-team Robot#endif 799