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

Side by Side Diff: src/IceTargetLoweringX8632.cpp

Issue 678533005: Subzero: Add basic ELFObjectWriter (text section, symtab, strtab, headers) (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: minor cleanup 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 unified diff | Download patch
« no previous file with comments | « src/IceTargetLoweringX8632.h ('k') | src/IceTranslator.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceTargetLoweringX8632.cpp - x86-32 lowering -----------===// 1 //===- subzero/src/IceTargetLoweringX8632.cpp - x86-32 lowering -----------===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // This file implements the TargetLoweringX8632 class, which 10 // This file implements the TargetLoweringX8632 class, which
(...skipping 4537 matching lines...) Expand 10 before | Expand all | Expand 10 after
4548 } 4548 }
4549 4549
4550 void ConstantUndef::emit(GlobalContext *) const { 4550 void ConstantUndef::emit(GlobalContext *) const {
4551 llvm_unreachable("undef value encountered by emitter."); 4551 llvm_unreachable("undef value encountered by emitter.");
4552 } 4552 }
4553 4553
4554 TargetGlobalInitX8632::TargetGlobalInitX8632(GlobalContext *Ctx) 4554 TargetGlobalInitX8632::TargetGlobalInitX8632(GlobalContext *Ctx)
4555 : TargetGlobalInitLowering(Ctx) {} 4555 : TargetGlobalInitLowering(Ctx) {}
4556 4556
4557 void TargetGlobalInitX8632::lower(const VariableDeclaration &Var) { 4557 void TargetGlobalInitX8632::lower(const VariableDeclaration &Var) {
4558 // TODO(jvoung): handle this without text.
4559 if (Ctx->getFlags().UseELFWriter)
4560 return;
4558 4561
4559 Ostream &Str = Ctx->getStrEmit(); 4562 Ostream &Str = Ctx->getStrEmit();
4560 4563
4561 const VariableDeclaration::InitializerListType &Initializers = 4564 const VariableDeclaration::InitializerListType &Initializers =
4562 Var.getInitializers(); 4565 Var.getInitializers();
4563 4566
4564 // If external and not initialized, this must be a cross test. 4567 // If external and not initialized, this must be a cross test.
4565 // Don't generate a declaration for such cases. 4568 // Don't generate a declaration for such cases.
4566 bool IsExternal = Var.isExternal() || Ctx->getFlags().DisableInternal; 4569 bool IsExternal = Var.isExternal() || Ctx->getFlags().DisableInternal;
4567 if (IsExternal && !Var.hasInitializer()) return; 4570 if (IsExternal && !Var.hasInitializer()) return;
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
4641 } else if (IsConstant || IsExternal) 4644 } else if (IsConstant || IsExternal)
4642 Str << "\t.zero\t" << Size << "\n"; 4645 Str << "\t.zero\t" << Size << "\n";
4643 // Size is part of .comm. 4646 // Size is part of .comm.
4644 4647
4645 if (IsConstant || HasNonzeroInitializer || IsExternal) 4648 if (IsConstant || HasNonzeroInitializer || IsExternal)
4646 Str << "\t.size\t" << MangledName << ", " << Size << "\n"; 4649 Str << "\t.size\t" << MangledName << ", " << Size << "\n";
4647 // Size is part of .comm. 4650 // Size is part of .comm.
4648 } 4651 }
4649 4652
4650 } // end of namespace Ice 4653 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceTargetLoweringX8632.h ('k') | src/IceTranslator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698