From: Richard Trieu Date: Thu, 17 Dec 2015 04:46:48 +0000 (+0000) Subject: Add QualType case to operator< for DynTypedNode. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7685be770f653044212184f0c6e993f466ea914c;p=clang Add QualType case to operator< for DynTypedNode. This allows sorting DynTypedNode's which are QualType's since QualType does not have memoization. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@255875 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/ASTTypeTraits.h b/include/clang/AST/ASTTypeTraits.h index 50ad9535a5..a1aad0bd2a 100644 --- a/include/clang/AST/ASTTypeTraits.h +++ b/include/clang/AST/ASTTypeTraits.h @@ -271,6 +271,10 @@ public: if (!NodeKind.isSame(Other.NodeKind)) return NodeKind < Other.NodeKind; + if (ASTNodeKind::getFromNodeKind().isSame(NodeKind)) + return getUnchecked().getAsOpaquePtr() == + Other.getUnchecked().getAsOpaquePtr(); + if (ASTNodeKind::getFromNodeKind().isSame(NodeKind)) { auto TLA = getUnchecked(); auto TLB = Other.getUnchecked();