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

Side by Side Diff: src/IceConverter.cpp

Issue 814163004: Subzero: Remove the GlobalContext::GlobalDeclarations vector. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Remove unused GlobalContext args Created 5 years, 11 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 | « no previous file | src/IceGlobalContext.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/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 833 matching lines...) Expand 10 before | Expand all | Expand 10 after
844 for (const Function &Func : *Mod) { 844 for (const Function &Func : *Mod) {
845 FuncSigType Signature; 845 FuncSigType Signature;
846 FunctionType *FuncType = Func.getFunctionType(); 846 FunctionType *FuncType = Func.getFunctionType();
847 Signature.setReturnType( 847 Signature.setReturnType(
848 Converter.convertToIceType(FuncType->getReturnType())); 848 Converter.convertToIceType(FuncType->getReturnType()));
849 for (size_t I = 0; I < FuncType->getNumParams(); ++I) { 849 for (size_t I = 0; I < FuncType->getNumParams(); ++I) {
850 Signature.appendArgType( 850 Signature.appendArgType(
851 Converter.convertToIceType(FuncType->getParamType(I))); 851 Converter.convertToIceType(FuncType->getParamType(I)));
852 } 852 }
853 FunctionDeclaration *IceFunc = FunctionDeclaration::create( 853 FunctionDeclaration *IceFunc = FunctionDeclaration::create(
854 Ctx, Signature, Func.getCallingConv(), Func.getLinkage(), Func.empty()); 854 Signature, Func.getCallingConv(), Func.getLinkage(), Func.empty());
855 IceFunc->setName(Func.getName()); 855 IceFunc->setName(Func.getName());
856 GlobalDeclarationMap[&Func] = IceFunc; 856 GlobalDeclarationMap[&Func] = IceFunc;
857 } 857 }
858 // Install global variable declarations. 858 // Install global variable declarations.
859 for (Module::const_global_iterator I = Mod->global_begin(), 859 for (Module::const_global_iterator I = Mod->global_begin(),
860 E = Mod->global_end(); 860 E = Mod->global_end();
861 I != E; ++I) { 861 I != E; ++I) {
862 const GlobalVariable *GV = I; 862 const GlobalVariable *GV = I;
863 VariableDeclaration *Var = VariableDeclaration::create(Ctx); 863 VariableDeclaration *Var = VariableDeclaration::create();
864 Var->setName(GV->getName()); 864 Var->setName(GV->getName());
865 Var->setAlignment(GV->getAlignment()); 865 Var->setAlignment(GV->getAlignment());
866 Var->setIsConstant(GV->isConstant()); 866 Var->setIsConstant(GV->isConstant());
867 Var->setLinkage(GV->getLinkage()); 867 Var->setLinkage(GV->getLinkage());
868 GlobalDeclarationMap[GV] = Var; 868 GlobalDeclarationMap[GV] = Var;
869 } 869 }
870 } 870 }
871 871
872 void Converter::convertGlobals(Module *Mod) { 872 void Converter::convertGlobals(Module *Mod) {
873 LLVM2ICEGlobalsConverter GlobalsConverter(*this); 873 LLVM2ICEGlobalsConverter GlobalsConverter(*this);
(...skipping 18 matching lines...) Expand all
892 Cfg *Fcn = FunctionConverter.convertFunction(&I); 892 Cfg *Fcn = FunctionConverter.convertFunction(&I);
893 translateFcn(Fcn); 893 translateFcn(Fcn);
894 if (ALLOW_DUMP && Ctx->getFlags().TimeEachFunction) 894 if (ALLOW_DUMP && Ctx->getFlags().TimeEachFunction)
895 Ctx->popTimer(TimerID, StackID); 895 Ctx->popTimer(TimerID, StackID);
896 } 896 }
897 897
898 emitConstants(); 898 emitConstants();
899 } 899 }
900 900
901 } // end of namespace Ice 901 } // end of namespace Ice
OLDNEW
« no previous file with comments | « no previous file | src/IceGlobalContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698