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

Side by Side Diff: src/IceGlobalContext.cpp

Issue 1516753008: Subzero: Use "auto" per (unwritten) auto coding style. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: More <cast> instances without the llvm:: prefix Created 5 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/IceConverter.cpp ('k') | src/IceInst.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/IceGlobalContext.cpp - Global context defs -------------===// 1 //===- subzero/src/IceGlobalContext.cpp - Global context defs -------------===//
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 /// \file 10 /// \file
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 template <Type Ty, typename KeyType, typename ValueType> class TypePool { 123 template <Type Ty, typename KeyType, typename ValueType> class TypePool {
124 TypePool(const TypePool &) = delete; 124 TypePool(const TypePool &) = delete;
125 TypePool &operator=(const TypePool &) = delete; 125 TypePool &operator=(const TypePool &) = delete;
126 126
127 public: 127 public:
128 TypePool() = default; 128 TypePool() = default;
129 ValueType *getOrAdd(GlobalContext *Ctx, KeyType Key) { 129 ValueType *getOrAdd(GlobalContext *Ctx, KeyType Key) {
130 auto Iter = Pool.find(Key); 130 auto Iter = Pool.find(Key);
131 if (Iter != Pool.end()) 131 if (Iter != Pool.end())
132 return Iter->second; 132 return Iter->second;
133 ValueType *Result = ValueType::create(Ctx, Ty, Key); 133 auto *Result = ValueType::create(Ctx, Ty, Key);
134 Pool[Key] = Result; 134 Pool[Key] = Result;
135 return Result; 135 return Result;
136 } 136 }
137 ConstantList getConstantPool() const { 137 ConstantList getConstantPool() const {
138 ConstantList Constants; 138 ConstantList Constants;
139 Constants.reserve(Pool.size()); 139 Constants.reserve(Pool.size());
140 for (auto &I : Pool) 140 for (auto &I : Pool)
141 Constants.push_back(I.second); 141 Constants.push_back(I.second);
142 // The sort (and its KeyCompareLess machinery) is not strictly necessary, 142 // The sort (and its KeyCompareLess machinery) is not strictly necessary,
143 // but is desirable for producing output that is deterministic across 143 // but is desirable for producing output that is deterministic across
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after
1009 Ctx = Func->getContext(); 1009 Ctx = Func->getContext();
1010 Active = 1010 Active =
1011 Func->getFocusedTiming() || Ctx->getFlags().getSubzeroTimingEnabled(); 1011 Func->getFocusedTiming() || Ctx->getFlags().getSubzeroTimingEnabled();
1012 if (Active) 1012 if (Active)
1013 Ctx->pushTimer(ID, StackID); 1013 Ctx->pushTimer(ID, StackID);
1014 } 1014 }
1015 1015
1016 ICE_TLS_DEFINE_FIELD(GlobalContext::ThreadContext *, GlobalContext, TLS); 1016 ICE_TLS_DEFINE_FIELD(GlobalContext::ThreadContext *, GlobalContext, TLS);
1017 1017
1018 } // end of namespace Ice 1018 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceConverter.cpp ('k') | src/IceInst.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698