summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp2
-rw-r--r--llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCInstrInfo.cpp10
-rw-r--r--llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCInstrInfo.h7
3 files changed, 11 insertions, 8 deletions
diff --git a/llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp b/llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp
index 289d2676bf2..369bb46c44e 100644
--- a/llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp
+++ b/llvm/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp
@@ -871,7 +871,7 @@ bool HexagonAsmParser::MatchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode,
MatchingInlineAsm, MustExtend))
return true;
HexagonMCInstrInfo::extendIfNeeded(
- MCII, MCB, *SubInst,
+ getParser().getContext(), MCII, MCB, *SubInst,
HexagonMCInstrInfo::isExtended(MCII, *SubInst) || MustExtend);
MCB.addOperand(MCOperand::createInst(SubInst));
if (!InBrackets)
diff --git a/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCInstrInfo.cpp b/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCInstrInfo.cpp
index 29406120803..2145fb7f423 100644
--- a/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCInstrInfo.cpp
+++ b/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCInstrInfo.cpp
@@ -28,7 +28,8 @@ void HexagonMCInstrInfo::addConstant(MCInst &MI, uint64_t Value,
MI.addOperand(MCOperand::createExpr(MCConstantExpr::create(Value, Context)));
}
-void HexagonMCInstrInfo::addConstExtender(MCInstrInfo const &MCII, MCInst &MCB,
+void HexagonMCInstrInfo::addConstExtender(MCContext &Context,
+ MCInstrInfo const &MCII, MCInst &MCB,
MCInst const &MCI) {
assert(HexagonMCInstrInfo::isBundle(MCB));
MCOperand const &exOp =
@@ -36,7 +37,7 @@ void HexagonMCInstrInfo::addConstExtender(MCInstrInfo const &MCII, MCInst &MCB,
// Create the extender.
MCInst *XMCI =
- new MCInst(HexagonMCInstrInfo::deriveExtender(MCII, MCI, exOp));
+ new (Context) MCInst(HexagonMCInstrInfo::deriveExtender(MCII, MCI, exOp));
MCB.addOperand(MCOperand::createInst(XMCI));
}
@@ -150,10 +151,11 @@ MCInst const *HexagonMCInstrInfo::extenderForIndex(MCInst const &MCB,
return nullptr;
}
-void HexagonMCInstrInfo::extendIfNeeded(MCInstrInfo const &MCII, MCInst &MCB,
+void HexagonMCInstrInfo::extendIfNeeded(MCContext &Context,
+ MCInstrInfo const &MCII, MCInst &MCB,
MCInst const &MCI, bool MustExtend) {
if (isConstExtended(MCII, MCI) || MustExtend)
- addConstExtender(MCII, MCB, MCI);
+ addConstExtender(Context, MCII, MCB, MCI);
}
HexagonII::MemAccessSize
diff --git a/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCInstrInfo.h b/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCInstrInfo.h
index a3230d2ae73..f8c6f395ee1 100644
--- a/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCInstrInfo.h
+++ b/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCInstrInfo.h
@@ -53,7 +53,8 @@ int64_t const memStoreReorderEnabledMask = 1 << memStoreReorderEnabledOffset;
size_t const bundleInstructionsOffset = 1;
void addConstant(MCInst &MI, uint64_t Value, MCContext &Context);
-void addConstExtender(MCInstrInfo const &MCII, MCInst &MCB, MCInst const &MCI);
+void addConstExtender(MCContext &Context, MCInstrInfo const &MCII, MCInst &MCB,
+ MCInst const &MCI);
// Returns a iterator range of instructions in this bundle
iterator_range<MCInst::const_iterator> bundleInstructions(MCInst const &MCI);
@@ -71,8 +72,8 @@ void clampExtended(MCInstrInfo const &MCII, MCContext &Context, MCInst &MCI);
// Return the extender for instruction at Index or nullptr if none
MCInst const *extenderForIndex(MCInst const &MCB, size_t Index);
-void extendIfNeeded(MCInstrInfo const &MCII, MCInst &MCB, MCInst const &MCI,
- bool MustExtend);
+void extendIfNeeded(MCContext &Context, MCInstrInfo const &MCII, MCInst &MCB,
+ MCInst const &MCI, bool MustExtend);
// Create a duplex instruction given the two subinsts
MCInst *deriveDuplex(MCContext &Context, unsigned iClass, MCInst const &inst0,
OpenPOWER on IntegriCloud