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/IceConverter.cpp

Issue 589003002: Subzero: Refactor tracking of Defs and block-local Variables. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: "Mark args as being used in the entry node" was unnecessary. Created 6 years, 3 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/IceCfgNode.cpp ('k') | src/IceDefs.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceConverter.cpp
diff --git a/src/IceConverter.cpp b/src/IceConverter.cpp
index ec797c19144055955d68ea31958e737f385b5aa7..b34afd673ec90176ca7ff900ee156ac8c5071004 100644
--- a/src/IceConverter.cpp
+++ b/src/IceConverter.cpp
@@ -56,7 +56,7 @@ template <typename T> static std::string LLVMObjectAsString(const T *O) {
class LLVM2ICEConverter {
public:
LLVM2ICEConverter(Ice::GlobalContext *Ctx, LLVMContext &LLVMContext)
- : Ctx(Ctx), Func(NULL), CurrentNode(NULL), TypeConverter(LLVMContext) {}
+ : Ctx(Ctx), Func(NULL), TypeConverter(LLVMContext) {}
// Caller is expected to delete the returned Ice::Cfg object.
Ice::Cfg *convertFunction(const Function *F) {
@@ -68,7 +68,6 @@ public:
Func->setInternal(F->hasInternalLinkage());
// The initial definition/use of each arg is the entry node.
- CurrentNode = mapBasicBlockToNode(&F->getEntryBlock());
for (Function::const_arg_iterator ArgI = F->arg_begin(),
ArgE = F->arg_end();
ArgI != ArgE; ++ArgI) {
@@ -85,7 +84,6 @@ public:
}
for (Function::const_iterator BBI = F->begin(), BBE = F->end(); BBI != BBE;
++BBI) {
- CurrentNode = mapBasicBlockToNode(BBI);
convertBasicBlock(BBI);
}
Func->setEntryNode(mapBasicBlockToNode(&F->getEntryBlock()));
@@ -132,8 +130,7 @@ private:
if (IceTy == Ice::IceType_void)
return NULL;
if (VarMap.find(V) == VarMap.end()) {
- assert(CurrentNode);
- VarMap[V] = Func->makeVariable(IceTy, CurrentNode, V->getName());
+ VarMap[V] = Func->makeVariable(IceTy, V->getName());
}
return VarMap[V];
}
@@ -614,7 +611,6 @@ private:
// Data
Ice::GlobalContext *Ctx;
Ice::Cfg *Func;
- Ice::CfgNode *CurrentNode;
std::map<const Value *, Ice::Variable *> VarMap;
std::map<const BasicBlock *, Ice::CfgNode *> NodeMap;
Ice::TypeConverter TypeConverter;
« no previous file with comments | « src/IceCfgNode.cpp ('k') | src/IceDefs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698