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

Unified Diff: src/IceTargetLowering.cpp

Issue 1776473007: Subzero. Allocate global initializers from a dedicated arena. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Removes global variable (and initializer) allocation methods from GlobalContext. Created 4 years, 9 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/IceGlobalInits.cpp ('k') | src/IceTargetLoweringARM32.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 468883b02f53fc24c388c807ecc169d700e0229e..b1b8a8d7fa363f4b852d3da4782ca57e48fc93e4 100644
--- a/src/IceTargetLowering.cpp
+++ b/src/IceTargetLowering.cpp
@@ -823,12 +823,11 @@ void TargetDataLowering::emitGlobal(const VariableDeclaration &Var,
Str << Name << ":\n";
if (HasNonzeroInitializer) {
- for (const std::unique_ptr<VariableDeclaration::Initializer> &Init :
- Var.getInitializers()) {
+ for (const auto *Init : Var.getInitializers()) {
switch (Init->getKind()) {
case VariableDeclaration::Initializer::DataInitializerKind: {
const auto &Data =
- llvm::cast<VariableDeclaration::DataInitializer>(Init.get())
+ llvm::cast<VariableDeclaration::DataInitializer>(Init)
->getContents();
for (SizeT i = 0; i < Init->getNumBytes(); ++i) {
Str << "\t.byte\t" << (((unsigned)Data[i]) & 0xff) << "\n";
@@ -840,7 +839,7 @@ void TargetDataLowering::emitGlobal(const VariableDeclaration &Var,
break;
case VariableDeclaration::Initializer::RelocInitializerKind: {
const auto *Reloc =
- llvm::cast<VariableDeclaration::RelocInitializer>(Init.get());
+ llvm::cast<VariableDeclaration::RelocInitializer>(Init);
Str << "\t" << getEmit32Directive() << "\t";
Str << Reloc->getDeclaration()->getName();
if (Reloc->hasFixup()) {
« no previous file with comments | « src/IceGlobalInits.cpp ('k') | src/IceTargetLoweringARM32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698