Chromium Code Reviews| Index: src/IceTargetLoweringX86BaseImpl.h |
| diff --git a/src/IceTargetLoweringX86BaseImpl.h b/src/IceTargetLoweringX86BaseImpl.h |
| index a9dc7a7e75496b3d28fb654c2188c7b6cc2ed0da..4ba477a708589ddc6c64d51cc780d10f2ed25039 100644 |
| --- a/src/IceTargetLoweringX86BaseImpl.h |
| +++ b/src/IceTargetLoweringX86BaseImpl.h |
| @@ -944,17 +944,12 @@ void TargetX86Base<TraitsType>::emitVariable(const Variable *Var) const { |
| auto BaseRegNum = Var->getBaseRegNum(); |
| if (BaseRegNum.hasNoValue()) |
| BaseRegNum = getFrameOrStackReg(); |
| - // Print in the form "Offset(%reg)", taking care that: |
| - // - Offset is never printed when it is 0 |
| - |
| - const bool DecorateAsm = getFlags().getDecorateAsm(); |
| - // Only print Offset when it is nonzero, regardless of DecorateAsm. |
| - if (Offset) { |
| - if (DecorateAsm) { |
| - Str << Var->getSymbolicStackOffset(); |
| - } else { |
| - Str << Offset; |
| - } |
| + |
| + // Print in the form "Offset(%reg)", omitting Offset when it is 0. |
| + if (getFlags().getDecorateAsm()) { |
| + Str << Var->getSymbolicStackOffset(); |
| + } else if (Offset) { |
|
John
2016/07/06 16:07:39
I prefer
if (Offset != 0),
but up to you.
Jim Stichnoth
2016/07/08 10:37:54
Done.
|
| + Str << Offset; |
| } |
| const Type FrameSPTy = Traits::WordType; |
| Str << "(%" << getRegName(BaseRegNum, FrameSPTy) << ")"; |
| @@ -1211,7 +1206,7 @@ void TargetX86Base<TraitsType>::addProlog(CfgNode *Node) { |
| // Assign stack offsets to variables that have been linked to spilled |
| // variables. |
| for (Variable *Var : VariablesLinkedToSpillSlots) { |
| - const Variable *Linked = Var->getLinkedTo(); |
| + const Variable *Linked = Var->getLinkedToRoot(); |
|
John
2016/07/06 16:07:39
Consider renaming Linked to Root (yes, this is opt
Jim Stichnoth
2016/07/08 10:37:54
Done.
|
| assert(Linked != nullptr); |
| Var->setStackOffset(Linked->getStackOffset()); |
| } |