diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2019-10-23 17:52:09 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2019-10-23 17:52:09 +0000 |
| commit | 519fc96c475680de2cc49e7811dbbfadb912cbcc (patch) | |
| tree | 310ca684459b7e9ae13c9a3b9abf308b3a634afe /lib/AST/ASTTypeTraits.cpp | |
| parent | 2298981669bf3bd63335a4be179bc0f96823a8f4 (diff) | |
Vendor import of stripped clang trunk r375505, the last commit beforevendor/clang/clang-trunk-r375505vendor/clang
the upstream Subversion repository was made read-only, and the LLVM
project migrated to GitHub:
https://llvm.org/svn/llvm-project/cfe/trunk@375505
Notes
svn path=/vendor/clang/dist/; revision=353942
svn path=/vendor/clang/clang-r375505/; revision=353943; tag=vendor/clang/clang-trunk-r375505
Diffstat (limited to 'lib/AST/ASTTypeTraits.cpp')
| -rw-r--r-- | lib/AST/ASTTypeTraits.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/AST/ASTTypeTraits.cpp b/lib/AST/ASTTypeTraits.cpp index ba1581bd3f6b..6b7f6ec51086 100644 --- a/lib/AST/ASTTypeTraits.cpp +++ b/lib/AST/ASTTypeTraits.cpp @@ -15,6 +15,7 @@ #include "clang/AST/ASTTypeTraits.h" #include "clang/AST/ASTContext.h" #include "clang/AST/DeclCXX.h" +#include "clang/AST/NestedNameSpecifier.h" namespace clang { namespace ast_type_traits { @@ -36,7 +37,7 @@ const ASTNodeKind::KindInfo ASTNodeKind::AllKindInfo[] = { #include "clang/AST/StmtNodes.inc" { NKI_None, "Type" }, #define TYPE(DERIVED, BASE) { NKI_##BASE, #DERIVED "Type" }, -#include "clang/AST/TypeNodes.def" +#include "clang/AST/TypeNodes.inc" { NKI_None, "OMPClause" }, #define OPENMP_CLAUSE(TextualSpelling, Class) {NKI_OMPClause, #Class}, #include "clang/Basic/OpenMPKinds.def" @@ -103,7 +104,7 @@ ASTNodeKind ASTNodeKind::getFromNode(const Type &T) { #define TYPE(Class, Base) \ case Type::Class: return ASTNodeKind(NKI_##Class##Type); #define ABSTRACT_TYPE(Class, Base) -#include "clang/AST/TypeNodes.def" +#include "clang/AST/TypeNodes.inc" } llvm_unreachable("invalid type kind"); } @@ -115,6 +116,8 @@ ASTNodeKind ASTNodeKind::getFromNode(const OMPClause &C) { #include "clang/Basic/OpenMPKinds.def" case OMPC_threadprivate: case OMPC_uniform: + case OMPC_device_type: + case OMPC_match: case OMPC_unknown: llvm_unreachable("unexpected OpenMP clause kind"); } @@ -129,9 +132,12 @@ void DynTypedNode::print(llvm::raw_ostream &OS, TN->print(OS, PP); else if (const NestedNameSpecifier *NNS = get<NestedNameSpecifier>()) NNS->print(OS, PP); - else if (const NestedNameSpecifierLoc *NNSL = get<NestedNameSpecifierLoc>()) - NNSL->getNestedNameSpecifier()->print(OS, PP); - else if (const QualType *QT = get<QualType>()) + else if (const NestedNameSpecifierLoc *NNSL = get<NestedNameSpecifierLoc>()) { + if (const NestedNameSpecifier *NNS = NNSL->getNestedNameSpecifier()) + NNS->print(OS, PP); + else + OS << "(empty NestedNameSpecifierLoc)"; + } else if (const QualType *QT = get<QualType>()) QT->print(OS, PP); else if (const TypeLoc *TL = get<TypeLoc>()) TL->getType().print(OS, PP); |
