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

Unified Diff: src/IceTargetLowering.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/IceOperand.h ('k') | src/PNaClTranslator.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTargetLowering.cpp
diff --git a/src/IceTargetLowering.cpp b/src/IceTargetLowering.cpp
index 5355a33206b3ceb24d9f864caa8edbed029ad0a0..dec8034666232bca423bab234dedc2908ea9bad7 100644
--- a/src/IceTargetLowering.cpp
+++ b/src/IceTargetLowering.cpp
@@ -514,11 +514,12 @@ void TargetDataLowering::emitGlobal(const VariableDeclaration &Var,
Str << MangledName << ":\n";
if (HasNonzeroInitializer) {
- for (VariableDeclaration::Initializer *Init : Var.getInitializers()) {
+ for (const std::unique_ptr<VariableDeclaration::Initializer> &Init :
+ Var.getInitializers()) {
switch (Init->getKind()) {
case VariableDeclaration::Initializer::DataInitializerKind: {
const auto &Data = llvm::cast<VariableDeclaration::DataInitializer>(
- Init)->getContents();
+ Init.get())->getContents();
for (SizeT i = 0; i < Init->getNumBytes(); ++i) {
Str << "\t.byte\t" << (((unsigned)Data[i]) & 0xff) << "\n";
}
@@ -529,7 +530,7 @@ void TargetDataLowering::emitGlobal(const VariableDeclaration &Var,
break;
case VariableDeclaration::Initializer::RelocInitializerKind: {
const auto *Reloc =
- llvm::cast<VariableDeclaration::RelocInitializer>(Init);
+ llvm::cast<VariableDeclaration::RelocInitializer>(Init.get());
Str << "\t" << getEmit32Directive() << "\t";
Str << Reloc->getDeclaration()->mangleName(Ctx);
if (RelocOffsetT Offset = Reloc->getOffset()) {
« no previous file with comments | « src/IceOperand.h ('k') | src/PNaClTranslator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698