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/ASTLocation.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/ASTLocation.cpp')
-rw-r--r-- | lib/Index/ASTLocation.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/Index/ASTLocation.cpp b/lib/Index/ASTLocation.cpp index f010a2bcc8..d6f5cc7cfb 100644 --- a/lib/Index/ASTLocation.cpp +++ b/lib/Index/ASTLocation.cpp @@ -32,7 +32,7 @@ static Decl *getDeclFromExpr(Stmt *E) { return getDeclFromExpr(CE->getCallee()); if (CastExpr *CE = dyn_cast<CastExpr>(E)) return getDeclFromExpr(CE->getSubExpr()); - + return 0; } @@ -41,7 +41,7 @@ Decl *ASTLocation::getReferencedDecl() { return 0; if (isDecl()) return getDecl(); - + assert(getStmt()); return getDeclFromExpr(getStmt()); } @@ -49,17 +49,17 @@ Decl *ASTLocation::getReferencedDecl() { static bool isContainedInStatement(Stmt *Node, Stmt *Parent) { assert(Node && Parent && "Passed null Node or Parent"); - + if (Node == Parent) return true; - + for (Stmt::child_iterator I = Parent->child_begin(), E = Parent->child_end(); I != E; ++I) { if (*I) if (isContainedInStatement(Node, *I)) return true; } - + return false; } @@ -76,7 +76,7 @@ Decl *ASTLocation::FindImmediateParent(Decl *D, Stmt *Node) { if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) { if (!FD->isThisDeclarationADefinition()) return 0; - + for (DeclContext::decl_iterator I = FD->decls_begin(), E = FD->decls_end(); I != E; ++I) { Decl *Child = FindImmediateParent(*I, Node); @@ -138,7 +138,7 @@ void ASTLocation::print(llvm::raw_ostream &OS) const { OS << "[Decl: " << getDecl()->getDeclKindName() << " "; if (const NamedDecl *ND = dyn_cast<NamedDecl>(getDecl())) OS << ND->getNameAsString(); - + if (getStmt()) { ASTContext &Ctx = getDecl()->getASTContext(); OS << " | Stmt: " << getStmt()->getStmtClassName() << " "; @@ -146,7 +146,7 @@ void ASTLocation::print(llvm::raw_ostream &OS) const { } OS << "] <"; - + SourceRange Range = getSourceRange(); SourceManager &SourceMgr = getDecl()->getASTContext().getSourceManager(); Range.getBegin().print(OS, SourceMgr); |