Skip to content

Commit

Permalink
Merge pull request #1776 from braddr/dwarf
Browse files Browse the repository at this point in the history
expose dwarf_regno as a platform specific function
  • Loading branch information
WalterBright committed Mar 22, 2013
1 parent 53411e5 commit f517104
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/backend/dwarf.c
Expand Up @@ -149,6 +149,7 @@ struct CFA_state
CFA_reg regstates[17]; // register states
};

#if TX86
int dwarf_regno(int reg)
{
assert(reg < NUMGENREGS);
Expand All @@ -162,6 +163,7 @@ int dwarf_regno(int reg)
return reg < 8 ? to_amd64_reg_map[reg] : reg;
}
}
#endif

static CFA_state CFA_state_init_32 = // initial CFA state as defined by CIE
{ 0, // location
Expand Down
2 changes: 2 additions & 0 deletions src/backend/dwarf.h
Expand Up @@ -15,4 +15,6 @@ void dwarf_func_term(Symbol *sfunc);
unsigned dwarf_typidx(type *t);
unsigned dwarf_abbrev_code(unsigned char *data, size_t nbytes);

int dwarf_regno(int reg);

#endif
2 changes: 2 additions & 0 deletions src/backend/platform_stub.c
Expand Up @@ -40,6 +40,8 @@ code* REGSAVE::save(code* c, int reg, unsigned* pidx) { assert(0); return NULL;
FuncParamRegs::FuncParamRegs(tym_t tyf) { assert(0); }
int FuncParamRegs::alloc(type *t, tym_t ty, unsigned char *preg1, unsigned char *preg2) { assert(0); return 0; }

int dwarf_regno(int reg) { assert(0); return 0; }

code* prolog_ifunc(tym_t* tyf) { assert(0); return NULL; }
code* prolog_ifunc2(tym_t tyf, tym_t tym, bool pushds) { assert(0); return NULL; }
code* prolog_16bit_windows_farfunc(tym_t* tyf, bool* pushds) { assert(0); return NULL; }
Expand Down

0 comments on commit f517104

Please sign in to comment.