diff options
Diffstat (limited to 'contrib/llvm/tools/clang/lib/AST/NestedNameSpecifier.cpp')
-rw-r--r-- | contrib/llvm/tools/clang/lib/AST/NestedNameSpecifier.cpp | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/contrib/llvm/tools/clang/lib/AST/NestedNameSpecifier.cpp b/contrib/llvm/tools/clang/lib/AST/NestedNameSpecifier.cpp index 1ff2e71..dbf267b 100644 --- a/contrib/llvm/tools/clang/lib/AST/NestedNameSpecifier.cpp +++ b/contrib/llvm/tools/clang/lib/AST/NestedNameSpecifier.cpp @@ -130,7 +130,7 @@ NestedNameSpecifier::SpecifierKind NestedNameSpecifier::getKind() const { return TypeSpecWithTemplate; } - return Global; + llvm_unreachable("Invalid NNS Kind!"); } /// \brief Retrieve the namespace stored in this nested name @@ -170,8 +170,7 @@ bool NestedNameSpecifier::isDependent() const { return getAsType()->isDependentType(); } - // Necessary to suppress a GCC warning. - return false; + llvm_unreachable("Invalid NNS Kind!"); } /// \brief Whether this nested name specifier refers to a dependent @@ -191,9 +190,8 @@ bool NestedNameSpecifier::isInstantiationDependent() const { case TypeSpecWithTemplate: return getAsType()->isInstantiationDependentType(); } - - // Necessary to suppress a GCC warning. - return false; + + llvm_unreachable("Invalid NNS Kind!"); } bool NestedNameSpecifier::containsUnexpandedParameterPack() const { @@ -211,8 +209,7 @@ bool NestedNameSpecifier::containsUnexpandedParameterPack() const { return getAsType()->containsUnexpandedParameterPack(); } - // Necessary to suppress a GCC warning. - return false; + llvm_unreachable("Invalid NNS Kind!"); } /// \brief Print this nested name specifier to the given output @@ -229,6 +226,9 @@ NestedNameSpecifier::print(raw_ostream &OS, break; case Namespace: + if (getAsNamespace()->isAnonymousNamespace()) + return; + OS << getAsNamespace()->getName(); break; @@ -379,8 +379,8 @@ SourceRange NestedNameSpecifierLoc::getLocalSourceRange() const { LoadSourceLocation(Data, Offset + sizeof(void*))); } } - - return SourceRange(); + + llvm_unreachable("Invalid NNS Kind!"); } TypeLoc NestedNameSpecifierLoc::getTypeLoc() const { @@ -434,9 +434,6 @@ namespace { } } -NestedNameSpecifierLocBuilder::NestedNameSpecifierLocBuilder() - : Representation(0), Buffer(0), BufferSize(0), BufferCapacity(0) { } - NestedNameSpecifierLocBuilder:: NestedNameSpecifierLocBuilder(const NestedNameSpecifierLocBuilder &Other) : Representation(Other.Representation), Buffer(0), @@ -499,11 +496,6 @@ operator=(const NestedNameSpecifierLocBuilder &Other) { return *this; } -NestedNameSpecifierLocBuilder::~NestedNameSpecifierLocBuilder() { - if (BufferCapacity) - free(Buffer); -} - void NestedNameSpecifierLocBuilder::Extend(ASTContext &Context, SourceLocation TemplateKWLoc, TypeLoc TL, |