diff options
| author | 2018-04-06 14:26:03 +0000 | |
|---|---|---|
| committer | 2018-04-06 14:26:03 +0000 | |
| commit | bdabc2f19ffb9e20600dad6e8a300842a7bda50e (patch) | |
| tree | c50e7b2e5449b074651bb82a58517a8ebc4a8cf7 /gnu/llvm/tools/clang/lib/AST/DeclarationName.cpp | |
| parent | Print a 'p' flag for file descriptors that were opened after pledge(2). (diff) | |
| download | wireguard-openbsd-bdabc2f19ffb9e20600dad6e8a300842a7bda50e.tar.xz wireguard-openbsd-bdabc2f19ffb9e20600dad6e8a300842a7bda50e.zip | |
Import LLVM 6.0.1 release including clang, lld and lldb.
"where is the kaboom?" deraadt@
Diffstat (limited to 'gnu/llvm/tools/clang/lib/AST/DeclarationName.cpp')
| -rw-r--r-- | gnu/llvm/tools/clang/lib/AST/DeclarationName.cpp | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/gnu/llvm/tools/clang/lib/AST/DeclarationName.cpp b/gnu/llvm/tools/clang/lib/AST/DeclarationName.cpp index 1f8e26deda9..31bae93c3cb 100644 --- a/gnu/llvm/tools/clang/lib/AST/DeclarationName.cpp +++ b/gnu/llvm/tools/clang/lib/AST/DeclarationName.cpp @@ -1,4 +1,4 @@ -//===-- DeclarationName.cpp - Declaration names implementation --*- C++ -*-===// +//===- DeclarationName.cpp - Declaration names implementation -------------===// // // The LLVM Compiler Infrastructure // @@ -11,20 +11,36 @@ // classes. // //===----------------------------------------------------------------------===// + #include "clang/AST/DeclarationName.h" #include "clang/AST/ASTContext.h" +#include "clang/AST/Decl.h" +#include "clang/AST/DeclBase.h" #include "clang/AST/DeclCXX.h" #include "clang/AST/DeclTemplate.h" +#include "clang/AST/PrettyPrinter.h" #include "clang/AST/Type.h" #include "clang/AST/TypeLoc.h" #include "clang/AST/TypeOrdering.h" #include "clang/Basic/IdentifierTable.h" +#include "clang/Basic/LLVM.h" +#include "clang/Basic/LangOptions.h" +#include "clang/Basic/OperatorKinds.h" +#include "clang/Basic/SourceLocation.h" #include "llvm/ADT/FoldingSet.h" +#include "llvm/Support/Casting.h" +#include "llvm/Support/Compiler.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/raw_ostream.h" +#include <algorithm> +#include <cassert> +#include <cstdint> +#include <string> + using namespace clang; namespace clang { + /// CXXSpecialName - Records the type associated with one of the /// "special" kinds of declaration names in C++, e.g., constructors, /// destructors, and conversion functions. @@ -89,6 +105,8 @@ public: } }; +} // namespace clang + static int compareInt(unsigned A, unsigned B) { return (A < B ? -1 : (A > B ? 1 : 0)); } @@ -197,10 +215,9 @@ void DeclarationName::print(raw_ostream &OS, const PrintingPolicy &Policy) { case DeclarationName::CXXConstructorName: return printCXXConstructorDestructorName(N.getCXXNameType(), OS, Policy); - case DeclarationName::CXXDestructorName: { + case DeclarationName::CXXDestructorName: OS << '~'; return printCXXConstructorDestructorName(N.getCXXNameType(), OS, Policy); - } case DeclarationName::CXXDeductionGuideName: OS << "<deduction guide for "; @@ -250,13 +267,15 @@ void DeclarationName::print(raw_ostream &OS, const PrintingPolicy &Policy) { llvm_unreachable("Unexpected declaration name kind"); } +namespace clang { + raw_ostream &operator<<(raw_ostream &OS, DeclarationName N) { LangOptions LO; N.print(OS, PrintingPolicy(LO)); return OS; } -} // end namespace clang +} // namespace clang DeclarationName::NameKind DeclarationName::getNameKind() const { switch (getStoredNameKind()) { |
