summaryrefslogtreecommitdiffstats
path: root/clang/Lex
diff options
context:
space:
mode:
Diffstat (limited to 'clang/Lex')
-rw-r--r--clang/Lex/IdentifierTable.cpp1
-rw-r--r--clang/Lex/MacroInfo.cpp7
-rw-r--r--clang/Lex/Preprocessor.cpp14
3 files changed, 3 insertions, 19 deletions
diff --git a/clang/Lex/IdentifierTable.cpp b/clang/Lex/IdentifierTable.cpp
index 29f90edc2bd..f0272ea7950 100644
--- a/clang/Lex/IdentifierTable.cpp
+++ b/clang/Lex/IdentifierTable.cpp
@@ -209,7 +209,6 @@ IdentifierInfo &IdentifierTable::get(const char *NameStart,
Identifier->TokInfo.TokenID = tok::identifier;
Identifier->TokInfo.IsExtension = false;
Identifier->TokInfo.IsPoisoned = false;
- Identifier->TokInfo.IsMacroArg = false;
Identifier->TokInfo.FETokenInfo = 0;
// Copy the string information.
diff --git a/clang/Lex/MacroInfo.cpp b/clang/Lex/MacroInfo.cpp
index 8b3b87e42a6..6587fa7ec6a 100644
--- a/clang/Lex/MacroInfo.cpp
+++ b/clang/Lex/MacroInfo.cpp
@@ -26,13 +26,6 @@ MacroInfo::MacroInfo(SourceLocation DefLoc) : Location(DefLoc) {
IsUsed = true;
}
-/// SetIdentifierIsMacroArgFlags - Set or clear the "isMacroArg" flags on the
-/// identifiers that make up the argument list for this macro.
-void MacroInfo::SetIdentifierIsMacroArgFlags(bool Val) const {
- for (arg_iterator I = arg_begin(), E = arg_end(); I != E; ++I)
- (*I)->setIsMacroArg(Val);
-}
-
/// isIdenticalTo - Return true if the specified macro definition is equal to
/// this macro in spelling, arguments, and whitespace. This is used to emit
/// duplicate definition warnings. This implements the rules in C99 6.10.3.
diff --git a/clang/Lex/Preprocessor.cpp b/clang/Lex/Preprocessor.cpp
index 8002702638d..6f1c9cea388 100644
--- a/clang/Lex/Preprocessor.cpp
+++ b/clang/Lex/Preprocessor.cpp
@@ -1609,15 +1609,13 @@ bool Preprocessor::ReadMacroDefinitionArgList(MacroInfo *MI) {
// If this is already used as an argument, it is used multiple times (e.g.
// #define X(A,A.
- if (II->isMacroArg()) { // C99 6.10.3p6
+ if (MI->getArgumentNum(II) != -1) { // C99 6.10.3p6
Diag(Tok, diag::err_pp_duplicate_name_in_arg_list, II->getName());
return true;
}
// Add the argument to the macro info.
MI->addArgument(II);
- // Remember it is an argument now.
- II->setIsMacroArg(true);
// Lex the token after the identifier.
LexUnexpandedToken(Tok);
@@ -1677,8 +1675,6 @@ void Preprocessor::HandleDefineDirective(LexerToken &DefineTok) {
// This is a function-like macro definition. Read the argument list.
MI->setIsFunctionLike();
if (ReadMacroDefinitionArgList(MI)) {
- // Clear the "isMacroArg" flags from all the macro arguments parsed.
- MI->SetIdentifierIsMacroArgFlags(false);
// Forget about MI.
delete MI;
// Throw away the rest of the line.
@@ -1720,10 +1716,9 @@ void Preprocessor::HandleDefineDirective(LexerToken &DefineTok) {
LexUnexpandedToken(Tok);
// Not a macro arg identifier?
- if (!Tok.getIdentifierInfo() || !Tok.getIdentifierInfo()->isMacroArg()) {
+ if (!Tok.getIdentifierInfo() ||
+ MI->getArgumentNum(Tok.getIdentifierInfo()) == -1) {
Diag(Tok, diag::err_pp_stringize_not_parameter);
- // Clear the "isMacroArg" flags from all the macro arguments.
- MI->SetIdentifierIsMacroArgFlags(false);
delete MI;
return;
}
@@ -1735,9 +1730,6 @@ void Preprocessor::HandleDefineDirective(LexerToken &DefineTok) {
LexUnexpandedToken(Tok);
}
- // Clear the "isMacroArg" flags from all the macro arguments.
- MI->SetIdentifierIsMacroArgFlags(false);
-
// Check that there is no paste (##) operator at the begining or end of the
// replacement list.
unsigned NumTokens = MI->getNumTokens();
OpenPOWER on IntegriCloud