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

Unified Diff: src/IceOperand.h

Issue 1691193002: Subzero: Prototype to make use of RegNumT::No Register more concise (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: changes suggested by stichnot Created 4 years, 10 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/IceOperand.cpp » ('j') | src/IceOperand.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceOperand.h
diff --git a/src/IceOperand.h b/src/IceOperand.h
index a20308660ced41885cc20c2d8cdf756a5ee4ffe3..0cc46405dd49953ad5656da4740f4a0f281b8f22 100644
--- a/src/IceOperand.h
+++ b/src/IceOperand.h
@@ -443,6 +443,9 @@ public:
enum { NoRegisterValue = std::numeric_limits<BaseType>::max() };
const static RegNumT NoRegister /* = NoRegisterValue */;
+ bool hasNoValue() const { return !hasValue(); }
Jim Stichnoth 2016/02/12 18:29:54 Nit: I would reverse the order of these two defini
rkotlerimgtec 2016/02/12 22:02:01 Done.
+ bool hasValue() const { return Value != NoRegisterValue; }
+
private:
BaseType Value = NoRegisterValue;
static BaseType Limit;
@@ -646,14 +649,14 @@ public:
return "lv$" + getName(Func);
}
- bool hasReg() const { return getRegNum() != RegNumT::NoRegister; }
+ bool hasReg() const { return getRegNum().hasValue(); }
RegNumT getRegNum() const { return RegNum; }
void setRegNum(RegNumT NewRegNum) {
// Regnum shouldn't be set more than once.
assert(!hasReg() || RegNum == NewRegNum);
RegNum = NewRegNum;
}
- bool hasRegTmp() const { return getRegNumTmp() != RegNumT::NoRegister; }
+ bool hasRegTmp() const { return getRegNumTmp().hasValue(); }
RegNumT getRegNumTmp() const { return RegNumTmp; }
void setRegNumTmp(RegNumT NewRegNum) { RegNumTmp = NewRegNum; }
« no previous file with comments | « no previous file | src/IceOperand.cpp » ('j') | src/IceOperand.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698