Revert "add ability to record accessed and declared "named defines""
This reverts commit e735042306.
This commit is contained in:
parent
a1184ddd48
commit
1aaa3567d9
3 changed files with 4 additions and 31 deletions
|
|
@ -102,8 +102,7 @@ int TPpContext::CPPdefine(TPpToken* ppToken)
|
|||
parseContext.ppError(ppToken->loc, "must be followed by macro name", "#define", "");
|
||||
return token;
|
||||
}
|
||||
bool inUserCode(ppToken->loc.string >= 0);
|
||||
if (inUserCode) {
|
||||
if (ppToken->loc.string >= 0) {
|
||||
// We are in user code; check for reserved name use:
|
||||
parseContext.reservedPpErrorCheck(ppToken->loc, ppToken->name, "#define");
|
||||
}
|
||||
|
|
@ -187,11 +186,8 @@ int TPpContext::CPPdefine(TPpToken* ppToken)
|
|||
}
|
||||
}
|
||||
*existing = mac;
|
||||
} else {
|
||||
addMacroDef(defAtom, mac);
|
||||
if ( inUserCode && mac.args.empty() && mac.body.atEnd() )
|
||||
parseContext.intermediate.insertDeclaredNamedDefine( atomStrings.getString( defAtom ) );
|
||||
}
|
||||
} else
|
||||
addMacroDef(defAtom, mac);
|
||||
|
||||
return '\n';
|
||||
}
|
||||
|
|
@ -252,8 +248,6 @@ int TPpContext::CPPelse(int matchelse, TPpToken* ppToken)
|
|||
} else {
|
||||
ifdepth++;
|
||||
elsetracker++;
|
||||
if ( nextAtom != PpAtomIf && scanToken( ppToken ) == PpAtomIdentifier )
|
||||
parseContext.intermediate.insertAccessedNamedDefine( ppToken->name );
|
||||
}
|
||||
} else if (nextAtom == PpAtomEndif) {
|
||||
token = extraTokenCheck(nextAtom, ppToken, scanToken(ppToken));
|
||||
|
|
@ -426,7 +420,7 @@ int TPpContext::eval(int token, int precedence, bool shortCircuit, int& res, boo
|
|||
|
||||
return token;
|
||||
}
|
||||
parseContext.intermediate.insertAccessedNamedDefine( ppToken->name );
|
||||
|
||||
MacroSymbol* macro = lookupMacroDef(atomStrings.getAtom(ppToken->name));
|
||||
res = macro != nullptr ? !macro->undef : 0;
|
||||
token = scanToken(ppToken);
|
||||
|
|
@ -583,7 +577,6 @@ int TPpContext::CPPifdef(int defined, TPpToken* ppToken)
|
|||
else
|
||||
parseContext.ppError(ppToken->loc, "must be followed by macro name", "#ifndef", "");
|
||||
} else {
|
||||
parseContext.intermediate.insertAccessedNamedDefine( ppToken->name );
|
||||
MacroSymbol* macro = lookupMacroDef(atomStrings.getAtom(ppToken->name));
|
||||
token = scanToken(ppToken);
|
||||
if (token != '\n') {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue