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

Side by Side Diff: include/llvm/Bitcode/NaCl/NaClBitcodeMungeUtils.h

Issue 1156103003: Initial implementation of a record-level bitcode fuzzer. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-llvm.git@fuzz
Patch Set: Fix issues in last patch. 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 | include/llvm/Bitcode/NaCl/NaClFuzz.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 //===- NaClBitcodeMungeUtils.h - Munge bitcode records --------*- C++ -*-===// 1 //===- NaClBitcodeMungeUtils.h - Munge bitcode records --------*- 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 // This file defines utility class NaClMungedBitcode to edit a base 10 // This file defines utility class NaClMungedBitcode to edit a base
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 /// \param AddHeader Add header block when true. 231 /// \param AddHeader Add header block when true.
232 /// \param Flags Write flags to use. 232 /// \param Flags Write flags to use.
233 /// 233 ///
234 /// \return Returns the results of the write. 234 /// \return Returns the results of the write.
235 WriteResults writeMaybeRepair( 235 WriteResults writeMaybeRepair(
236 SmallVectorImpl<char> &Buffer, bool AddHeader, 236 SmallVectorImpl<char> &Buffer, bool AddHeader,
237 const WriteFlags &Flags) const; 237 const WriteFlags &Flags) const;
238 238
239 bool write(SmallVectorImpl<char> &Buffer, bool AddHeader, 239 bool write(SmallVectorImpl<char> &Buffer, bool AddHeader,
240 const WriteFlags &Flags) const { 240 const WriteFlags &Flags) const {
241 return writeMaybeRepair(Buffer, AddHeader, Flags).NumErrors == 0; 241 WriteResults Results = writeMaybeRepair(Buffer, AddHeader, Flags);
242 return Results.NumErrors == 0
243 || (Flags.getTryToRecover() && Results.NumErrors == Results.NumRepairs);
242 } 244 }
243 245
244 bool write(SmallVectorImpl<char> &Buffer, bool AddHeader) const { 246 bool write(SmallVectorImpl<char> &Buffer, bool AddHeader) const {
245 WriteFlags Flags; 247 WriteFlags Flags;
246 return write(Buffer, AddHeader, Flags); 248 return write(Buffer, AddHeader, Flags);
247 } 249 }
248 250
249 /// \brief The types of editing actions that can be applied. 251 /// \brief The types of editing actions that can be applied.
250 enum EditAction { 252 enum EditAction {
251 AddBefore, // Insert new record before base record at index. 253 AddBefore, // Insert new record before base record at index.
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 } 454 }
453 455
454 // \brief Moves the iterator to the position of the next edited 456 // \brief Moves the iterator to the position of the next edited
455 // record. 457 // record.
456 void updatePosition(); 458 void updatePosition();
457 }; 459 };
458 460
459 } // end namespace llvm. 461 } // end namespace llvm.
460 462
461 #endif // LLVM_BITCODE_NACL_NACLBITCODEMUNGE_H 463 #endif // LLVM_BITCODE_NACL_NACLBITCODEMUNGE_H
OLDNEW
« no previous file with comments | « no previous file | include/llvm/Bitcode/NaCl/NaClFuzz.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698