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

Side by Side Diff: lib/Bitcode/NaCl/TestUtils/NaClBitcodeMungeWriter.cpp

Issue 1164803003: Fix compiler error for type of NumAbbrevOps. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- NaClBitcodeMungeWriter.cpp - Write munged bitcode --------*- C++ -*-===// 1 //===- NaClBitcodeMungeWriter.cpp - Write munged bitcode --------*- C++ -*-===//
2 // 2 //
3 // The LLVM Compiler Infrastructure 3 // The LLVM Compiler Infrastructure
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 // Implements method NaClMungedBitcode.write(), which writes out a munged 10 // Implements method NaClMungedBitcode.write(), which writes out a munged
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 << "(" << static_cast<int64_t>(Value) 502 << "(" << static_cast<int64_t>(Value)
503 << ") in: " << Record << "\n"; 503 << ") in: " << Record << "\n";
504 return false; 504 return false;
505 } 505 }
506 506
507 NaClBitCodeAbbrev *WriteState::buildAbbrev( 507 NaClBitCodeAbbrev *WriteState::buildAbbrev(
508 const NaClBitcodeAbbrevRecord &Record) { 508 const NaClBitcodeAbbrevRecord &Record) {
509 // Note: Recover by removing abbreviation. 509 // Note: Recover by removing abbreviation.
510 NaClBitCodeAbbrev *Abbrev = new NaClBitCodeAbbrev(); 510 NaClBitCodeAbbrev *Abbrev = new NaClBitCodeAbbrev();
511 size_t Index = 0; 511 size_t Index = 0;
512 size_t NumAbbrevOps; 512 uint64_t NumAbbrevOps;
513 if (!nextAbbrevValue(NumAbbrevOps, Record, Index)) 513 if (!nextAbbrevValue(NumAbbrevOps, Record, Index))
514 return deleteAbbrev(Abbrev); 514 return deleteAbbrev(Abbrev);
515 if (NumAbbrevOps == 0) { 515 if (NumAbbrevOps == 0) {
516 RecoverableError() << "Abbreviation must contain at least one operator: " 516 RecoverableError() << "Abbreviation must contain at least one operator: "
517 << Record << "\n"; 517 << Record << "\n";
518 return deleteAbbrev(Abbrev); 518 return deleteAbbrev(Abbrev);
519 } 519 }
520 for (size_t Count = 0; Count < NumAbbrevOps; ++Count) { 520 for (uint64_t Count = 0; Count < NumAbbrevOps; ++Count) {
521 uint64_t IsLiteral; 521 uint64_t IsLiteral;
522 if (!nextAbbrevValue(IsLiteral, Record, Index)) 522 if (!nextAbbrevValue(IsLiteral, Record, Index))
523 return deleteAbbrev(Abbrev); 523 return deleteAbbrev(Abbrev);
524 switch (IsLiteral) { 524 switch (IsLiteral) {
525 case 1: { 525 case 1: {
526 uint64_t Value; 526 uint64_t Value;
527 if (!nextAbbrevValue(Value, Record, Index)) 527 if (!nextAbbrevValue(Value, Record, Index))
528 return deleteAbbrev(Abbrev); 528 return deleteAbbrev(Abbrev);
529 if (!verifyAbbrevOp(NaClBitCodeAbbrevOp::Literal, Value, Record)) 529 if (!verifyAbbrevOp(NaClBitCodeAbbrevOp::Literal, Value, Record))
530 return deleteAbbrev(Abbrev); 530 return deleteAbbrev(Abbrev);
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 NaClWriteHeader(Writer, true); 604 NaClWriteHeader(Writer, true);
605 } 605 }
606 for (const NaClBitcodeAbbrevRecord &Record : *this) { 606 for (const NaClBitcodeAbbrevRecord &Record : *this) {
607 if (!State.emitRecord(Writer, Record)) 607 if (!State.emitRecord(Writer, Record))
608 break; 608 break;
609 } 609 }
610 bool RecoverSilently = 610 bool RecoverSilently =
611 State.Results.NumErrors > 0 && !Flags.getTryToRecover(); 611 State.Results.NumErrors > 0 && !Flags.getTryToRecover();
612 return State.finish(Writer, RecoverSilently); 612 return State.finish(Writer, RecoverSilently);
613 } 613 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698