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

Side by Side Diff: src/IceConverter.cpp

Issue 802183004: Subzero: Use CFG-local arena allocation for relevant containers. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Typo fix 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/IceCfg.cpp ('k') | src/IceDefs.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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 operator=(const LLVM2ICEFunctionConverter &) = delete; 76 operator=(const LLVM2ICEFunctionConverter &) = delete;
77 77
78 public: 78 public:
79 LLVM2ICEFunctionConverter(Ice::Converter &Converter) 79 LLVM2ICEFunctionConverter(Ice::Converter &Converter)
80 : LLVM2ICEConverter(Converter), Func(nullptr) {} 80 : LLVM2ICEConverter(Converter), Func(nullptr) {}
81 81
82 // Caller is expected to delete the returned Ice::Cfg object. 82 // Caller is expected to delete the returned Ice::Cfg object.
83 Ice::Cfg *convertFunction(const Function *F) { 83 Ice::Cfg *convertFunction(const Function *F) {
84 VarMap.clear(); 84 VarMap.clear();
85 NodeMap.clear(); 85 NodeMap.clear();
86 Func = new Ice::Cfg(Ctx); 86 Func = Ice::Cfg::create(Ctx);
87 Func->setFunctionName(F->getName()); 87 Func->setFunctionName(F->getName());
88 Func->setReturnType(convertToIceType(F->getReturnType())); 88 Func->setReturnType(convertToIceType(F->getReturnType()));
89 Func->setInternal(F->hasInternalLinkage()); 89 Func->setInternal(F->hasInternalLinkage());
90 Ice::TimerMarker T(Ice::TimerStack::TT_llvmConvert, Func); 90 Ice::TimerMarker T(Ice::TimerStack::TT_llvmConvert, Func);
91 91
92 // The initial definition/use of each arg is the entry node. 92 // The initial definition/use of each arg is the entry node.
93 for (auto ArgI = F->arg_begin(), ArgE = F->arg_end(); ArgI != ArgE; 93 for (auto ArgI = F->arg_begin(), ArgE = F->arg_end(); ArgI != ArgE;
94 ++ArgI) { 94 ++ArgI) {
95 Func->addArg(mapValueToIceVar(ArgI)); 95 Func->addArg(mapValueToIceVar(ArgI));
96 } 96 }
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after
894 Cfg *Fcn = FunctionConverter.convertFunction(&I); 894 Cfg *Fcn = FunctionConverter.convertFunction(&I);
895 translateFcn(Fcn); 895 translateFcn(Fcn);
896 if (ALLOW_DUMP && Ctx->getFlags().TimeEachFunction) 896 if (ALLOW_DUMP && Ctx->getFlags().TimeEachFunction)
897 Ctx->popTimer(TimerID, StackID); 897 Ctx->popTimer(TimerID, StackID);
898 } 898 }
899 899
900 emitConstants(); 900 emitConstants();
901 } 901 }
902 902
903 } // end of namespace Ice 903 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceCfg.cpp ('k') | src/IceDefs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698