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

Unified Diff: src/IceOperand.cpp

Issue 802183004: Subzero: Use CFG-local arena allocation for relevant containers. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Typo fix Created 6 years 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/IceOperand.h ('k') | src/IceTargetLoweringX8632.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceOperand.cpp
diff --git a/src/IceOperand.cpp b/src/IceOperand.cpp
index bf5546f1517099073ba3fa2f270b221edbd10d9c..8d0ffed074d35a7a73318470da2e936d9c3bfce9 100644
--- a/src/IceOperand.cpp
+++ b/src/IceOperand.cpp
@@ -126,13 +126,16 @@ IceString Variable::getName(const Cfg *Func) const {
return "__" + std::to_string(getIndex());
}
-Variable Variable::asType(Type Ty) {
+Variable *Variable::asType(Type Ty) {
// Note: This returns a Variable, even if the "this" object is a
// subclass of Variable.
- Variable V(kVariable, Ty, Number);
- V.NameIndex = NameIndex;
- V.RegNum = RegNum;
- V.StackOffset = StackOffset;
+ if (!ALLOW_DUMP || getType() == Ty)
+ return this;
+ Variable *V = new (getCurrentCfgAllocator()->Allocate<Variable>())
+ Variable(kVariable, Ty, Number);
+ V->NameIndex = NameIndex;
+ V->RegNum = RegNum;
+ V->StackOffset = StackOffset;
return V;
}
« no previous file with comments | « src/IceOperand.h ('k') | src/IceTargetLoweringX8632.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698