Commit b2f61492 authored by Kevin Modzelewski's avatar Kevin Modzelewski Committed by Kevin Modzelewski

Incorporate Marius's feedback

parent 43992f58
...@@ -36,7 +36,6 @@ public: ...@@ -36,7 +36,6 @@ public:
virtual ~BBAnalyzer() {} virtual ~BBAnalyzer() {}
virtual T merge(T from, T into) const = 0; virtual T merge(T from, T into) const = 0;
virtual T mergeBlank(T into) const = 0;
virtual void processBB(Map& starting, CFGBlock* block) const = 0; virtual void processBB(Map& starting, CFGBlock* block) const = 0;
}; };
......
...@@ -36,7 +36,7 @@ namespace pyston { ...@@ -36,7 +36,7 @@ namespace pyston {
class LivenessBBVisitor : public NoopASTVisitor { class LivenessBBVisitor : public NoopASTVisitor {
private: private:
struct Status { struct Status {
enum Usage { enum Usage : char {
NONE, NONE,
USED, USED,
DEFINED, DEFINED,
...@@ -231,10 +231,6 @@ public: ...@@ -231,10 +231,6 @@ public:
return DefinednessAnalysis::PotentiallyDefined; return DefinednessAnalysis::PotentiallyDefined;
} }
virtual void processBB(Map& starting, CFGBlock* block) const; virtual void processBB(Map& starting, CFGBlock* block) const;
virtual DefinitionLevel mergeBlank(DefinitionLevel into) const {
assert(into != DefinednessAnalysis::Undefined);
return DefinednessAnalysis::PotentiallyDefined;
}
}; };
class DefinednessVisitor : public ASTVisitor { class DefinednessVisitor : public ASTVisitor {
......
...@@ -58,7 +58,7 @@ class PhiAnalysis; ...@@ -58,7 +58,7 @@ class PhiAnalysis;
class DefinednessAnalysis { class DefinednessAnalysis {
public: public:
enum DefinitionLevel { enum DefinitionLevel : char {
Unknown, Unknown,
Undefined, Undefined,
PotentiallyDefined, PotentiallyDefined,
...@@ -96,12 +96,10 @@ public: ...@@ -96,12 +96,10 @@ public:
PhiAnalysis(VRegMap<DefinednessAnalysis::DefinitionLevel> initial_map, CFGBlock* initial_block, PhiAnalysis(VRegMap<DefinednessAnalysis::DefinitionLevel> initial_map, CFGBlock* initial_block,
bool initials_need_phis, LivenessAnalysis* liveness, ScopeInfo* scope_info); bool initials_need_phis, LivenessAnalysis* liveness, ScopeInfo* scope_info);
// TODO: convert these to taking vregs
bool isRequired(int vreg, CFGBlock* block); bool isRequired(int vreg, CFGBlock* block);
bool isRequiredAfter(int vreg, CFGBlock* block); bool isRequiredAfter(int vreg, CFGBlock* block);
const VRegSet& getAllRequiredAfter(CFGBlock* block); const VRegSet& getAllRequiredAfter(CFGBlock* block);
const VRegSet& getAllRequiredFor(CFGBlock* block); const VRegSet& getAllRequiredFor(CFGBlock* block);
// TODO: convert these to taking vregs
// If "name" may be undefined at the beginning of any immediate successor block of "block": // If "name" may be undefined at the beginning of any immediate successor block of "block":
bool isPotentiallyUndefinedAfter(int vreg, CFGBlock* block); bool isPotentiallyUndefinedAfter(int vreg, CFGBlock* block);
// If "name" may be undefined at the beginning of "block" // If "name" may be undefined at the beginning of "block"
......
...@@ -203,7 +203,7 @@ public: ...@@ -203,7 +203,7 @@ public:
class VRegSet { class VRegSet {
private: private:
// TODO: switch just to a bool* // TODO: switch just to a bool*?
std::vector<bool> v; std::vector<bool> v;
public: public:
...@@ -259,7 +259,7 @@ public: ...@@ -259,7 +259,7 @@ public:
template <typename T> class VRegMap { template <typename T> class VRegMap {
private: private:
// TODO: switch just to a T* // TODO: switch just to a T*?
std::vector<T> v; std::vector<T> v;
public: public:
......
...@@ -347,7 +347,7 @@ public: ...@@ -347,7 +347,7 @@ public:
// The function pointer to the generated code. For convenience, it can be accessed // The function pointer to the generated code. For convenience, it can be accessed
// as one of many different types. // as one of many different types.
// TODO: we instead make these functions that make sure that the function actually // TODO: we instead make these accessor-functions that make sure that the code actually
// matches the C signature that we would return. // matches the C signature that we would return.
union { union {
Box* (*call)(Box*, Box*, Box*, Box**); Box* (*call)(Box*, Box*, Box*, Box**);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment