Decompiler support for default data space

This commit is contained in:
caheckman 2020-01-23 14:32:54 -05:00
parent 660062691a
commit 46e8a54948
21 changed files with 97 additions and 65 deletions

View file

@ -1865,7 +1865,7 @@ void SleighCompile::process(void)
{ // Do all post processing on the parsed data structures
checkNops();
if (getDefaultSpace() == (AddrSpace *)0)
if (getDefaultCodeSpace() == (AddrSpace *)0)
reportError("No default space specified");
if (errors>0) return;
checkConsistency();
@ -2037,10 +2037,10 @@ void SleighCompile::newSpace(SpaceQuality *qual)
AddrSpace *spc = new AddrSpace(this,this,IPTR_PROCESSOR,qual->name,qual->size,qual->wordsize,numSpaces(),AddrSpace::hasphysical,delay);
insertSpace(spc);
if (qual->isdefault) {
if (getDefaultSpace() != (AddrSpace *)0)
reportError(getCurrentLocation(), "Multiple default spaces -- '" + getDefaultSpace()->getName() + "', '" + qual->name + "'");
if (getDefaultCodeSpace() != (AddrSpace *)0)
reportError(getCurrentLocation(), "Multiple default spaces -- '" + getDefaultCodeSpace()->getName() + "', '" + qual->name + "'");
else {
setDefaultSpace(spc->getIndex()); // Make the flagged space the default
setDefaultCodeSpace(spc->getIndex()); // Make the flagged space the default
pcode.setDefaultSpace(spc);
}
}