forked from OSchip/llvm-project
[ORC] Update comments in RTDyldObjectLinkingLayer to refer to singular objects
rather than object sets. llvm-svn: 312423
This commit is contained in:
parent
619b759a57
commit
b3942ac521
|
@ -41,9 +41,9 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
/// @brief Holds a set of objects to be allocated/linked as a unit in the JIT.
|
/// @brief Holds an object to be allocated/linked as a unit in the JIT.
|
||||||
///
|
///
|
||||||
/// An instance of this class will be created for each set of objects added
|
/// An instance of this class will be created for each object added
|
||||||
/// via JITObjectLayer::addObject. Deleting the instance (via
|
/// via JITObjectLayer::addObject. Deleting the instance (via
|
||||||
/// removeObject) frees its memory, removing all symbol definitions that
|
/// removeObject) frees its memory, removing all symbol definitions that
|
||||||
/// had been provided by this instance. Higher level layers are responsible
|
/// had been provided by this instance. Higher level layers are responsible
|
||||||
|
@ -83,7 +83,7 @@ protected:
|
||||||
using LinkedObjectListT = std::list<std::unique_ptr<LinkedObject>>;
|
using LinkedObjectListT = std::list<std::unique_ptr<LinkedObject>>;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// @brief Handle to a set of loaded objects.
|
/// @brief Handle to a loaded object.
|
||||||
using ObjHandleT = LinkedObjectListT::iterator;
|
using ObjHandleT = LinkedObjectListT::iterator;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -253,10 +253,9 @@ public:
|
||||||
this->ProcessAllSections = ProcessAllSections;
|
this->ProcessAllSections = ProcessAllSections;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @brief Add a set of objects (or archives) that will be treated as a unit
|
/// @brief Add an object to the JIT.
|
||||||
/// for the purposes of symbol lookup and memory management.
|
|
||||||
///
|
///
|
||||||
/// @return A handle that can be used to refer to the loaded objects (for
|
/// @return A handle that can be used to refer to the loaded object (for
|
||||||
/// symbol searching, finalization, freeing memory, etc.).
|
/// symbol searching, finalization, freeing memory, etc.).
|
||||||
Expected<ObjHandleT> addObject(ObjectPtr Obj,
|
Expected<ObjHandleT> addObject(ObjectPtr Obj,
|
||||||
std::shared_ptr<JITSymbolResolver> Resolver) {
|
std::shared_ptr<JITSymbolResolver> Resolver) {
|
||||||
|
@ -291,10 +290,10 @@ public:
|
||||||
return Handle;
|
return Handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @brief Remove the set of objects associated with handle H.
|
/// @brief Remove the object associated with handle H.
|
||||||
///
|
///
|
||||||
/// All memory allocated for the objects will be freed, and the sections and
|
/// All memory allocated for the object will be freed, and the sections and
|
||||||
/// symbols they provided will no longer be available. No attempt is made to
|
/// symbols it provided will no longer be available. No attempt is made to
|
||||||
/// re-emit the missing symbols, and any use of these symbols (directly or
|
/// re-emit the missing symbols, and any use of these symbols (directly or
|
||||||
/// indirectly) will result in undefined behavior. If dependence tracking is
|
/// indirectly) will result in undefined behavior. If dependence tracking is
|
||||||
/// required to detect or resolve such issues it should be added at a higher
|
/// required to detect or resolve such issues it should be added at a higher
|
||||||
|
@ -318,27 +317,27 @@ public:
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @brief Search for the given named symbol in the context of the set of
|
/// @brief Search for the given named symbol in the context of the loaded
|
||||||
/// loaded objects represented by the handle H.
|
/// object represented by the handle H.
|
||||||
/// @param H The handle for the object set to search in.
|
/// @param H The handle for the object to search in.
|
||||||
/// @param Name The name of the symbol to search for.
|
/// @param Name The name of the symbol to search for.
|
||||||
/// @param ExportedSymbolsOnly If true, search only for exported symbols.
|
/// @param ExportedSymbolsOnly If true, search only for exported symbols.
|
||||||
/// @return A handle for the given named symbol, if it is found in the
|
/// @return A handle for the given named symbol, if it is found in the
|
||||||
/// given object set.
|
/// given object.
|
||||||
JITSymbol findSymbolIn(ObjHandleT H, StringRef Name,
|
JITSymbol findSymbolIn(ObjHandleT H, StringRef Name,
|
||||||
bool ExportedSymbolsOnly) {
|
bool ExportedSymbolsOnly) {
|
||||||
return (*H)->getSymbol(Name, ExportedSymbolsOnly);
|
return (*H)->getSymbol(Name, ExportedSymbolsOnly);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @brief Map section addresses for the objects associated with the handle H.
|
/// @brief Map section addresses for the object associated with the handle H.
|
||||||
void mapSectionAddress(ObjHandleT H, const void *LocalAddress,
|
void mapSectionAddress(ObjHandleT H, const void *LocalAddress,
|
||||||
JITTargetAddress TargetAddr) {
|
JITTargetAddress TargetAddr) {
|
||||||
(*H)->mapSectionAddress(LocalAddress, TargetAddr);
|
(*H)->mapSectionAddress(LocalAddress, TargetAddr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @brief Immediately emit and finalize the object set represented by the
|
/// @brief Immediately emit and finalize the object represented by the given
|
||||||
/// given handle.
|
/// handle.
|
||||||
/// @param H Handle for object set to emit/finalize.
|
/// @param H Handle for object to emit/finalize.
|
||||||
Error emitAndFinalize(ObjHandleT H) {
|
Error emitAndFinalize(ObjHandleT H) {
|
||||||
(*H)->finalize();
|
(*H)->finalize();
|
||||||
return Error::success();
|
return Error::success();
|
||||||
|
|
Loading…
Reference in New Issue