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

Side by Side Diff: src/IceLiveness.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/IceIntrinsics.cpp ('k') | src/IceOperand.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/IceLiveness.cpp - Liveness analysis implementation -----===// 1 //===- subzero/src/IceLiveness.cpp - Liveness analysis implementation -----===//
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 provides some of the support for the Liveness class. In 10 // This file provides some of the support for the Liveness class. In
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 ++NumGlobals; 44 ++NumGlobals;
45 } else { 45 } else {
46 SizeT Index = VMetadata->getLocalUseNode(Var)->getIndex(); 46 SizeT Index = VMetadata->getLocalUseNode(Var)->getIndex();
47 ++Nodes[Index].NumLocals; 47 ++Nodes[Index].NumLocals;
48 } 48 }
49 } 49 }
50 50
51 // Resize each LivenessNode::LiveToVarMap, and the global 51 // Resize each LivenessNode::LiveToVarMap, and the global
52 // LiveToVarMap. Reset the counts to 0. 52 // LiveToVarMap. Reset the counts to 0.
53 for (SizeT i = 0; i < NumNodes; ++i) { 53 for (SizeT i = 0; i < NumNodes; ++i) {
54 Nodes[i].LiveToVarMap.assign(Nodes[i].NumLocals, NULL); 54 Nodes[i].LiveToVarMap.assign(Nodes[i].NumLocals, nullptr);
55 Nodes[i].NumLocals = 0; 55 Nodes[i].NumLocals = 0;
56 Nodes[i].NumNonDeadPhis = 0; 56 Nodes[i].NumNonDeadPhis = 0;
57 } 57 }
58 LiveToVarMap.assign(NumGlobals, NULL); 58 LiveToVarMap.assign(NumGlobals, nullptr);
59 59
60 // Sort each variable into the appropriate LiveToVarMap. Also set 60 // Sort each variable into the appropriate LiveToVarMap. Also set
61 // VarToLiveMap. 61 // VarToLiveMap.
62 SizeT TmpNumGlobals = 0; 62 SizeT TmpNumGlobals = 0;
63 for (SizeT i = 0; i < NumVars; ++i) { 63 for (SizeT i = 0; i < NumVars; ++i) {
64 Variable *Var = Func->getVariables()[i]; 64 Variable *Var = Func->getVariables()[i];
65 SizeT VarIndex = Var->getIndex(); 65 SizeT VarIndex = Var->getIndex();
66 SizeT LiveIndex; 66 SizeT LiveIndex;
67 if (VMetadata->isMultiBlock(Var)) { 67 if (VMetadata->isMultiBlock(Var)) {
68 LiveIndex = TmpNumGlobals++; 68 LiveIndex = TmpNumGlobals++;
(...skipping 20 matching lines...) Expand all
89 } 89 }
90 90
91 Variable *Liveness::getVariable(SizeT LiveIndex, const CfgNode *Node) const { 91 Variable *Liveness::getVariable(SizeT LiveIndex, const CfgNode *Node) const {
92 if (LiveIndex < NumGlobals) 92 if (LiveIndex < NumGlobals)
93 return LiveToVarMap[LiveIndex]; 93 return LiveToVarMap[LiveIndex];
94 SizeT NodeIndex = Node->getIndex(); 94 SizeT NodeIndex = Node->getIndex();
95 return Nodes[NodeIndex].LiveToVarMap[LiveIndex - NumGlobals]; 95 return Nodes[NodeIndex].LiveToVarMap[LiveIndex - NumGlobals];
96 } 96 }
97 97
98 } // end of namespace Ice 98 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceIntrinsics.cpp ('k') | src/IceOperand.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698