summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-exegesis/lib/CodeTemplate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-exegesis/lib/CodeTemplate.cpp')
-rw-r--r--llvm/tools/llvm-exegesis/lib/CodeTemplate.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/llvm/tools/llvm-exegesis/lib/CodeTemplate.cpp b/llvm/tools/llvm-exegesis/lib/CodeTemplate.cpp
index 9d01c7d40b0..9840a08c253 100644
--- a/llvm/tools/llvm-exegesis/lib/CodeTemplate.cpp
+++ b/llvm/tools/llvm-exegesis/lib/CodeTemplate.cpp
@@ -15,8 +15,8 @@ CodeTemplate::CodeTemplate(CodeTemplate &&) = default;
CodeTemplate &CodeTemplate::operator=(CodeTemplate &&) = default;
-InstructionTemplate::InstructionTemplate(const Instruction &Instr)
- : Instr(Instr), VariableValues(Instr.Variables.size()) {}
+InstructionTemplate::InstructionTemplate(const Instruction *Instr)
+ : Instr(Instr), VariableValues(Instr->Variables.size()) {}
InstructionTemplate::InstructionTemplate(InstructionTemplate &&) = default;
@@ -29,7 +29,7 @@ InstructionTemplate &InstructionTemplate::
operator=(const InstructionTemplate &) = default;
unsigned InstructionTemplate::getOpcode() const {
- return Instr.Description->getOpcode();
+ return Instr->Description.getOpcode();
}
MCOperand &InstructionTemplate::getValueFor(const Variable &Var) {
@@ -41,23 +41,23 @@ const MCOperand &InstructionTemplate::getValueFor(const Variable &Var) const {
}
MCOperand &InstructionTemplate::getValueFor(const Operand &Op) {
- return getValueFor(Instr.Variables[Op.getVariableIndex()]);
+ return getValueFor(Instr->Variables[Op.getVariableIndex()]);
}
const MCOperand &InstructionTemplate::getValueFor(const Operand &Op) const {
- return getValueFor(Instr.Variables[Op.getVariableIndex()]);
+ return getValueFor(Instr->Variables[Op.getVariableIndex()]);
}
bool InstructionTemplate::hasImmediateVariables() const {
- return any_of(Instr.Variables, [this](const Variable &Var) {
- return Instr.getPrimaryOperand(Var).isImmediate();
+ return any_of(Instr->Variables, [this](const Variable &Var) {
+ return Instr->getPrimaryOperand(Var).isImmediate();
});
}
MCInst InstructionTemplate::build() const {
MCInst Result;
- Result.setOpcode(Instr.Description->Opcode);
- for (const auto &Op : Instr.Operands)
+ Result.setOpcode(Instr->Description.Opcode);
+ for (const auto &Op : Instr->Operands)
if (Op.isExplicit())
Result.addOperand(getValueFor(Op));
return Result;
OpenPOWER on IntegriCloud