Commit c1839ee3 by Antonio Maiorano

Apply google3 upstream fixes for latest LLVM

As LLVM Orc v2 API is in flux, changes are being made in google3. This CL applies those changes, while also continuing to make our backend work against LLVM 10. Bug: b/171402030 Change-Id: If7be93bfe495e9d40a6e69415978a622ed3afb50 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/49608 Presubmit-Ready: Antonio Maiorano <amaiorano@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Kokoro-Result: kokoro <noreply+kokoro@google.com> Tested-by: 's avatarAntonio Maiorano <amaiorano@google.com>
parent bb66fa41
...@@ -252,7 +252,11 @@ static uint32_t sync_fetch_and_op(uint32_t volatile *ptr, uint32_t val, F f) ...@@ -252,7 +252,11 @@ static uint32_t sync_fetch_and_op(uint32_t volatile *ptr, uint32_t val, F f)
} }
#endif #endif
#if LLVM_VERSION_MAJOR >= 11 /* TODO(b/165000222): Unconditional after LLVM 11 upgrade */
class ExternalSymbolGenerator : public llvm::orc::DefinitionGenerator
#else
class ExternalSymbolGenerator : public llvm::orc::JITDylib::DefinitionGenerator class ExternalSymbolGenerator : public llvm::orc::JITDylib::DefinitionGenerator
#endif
{ {
struct Atomic struct Atomic
{ {
...@@ -413,7 +417,11 @@ class ExternalSymbolGenerator : public llvm::orc::JITDylib::DefinitionGenerator ...@@ -413,7 +417,11 @@ class ExternalSymbolGenerator : public llvm::orc::JITDylib::DefinitionGenerator
} }
}; };
llvm::Error tryToGenerate(llvm::orc::LookupKind kind, llvm::Error tryToGenerate(
#if LLVM_VERSION_MAJOR >= 11 /* TODO(b/165000222): Unconditional after LLVM 11 upgrade */
llvm::orc::LookupState &state,
#endif
llvm::orc::LookupKind kind,
llvm::orc::JITDylib &dylib, llvm::orc::JITDylib &dylib,
llvm::orc::JITDylibLookupFlags flags, llvm::orc::JITDylibLookupFlags flags,
const llvm::orc::SymbolLookupSet &set) override const llvm::orc::SymbolLookupSet &set) override
...@@ -566,10 +574,11 @@ public: ...@@ -566,10 +574,11 @@ public:
~JITRoutine() ~JITRoutine()
{ {
// TODO(b/165000222): Unconditional after LLVM 11 upgrade #if LLVM_VERSION_MAJOR >= 11 /* TODO(b/165000222): Unconditional after LLVM 11 upgrade */
#if LLVM_VERSION_MAJOR >= 11 if(auto err = session.endSession())
// Avoid assert in ~RTDyldObjectLinkingLayer() {
dylib.getDefaultResourceTracker()->remove(); session.reportError(std::move(err));
}
#endif #endif
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment