summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/ExecutionEngine/Orc/LegacyRTDyldObjectLinkingLayerTest.cpp
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2020-01-21 16:28:30 -0800
committerHans Wennborg <hans@chromium.org>2020-01-29 21:50:16 +0100
commit32723d572077e9a3776553a2067563974e85e7c8 (patch)
tree72635c7810a1525721b9b12e1cb9fbfbfcad96ef /llvm/unittests/ExecutionEngine/Orc/LegacyRTDyldObjectLinkingLayerTest.cpp
parentf7f0fd4a21d52d30f9b3257cd537fbc706f0f176 (diff)
downloadbcm5719-llvm-32723d572077e9a3776553a2067563974e85e7c8.tar.gz
bcm5719-llvm-32723d572077e9a3776553a2067563974e85e7c8.zip
[ORC] Add support for emulated TLS to ORCv2.
This commit adds a ManglingOptions struct to IRMaterializationUnit, and replaces IRCompileLayer::CompileFunction with a new IRCompileLayer::IRCompiler class. The ManglingOptions struct defines the emulated-TLS state (via a bool member, EmulatedTLS, which is true if emulated-TLS is enabled and false otherwise). The IRCompileLayer::IRCompiler class wraps an IRCompiler (the same way that the CompileFunction typedef used to), but adds a method to return the IRCompileLayer::ManglingOptions that the compiler will use. These changes allow us to correctly determine the symbols that will be produced when a thread local global variable defined at the IR level is compiled with or without emulated TLS. This is required for ORCv2, where MaterializationUnits must declare their interface up-front. Most ORCv2 clients should not require any changes. Clients writing custom IR compilers will need to wrap their compiler in an IRCompileLayer::IRCompiler, rather than an IRCompileLayer::CompileFunction, however this should be a straightforward change (see modifications to CompileUtils.* in this patch for an example). (cherry picked from commit ce2207abaf9a925b35f15ef92aaff6b301ba6d22)
Diffstat (limited to 'llvm/unittests/ExecutionEngine/Orc/LegacyRTDyldObjectLinkingLayerTest.cpp')
-rw-r--r--llvm/unittests/ExecutionEngine/Orc/LegacyRTDyldObjectLinkingLayerTest.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/unittests/ExecutionEngine/Orc/LegacyRTDyldObjectLinkingLayerTest.cpp b/llvm/unittests/ExecutionEngine/Orc/LegacyRTDyldObjectLinkingLayerTest.cpp
index 3f0f85b69a7..896914da624 100644
--- a/llvm/unittests/ExecutionEngine/Orc/LegacyRTDyldObjectLinkingLayerTest.cpp
+++ b/llvm/unittests/ExecutionEngine/Orc/LegacyRTDyldObjectLinkingLayerTest.cpp
@@ -94,7 +94,7 @@ TEST(LegacyRTDyldObjectLinkingLayerTest, TestSetProcessAllSections) {
if (!TM)
return;
- auto Obj = SimpleCompiler(*TM)(*M);
+ auto Obj = cantFail(SimpleCompiler(*TM)(*M));
{
// Test with ProcessAllSections = false (the default).
@@ -165,7 +165,7 @@ TEST_F(LegacyRTDyldObjectLinkingLayerExecutionTest, NoDuplicateFinalization) {
Builder.CreateRet(FourtyTwo);
}
- auto Obj1 = Compile(*MB1.getModule());
+ auto Obj1 = cantFail(Compile(*MB1.getModule()));
ModuleBuilder MB2(Context, "", "dummy");
{
@@ -178,7 +178,7 @@ TEST_F(LegacyRTDyldObjectLinkingLayerExecutionTest, NoDuplicateFinalization) {
IRBuilder<> Builder(FooEntry);
Builder.CreateRet(Builder.CreateCall(BarDecl));
}
- auto Obj2 = Compile(*MB2.getModule());
+ auto Obj2 = cantFail(Compile(*MB2.getModule()));
auto K1 = ES.allocateVModule();
Resolvers[K1] = std::make_shared<NullResolver>();
@@ -251,7 +251,7 @@ TEST_F(LegacyRTDyldObjectLinkingLayerExecutionTest, NoPrematureAllocation) {
Builder.CreateRet(FourtyTwo);
}
- auto Obj1 = Compile(*MB1.getModule());
+ auto Obj1 = cantFail(Compile(*MB1.getModule()));
ModuleBuilder MB2(Context, "", "dummy");
{
@@ -264,7 +264,7 @@ TEST_F(LegacyRTDyldObjectLinkingLayerExecutionTest, NoPrematureAllocation) {
Value *Seven = ConstantInt::getSigned(Int32Ty, 7);
Builder.CreateRet(Seven);
}
- auto Obj2 = Compile(*MB2.getModule());
+ auto Obj2 = cantFail(Compile(*MB2.getModule()));
auto K = ES.allocateVModule();
cantFail(ObjLayer.addObject(K, std::move(Obj1)));
OpenPOWER on IntegriCloud