diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-07-06 21:34:20 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-07-06 21:34:20 +0000 |
commit | 874012b1fb80dff2ec227c726a0c63d55e3db63f (patch) | |
tree | 70eab7283470c4b7f92f2ab777edf8fdea9397ff /lib | |
parent | 145918ca119904b6abe8b41aae0cbbf9a7247905 (diff) |
Rename 'ASTNode' -> 'ASTLocation'.
ASTLocation is a much better name for its intended purpose which to represent a "point" into the AST.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74858 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AST/ASTLocation.cpp (renamed from lib/AST/ASTNode.cpp) | 12 | ||||
-rw-r--r-- | lib/AST/CMakeLists.txt | 2 | ||||
-rw-r--r-- | lib/AST/DeclReferenceMap.cpp | 16 | ||||
-rw-r--r-- | lib/Frontend/ResolveLocation.cpp | 8 |
4 files changed, 19 insertions, 19 deletions
diff --git a/lib/AST/ASTNode.cpp b/lib/AST/ASTLocation.cpp index ff5ecc10de..e72acf0793 100644 --- a/lib/AST/ASTNode.cpp +++ b/lib/AST/ASTLocation.cpp @@ -1,4 +1,4 @@ -//===--- ASTNode.h - A <Decl, Stmt> pair ------------------------*- C++ -*-===// +//===--- ASTLocation.h - A <Decl, Stmt> pair --------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -7,11 +7,11 @@ // //===----------------------------------------------------------------------===// // -// ASTNode is Decl or a Stmt and its immediate Decl parent. +// ASTLocation is Decl or a Stmt and its immediate Decl parent. // //===----------------------------------------------------------------------===// -#include "clang/AST/ASTNode.h" +#include "clang/AST/ASTLocation.h" #include "clang/AST/Decl.h" #include "clang/AST/Stmt.h" #include "clang/AST/Expr.h" @@ -60,13 +60,13 @@ static Decl *FindImmediateParent(Decl *D, Stmt *Node) { return 0; } -bool ASTNode::isImmediateParent(Decl *D, Stmt *Node) { +bool ASTLocation::isImmediateParent(Decl *D, Stmt *Node) { assert(D && Node && "Passed null Decl or null Stmt"); return D == FindImmediateParent(D, Node); } -void ASTNode::print(llvm::raw_ostream &OS) { - assert(isValid() && "ASTNode is not valid"); +void ASTLocation::print(llvm::raw_ostream &OS) { + assert(isValid() && "ASTLocation is not valid"); OS << "[Decl: " << getDecl()->getDeclKindName() << " "; if (NamedDecl *ND = dyn_cast<NamedDecl>(getDecl())) diff --git a/lib/AST/CMakeLists.txt b/lib/AST/CMakeLists.txt index 899bc8f78e..f844cf1529 100644 --- a/lib/AST/CMakeLists.txt +++ b/lib/AST/CMakeLists.txt @@ -4,7 +4,7 @@ add_clang_library(clangAST APValue.cpp ASTConsumer.cpp ASTContext.cpp - ASTNode.cpp + ASTLocation.cpp CFG.cpp DeclarationName.cpp DeclBase.cpp diff --git a/lib/AST/DeclReferenceMap.cpp b/lib/AST/DeclReferenceMap.cpp index 3e0114a0cb..41f53fdd52 100644 --- a/lib/AST/DeclReferenceMap.cpp +++ b/lib/AST/DeclReferenceMap.cpp @@ -7,15 +7,15 @@ // //===----------------------------------------------------------------------===// // -// DeclReferenceMap creates a mapping from Decls to the ASTNodes that -// references them. +// DeclReferenceMap creates a mapping from Decls to the ASTLocations that +// reference them. // //===----------------------------------------------------------------------===// #include "clang/AST/DeclReferenceMap.h" #include "clang/AST/Decl.h" #include "clang/AST/Stmt.h" -#include "clang/AST/ASTNode.h" +#include "clang/AST/ASTLocation.h" #include "clang/AST/DeclVisitor.h" #include "clang/AST/StmtVisitor.h" #include "llvm/Support/Compiler.h" @@ -65,7 +65,7 @@ void StmtMapper::VisitDeclStmt(DeclStmt *Node) { void StmtMapper::VisitDeclRefExpr(DeclRefExpr *Node) { NamedDecl *PrimD = cast<NamedDecl>(Node->getDecl()->getPrimaryDecl()); - Map.insert(std::make_pair(PrimD, ASTNode(Parent, Node))); + Map.insert(std::make_pair(PrimD, ASTLocation(Parent, Node))); } void StmtMapper::VisitStmt(Stmt *Node) { @@ -113,16 +113,16 @@ DeclReferenceMap::DeclReferenceMap(ASTContext &Ctx) { DeclMapper(Map).Visit(Ctx.getTranslationUnitDecl()); } -DeclReferenceMap::astnode_iterator +DeclReferenceMap::astlocation_iterator DeclReferenceMap::refs_begin(NamedDecl *D) const { NamedDecl *Prim = cast<NamedDecl>(D->getPrimaryDecl()); - return astnode_iterator(Map.lower_bound(Prim)); + return astlocation_iterator(Map.lower_bound(Prim)); } -DeclReferenceMap::astnode_iterator +DeclReferenceMap::astlocation_iterator DeclReferenceMap::refs_end(NamedDecl *D) const { NamedDecl *Prim = cast<NamedDecl>(D->getPrimaryDecl()); - return astnode_iterator(Map.upper_bound(Prim)); + return astlocation_iterator(Map.upper_bound(Prim)); } bool DeclReferenceMap::refs_empty(NamedDecl *D) const { diff --git a/lib/Frontend/ResolveLocation.cpp b/lib/Frontend/ResolveLocation.cpp index 5b8eed0c0e..c2d32bbc90 100644 --- a/lib/Frontend/ResolveLocation.cpp +++ b/lib/Frontend/ResolveLocation.cpp @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// #include "clang/Frontend/Utils.h" -#include "clang/AST/ASTNode.h" +#include "clang/AST/ASTLocation.h" #include "clang/AST/DeclVisitor.h" #include "clang/AST/StmtVisitor.h" #include "clang/Lex/Lexer.h" @@ -321,11 +321,11 @@ void LocResolverBase::print(Stmt *Node) { /// \brief Returns the AST node that a source location points to. /// -ASTNode clang::ResolveLocationInAST(ASTContext &Ctx, SourceLocation Loc) { +ASTLocation clang::ResolveLocationInAST(ASTContext &Ctx, SourceLocation Loc) { if (Loc.isInvalid()) - return ASTNode(); + return ASTLocation(); DeclLocResolver DLR(Ctx, Loc); DLR.Visit(Ctx.getTranslationUnitDecl()); - return ASTNode(DLR.getDecl(), DLR.getStmt()); + return ASTLocation(DLR.getDecl(), DLR.getStmt()); } |