@@ -89,39 +89,39 @@ bool Instruction::hasMemoryOperands() const {
89
89
[](const Operand &Op) { return Op.IsMem ; });
90
90
}
91
91
92
- InstructionInstance::InstructionInstance (const Instruction &Instr)
92
+ InstructionBuilder::InstructionBuilder (const Instruction &Instr)
93
93
: Instr(Instr), VariableValues(Instr.Variables.size()) {}
94
94
95
- InstructionInstance::InstructionInstance (InstructionInstance &&) = default ;
95
+ InstructionBuilder::InstructionBuilder (InstructionBuilder &&) = default ;
96
96
97
- InstructionInstance &InstructionInstance ::
98
- operator =(InstructionInstance &&) = default ;
97
+ InstructionBuilder &InstructionBuilder ::
98
+ operator =(InstructionBuilder &&) = default ;
99
99
100
- InstructionInstance::InstructionInstance (const InstructionInstance &) = default ;
100
+ InstructionBuilder::InstructionBuilder (const InstructionBuilder &) = default ;
101
101
102
- InstructionInstance &InstructionInstance ::
103
- operator =(const InstructionInstance &) = default ;
102
+ InstructionBuilder &InstructionBuilder ::
103
+ operator =(const InstructionBuilder &) = default ;
104
104
105
- unsigned InstructionInstance ::getOpcode () const {
105
+ unsigned InstructionBuilder ::getOpcode () const {
106
106
return Instr.Description ->getOpcode ();
107
107
}
108
108
109
- llvm::MCOperand &InstructionInstance ::getValueFor (const Variable &Var) {
109
+ llvm::MCOperand &InstructionBuilder ::getValueFor (const Variable &Var) {
110
110
return VariableValues[Var.Index ];
111
111
}
112
112
113
113
const llvm::MCOperand &
114
- InstructionInstance ::getValueFor (const Variable &Var) const {
114
+ InstructionBuilder ::getValueFor (const Variable &Var) const {
115
115
return VariableValues[Var.Index ];
116
116
}
117
117
118
- llvm::MCOperand &InstructionInstance ::getValueFor (const Operand &Op) {
118
+ llvm::MCOperand &InstructionBuilder ::getValueFor (const Operand &Op) {
119
119
assert (Op.VariableIndex >= 0 );
120
120
return getValueFor (Instr.Variables [Op.VariableIndex ]);
121
121
}
122
122
123
123
const llvm::MCOperand &
124
- InstructionInstance ::getValueFor (const Operand &Op) const {
124
+ InstructionBuilder ::getValueFor (const Operand &Op) const {
125
125
assert (Op.VariableIndex >= 0 );
126
126
return getValueFor (Instr.Variables [Op.VariableIndex ]);
127
127
}
@@ -131,7 +131,7 @@ static void randomize(const Instruction &Instr, const Variable &Var,
131
131
llvm::MCOperand &AssignedValue,
132
132
const llvm::BitVector &ForbiddenRegs);
133
133
134
- bool InstructionInstance ::hasImmediateVariables () const {
134
+ bool InstructionBuilder ::hasImmediateVariables () const {
135
135
return llvm::any_of (Instr.Variables , [this ](const Variable &Var) {
136
136
assert (!Var.TiedOperands .empty ());
137
137
const unsigned OpIndex = Var.TiedOperands [0 ];
@@ -141,7 +141,7 @@ bool InstructionInstance::hasImmediateVariables() const {
141
141
});
142
142
}
143
143
144
- void InstructionInstance ::randomizeUnsetVariables (
144
+ void InstructionBuilder ::randomizeUnsetVariables (
145
145
const llvm::BitVector &ForbiddenRegs) {
146
146
for (const Variable &Var : Instr.Variables ) {
147
147
llvm::MCOperand &AssignedValue = getValueFor (Var);
@@ -150,7 +150,7 @@ void InstructionInstance::randomizeUnsetVariables(
150
150
}
151
151
}
152
152
153
- llvm::MCInst InstructionInstance ::build () const {
153
+ llvm::MCInst InstructionBuilder ::build () const {
154
154
llvm::MCInst Result;
155
155
Result.setOpcode (Instr.Description ->Opcode );
156
156
for (const auto &Op : Instr.Operands )
@@ -261,10 +261,10 @@ static void randomize(const Instruction &Instr, const Variable &Var,
261
261
}
262
262
263
263
static void setRegisterOperandValue (const RegisterOperandAssignment &ROV,
264
- InstructionInstance &II ) {
264
+ InstructionBuilder &IB ) {
265
265
assert (ROV.Op );
266
266
if (ROV.Op ->IsExplicit ) {
267
- auto &AssignedValue = II .getValueFor (*ROV.Op );
267
+ auto &AssignedValue = IB .getValueFor (*ROV.Op );
268
268
if (AssignedValue.isValid ()) {
269
269
assert (AssignedValue.isReg () && AssignedValue.getReg () == ROV.Reg );
270
270
return ;
@@ -285,12 +285,12 @@ size_t randomBit(const llvm::BitVector &Vector) {
285
285
}
286
286
287
287
void setRandomAliasing (const AliasingConfigurations &AliasingConfigurations,
288
- InstructionInstance &DefII, InstructionInstance &UseII ) {
288
+ InstructionBuilder &DefIB, InstructionBuilder &UseIB ) {
289
289
assert (!AliasingConfigurations.empty ());
290
290
assert (!AliasingConfigurations.hasImplicitAliasing ());
291
291
const auto &RandomConf = randomElement (AliasingConfigurations.Configurations );
292
- setRegisterOperandValue (randomElement (RandomConf.Defs ), DefII );
293
- setRegisterOperandValue (randomElement (RandomConf.Uses ), UseII );
292
+ setRegisterOperandValue (randomElement (RandomConf.Defs ), DefIB );
293
+ setRegisterOperandValue (randomElement (RandomConf.Uses ), UseIB );
294
294
}
295
295
296
296
void DumpMCOperand (const llvm::MCRegisterInfo &MCRegisterInfo,
0 commit comments