namespace {
/// \brief Helper class which uses a value handler to automatically deletes the
/// memory block when the GlobalVariable is destroyed.
-class GVMemoryBlock : public CallbackVH {
+class GVMemoryBlock final : public CallbackVH {
GVMemoryBlock(const GlobalVariable *GV)
: CallbackVH(const_cast<GlobalVariable*>(GV)) {}
void ExecutionEngine::clearGlobalMappingsFromModule(Module *M) {
MutexGuard locked(lock);
- for (Module::iterator FI = M->begin(), FE = M->end(); FI != FE; ++FI)
- EEState.RemoveMapping(getMangledName(FI));
- for (Module::global_iterator GI = M->global_begin(), GE = M->global_end();
- GI != GE; ++GI)
- EEState.RemoveMapping(getMangledName(GI));
+ for (Function &FI : *M)
+ EEState.RemoveMapping(getMangledName(&FI));
+ for (GlobalVariable &GI : M->globals())
+ EEState.RemoveMapping(getMangledName(&GI));
}
uint64_t ExecutionEngine::updateGlobalMapping(const GlobalValue *GV,
GV.IntVal = apfLHS.bitcastToAPInt();
break;
case Instruction::FRem:
- apfLHS.mod(APFloat(Sem, RHS.IntVal),
- APFloat::rmNearestTiesToEven);
+ apfLHS.mod(APFloat(Sem, RHS.IntVal));
GV.IntVal = apfLHS.bitcastToAPInt();
break;
}