Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1292)

Unified Diff: src/IceCfg.cpp

Issue 1323693002: Subzero: Provide a macro for iterating over instruction variables. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: "Addresses comments" Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/IceCfgNode.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceCfg.cpp
diff --git a/src/IceCfg.cpp b/src/IceCfg.cpp
index 5797fdcaf6375139dc1dc611e27792fdbba838cf..416376be28d3938e3854f5ccd9aa249f749197cd 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) {
+ static constexpr 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";
}
}
}
« no previous file with comments | « no previous file | src/IceCfgNode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698