LLVM 22.0.0git
IRMutator.cpp File Reference

Go to the source code of this file.

Functions

static void eliminateDeadCode (Function &F)
static InstructiongetEffectiveTerminator (BasicBlock &BB)
static BasicBlock::iterator getEndIterator (BasicBlock &BB)
static iterator_range< BasicBlock::iteratorgetInsertionRange (BasicBlock &BB)
static uint64_t getUniqueCaseValue (SmallSet< uint64_t, 4 > &CasesTaken, uint64_t MaxValue, RandomIRBuilder &IB)
 Return a case value that is not already taken to make sure we don't have two cases with same value.
static bool isUnsupportedFunction (Function *F)
 Determines whether a function is unsupported by the current mutator's implementation.

Function Documentation

◆ eliminateDeadCode()

◆ getEffectiveTerminator()

Instruction * getEffectiveTerminator ( BasicBlock & BB)
inlinestatic

◆ getEndIterator()

◆ getInsertionRange()

◆ getUniqueCaseValue()

uint64_t getUniqueCaseValue ( SmallSet< uint64_t, 4 > & CasesTaken,
uint64_t MaxValue,
RandomIRBuilder & IB )
static

Return a case value that is not already taken to make sure we don't have two cases with same value.

Definition at line 383 of file IRMutator.cpp.

References llvm::SmallSet< T, N, C >::count(), llvm::SmallSet< T, N, C >::insert(), and llvm::uniform().

Referenced by llvm::InsertCFGStrategy::mutate().

◆ isUnsupportedFunction()

bool isUnsupportedFunction ( Function * F)
static

Determines whether a function is unsupported by the current mutator's implementation.

The function returns true if any of the following criteria are met:

  • The function accepts metadata or token types as arguments.
  • The function has ABI attributes that could cause UB.
  • The function uses a non-callable CC that may result in UB.

Definition at line 399 of file IRMutator.cpp.

References A(), llvm::any_of(), F, llvm::isCallableCC(), and T.

Referenced by llvm::InsertFunctionStrategy::mutate().