Chromium Code Reviews| Index: src/IceCfg.cpp |
| diff --git a/src/IceCfg.cpp b/src/IceCfg.cpp |
| index 5797fdcaf6375139dc1dc611e27792fdbba838cf..664114b7b47a8d88235e89f1235c5cd8a176777b 100644 |
| --- a/src/IceCfg.cpp |
| +++ b/src/IceCfg.cpp |
| @@ -22,6 +22,7 @@ |
| #include "IceELFObjectWriter.h" |
| #include "IceGlobalInits.h" |
| #include "IceInst.h" |
| +#include "IceInstVarIter.h" |
| #include "IceLiveness.h" |
| #include "IceOperand.h" |
| #include "IceTargetLowering.h" |
| @@ -585,19 +586,14 @@ bool Cfg::validateLiveness() const { |
| } |
| } |
| } |
| - for (SizeT I = 0; I < Inst.getSrcSize(); ++I) { |
| - Operand *Src = Inst.getSrc(I); |
| - SizeT NumVars = Src->getNumVars(); |
| - for (SizeT J = 0; J < NumVars; ++J) { |
| - const Variable *Var = Src->getVar(J); |
| - const bool IsDest = false; |
| - if (!Var->getIgnoreLiveness() && |
| - !Var->getLiveRange().containsValue(InstNumber, IsDest)) { |
| - Valid = false; |
| - Str << "Liveness error: inst " << Inst.getNumber() << " var "; |
| - Var->dump(this); |
| - Str << " live range " << Var->getLiveRange() << "\n"; |
| - } |
| + FOREACH_VAR_IN_INST(Var, Inst) { |
| + const bool IsDest = false; |
|
Jim Stichnoth
2015/08/29 23:20:39
constexpr
John
2015/08/31 16:26:39
Do you mind
static constexpr
??
|
| + if (!Var->getIgnoreLiveness() && |
| + !Var->getLiveRange().containsValue(InstNumber, IsDest)) { |
| + Valid = false; |
| + Str << "Liveness error: inst " << Inst.getNumber() << " var "; |
| + Var->dump(this); |
| + Str << " live range " << Var->getLiveRange() << "\n"; |
| } |
| } |
| } |