diff options
author | dim <dim@FreeBSD.org> | 2011-10-20 21:14:49 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2011-10-20 21:14:49 +0000 |
commit | 3963a48221351c61c17fb3f382341ab04809a3d3 (patch) | |
tree | ee2483e98b09cac943dc93a6969d83ca737ff139 /lib/AST/DeclarationName.cpp | |
parent | 611ba3ea3300b71eb95dc4e45f20eee5dddd32e1 (diff) | |
download | FreeBSD-src-3963a48221351c61c17fb3f382341ab04809a3d3.zip FreeBSD-src-3963a48221351c61c17fb3f382341ab04809a3d3.tar.gz |
Vendor import of clang release_30 branch r142614:
http://llvm.org/svn/llvm-project/cfe/branches/release_30@142614
Diffstat (limited to 'lib/AST/DeclarationName.cpp')
-rw-r--r-- | lib/AST/DeclarationName.cpp | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/lib/AST/DeclarationName.cpp b/lib/AST/DeclarationName.cpp index 72c0e9d..bf647ed 100644 --- a/lib/AST/DeclarationName.cpp +++ b/lib/AST/DeclarationName.cpp @@ -193,8 +193,7 @@ DeclarationName::NameKind DeclarationName::getNameKind() const { } // Can't actually get here. - assert(0 && "This should be unreachable!"); - return Identifier; + llvm_unreachable("This should be unreachable!"); } bool DeclarationName::isDependentName() const { @@ -209,7 +208,7 @@ std::string DeclarationName::getAsString() const { return OS.str(); } -void DeclarationName::printName(llvm::raw_ostream &OS) const { +void DeclarationName::printName(raw_ostream &OS) const { switch (getNameKind()) { case Identifier: if (const IdentifierInfo *II = getAsIdentifierInfo()) @@ -225,7 +224,7 @@ void DeclarationName::printName(llvm::raw_ostream &OS) const { case CXXConstructorName: { QualType ClassType = getCXXNameType(); if (const RecordType *ClassRec = ClassType->getAs<RecordType>()) - OS << ClassRec->getDecl(); + OS << *ClassRec->getDecl(); else OS << ClassType.getAsString(); return; @@ -235,7 +234,7 @@ void DeclarationName::printName(llvm::raw_ostream &OS) const { OS << '~'; QualType Type = getCXXNameType(); if (const RecordType *Rec = Type->getAs<RecordType>()) - OS << Rec->getDecl(); + OS << *Rec->getDecl(); else OS << Type.getAsString(); return; @@ -266,7 +265,7 @@ void DeclarationName::printName(llvm::raw_ostream &OS) const { OS << "operator "; QualType Type = getCXXNameType(); if (const RecordType *Rec = Type->getAs<RecordType>()) - OS << Rec->getDecl(); + OS << *Rec->getDecl(); else OS << Type.getAsString(); return; @@ -276,7 +275,7 @@ void DeclarationName::printName(llvm::raw_ostream &OS) const { return; } - assert(false && "Unexpected declaration name kind"); + llvm_unreachable("Unexpected declaration name kind"); } QualType DeclarationName::getCXXNameType() const { @@ -338,9 +337,8 @@ void *DeclarationName::getFETokenInfoAsVoid() const { return getCXXLiteralIdentifier()->getFETokenInfo<void>(); default: - assert(false && "Declaration name has no FETokenInfo"); + llvm_unreachable("Declaration name has no FETokenInfo"); } - return 0; } void DeclarationName::setFETokenInfo(void *T) { @@ -364,7 +362,7 @@ void DeclarationName::setFETokenInfo(void *T) { break; default: - assert(false && "Declaration name has no FETokenInfo"); + llvm_unreachable("Declaration name has no FETokenInfo"); } } @@ -562,7 +560,7 @@ std::string DeclarationNameInfo::getAsString() const { return OS.str(); } -void DeclarationNameInfo::printName(llvm::raw_ostream &OS) const { +void DeclarationNameInfo::printName(raw_ostream &OS) const { switch (Name.getNameKind()) { case DeclarationName::Identifier: case DeclarationName::ObjCZeroArgSelector: @@ -588,7 +586,7 @@ void DeclarationNameInfo::printName(llvm::raw_ostream &OS) const { Name.printName(OS); return; } - assert(false && "Unexpected declaration name kind"); + llvm_unreachable("Unexpected declaration name kind"); } SourceLocation DeclarationNameInfo::getEndLoc() const { @@ -621,6 +619,5 @@ SourceLocation DeclarationNameInfo::getEndLoc() const { case DeclarationName::CXXUsingDirective: return NameLoc; } - assert(false && "Unexpected declaration name kind"); - return SourceLocation(); + llvm_unreachable("Unexpected declaration name kind"); } |