[PATCH] Make it easier to use DwarfContext with MCJIT

Keno Fischer kfischer at college.harvard.edu
Thu May 21 13:35:24 PDT 2015


REPOSITORY
  rL LLVM

================
Comment at: include/llvm/DebugInfo/DIContext.h:173
@@ +172,3 @@
+  /// The caller is responsible for deallocation once the copy is no longer required.
+  virtual LoadedObjectInfo *clone() const = 0;
+};
----------------
echristo wrote:
> loladiro wrote:
> > echristo wrote:
> > > clone is entirely unused.
> > It's supposed to be available for the client to be able to obtain a copy of the LoadedObjectInfo, since the one it gets from MCJIT is passed by reference. We could probably change that one to a shared_ptr, but I didn't want to put that API breakage into the same commit.
> I guess, it might be nicer to make this clear. I'm not a fan of requiring people to clone it etc. Maybe I'm just not seeing where it's going to be used off the top of my head, and can be added in the future if we have a user of the functionality?
I added this because I need it in Julia. The MCJIT listener interface is
```
NotifyObjectEmitted(const ObjectFile &Object, const RuntimeDyld::LoadedObjectInfo &L) 
```
but I need to store the LoadedObjectInfo for later (to query the DWARFContext), so I added the clone method as a workaround. Better alternatives would be most appreciated of course.

http://reviews.llvm.org/D6961

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list