[Orc][MCJIT][RuntimeDyld] Re-apply r231726 and r231724 with fix suggested by
[oota-llvm.git] / lib / ExecutionEngine / MCJIT / MCJIT.cpp
index 527941b59a8d0581b5a9c5442cdcd12cc02b4418..20b85532e0b399f7dbcfa46b856392a75eea484d 100644 (file)
@@ -257,7 +257,7 @@ uint64_t MCJIT::getExistingSymbolAddress(const std::string &Name) {
   Mangler Mang(TM->getDataLayout());
   SmallString<128> FullName;
   Mang.getNameWithPrefix(FullName, Name);
-  return Dyld.getSymbolLoadAddress(FullName);
+  return Dyld.getSymbol(FullName).getAddress();
 }
 
 Module *MCJIT::findModuleForSymbol(const std::string &Name,
@@ -383,7 +383,7 @@ void *MCJIT::getPointerToFunction(Function *F) {
   //
   // This is the accessor for the target address, so make sure to check the
   // load address of the symbol, not the local address.
-  return (void*)Dyld.getSymbolLoadAddress(Name);
+  return (void*)Dyld.getSymbol(Name).getAddress();
 }
 
 void MCJIT::runStaticConstructorsDestructorsInModulePtrSet(