mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-14 11:39:35 +00:00
Two identifiers are not the same unless they have the same identifier info.
llvm-svn: 51827
This commit is contained in:
parent
252e5f1b29
commit
d3f3231a07
@ -24,9 +24,15 @@ using namespace clang;
|
||||
/// isSameToken - Return true if the two specified tokens start have the same
|
||||
/// content.
|
||||
static bool isSameToken(Token &RawTok, Token &PPTok) {
|
||||
if (PPTok.getKind() == RawTok.getKind())
|
||||
// If two tokens have the same kind and the same identifier info, they are
|
||||
// obviously the same.
|
||||
if (PPTok.getKind() == RawTok.getKind() &&
|
||||
PPTok.getIdentifierInfo() == RawTok.getIdentifierInfo())
|
||||
return true;
|
||||
|
||||
// Otherwise, if they are different but have the same identifier info, they
|
||||
// are also considered to be the same. This allows keywords and raw lexed
|
||||
// identifiers with the same name to be treated the same.
|
||||
if (PPTok.getIdentifierInfo() &&
|
||||
PPTok.getIdentifierInfo() == RawTok.getIdentifierInfo())
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user