LLVM 20.0.0git
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
llvm::RandomNumberGenerator Class Reference

A random number generator. More...

#include "llvm/Support/RandomNumberGenerator.h"

Public Types

using result_type = generator_type::result_type
 

Public Member Functions

result_type operator() ()
 Returns a random number in the range [0, Max).
 

Static Public Member Functions

static constexpr result_type min ()
 
static constexpr result_type max ()
 

Friends

class Module
 

Detailed Description

A random number generator.

Instances of this class should not be shared across threads. The seed should be set by passing the -rng-seed=<uint64> option. Use Module::createRNG to create a new RNG instance for use with that module.

Definition at line 32 of file RandomNumberGenerator.h.

Member Typedef Documentation

◆ result_type

using llvm::RandomNumberGenerator::result_type = generator_type::result_type

Definition at line 41 of file RandomNumberGenerator.h.

Member Function Documentation

◆ max()

static constexpr result_type llvm::RandomNumberGenerator::max ( )
inlinestaticconstexpr

Definition at line 47 of file RandomNumberGenerator.h.

◆ min()

static constexpr result_type llvm::RandomNumberGenerator::min ( )
inlinestaticconstexpr

Definition at line 46 of file RandomNumberGenerator.h.

◆ operator()()

RandomNumberGenerator::result_type RandomNumberGenerator::operator() ( )

Returns a random number in the range [0, Max).

Definition at line 65 of file RandomNumberGenerator.cpp.

Friends And Related Function Documentation

◆ Module

friend class Module
friend

Definition at line 62 of file RandomNumberGenerator.h.


The documentation for this class was generated from the following files: