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

Side by Side Diff: src/IceTargetLoweringMIPS32.cpp

Issue 1188603002: Move lowerGlobal() from target-specific code to emitGlobal() in generic code. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: .long vs .4byte 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 unified diff | Download patch
« no previous file with comments | « src/IceTargetLoweringMIPS32.h ('k') | src/IceTargetLoweringX8632.h » ('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/IceTargetLoweringMIPS32.cpp - MIPS32 lowering ----------===// 1 //===- subzero/src/IceTargetLoweringMIPS32.cpp - MIPS32 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 TargetLoweringMIPS32 class, which consists almost 10 // This file implements the TargetLoweringMIPS32 class, which consists almost
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 } 664 }
665 665
666 void ConstantUndef::emit(GlobalContext *) const { 666 void ConstantUndef::emit(GlobalContext *) const {
667 llvm_unreachable("undef value encountered by emitter."); 667 llvm_unreachable("undef value encountered by emitter.");
668 } 668 }
669 */ 669 */
670 670
671 TargetDataMIPS32::TargetDataMIPS32(GlobalContext *Ctx) 671 TargetDataMIPS32::TargetDataMIPS32(GlobalContext *Ctx)
672 : TargetDataLowering(Ctx) {} 672 : TargetDataLowering(Ctx) {}
673 673
674 void TargetDataMIPS32::lowerGlobal(const VariableDeclaration &Var) const {
675 (void)Var;
676 llvm::report_fatal_error("Not yet implemented");
677 }
678
679 void TargetDataMIPS32::lowerGlobals( 674 void TargetDataMIPS32::lowerGlobals(
680 std::unique_ptr<VariableDeclarationList> Vars) { 675 std::unique_ptr<VariableDeclarationList> Vars) {
681 switch (Ctx->getFlags().getOutFileType()) { 676 switch (Ctx->getFlags().getOutFileType()) {
682 case FT_Elf: { 677 case FT_Elf: {
683 ELFObjectWriter *Writer = Ctx->getObjectWriter(); 678 ELFObjectWriter *Writer = Ctx->getObjectWriter();
684 Writer->writeDataSection(*Vars, llvm::ELF::R_MIPS_GLOB_DAT); 679 Writer->writeDataSection(*Vars, llvm::ELF::R_MIPS_GLOB_DAT);
685 } break; 680 } break;
686 case FT_Asm: 681 case FT_Asm:
687 case FT_Iasm: { 682 case FT_Iasm: {
688 const IceString &TranslateOnly = Ctx->getFlags().getTranslateOnly(); 683 const IceString &TranslateOnly = Ctx->getFlags().getTranslateOnly();
689 OstreamLocker L(Ctx); 684 OstreamLocker L(Ctx);
690 for (const VariableDeclaration *Var : *Vars) { 685 for (const VariableDeclaration *Var : *Vars) {
691 if (GlobalContext::matchSymbolName(Var->getName(), TranslateOnly)) { 686 if (GlobalContext::matchSymbolName(Var->getName(), TranslateOnly)) {
692 lowerGlobal(*Var); 687 emitGlobal(*Var);
693 } 688 }
694 } 689 }
695 } break; 690 } break;
696 } 691 }
697 } 692 }
698 693
699 void TargetDataMIPS32::lowerConstants() { 694 void TargetDataMIPS32::lowerConstants() {
700 if (Ctx->getFlags().getDisableTranslation()) 695 if (Ctx->getFlags().getDisableTranslation())
701 return; 696 return;
702 llvm::report_fatal_error("Not yet implemented"); 697 llvm::report_fatal_error("Not yet implemented");
703 } 698 }
704 699
705 TargetHeaderMIPS32::TargetHeaderMIPS32(GlobalContext *Ctx) 700 TargetHeaderMIPS32::TargetHeaderMIPS32(GlobalContext *Ctx)
706 : TargetHeaderLowering(Ctx) {} 701 : TargetHeaderLowering(Ctx) {}
707 702
708 } // end of namespace Ice 703 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceTargetLoweringMIPS32.h ('k') | src/IceTargetLoweringX8632.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698