[sanitizer] Improve FreeBSD ASLR detection
[llvm-project.git] / llvm / tools / llvm-reduce / ReducerWorkItem.h
bloba86e158d916feb2a54a8835fbe1a13f54ee68552
1 //===- ReducerWorkItem.h - Wrapper for Module and MachineFunction ---------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_TOOLS_LLVM_REDUCE_REDUCERWORKITEM_H
10 #define LLVM_TOOLS_LLVM_REDUCE_REDUCERWORKITEM_H
12 #include "llvm/CodeGen/MachineFunction.h"
13 #include "llvm/CodeGen/MachineModuleInfo.h"
14 #include "llvm/IR/Module.h"
16 using namespace llvm;
18 class ReducerWorkItem {
19 public:
20 std::shared_ptr<Module> M;
21 std::unique_ptr<MachineFunction> MF;
22 void print(raw_ostream &ROS, void *p = nullptr) const;
23 bool isMIR() { return MF != nullptr; }
24 operator Module &() const { return *M; }
25 operator MachineFunction &() const { return *MF; }
28 std::unique_ptr<ReducerWorkItem> parseReducerWorkItem(StringRef Filename,
29 LLVMContext &Ctxt,
30 MachineModuleInfo *MMI);
32 std::unique_ptr<ReducerWorkItem>
33 cloneReducerWorkItem(const ReducerWorkItem &MMM);
35 bool verifyReducerWorkItem(const ReducerWorkItem &MMM, raw_fd_ostream *OS);
37 #endif