16
16
17
17
#include " llvm/IR/LLVMContext.h"
18
18
#include " llvm/IR/Module.h"
19
- #include " llvm/Support/Compiler.h"
20
19
21
20
#include < functional>
22
21
#include < memory>
@@ -41,7 +40,7 @@ class ThreadSafeContext {
41
40
public:
42
41
43
42
// RAII based lock for ThreadSafeContext.
44
- class LLVM_NODISCARD Lock {
43
+ class Lock {
45
44
private:
46
45
using UnderlyingLock = std::lock_guard<std::recursive_mutex>;
47
46
public:
@@ -89,11 +88,13 @@ class ThreadSafeModule {
89
88
// / Construct a ThreadSafeModule from a unique_ptr<Module> and a
90
89
// / unique_ptr<LLVMContext>. This creates a new ThreadSafeContext from the
91
90
// / given context.
92
- ThreadSafeModule (std::unique_ptr<Module> M, std::unique_ptr<LLVMContext> Ctx)
93
- : TSCtx(std::move(Ctx)), M(std::move(M)) {}
91
+ ThreadSafeModule (std::unique_ptr<Module> M,
92
+ std::unique_ptr<LLVMContext> Ctx)
93
+ : M(std::move(M)), TSCtx(std::move(Ctx)) {}
94
94
95
- ThreadSafeModule (std::unique_ptr<Module> M, ThreadSafeContext TSCtx)
96
- : TSCtx(std::move(TSCtx)), M(std::move(M)) {}
95
+ ThreadSafeModule (std::unique_ptr<Module> M,
96
+ ThreadSafeContext TSCtx)
97
+ : M(std::move(M)), TSCtx(std::move(TSCtx)) {}
97
98
98
99
Module* getModule () { return M.get (); }
99
100
@@ -108,8 +109,8 @@ class ThreadSafeModule {
108
109
}
109
110
110
111
private:
111
- ThreadSafeContext TSCtx;
112
112
std::unique_ptr<Module> M;
113
+ ThreadSafeContext TSCtx;
113
114
};
114
115
115
116
using GVPredicate = std::function<bool (const GlobalValue&)>;
0 commit comments