@@ -91,10 +91,8 @@ struct ObjectInfo {
91
91
const object::ObjectFile *object;
92
92
size_t SectionSize;
93
93
ptrdiff_t slide;
94
- #ifdef LLVM39
94
+ #ifdef LLVM37
95
95
DIContext *context;
96
- #elif defined(LLVM37)
97
- const llvm::LoadedObjectInfo *L;
98
96
#endif
99
97
#if defined(_OS_DARWIN_) && !defined(LLVM37)
100
98
const char *name;
@@ -273,29 +271,25 @@ class JuliaJITEventListener: public JITEventListener
273
271
return NULL ;
274
272
}
275
273
#ifdef LLVM36
276
-
277
274
virtual void NotifyObjectEmitted (const object::ObjectFile &obj,
278
275
const RuntimeDyld::LoadedObjectInfo &L)
279
- {
280
- return _NotifyObjectEmitted (obj,obj,L);
281
- }
282
-
283
- virtual void _NotifyObjectEmitted (const object::ObjectFile &obj,
284
- const object::ObjectFile &debugObj,
285
- const RuntimeDyld::LoadedObjectInfo &L)
286
276
#else
287
277
virtual void NotifyObjectEmitted (const ObjectImage &obj)
288
278
#endif
289
279
{
290
280
int8_t gc_state = jl_gc_safe_enter ();
291
281
uv_rwlock_wrlock (&threadsafe);
292
282
jl_gc_safe_leave (gc_state);
283
+
293
284
#ifdef LLVM36
285
+ const object::OwningBinary<object::ObjectFile> &debugObjOwner = L.getObjectForDebug (obj);
286
+ const object::ObjectFile &debugObj =
287
+ (debugObjOwner.getBinary () ? *debugObjOwner.getBinary () : obj);
294
288
object::section_iterator Section = debugObj.section_begin ();
295
289
object::section_iterator EndSection = debugObj.section_end ();
296
290
#else
297
- object::section_iterator Section = debugObj .begin_sections ();
298
- object::section_iterator EndSection = debugObj .end_sections ();
291
+ object::section_iterator Section = obj .begin_sections ();
292
+ object::section_iterator EndSection = obj .end_sections ();
299
293
#endif
300
294
301
295
#ifdef LLVM38
@@ -444,11 +438,7 @@ class JuliaJITEventListener: public JITEventListener
444
438
ObjectInfo tmp = {&debugObj,
445
439
(size_t )SectionSize,
446
440
(ptrdiff_t )(SectionAddr - SectionLoadAddr),
447
- #ifdef LLVM39
448
441
new DWARFContextInMemory (debugObj, &L),
449
- #else
450
- L.clone ().release (),
451
- #endif
452
442
};
453
443
objectmap[SectionLoadAddr] = tmp;
454
444
first = false ;
@@ -524,11 +514,6 @@ class JuliaJITEventListener: public JITEventListener
524
514
#endif
525
515
ObjectInfo tmp = {objfile, (size_t )Size ,
526
516
(ptrdiff_t )(SectionAddr - SectionLoadAddr),
527
- #ifdef LLVM39
528
- new DWARFContextInMemory (*objfile, &L),
529
- #elif defined(LLVM37)
530
- L.clone ().release (),
531
- #endif
532
517
#ifdef _OS_DARWIN_
533
518
strndup (sName .data (), sName .size ()),
534
519
#endif
@@ -568,16 +553,6 @@ class JuliaJITEventListener: public JITEventListener
568
553
#endif // USE_MCJIT
569
554
};
570
555
571
- #ifdef USE_ORCJIT
572
- JL_DLLEXPORT void ORCNotifyObjectEmitted (JITEventListener *Listener,
573
- const object::ObjectFile &obj,
574
- const object::ObjectFile &debugObj,
575
- const RuntimeDyld::LoadedObjectInfo &L)
576
- {
577
- ((JuliaJITEventListener*)Listener)->_NotifyObjectEmitted (obj,debugObj,L);
578
- }
579
- #endif
580
-
581
556
extern " C"
582
557
char *jl_demangle (const char *name)
583
558
{
@@ -1045,10 +1020,8 @@ int jl_DI_for_fptr(uint64_t fptr, uint64_t *symsize, int64_t *slide, int64_t *se
1045
1020
*section_slide = fit->second .slide ;
1046
1021
*object = fit->second .object ;
1047
1022
if (context) {
1048
- #if defined(LLVM39 )
1023
+ #if defined(LLVM37 )
1049
1024
*context = fit->second .context ;
1050
- #elif defined(LLVM37)
1051
- *context = new DWARFContextInMemory (*fit->second .object , fit->second .L );
1052
1025
#else
1053
1026
*context = DIContext::getDWARFContext (*fit->second .object );
1054
1027
#endif
@@ -1100,13 +1073,6 @@ JL_DLLEXPORT uint64_t jl_get_section_start(uint64_t fptr)
1100
1073
1101
1074
#endif
1102
1075
1103
- void jl_cleanup_DI (llvm::DIContext *context)
1104
- {
1105
- #ifndef LLVM39
1106
- delete context;
1107
- #endif
1108
- }
1109
-
1110
1076
// Set *name and *filename to either NULL or malloc'd string
1111
1077
void jl_getFunctionInfo (char **name, char **filename, size_t *line,
1112
1078
char **inlinedat_file, size_t *inlinedat_line, jl_lambda_info_t **outer_linfo,
@@ -1130,7 +1096,6 @@ void jl_getFunctionInfo(char **name, char **filename, size_t *line,
1130
1096
if (jl_DI_for_fptr (pointer, &symsize, &slide, NULL , &object, &context)) {
1131
1097
*outer_linfo = jl_jit_events->lookupLinfo (pointer);
1132
1098
lookup_pointer (context, name, line, filename, inlinedat_line, inlinedat_file, pointer+slide, 1 , fromC);
1133
- jl_cleanup_DI (context);
1134
1099
return ;
1135
1100
}
1136
1101
#else // !USE_MCJIT
0 commit comments