Chromium Code Reviews| Index: src/IceInst.h |
| diff --git a/src/IceInst.h b/src/IceInst.h |
| index 0a47e1a50821880994e1c52fc139221abc612973..aba4ce02b44cb04de1a18f6f3baa5e0df921ce05 100644 |
| --- a/src/IceInst.h |
| +++ b/src/IceInst.h |
| @@ -100,11 +100,21 @@ public: |
| "getTerminatorEdges() called on a non-terminator instruction"); |
| return NodeList(); |
| } |
| + virtual bool isUnconditionalBranch() const { return false; } |
| + // If the instruction is a branch-type instruction with OldNode as a |
| + // target, repoint it to NewNode and return true, otherwise return |
| + // false. Only repoint one instance, even if the instruction has |
| + // multiple instances of OldNode as a target. |
| + virtual bool repointEdge(CfgNode *OldNode, CfgNode *NewNode) { |
| + (void)OldNode; |
| + (void)NewNode; |
| + return false; |
| + } |
| virtual bool isSimpleAssign() const { return false; } |
| void livenessLightweight(Cfg *Func, LivenessBV &Live); |
| - void liveness(InstNumberT InstNumber, LivenessBV &Live, Liveness *Liveness, |
| + bool liveness(InstNumberT InstNumber, LivenessBV &Live, Liveness *Liveness, |
|
jvoung (off chromium)
2014/10/27 22:12:21
document the meaning of the "bool" return value of
Jim Stichnoth
2014/10/28 01:20:14
I had documented it in the .cpp file, so I moved t
|
| LiveBeginEndMap *LiveBegin, LiveBeginEndMap *LiveEnd); |
| // Get the number of native instructions that this instruction |
| @@ -304,6 +314,8 @@ public: |
| return getTargetFalse(); |
| } |
| NodeList getTerminatorEdges() const override; |
| + bool isUnconditionalBranch() const override { return isUnconditional(); } |
| + bool repointEdge(CfgNode *OldNode, CfgNode *NewNode) override; |
| void dump(const Cfg *Func) const override; |
| static bool classof(const Inst *Inst) { return Inst->getKind() == Br; } |
| @@ -314,8 +326,8 @@ private: |
| InstBr(Cfg *Func, CfgNode *Target); |
| ~InstBr() override {} |
| - CfgNode *const TargetFalse; // Doubles as unconditional branch target |
| - CfgNode *const TargetTrue; // NULL if unconditional branch |
| + CfgNode *TargetFalse; // Doubles as unconditional branch target |
| + CfgNode *TargetTrue; // NULL if unconditional branch |
| }; |
| // Call instruction. The call target is captured as getSrc(0), and |
| @@ -671,6 +683,7 @@ public: |
| } |
| void addBranch(SizeT CaseIndex, uint64_t Value, CfgNode *Label); |
| NodeList getTerminatorEdges() const override; |
| + bool repointEdge(CfgNode *OldNode, CfgNode *NewNode) override; |
| void dump(const Cfg *Func) const override; |
| static bool classof(const Inst *Inst) { return Inst->getKind() == Switch; } |