Skip to content

Commit 523ffb6

Browse files
committed
Revert r343129 "[ORC] Change the field order of ThreadSafeModule to ensure the "
It broke several bots. llvm-svn: 343133
1 parent 6feb637 commit 523ffb6

File tree

3 files changed

+8
-92
lines changed

3 files changed

+8
-92
lines changed

llvm/include/llvm/ExecutionEngine/Orc/ThreadSafeModule.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
#include "llvm/IR/LLVMContext.h"
1818
#include "llvm/IR/Module.h"
19-
#include "llvm/Support/Compiler.h"
2019

2120
#include <functional>
2221
#include <memory>
@@ -41,7 +40,7 @@ class ThreadSafeContext {
4140
public:
4241

4342
// RAII based lock for ThreadSafeContext.
44-
class LLVM_NODISCARD Lock {
43+
class Lock {
4544
private:
4645
using UnderlyingLock = std::lock_guard<std::recursive_mutex>;
4746
public:
@@ -89,11 +88,13 @@ class ThreadSafeModule {
8988
/// Construct a ThreadSafeModule from a unique_ptr<Module> and a
9089
/// unique_ptr<LLVMContext>. This creates a new ThreadSafeContext from the
9190
/// 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)) {}
9494

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)) {}
9798

9899
Module* getModule() { return M.get(); }
99100

@@ -108,8 +109,8 @@ class ThreadSafeModule {
108109
}
109110

110111
private:
111-
ThreadSafeContext TSCtx;
112112
std::unique_ptr<Module> M;
113+
ThreadSafeContext TSCtx;
113114
};
114115

115116
using GVPredicate = std::function<bool(const GlobalValue&)>;

llvm/unittests/ExecutionEngine/Orc/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ add_llvm_unittest(OrcJITTests
2626
RTDyldObjectLinkingLayerTest.cpp
2727
RTDyldObjectLinkingLayer2Test.cpp
2828
SymbolStringPoolTest.cpp
29-
ThreadSafeModuleTest.cpp
3029
)
3130

3231
target_link_libraries(OrcJITTests PRIVATE ${ORC_JIT_TEST_LIBS})

llvm/unittests/ExecutionEngine/Orc/ThreadSafeModuleTest.cpp

Lines changed: 0 additions & 84 deletions
This file was deleted.

0 commit comments

Comments
 (0)