14#include "llvm/ADT/SmallPtrSet.h"
15#include "llvm/IR/Function.h"
16#include "llvm/IR/Instruction.h"
17#include "llvm/IR/Module.h"
26 llvm::SmallPtrSet<llvm::Function *,16> CallingFunctions;
28 if (!F.hasName() || !F.getName().startswith(
"klee_"))
30 for (
auto *U : F.users()) {
32 if (!llvm::isa<llvm::CallInst>(U) && !llvm::isa<llvm::InvokeInst>(U))
34 auto *Inst = llvm::cast<llvm::Instruction>(U);
35 CallingFunctions.insert(Inst->getParent()->getParent());
40 for (
auto F : CallingFunctions) {
42 if (F->hasFnAttribute(llvm::Attribute::OptimizeNone))
44 F->addFnAttr(llvm::Attribute::OptimizeNone);
45 F->addFnAttr(llvm::Attribute::NoInline);
bool runOnModule(llvm::Module &M) override