clang-tidy cleanups. No functional change intended.

This commit is contained in:
Wilson Snyder
2020-11-10 21:40:14 -05:00
parent 8664aac225
commit 44eb362a18
37 changed files with 184 additions and 193 deletions
+10 -17
View File
@@ -49,7 +49,6 @@ public:
VDouble0 m_statAssnCon; // Statistic tracking
std::vector<AstNode*> m_unlinkps;
public:
// CONSTRUCTORS
LifeState() {}
~LifeState() {
@@ -68,35 +67,29 @@ public:
// Structure for each variable encountered
class LifeVarEntry {
AstNodeAssign* m_assignp; // Last assignment to this varscope, nullptr if no longer relevant
AstConst* m_constp; // Known constant value
// Last assignment to this varscope, nullptr if no longer relevant
AstNodeAssign* m_assignp = nullptr;
AstConst* m_constp = nullptr; // Known constant value
// First access was a set (and thus block above may have a set that can be deleted
bool m_setBeforeUse;
// Was ever assigned (and thus above block may not preserve constant propagation)
bool m_everSet;
inline void init(bool setBeforeUse) {
m_assignp = nullptr;
m_constp = nullptr;
m_setBeforeUse = setBeforeUse;
m_everSet = false;
}
bool m_everSet = false;
public:
class SIMPLEASSIGN {};
class COMPLEXASSIGN {};
class CONSUMED {};
LifeVarEntry(SIMPLEASSIGN, AstNodeAssign* assp) {
init(true);
LifeVarEntry(SIMPLEASSIGN, AstNodeAssign* assp)
: m_setBeforeUse{true} {
simpleAssign(assp);
}
explicit LifeVarEntry(COMPLEXASSIGN) {
init(false);
explicit LifeVarEntry(COMPLEXASSIGN)
: m_setBeforeUse{false} {
complexAssign();
}
explicit LifeVarEntry(CONSUMED) {
init(false);
explicit LifeVarEntry(CONSUMED)
: m_setBeforeUse{false} {
consumed();
}
~LifeVarEntry() {}