about summary refs log tree commit diff homepage
path: root/lib/Module/ModuleHelper.h
blob: 1b279edd14cae342ef3ee0f4bc4e87951b7dadec (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//===-- ModuleHelper.h ------------------------------------------*- C++ -*-===//
//
//                     The KLEE Symbolic Virtual Machine
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef KLEE_MODULEHELPER_H
#define KLEE_MODULEHELPER_H

#include "llvm/ADT/ArrayRef.h"
#include "llvm/IR/Module.h"

namespace klee {
enum class SwitchImplType {
  eSwitchTypeSimple,
  eSwitchTypeLLVM,
  eSwitchTypeInternal
};

void optimiseAndPrepare(bool OptimiseKLEECall, bool Optimize,
                        SwitchImplType SwitchType, std::string EntryPoint,
                        llvm::ArrayRef<const char *> preservedFunctions,
                        llvm::Module *module);
void checkModule(bool DontVerfify, llvm::Module *module);
void instrument(bool CheckDivZero, bool CheckOvershift, llvm::Module *module);

void injectStaticConstructorsAndDestructors(llvm::Module *m,
                                            llvm::StringRef entryFunction);

void optimizeModule(llvm::Module *M,
                    llvm::ArrayRef<const char *> preservedFunctions);
} // namespace klee

#endif // KLEE_MODULEHELPER_H