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

Unified Diff: src/IceCfg.cpp

Issue 1326013002: Refactor Lo and Hi out of Variable. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Refactor Hi and Lo out of Variable Created 5 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/IceCfg.h ('k') | src/IceInst.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceCfg.cpp
diff --git a/src/IceCfg.cpp b/src/IceCfg.cpp
index 02d450329055afadfb076ac8cba482d0e66158ab..7b1b9affc2ebd7fe482e395a41374656e63645e5 100644
--- a/src/IceCfg.cpp
+++ b/src/IceCfg.cpp
@@ -75,6 +75,16 @@ void Cfg::swapNodes(NodeList &NewNodes) {
Nodes[I]->resetIndex(I);
}
+template <>
+Variable *Cfg::makeVariable<Variable>(Type Ty) {
+ SizeT Index = Variables.size();
+ Variable *Var = Target->shouldSplitToVariable64On32(Ty)
+ ? Variable64On32::create(this, Ty, Index)
+ : Variable::create(this, Ty, Index);
+ Variables.push_back(Var);
+ return Var;
+}
+
void Cfg::addArg(Variable *Arg) {
Arg->setIsArg();
Args.push_back(Arg);
@@ -175,6 +185,11 @@ void Cfg::translate() {
}
TimerMarker T(TimerStack::TT_translate, this);
+ // Create the Hi and Lo variables where a split was needed
+ for (Variable *Var : Variables)
+ if (auto Var64On32 = llvm::dyn_cast<Variable64On32>(Var))
+ Var64On32->initHiLo(this);
+
dump("Initial CFG");
if (getContext()->getFlags().getEnableBlockProfile()) {
« no previous file with comments | « src/IceCfg.h ('k') | src/IceInst.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698