diff options
Diffstat (limited to 'clang/include')
| -rw-r--r-- | clang/include/clang/Basic/DiagnosticKinds.def | 6 | ||||
| -rw-r--r-- | clang/include/clang/Lex/MacroInfo.h | 5 | ||||
| -rw-r--r-- | clang/include/clang/Lex/Preprocessor.h | 2 |
3 files changed, 11 insertions, 2 deletions
diff --git a/clang/include/clang/Basic/DiagnosticKinds.def b/clang/include/clang/Basic/DiagnosticKinds.def index fbf2c7c813a..df5c32e1756 100644 --- a/clang/include/clang/Basic/DiagnosticKinds.def +++ b/clang/include/clang/Basic/DiagnosticKinds.def @@ -115,7 +115,11 @@ DIAG(ext_pp_comma_expr, EXTENSION, "comma operator in operand of #if") DIAG(ext_pp_bad_vaargs_use, EXTENSION, "__VA_ARGS__ can only appear in the expansion of a C99 variadic macro") - +DIAG(ext_pp_macro_redef, EXTENSION, + "\"%s\" macro redefined") +DIAG(ext_pp_macro_redef2, EXTENSION, + "this is previous definition") + DIAG(ext_pp_base_file, EXTENSION, "__BASE_FILE__ is a language extension") DIAG(ext_pp_include_level, EXTENSION, diff --git a/clang/include/clang/Lex/MacroInfo.h b/clang/include/clang/Lex/MacroInfo.h index bb92ec965d9..ca668a5ae6a 100644 --- a/clang/include/clang/Lex/MacroInfo.h +++ b/clang/include/clang/Lex/MacroInfo.h @@ -57,6 +57,11 @@ public: /// SourceLocation getDefinitionLoc() const { return Location; } + /// isEqualTo - 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. + bool isEqualTo(const MacroInfo &Other) const; + /// setIsBuiltinMacro - Set or clear the isBuiltinMacro flag. /// void setIsBuiltinMacro(bool Val = true) { diff --git a/clang/include/clang/Lex/Preprocessor.h b/clang/include/clang/Lex/Preprocessor.h index 7a65c82cad2..ef2b662c730 100644 --- a/clang/include/clang/Lex/Preprocessor.h +++ b/clang/include/clang/Lex/Preprocessor.h @@ -421,7 +421,7 @@ private: /// ReadMacroName - Lex and validate a macro name, which occurs after a /// #define or #undef. This emits a diagnostic, sets the token kind to eom, /// and discards the rest of the macro line if the macro name is invalid. - void ReadMacroName(LexerToken &MacroNameTok, bool isDefineUndef = false); + void ReadMacroName(LexerToken &MacroNameTok, char isDefineUndef = 0); /// SkipExcludedConditionalBlock - We just read a #if or related directive and /// decided that the subsequent tokens are in the #if'd out portion of the |

