Namespace display options

This commit is contained in:
caheckman 2020-06-26 16:48:00 -04:00
parent 05c3358fe4
commit e339d91ffd
12 changed files with 129 additions and 75 deletions

View file

@ -174,7 +174,17 @@ void PrintC::pushPrototypeInputs(const FuncProto *proto)
void PrintC::pushSymbolScope(const Symbol *symbol)
{
int4 scopedepth = symbol->getResolutionDepth(curscope);
int4 scopedepth;
if (namespc_strategy == MINIMAL_NAMESPACES)
scopedepth = symbol->getResolutionDepth(curscope);
else if (namespc_strategy == ALL_NAMESPACES) {
if (symbol->getScope() == curscope)
scopedepth = 0;
else
scopedepth = symbol->getResolutionDepth((const Scope *)0);
}
else
scopedepth = 0;
if (scopedepth != 0) {
vector<const Scope *> scopeList;
const Scope *point = symbol->getScope();
@ -195,7 +205,17 @@ void PrintC::pushSymbolScope(const Symbol *symbol)
void PrintC::emitSymbolScope(const Symbol *symbol)
{
int4 scopedepth = symbol->getResolutionDepth(curscope);
int4 scopedepth;
if (namespc_strategy == MINIMAL_NAMESPACES)
scopedepth = symbol->getResolutionDepth(curscope);
else if (namespc_strategy == ALL_NAMESPACES) {
if (symbol->getScope() == curscope)
scopedepth = 0;
else
scopedepth = symbol->getResolutionDepth((const Scope *)0);
}
else
scopedepth = 0;
if (scopedepth != 0) {
vector<const Scope *> scopeList;
const Scope *point = symbol->getScope();