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

Unified Diff: src/PNaClTranslator.cpp

Issue 1181013016: Subzero. Fixes memory leaks. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addresses codereview comments. Created 5 years, 6 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/IceTargetLowering.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/PNaClTranslator.cpp
diff --git a/src/PNaClTranslator.cpp b/src/PNaClTranslator.cpp
index d25e9f9769ca797c0f34fc96fe32f226d50419ae..a95afca97cd8cfc7ac8081301682284e07920f11 100644
--- a/src/PNaClTranslator.cpp
+++ b/src/PNaClTranslator.cpp
@@ -294,7 +294,8 @@ public:
assert(VariableDeclarations);
assert(VariableDeclarations->empty());
for (size_t i = 0; i < Count; ++i) {
- VariableDeclarations->push_back(Ice::VariableDeclaration::create());
+ VariableDeclarations->push_back(
+ Ice::VariableDeclaration::create(getTranslator().getContext()));
}
}
@@ -907,7 +908,8 @@ public:
: BlockParserBaseClass(BlockID, EnclosingParser),
Timer(Ice::TimerStack::TT_parseGlobals, getTranslator().getContext()),
InitializersNeeded(0), NextGlobalID(0),
- DummyGlobalVar(Ice::VariableDeclaration::create()),
+ DummyGlobalVar(
+ Ice::VariableDeclaration::create(getTranslator().getContext())),
CurGlobalVar(DummyGlobalVar) {}
~GlobalsParser() final {}
@@ -1020,7 +1022,7 @@ void GlobalsParser::ProcessRecord() {
if (isIRGenerationDisabled())
return;
CurGlobalVar->addInitializer(
- new Ice::VariableDeclaration::ZeroInitializer(Values[0]));
+ Ice::VariableDeclaration::ZeroInitializer::create(Values[0]));
return;
}
case naclbitc::GLOBALVAR_DATA: {
@@ -1030,7 +1032,7 @@ void GlobalsParser::ProcessRecord() {
if (isIRGenerationDisabled())
return;
CurGlobalVar->addInitializer(
- new Ice::VariableDeclaration::DataInitializer(Values));
+ Ice::VariableDeclaration::DataInitializer::create(Values));
return;
}
case naclbitc::GLOBALVAR_RELOC: {
@@ -1043,8 +1045,9 @@ void GlobalsParser::ProcessRecord() {
Ice::SizeT Offset = 0;
if (Values.size() == 2)
Offset = Values[1];
- CurGlobalVar->addInitializer(new Ice::VariableDeclaration::RelocInitializer(
- Context->getGlobalDeclarationByID(Index), Offset));
+ CurGlobalVar->addInitializer(
+ Ice::VariableDeclaration::RelocInitializer::create(
+ Context->getGlobalDeclarationByID(Index), Offset));
return;
}
default:
@@ -2951,7 +2954,8 @@ void ModuleParser::ProcessRecord() {
}
bool IsProto = Values[2] == 1;
Ice::FunctionDeclaration *Func = Ice::FunctionDeclaration::create(
- Signature, CallingConv, Linkage, IsProto);
+ Context->getTranslator().getContext(), Signature, CallingConv, Linkage,
+ IsProto);
Context->setNextFunctionID(Func);
return;
}
« no previous file with comments | « src/IceTargetLowering.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698