diff options
author | dim <dim@FreeBSD.org> | 2012-05-03 16:53:59 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2012-05-03 16:53:59 +0000 |
commit | 822bde9df508e0b9afac5e581b0d6ab403417a28 (patch) | |
tree | 2e51705e103e92c7be1b21e8bd8ffd5b5d0e4d52 /lib/Index/Program.cpp | |
parent | 50b73317314e889cf39c7b1d6cbf419fa7502f22 (diff) | |
download | FreeBSD-src-822bde9df508e0b9afac5e581b0d6ab403417a28.zip FreeBSD-src-822bde9df508e0b9afac5e581b0d6ab403417a28.tar.gz |
Vendor import of clang release_31 branch r155985:
http://llvm.org/svn/llvm-project/cfe/branches/release_31@155985
Diffstat (limited to 'lib/Index/Program.cpp')
-rw-r--r-- | lib/Index/Program.cpp | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/lib/Index/Program.cpp b/lib/Index/Program.cpp deleted file mode 100644 index 4efad2c..0000000 --- a/lib/Index/Program.cpp +++ /dev/null @@ -1,50 +0,0 @@ -//===--- Program.cpp - Entity originator and misc -------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// Storage for Entities and utility functions -// -//===----------------------------------------------------------------------===// - -#include "clang/Index/Program.h" -#include "ProgramImpl.h" -#include "clang/Index/Handlers.h" -#include "clang/Index/TranslationUnit.h" -#include "clang/AST/DeclBase.h" -#include "clang/AST/ASTContext.h" -#include "llvm/Support/raw_ostream.h" -using namespace clang; -using namespace idx; - -// Out-of-line to give the virtual tables a home. -TranslationUnit::~TranslationUnit() { } - -Program::Program() : Impl(new ProgramImpl()) { } - -Program::~Program() { - delete static_cast<ProgramImpl *>(Impl); -} - -static void FindEntitiesInDC(DeclContext *DC, Program &Prog, - EntityHandler &Handler) { - for (DeclContext::decl_iterator - I = DC->decls_begin(), E = DC->decls_end(); I != E; ++I) { - if (I->getLocation().isInvalid()) - continue; - Entity Ent = Entity::get(*I, Prog); - if (Ent.isValid()) - Handler.Handle(Ent); - if (DeclContext *SubDC = dyn_cast<DeclContext>(*I)) - FindEntitiesInDC(SubDC, Prog, Handler); - } -} - -/// \brief Traverses the AST and passes all the entities to the Handler. -void Program::FindEntities(ASTContext &Ctx, EntityHandler &Handler) { - FindEntitiesInDC(Ctx.getTranslationUnitDecl(), *this, Handler); -} |