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

Side by Side Diff: src/IceGlobalContext.cpp

Issue 814353002: Subzero: Convert NULL->nullptr. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Revert crosstest whitespace changes 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/IceCfgNode.cpp ('k') | src/IceInst.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/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 // This file defines aspects of the compilation that persist across 10 // This file defines aspects of the compilation that persist across
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 71
72 // UndefPool maps ICE types to the corresponding ConstantUndef values. 72 // UndefPool maps ICE types to the corresponding ConstantUndef values.
73 class UndefPool { 73 class UndefPool {
74 UndefPool(const UndefPool &) = delete; 74 UndefPool(const UndefPool &) = delete;
75 UndefPool &operator=(const UndefPool &) = delete; 75 UndefPool &operator=(const UndefPool &) = delete;
76 76
77 public: 77 public:
78 UndefPool() : NextPoolID(0), Pool(IceType_NUM) {} 78 UndefPool() : NextPoolID(0), Pool(IceType_NUM) {}
79 79
80 ConstantUndef *getOrAdd(GlobalContext *Ctx, Type Ty) { 80 ConstantUndef *getOrAdd(GlobalContext *Ctx, Type Ty) {
81 if (Pool[Ty] == NULL) 81 if (Pool[Ty] == nullptr)
82 Pool[Ty] = ConstantUndef::create(Ctx, Ty, NextPoolID++); 82 Pool[Ty] = ConstantUndef::create(Ctx, Ty, NextPoolID++);
83 return Pool[Ty]; 83 return Pool[Ty];
84 } 84 }
85 85
86 private: 86 private:
87 uint32_t NextPoolID; 87 uint32_t NextPoolID;
88 std::vector<ConstantUndef *> Pool; 88 std::vector<ConstantUndef *> Pool;
89 }; 89 };
90 90
91 // The global constant pool bundles individual pools of each type of 91 // The global constant pool bundles individual pools of each type of
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 return getConstantInt8(Value); 318 return getConstantInt8(Value);
319 case IceType_i16: 319 case IceType_i16:
320 return getConstantInt16(Value); 320 return getConstantInt16(Value);
321 case IceType_i32: 321 case IceType_i32:
322 return getConstantInt32(Value); 322 return getConstantInt32(Value);
323 case IceType_i64: 323 case IceType_i64:
324 return getConstantInt64(Value); 324 return getConstantInt64(Value);
325 default: 325 default:
326 llvm_unreachable("Bad integer type for getConstant"); 326 llvm_unreachable("Bad integer type for getConstant");
327 } 327 }
328 return NULL; 328 return nullptr;
329 } 329 }
330 330
331 Constant *GlobalContext::getConstantInt1(int8_t ConstantInt1) { 331 Constant *GlobalContext::getConstantInt1(int8_t ConstantInt1) {
332 ConstantInt1 &= INT8_C(1); 332 ConstantInt1 &= INT8_C(1);
333 return ConstPool->Integers1.getOrAdd(this, ConstantInt1); 333 return ConstPool->Integers1.getOrAdd(this, ConstantInt1);
334 } 334 }
335 335
336 Constant *GlobalContext::getConstantInt8(int8_t ConstantInt8) { 336 Constant *GlobalContext::getConstantInt8(int8_t ConstantInt8) {
337 return ConstPool->Integers8.getOrAdd(this, ConstantInt8); 337 return ConstPool->Integers8.getOrAdd(this, ConstantInt8);
338 } 338 }
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 TimerMarker::TimerMarker(TimerIdT ID, const Cfg *Func) 510 TimerMarker::TimerMarker(TimerIdT ID, const Cfg *Func)
511 : ID(ID), Ctx(Func->getContext()), Active(false) { 511 : ID(ID), Ctx(Func->getContext()), Active(false) {
512 if (ALLOW_DUMP) { 512 if (ALLOW_DUMP) {
513 Active = Func->getFocusedTiming() || Ctx->getFlags().SubzeroTimingEnabled; 513 Active = Func->getFocusedTiming() || Ctx->getFlags().SubzeroTimingEnabled;
514 if (Active) 514 if (Active)
515 Ctx->pushTimer(ID); 515 Ctx->pushTimer(ID);
516 } 516 }
517 } 517 }
518 518
519 } // end of namespace Ice 519 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceCfgNode.cpp ('k') | src/IceInst.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698