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

Side by Side Diff: src/IceRNG.h

Issue 619983002: Subzero: Remove LLVM_DELETED_FUNCTION. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 6 years, 2 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 | « src/IceOperand.h ('k') | src/IceRegAlloc.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/IceRNG.h - Random number generator -----------*- C++ -*-===// 1 //===- subzero/src/IceRNG.h - Random number generator -----------*- C++ -*-===//
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 declares a random number generator. 10 // This file declares a random number generator.
11 // 11 //
12 //===----------------------------------------------------------------------===// 12 //===----------------------------------------------------------------------===//
13 13
14 #ifndef SUBZERO_SRC_ICERNG_H 14 #ifndef SUBZERO_SRC_ICERNG_H
15 #define SUBZERO_SRC_ICERNG_H 15 #define SUBZERO_SRC_ICERNG_H
16 16
17 #include <cstdint> 17 #include <cstdint>
18 18
19 #include "llvm/ADT/StringRef.h" 19 #include "llvm/ADT/StringRef.h"
20 #include "llvm/Support/Compiler.h" 20 #include "llvm/Support/Compiler.h"
21 21
22 namespace Ice { 22 namespace Ice {
23 23
24 class RandomNumberGenerator { 24 class RandomNumberGenerator {
25 public: 25 public:
26 RandomNumberGenerator(llvm::StringRef Salt); 26 RandomNumberGenerator(llvm::StringRef Salt);
27 uint64_t next(uint64_t Max); 27 uint64_t next(uint64_t Max);
28 28
29 private: 29 private:
30 RandomNumberGenerator(const RandomNumberGenerator &) LLVM_DELETED_FUNCTION; 30 RandomNumberGenerator(const RandomNumberGenerator &) = delete;
31 RandomNumberGenerator & 31 RandomNumberGenerator &operator=(const RandomNumberGenerator &) = delete;
32 operator=(const RandomNumberGenerator &) LLVM_DELETED_FUNCTION;
33 32
34 uint64_t State; 33 uint64_t State;
35 }; 34 };
36 35
37 // This class adds additional random number generator utilities. The 36 // This class adds additional random number generator utilities. The
38 // reason for the wrapper class is that we want to keep the 37 // reason for the wrapper class is that we want to keep the
39 // RandomNumberGenerator interface identical to LLVM's. 38 // RandomNumberGenerator interface identical to LLVM's.
40 class RandomNumberGeneratorWrapper { 39 class RandomNumberGeneratorWrapper {
41 public: 40 public:
42 uint64_t next(uint64_t Max) { return RNG.next(Max); } 41 uint64_t next(uint64_t Max) { return RNG.next(Max); }
43 bool getTrueWithProbability(float Probability); 42 bool getTrueWithProbability(float Probability);
44 RandomNumberGeneratorWrapper(RandomNumberGenerator &RNG) : RNG(RNG) {} 43 RandomNumberGeneratorWrapper(RandomNumberGenerator &RNG) : RNG(RNG) {}
45 44
46 private: 45 private:
47 RandomNumberGeneratorWrapper(const RandomNumberGeneratorWrapper &) 46 RandomNumberGeneratorWrapper(const RandomNumberGeneratorWrapper &) = delete;
48 LLVM_DELETED_FUNCTION;
49 RandomNumberGeneratorWrapper & 47 RandomNumberGeneratorWrapper &
50 operator=(const RandomNumberGeneratorWrapper &) LLVM_DELETED_FUNCTION; 48 operator=(const RandomNumberGeneratorWrapper &) = delete;
51 49
52 RandomNumberGenerator &RNG; 50 RandomNumberGenerator &RNG;
53 }; 51 };
54 52
55 } // end of namespace Ice 53 } // end of namespace Ice
56 54
57 #endif // SUBZERO_SRC_ICERNG_H 55 #endif // SUBZERO_SRC_ICERNG_H
OLDNEW
« no previous file with comments | « src/IceOperand.h ('k') | src/IceRegAlloc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698