From: Benjamin Kramer Date: Sat, 30 Jan 2016 12:16:23 +0000 (+0000) Subject: [AST] Pull simple method inline. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b1072f2da825949c7b4c0cd22f83a1134e2a8da2;p=clang [AST] Pull simple method inline. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259304 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/ASTTypeTraits.h b/include/clang/AST/ASTTypeTraits.h index dcaac802c1..ad301b1482 100644 --- a/include/clang/AST/ASTTypeTraits.h +++ b/include/clang/AST/ASTTypeTraits.h @@ -62,7 +62,9 @@ public: /// \} /// \brief Returns \c true if \c this and \c Other represent the same kind. - bool isSame(ASTNodeKind Other) const; + bool isSame(ASTNodeKind Other) const { + return KindId != NKI_None && KindId == Other.KindId; + } /// \brief Returns \c true only for the default \c ASTNodeKind() bool isNone() const { return KindId == NKI_None; } diff --git a/lib/AST/ASTTypeTraits.cpp b/lib/AST/ASTTypeTraits.cpp index ec0671ceb1..5019be45b5 100644 --- a/lib/AST/ASTTypeTraits.cpp +++ b/lib/AST/ASTTypeTraits.cpp @@ -43,10 +43,6 @@ bool ASTNodeKind::isBaseOf(ASTNodeKind Other, unsigned *Distance) const { return isBaseOf(KindId, Other.KindId, Distance); } -bool ASTNodeKind::isSame(ASTNodeKind Other) const { - return KindId != NKI_None && KindId == Other.KindId; -} - bool ASTNodeKind::isBaseOf(NodeKindId Base, NodeKindId Derived, unsigned *Distance) { if (Base == NKI_None || Derived == NKI_None) return false;