// -*- C++ -*- (c) 2018 Vladimír Štill DIVINE_RELAX_WARNINGS #include #include #include #include DIVINE_UNRELAX_WARNINGS #include #include namespace lart { namespace svcomp { struct UndefNondet { static PassMeta meta() { return passMeta< UndefNondet >( "undef-nondet", "" ); } void run( llvm::Module &m ) { auto &ctx = m.getContext(); for ( auto &fn : m.functions() ) { if ( fn.getName().startswith( "__sym_val_" ) || fn.getName().startswith( "__VERIFIER_nondet_" ) ) { fn.deleteBody(); auto *retType = fn.getReturnType(); auto *bb = llvm::BasicBlock::Create( ctx, "", &fn ); llvm::IRBuilder<> irb( bb ); auto *alloca = irb.CreateAlloca( retType ); irb.CreateRet( irb.CreateLoad( alloca ) ); } } } }; PassMeta svcUndefNondetPass() { return compositePassMeta< UndefNondet >( "svc-undef-nondet", "" ); } } }