Commit 6a661ced by Mohit Bhakkad Committed by Jim Stichnoth

SubZero: Correct parenthesis for mem operands with labels in MIPS32

R=stichnot@chromium.org Review URL: https://codereview.chromium.org/2143243003 . Patch from Mohit Bhakkad <mohit.bhakkad@imgtec.com>.
parent f47d520c
...@@ -281,7 +281,9 @@ void OperandMIPS32Mem::emit(const Cfg *Func) const { ...@@ -281,7 +281,9 @@ void OperandMIPS32Mem::emit(const Cfg *Func) const {
Ostream &Str = Func->getContext()->getStrEmit(); Ostream &Str = Func->getContext()->getStrEmit();
Operand *Offset = getOffset(); Operand *Offset = getOffset();
if (auto *CR = llvm::dyn_cast<ConstantRelocatable>(Offset)) { if (auto *CR = llvm::dyn_cast<ConstantRelocatable>(Offset)) {
Str << "(";
CR->emitWithoutPrefix(Func->getTarget()); CR->emitWithoutPrefix(Func->getTarget());
Str << ")";
} else } else
Offset->emit(Func); Offset->emit(Func);
Str << "("; Str << "(";
......
...@@ -517,9 +517,7 @@ public: ...@@ -517,9 +517,7 @@ public:
getSrc(0)->emit(Func); getSrc(0)->emit(Func);
Str << ", "; Str << ", ";
emitRelocOp(Str, Reloc); emitRelocOp(Str, Reloc);
Str << (Reloc ? "(" : "");
getSrc(1)->emit(Func); getSrc(1)->emit(Func);
Str << (Reloc ? ")" : "");
} }
void emitIAS(const Cfg *Func) const override { void emitIAS(const Cfg *Func) const override {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment