diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-04-03 17:39:30 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-04-03 17:39:30 +0000 |
commit | bd25ff8632e18bb3af761369fd3b0f1b48fdf061 (patch) | |
tree | f90c89c23c1a46c4171646584fcbabe8f70aa66e /include/clang/Lex | |
parent | 9f4f5f1ca1e1967daf64d5422717c9b1e75eeb9e (diff) |
[preprocessor] Allow comparing two macro definitions syntactically instead of only lexically.
Syntactically means the function macro parameter names do not need to use the same
identifiers in order for the definitions to be considered identical.
Syntactic equivalence is a microsoft extension for macro redefinitions and we'll also
use this kind of comparison to check for ambiguous macros coming from modules.
rdar://13562254
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178671 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Lex')
-rw-r--r-- | include/clang/Lex/MacroInfo.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/clang/Lex/MacroInfo.h b/include/clang/Lex/MacroInfo.h index d7e72fb5c6..64323b7c76 100644 --- a/include/clang/Lex/MacroInfo.h +++ b/include/clang/Lex/MacroInfo.h @@ -145,9 +145,12 @@ public: /// \brief 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. - bool isIdenticalTo(const MacroInfo &Other, Preprocessor &PP) const; + /// \param Syntactically if true, the macro definitions can be identical even + /// if they use different identifiers for the function macro parameters. + /// Otherwise the comparison is lexical and this implements the rules in + /// C99 6.10.3. + bool isIdenticalTo(const MacroInfo &Other, Preprocessor &PP, + bool Syntactically) const; /// \brief Set or clear the isBuiltinMacro flag. void setIsBuiltinMacro(bool Val = true) { |