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

Side by Side Diff: lib/Bitcode/NaCl/Writer/NaClValueEnumerator.cpp

Issue 1151093004: Changes from 3.7 merge to files not in upstream (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Patch Set: Created 5 years, 7 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
OLDNEW
1 //===-- NaClValueEnumerator.cpp ------------------------------------------===// 1 //===-- NaClValueEnumerator.cpp ------------------------------------------===//
2 // Number values and types for bitcode writer 2 // Number values and types for bitcode writer
3 // 3 //
4 // The LLVM Compiler Infrastructure 4 // The LLVM Compiler Infrastructure
5 // 5 //
6 // This file is distributed under the University of Illinois Open Source 6 // This file is distributed under the University of Illinois Open Source
7 // License. See LICENSE.TXT for details. 7 // License. See LICENSE.TXT for details.
8 // 8 //
9 //===----------------------------------------------------------------------===// 9 //===----------------------------------------------------------------------===//
10 // 10 //
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 VI != VE; ++VI) 243 VI != VE; ++VI)
244 EnumerateValue(VI->getValue()); 244 EnumerateValue(VI->getValue());
245 } 245 }
246 246
247 void NaClValueEnumerator::EnumerateValue(const Value *VIn) { 247 void NaClValueEnumerator::EnumerateValue(const Value *VIn) {
248 // Skip over elided values. 248 // Skip over elided values.
249 const Value *V = ElideCasts(VIn); 249 const Value *V = ElideCasts(VIn);
250 if (V != VIn) return; 250 if (V != VIn) return;
251 251
252 assert(!V->getType()->isVoidTy() && "Can't insert void values!"); 252 assert(!V->getType()->isVoidTy() && "Can't insert void values!");
253 assert(!isa<MDNode>(V) && !isa<MDString>(V) &&
254 "EnumerateValue doesn't handle Metadata!");
255 253
256 // Check to see if it's already in! 254 // Check to see if it's already in!
257 unsigned &ValueID = ValueMap[V]; 255 unsigned &ValueID = ValueMap[V];
258 if (ValueID) { 256 if (ValueID) {
259 // Increment use count. 257 // Increment use count.
260 Values[ValueID-1].second++; 258 Values[ValueID-1].second++;
261 return; 259 return;
262 } 260 }
263 261
264 // Enumerate the type of this value. Skip global values since no 262 // Enumerate the type of this value. Skip global values since no
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 break; 494 break;
497 case Instruction::PtrToInt: 495 case Instruction::PtrToInt:
498 if (IsIntPtrType(I->getType())) { 496 if (IsIntPtrType(I->getType())) {
499 V = I->getOperand(0); 497 V = I->getOperand(0);
500 } 498 }
501 break; 499 break;
502 } 500 }
503 } 501 }
504 return V; 502 return V;
505 } 503 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698