OLD | NEW |
1 //===- subzero/src/IceConverter.cpp - Converts LLVM to Ice ---------------===// | 1 //===- subzero/src/IceConverter.cpp - Converts LLVM to Ice ---------------===// |
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 LLVM to ICE converter. | 10 // This file implements the LLVM to ICE converter. |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 Ice::Type SubzeroPointerType; | 674 Ice::Type SubzeroPointerType; |
675 std::map<const Value *, Ice::Variable *> VarMap; | 675 std::map<const Value *, Ice::Variable *> VarMap; |
676 std::map<const BasicBlock *, Ice::CfgNode *> NodeMap; | 676 std::map<const BasicBlock *, Ice::CfgNode *> NodeMap; |
677 }; | 677 }; |
678 | 678 |
679 } // end of anonymous namespace. | 679 } // end of anonymous namespace. |
680 | 680 |
681 namespace Ice { | 681 namespace Ice { |
682 | 682 |
683 void Converter::convertToIce(Module *Mod) { | 683 void Converter::convertToIce(Module *Mod) { |
684 convertGlobals(Mod); | 684 if (!Flags.DisableGlobals) |
| 685 convertGlobals(Mod); |
685 convertFunctions(Mod); | 686 convertFunctions(Mod); |
686 } | 687 } |
687 | 688 |
688 void Converter::convertGlobals(Module *Mod) { | 689 void Converter::convertGlobals(Module *Mod) { |
689 OwningPtr<TargetGlobalInitLowering> GlobalLowering( | 690 OwningPtr<TargetGlobalInitLowering> GlobalLowering( |
690 TargetGlobalInitLowering::createLowering(Ctx->getTargetArch(), Ctx)); | 691 TargetGlobalInitLowering::createLowering(Ctx->getTargetArch(), Ctx)); |
691 for (Module::const_global_iterator I = Mod->global_begin(), | 692 for (Module::const_global_iterator I = Mod->global_begin(), |
692 E = Mod->global_end(); | 693 E = Mod->global_end(); |
693 I != E; ++I) { | 694 I != E; ++I) { |
694 if (!I->hasInitializer()) | 695 if (!I->hasInitializer()) |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 << Fcn->getFunctionName() << ": " << TConvert.getElapsedSec() | 741 << Fcn->getFunctionName() << ": " << TConvert.getElapsedSec() |
741 << " sec\n"; | 742 << " sec\n"; |
742 } | 743 } |
743 translateFcn(Fcn); | 744 translateFcn(Fcn); |
744 } | 745 } |
745 | 746 |
746 emitConstants(); | 747 emitConstants(); |
747 } | 748 } |
748 | 749 |
749 } // end of Ice namespace. | 750 } // end of Ice namespace. |
OLD | NEW |