diff options
| author | 2017-01-24 08:32:59 +0000 | |
|---|---|---|
| committer | 2017-01-24 08:32:59 +0000 | |
| commit | 53d771aafdbe5b919f264f53cba3788e2c4cffd2 (patch) | |
| tree | 7eca39498be0ff1e3a6daf583cd9ca5886bb2636 /gnu/llvm/tools/clang/lib/AST/DeclarationName.cpp | |
| parent | In preparation of compiling our kernels with -ffreestanding, explicitly map (diff) | |
| download | wireguard-openbsd-53d771aafdbe5b919f264f53cba3788e2c4cffd2.tar.xz wireguard-openbsd-53d771aafdbe5b919f264f53cba3788e2c4cffd2.zip | |
Import LLVM 4.0.0 rc1 including clang and lld to help the current
development effort on OpenBSD/arm64.
Diffstat (limited to 'gnu/llvm/tools/clang/lib/AST/DeclarationName.cpp')
| -rw-r--r-- | gnu/llvm/tools/clang/lib/AST/DeclarationName.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gnu/llvm/tools/clang/lib/AST/DeclarationName.cpp b/gnu/llvm/tools/clang/lib/AST/DeclarationName.cpp index 2a988e1d22d..52791e51d2d 100644 --- a/gnu/llvm/tools/clang/lib/AST/DeclarationName.cpp +++ b/gnu/llvm/tools/clang/lib/AST/DeclarationName.cpp @@ -11,14 +11,13 @@ // classes. // //===----------------------------------------------------------------------===// +#include "clang/AST/DeclarationName.h" #include "clang/AST/ASTContext.h" #include "clang/AST/DeclCXX.h" -#include "clang/AST/DeclarationName.h" #include "clang/AST/Type.h" #include "clang/AST/TypeLoc.h" #include "clang/AST/TypeOrdering.h" #include "clang/Basic/IdentifierTable.h" -#include "llvm/ADT/DenseMap.h" #include "llvm/ADT/FoldingSet.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/raw_ostream.h" @@ -96,12 +95,18 @@ int DeclarationName::compare(DeclarationName LHS, DeclarationName RHS) { case DeclarationName::ObjCMultiArgSelector: { Selector LHSSelector = LHS.getObjCSelector(); Selector RHSSelector = RHS.getObjCSelector(); + // getNumArgs for ZeroArgSelector returns 0, but we still need to compare. + if (LHS.getNameKind() == DeclarationName::ObjCZeroArgSelector && + RHS.getNameKind() == DeclarationName::ObjCZeroArgSelector) { + return LHSSelector.getAsIdentifierInfo()->getName().compare( + RHSSelector.getAsIdentifierInfo()->getName()); + } unsigned LN = LHSSelector.getNumArgs(), RN = RHSSelector.getNumArgs(); for (unsigned I = 0, N = std::min(LN, RN); I != N; ++I) { switch (LHSSelector.getNameForSlot(I).compare( RHSSelector.getNameForSlot(I))) { - case -1: return true; - case 1: return false; + case -1: return -1; + case 1: return 1; default: break; } } |
