diff options
Diffstat (limited to 'contrib/llvm/tools/clang/lib/Index')
5 files changed, 13 insertions, 14 deletions
diff --git a/contrib/llvm/tools/clang/lib/Index/ASTLocation.cpp b/contrib/llvm/tools/clang/lib/Index/ASTLocation.cpp index bd3b5ee..66b393e 100644 --- a/contrib/llvm/tools/clang/lib/Index/ASTLocation.cpp +++ b/contrib/llvm/tools/clang/lib/Index/ASTLocation.cpp @@ -41,7 +41,7 @@ Decl *ASTLocation::getReferencedDecl() { return 0; switch (getKind()) { - default: assert(0 && "Invalid Kind"); + default: llvm_unreachable("Invalid Kind"); case N_Type: return 0; case N_Decl: @@ -60,8 +60,7 @@ SourceRange ASTLocation::getSourceRange() const { return SourceRange(); switch (getKind()) { - default: assert(0 && "Invalid Kind"); - return SourceRange(); + default: llvm_unreachable("Invalid Kind"); case N_Decl: return D->getSourceRange(); case N_Stmt: @@ -75,7 +74,7 @@ SourceRange ASTLocation::getSourceRange() const { return SourceRange(); } -void ASTLocation::print(llvm::raw_ostream &OS) const { +void ASTLocation::print(raw_ostream &OS) const { if (isInvalid()) { OS << "<< Invalid ASTLocation >>\n"; return; @@ -87,7 +86,7 @@ void ASTLocation::print(llvm::raw_ostream &OS) const { case N_Decl: OS << "[Decl: " << AsDecl()->getDeclKindName() << " "; if (const NamedDecl *ND = dyn_cast<NamedDecl>(AsDecl())) - OS << ND; + OS << *ND; break; case N_Stmt: @@ -97,7 +96,7 @@ void ASTLocation::print(llvm::raw_ostream &OS) const { case N_NamedRef: OS << "[NamedRef: " << AsNamedRef().ND->getDeclKindName() << " "; - OS << AsNamedRef().ND; + OS << *AsNamedRef().ND; break; case N_Type: { diff --git a/contrib/llvm/tools/clang/lib/Index/CallGraph.cpp b/contrib/llvm/tools/clang/lib/Index/CallGraph.cpp index 94790b8..741e781 100644 --- a/contrib/llvm/tools/clang/lib/Index/CallGraph.cpp +++ b/contrib/llvm/tools/clang/lib/Index/CallGraph.cpp @@ -110,7 +110,7 @@ Decl *CallGraph::getDecl(CallGraphNode *Node) { return Node->getDecl(*Ctx); } -void CallGraph::print(llvm::raw_ostream &os) { +void CallGraph::print(raw_ostream &os) { for (iterator I = begin(), E = end(); I != E; ++I) { if (I->second->hasCallee()) { os << "function: " << I->first.getPrintableName() diff --git a/contrib/llvm/tools/clang/lib/Index/Entity.cpp b/contrib/llvm/tools/clang/lib/Index/Entity.cpp index afac05c..fbab6d8 100644 --- a/contrib/llvm/tools/clang/lib/Index/Entity.cpp +++ b/contrib/llvm/tools/clang/lib/Index/Entity.cpp @@ -47,7 +47,7 @@ public: unsigned IdNS, bool isObjCInstanceMethod); // Get an Entity associated with the name in the global namespace. - Entity getGlobalEntity(llvm::StringRef Name); + Entity getGlobalEntity(StringRef Name); Entity VisitNamedDecl(NamedDecl *D); Entity VisitVarDecl(VarDecl *D); @@ -77,7 +77,7 @@ Entity EntityGetter::getEntity(Entity Parent, DeclarationName Name, return Entity(New); } -Entity EntityGetter::getGlobalEntity(llvm::StringRef Name) { +Entity EntityGetter::getGlobalEntity(StringRef Name) { IdentifierInfo *II = &ProgImpl.getIdents().get(Name); DeclarationName GlobName(II); unsigned IdNS = Decl::IDNS_Ordinary; @@ -209,7 +209,7 @@ Entity EntityImpl::get(Decl *D, Program &Prog, ProgramImpl &ProgImpl) { } /// \brief Get an Entity associated with a global name. -Entity EntityImpl::get(llvm::StringRef Name, Program &Prog, +Entity EntityImpl::get(StringRef Name, Program &Prog, ProgramImpl &ProgImpl) { return EntityGetter(Prog, ProgImpl).getGlobalEntity(Name); } @@ -259,7 +259,7 @@ Entity Entity::get(Decl *D, Program &Prog) { return EntityImpl::get(D, Prog, ProgImpl); } -Entity Entity::get(llvm::StringRef Name, Program &Prog) { +Entity Entity::get(StringRef Name, Program &Prog) { ProgramImpl &ProgImpl = *static_cast<ProgramImpl*>(Prog.Impl); return EntityImpl::get(Name, Prog, ProgImpl); } diff --git a/contrib/llvm/tools/clang/lib/Index/EntityImpl.h b/contrib/llvm/tools/clang/lib/Index/EntityImpl.h index da52ccf..6d6a0c6 100644 --- a/contrib/llvm/tools/clang/lib/Index/EntityImpl.h +++ b/contrib/llvm/tools/clang/lib/Index/EntityImpl.h @@ -47,7 +47,7 @@ public: /// \brief Get an Entity associated with the given Decl. /// \returns Null if an Entity cannot refer to this Decl. static Entity get(Decl *D, Program &Prog, ProgramImpl &ProgImpl); - static Entity get(llvm::StringRef Name, Program &Prog, ProgramImpl &ProgImpl); + static Entity get(StringRef Name, Program &Prog, ProgramImpl &ProgImpl); std::string getPrintableName(); diff --git a/contrib/llvm/tools/clang/lib/Index/GlobalSelector.cpp b/contrib/llvm/tools/clang/lib/Index/GlobalSelector.cpp index 3467918..2fe6f95 100644 --- a/contrib/llvm/tools/clang/lib/Index/GlobalSelector.cpp +++ b/contrib/llvm/tools/clang/lib/Index/GlobalSelector.cpp @@ -25,7 +25,7 @@ Selector GlobalSelector::getSelector(ASTContext &AST) const { Selector GlobSel = Selector(reinterpret_cast<uintptr_t>(Val)); - llvm::SmallVector<IdentifierInfo *, 8> Ids; + SmallVector<IdentifierInfo *, 8> Ids; for (unsigned i = 0, e = GlobSel.isUnarySelector() ? 1 : GlobSel.getNumArgs(); i != e; ++i) { IdentifierInfo *GlobII = GlobSel.getIdentifierInfoForSlot(i); @@ -52,7 +52,7 @@ GlobalSelector GlobalSelector::get(Selector Sel, Program &Prog) { ProgramImpl &ProgImpl = *static_cast<ProgramImpl*>(Prog.Impl); - llvm::SmallVector<IdentifierInfo *, 8> Ids; + SmallVector<IdentifierInfo *, 8> Ids; for (unsigned i = 0, e = Sel.isUnarySelector() ? 1 : Sel.getNumArgs(); i != e; ++i) { IdentifierInfo *II = Sel.getIdentifierInfoForSlot(i); |