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

Unified Diff: src/IceOperand.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 | « src/IceInstVarIter.h ('k') | src/IceRegAlloc.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceOperand.cpp
diff --git a/src/IceOperand.cpp b/src/IceOperand.cpp
index 32316ba6ffda6d4f1e8bcab3e1a1ddd589960695..c10656f5a19dbdb7596e5728fff183d2d790b115 100644
--- a/src/IceOperand.cpp
+++ b/src/IceOperand.cpp
@@ -18,6 +18,7 @@
#include "IceCfg.h"
#include "IceCfgNode.h"
#include "IceInst.h"
+#include "IceInstVarIter.h"
#include "IceTargetLowering.h" // dumping stack/frame pointer register
namespace Ice {
@@ -328,16 +329,11 @@ void VariablesMetadata::addNode(CfgNode *Node) {
assert(DestNum < Metadata.size());
Metadata[DestNum].markDef(Kind, &I, Node);
}
- for (SizeT SrcNum = 0; SrcNum < I.getSrcSize(); ++SrcNum) {
- Operand *Src = I.getSrc(SrcNum);
- SizeT NumVars = Src->getNumVars();
- for (SizeT J = 0; J < NumVars; ++J) {
- const Variable *Var = Src->getVar(J);
- SizeT VarNum = Var->getIndex();
- assert(VarNum < Metadata.size());
- constexpr bool IsImplicit = false;
- Metadata[VarNum].markUse(Kind, &I, Node, IsImplicit);
- }
+ FOREACH_VAR_IN_INST(Var, I) {
+ SizeT VarNum = Var->getIndex();
+ assert(VarNum < Metadata.size());
+ constexpr bool IsImplicit = false;
+ Metadata[VarNum].markUse(Kind, &I, Node, IsImplicit);
}
}
}
« no previous file with comments | « src/IceInstVarIter.h ('k') | src/IceRegAlloc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698