Skip to content

Commit

Permalink
Merge pull request JuliaLang#5433 from JuliaLang/kf/dinfo
Browse files Browse the repository at this point in the history
WIP: Add more debug info
  • Loading branch information
Keno committed Feb 4, 2015
2 parents 18d55b3 + 2cdd76c commit 0d40f50
Show file tree
Hide file tree
Showing 6 changed files with 254 additions and 29 deletions.
1 change: 1 addition & 0 deletions src/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,7 @@ jl_datatype_t *jl_new_datatype(jl_sym_t *name, jl_datatype_t *super,
t->ninitialized = ninitialized;
t->instance = NULL;
t->struct_decl = NULL;
t->ditype = NULL;
t->size = 0;
t->alignment = 1;

Expand Down
17 changes: 17 additions & 0 deletions src/cgutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,23 @@ class FunctionMover : public ValueMaterializer
};
#endif

static DIType julia_type_to_di(jl_value_t *jt, DIBuilder *dbuilder, bool isboxed = false)
{
if (jl_is_abstracttype(jt) || !jl_is_datatype(jt) || !jl_isbits(jt) || isboxed)
return jl_pvalue_dillvmt;
jl_datatype_t *jdt = (jl_datatype_t*)jt;
if (jdt->ditype != NULL)
return DIType((llvm::MDNode*)jdt->ditype);
if (jl_is_bitstype(jt)) {
DIType t = dbuilder->createBasicType(jdt->name->name->name,jdt->size,jdt->alignment,llvm::dwarf::DW_ATE_unsigned);
MDNode *M = t;
jdt->ditype = M;
return t;
}
// TODO: Fixme
return jl_pvalue_dillvmt;
}

// --- emitting pointers directly into code ---

static Value *literal_static_pointer_val(void *p, Type *t)
Expand Down
Loading

0 comments on commit 0d40f50

Please sign in to comment.