Temporarily revert r231726 and r231724 as they're breaking the build.:
[oota-llvm.git] / include / llvm / ExecutionEngine / Orc / ObjectLinkingLayer.h
index 9838991d6f41c7cf0a9b083f060fe311ac25c123..36af0feabda99c8282c3fc8adcc8c20518a371c0 100644 (file)
@@ -51,8 +51,10 @@ protected:
       return RTDyld->loadObject(Obj);
     }
 
-    RuntimeDyld::SymbolInfo getSymbol(StringRef Name) const {
-      return RTDyld->getSymbol(Name);
+    TargetAddress getSymbolAddress(StringRef Name, bool ExportedSymbolsOnly) {
+      if (ExportedSymbolsOnly)
+        return RTDyld->getExportedSymbolLoadAddress(Name);
+      return RTDyld->getSymbolLoadAddress(Name);
     }
 
     bool NeedsFinalization() const { return (State == Raw); }
@@ -212,32 +214,28 @@ public:
   ///         given object set.
   JITSymbol findSymbolIn(ObjSetHandleT H, StringRef Name,
                          bool ExportedSymbolsOnly) {
-    if (auto Sym = H->getSymbol(Name)) {
-      if (Sym.isExported() || !ExportedSymbolsOnly) {
-        auto Addr = Sym.getAddress();
-        auto Flags = Sym.getFlags();
-        if (!H->NeedsFinalization()) {
-          // If this instance has already been finalized then we can just return
-          // the address.
-          return JITSymbol(Addr, Flags);
-        } else {
-          // If this instance needs finalization return a functor that will do
-          // it. The functor still needs to double-check whether finalization is
-          // required, in case someone else finalizes this set before the
-          // functor is called.
-          auto GetAddress = 
-            [this, Addr, H]() {
-              if (H->NeedsFinalization()) {
-                H->Finalize();
-                if (NotifyFinalized)
-                  NotifyFinalized(H);
-              }
-              return Addr;
-            };
-          return JITSymbol(std::move(GetAddress), Flags);
-        }
+    if (auto Addr = H->getSymbolAddress(Name, ExportedSymbolsOnly)) {
+      if (!H->NeedsFinalization()) {
+        // If this instance has already been finalized then we can just return
+        // the address.
+        return JITSymbol(Addr);
+      } else {
+        // If this instance needs finalization return a functor that will do it.
+        // The functor still needs to double-check whether finalization is
+        // required, in case someone else finalizes this set before the functor
+        // is called.
+        return JITSymbol(
+          [this, Addr, H]() {
+            if (H->NeedsFinalization()) {
+              H->Finalize();
+              if (NotifyFinalized)
+                NotifyFinalized(H);
+            }
+            return Addr;
+          });
       }
     }
+
     return nullptr;
   }