diff options
author | Mike Stump <mrs@apple.com> | 2009-09-09 15:08:12 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2009-09-09 15:08:12 +0000 |
commit | 1eb4433ac451dc16f4133a88af2d002ac26c58ef (patch) | |
tree | 07065b80cb7787bb7b9ffcb985196007a57e86f7 /lib/Index/Entity.cpp | |
parent | 79d39f92590cf2e91bf81486b02cd1156d13ca54 (diff) |
Remove tabs, and whitespace cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Index/Entity.cpp')
-rw-r--r-- | lib/Index/Entity.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/Index/Entity.cpp b/lib/Index/Entity.cpp index 245fc9a555..77d7a84da4 100644 --- a/lib/Index/Entity.cpp +++ b/lib/Index/Entity.cpp @@ -41,10 +41,10 @@ class EntityGetter : public DeclVisitor<EntityGetter, Entity> { public: EntityGetter(Program &prog, ProgramImpl &progImpl) : Prog(prog), ProgImpl(progImpl) { } - + Entity VisitNamedDecl(NamedDecl *D); Entity VisitVarDecl(VarDecl *D); - Entity VisitFunctionDecl(FunctionDecl *D); + Entity VisitFunctionDecl(FunctionDecl *D); }; } @@ -80,12 +80,12 @@ Entity EntityGetter::VisitNamedDecl(NamedDecl *D) { // Treats other DeclarationNames as internal Decls for now.. if (LocalSel.isNull()) return Entity(D); - + Selector GlobSel = (uintptr_t)GlobalSelector::get(LocalSel, Prog).getAsOpaquePtr(); GlobName = DeclarationName(GlobSel); } - + assert(GlobName); unsigned IdNS = D->getIdentifierNamespace(); @@ -105,7 +105,7 @@ Entity EntityGetter::VisitNamedDecl(NamedDecl *D) { EntityImpl *New = new (Buf) EntityImpl(Parent, GlobName, IdNS, isObjCInstanceMethod); Entities.InsertNode(New, InsertPos); - + return Entity(New); } @@ -113,7 +113,7 @@ Entity EntityGetter::VisitVarDecl(VarDecl *D) { // If it's static it cannot be referred to by another translation unit. if (D->getStorageClass() == VarDecl::Static) return Entity(D); - + return VisitNamedDecl(D); } @@ -121,7 +121,7 @@ Entity EntityGetter::VisitFunctionDecl(FunctionDecl *D) { // If it's static it cannot be refered to by another translation unit. if (D->getStorageClass() == FunctionDecl::Static) return Entity(D); - + return VisitNamedDecl(D); } @@ -188,18 +188,18 @@ Entity::Entity(Decl *D) : Val(D->getCanonicalDecl()) { } Decl *Entity::getDecl(ASTContext &AST) const { if (isInvalid()) return 0; - + if (Decl *D = Val.dyn_cast<Decl *>()) // Check that the passed AST is actually the one that this Decl belongs to. return (&D->getASTContext() == &AST) ? D : 0; - + return Val.get<EntityImpl *>()->getDecl(AST); } std::string Entity::getPrintableName() const { if (isInvalid()) return "<< Invalid >>"; - + if (Decl *D = Val.dyn_cast<Decl *>()) { if (NamedDecl *ND = dyn_cast<NamedDecl>(D)) return ND->getNameAsString(); @@ -219,7 +219,7 @@ Entity Entity::get(Decl *D, Program &Prog) { return EntityImpl::get(D, Prog, ProgImpl); } -unsigned +unsigned llvm::DenseMapInfo<Entity>::getHashValue(Entity E) { return DenseMapInfo<void*>::getHashValue(E.getAsOpaquePtr()); } |