summaryrefslogtreecommitdiffstats
path: root/clang/lib/Index
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2009-12-07 02:54:59 +0000
committerJohn McCall <rjmccall@apple.com>2009-12-07 02:54:59 +0000
commitbcd035061dfe3dd81279493ffe3d999d930e17cc (patch)
tree5896ea539bc9ee3ace609ad5e4c1b25a59ec2774 /clang/lib/Index
parent24a6316aaa7c7efcd72f96dd20643996be6d3554 (diff)
downloadbcm5719-llvm-bcd035061dfe3dd81279493ffe3d999d930e17cc.tar.gz
bcm5719-llvm-bcd035061dfe3dd81279493ffe3d999d930e17cc.zip
DeclaratorInfo -> TypeSourceInfo. Makes an effort to rename associated variables,
but the results are imperfect. For posterity, I did: cat <<EOF > $cmdfile s/DeclaratorInfo/TypeSourceInfo/g s/DInfo/TInfo/g s/TypeTypeSourceInfo/TypeSourceInfo/g s/SourceTypeSourceInfo/TypeSourceInfo/g EOF find lib -name '*.cpp' -not -path 'lib/Parse/*' -exec sed -i '' -f $cmdfile '{}' \; find lib -name '*.h' -exec sed -i '' -f $cmdfile '{}' \; find include -name '*.h' -not -path 'include/clang/Parse/*' -not -path 'include/clang/Basic/*' -exec sed -i '' -f $cmdfile '{}' \; llvm-svn: 90743
Diffstat (limited to 'clang/lib/Index')
-rw-r--r--clang/lib/Index/ASTVisitor.h4
-rw-r--r--clang/lib/Index/ResolveLocation.cpp42
2 files changed, 23 insertions, 23 deletions
diff --git a/clang/lib/Index/ASTVisitor.h b/clang/lib/Index/ASTVisitor.h
index 0ae78fb74ff..6cfa381608a 100644
--- a/clang/lib/Index/ASTVisitor.h
+++ b/clang/lib/Index/ASTVisitor.h
@@ -52,8 +52,8 @@ public:
void VisitDeclaratorDecl(DeclaratorDecl *D) {
BaseDeclVisitor::VisitDeclaratorDecl(D);
- if (DeclaratorInfo *DInfo = D->getDeclaratorInfo())
- Visit(DInfo->getTypeLoc());
+ if (TypeSourceInfo *TInfo = D->getTypeSourceInfo())
+ Visit(TInfo->getTypeLoc());
}
void VisitFunctionDecl(FunctionDecl *D) {
diff --git a/clang/lib/Index/ResolveLocation.cpp b/clang/lib/Index/ResolveLocation.cpp
index c7379f7a835..81a5de44bf5 100644
--- a/clang/lib/Index/ResolveLocation.cpp
+++ b/clang/lib/Index/ResolveLocation.cpp
@@ -30,7 +30,7 @@ protected:
ASTContext &Ctx;
SourceLocation Loc;
- ASTLocation ResolveInDeclarator(Decl *D, Stmt *Stm, DeclaratorInfo *DInfo);
+ ASTLocation ResolveInDeclarator(Decl *D, Stmt *Stm, TypeSourceInfo *TInfo);
enum RangePos {
BeforeLoc,
@@ -39,13 +39,13 @@ protected:
};
RangePos CheckRange(SourceRange Range);
- RangePos CheckRange(DeclaratorInfo *DInfo);
+ RangePos CheckRange(TypeSourceInfo *TInfo);
RangePos CheckRange(Decl *D) {
if (DeclaratorDecl *DD = dyn_cast<DeclaratorDecl>(D))
- if (ContainsLocation(DD->getDeclaratorInfo()))
+ if (ContainsLocation(DD->getTypeSourceInfo()))
return ContainsLoc;
if (TypedefDecl *TD = dyn_cast<TypedefDecl>(D))
- if (ContainsLocation(TD->getTypeDeclaratorInfo()))
+ if (ContainsLocation(TD->getTypeSourceInfo()))
return ContainsLoc;
return CheckRange(D->getSourceRange());
@@ -142,9 +142,9 @@ StmtLocResolver::VisitSizeOfAlignOfExpr(SizeOfAlignOfExpr *Node) {
"Should visit only after verifying that loc is in range");
if (Node->isArgumentType()) {
- DeclaratorInfo *DInfo = Node->getArgumentTypeInfo();
- if (ContainsLocation(DInfo))
- return ResolveInDeclarator(Parent, Node, DInfo);
+ TypeSourceInfo *TInfo = Node->getArgumentTypeInfo();
+ if (ContainsLocation(TInfo))
+ return ResolveInDeclarator(Parent, Node, TInfo);
} else {
Expr *SubNode = Node->getArgumentExpr();
if (ContainsLocation(SubNode))
@@ -245,8 +245,8 @@ ASTLocation DeclLocResolver::VisitFunctionDecl(FunctionDecl *D) {
assert(ContainsLocation(D) &&
"Should visit only after verifying that loc is in range");
- if (ContainsLocation(D->getDeclaratorInfo()))
- return ResolveInDeclarator(D, 0, D->getDeclaratorInfo());
+ if (ContainsLocation(D->getTypeSourceInfo()))
+ return ResolveInDeclarator(D, 0, D->getTypeSourceInfo());
// First, search through the parameters of the function.
for (FunctionDecl::param_iterator
@@ -296,8 +296,8 @@ ASTLocation DeclLocResolver::VisitFunctionDecl(FunctionDecl *D) {
ASTLocation DeclLocResolver::VisitDeclaratorDecl(DeclaratorDecl *D) {
assert(ContainsLocation(D) &&
"Should visit only after verifying that loc is in range");
- if (ContainsLocation(D->getDeclaratorInfo()))
- return ResolveInDeclarator(D, /*Stmt=*/0, D->getDeclaratorInfo());
+ if (ContainsLocation(D->getTypeSourceInfo()))
+ return ResolveInDeclarator(D, /*Stmt=*/0, D->getTypeSourceInfo());
return ASTLocation(D);
}
@@ -306,8 +306,8 @@ ASTLocation DeclLocResolver::VisitTypedefDecl(TypedefDecl *D) {
assert(ContainsLocation(D) &&
"Should visit only after verifying that loc is in range");
- if (ContainsLocation(D->getTypeDeclaratorInfo()))
- return ResolveInDeclarator(D, /*Stmt=*/0, D->getTypeDeclaratorInfo());
+ if (ContainsLocation(D->getTypeSourceInfo()))
+ return ResolveInDeclarator(D, /*Stmt=*/0, D->getTypeSourceInfo());
return ASTLocation(D);
}
@@ -321,8 +321,8 @@ ASTLocation DeclLocResolver::VisitVarDecl(VarDecl *D) {
if (Init && ContainsLocation(Init))
return StmtLocResolver(Ctx, Loc, D).Visit(Init);
- if (ContainsLocation(D->getDeclaratorInfo()))
- return ResolveInDeclarator(D, 0, D->getDeclaratorInfo());
+ if (ContainsLocation(D->getTypeSourceInfo()))
+ return ResolveInDeclarator(D, 0, D->getTypeSourceInfo());
return ASTLocation(D);
}
@@ -491,12 +491,12 @@ ASTLocation TypeLocResolver::VisitTypeLoc(TypeLoc TL) {
}
ASTLocation LocResolverBase::ResolveInDeclarator(Decl *D, Stmt *Stm,
- DeclaratorInfo *DInfo) {
- assert(ContainsLocation(DInfo) &&
+ TypeSourceInfo *TInfo) {
+ assert(ContainsLocation(TInfo) &&
"Should visit only after verifying that loc is in range");
(void)TypeLocResolver(Ctx, Loc, D);
- for (TypeLoc TL = DInfo->getTypeLoc(); TL; TL = TL.getNextTypeLoc())
+ for (TypeLoc TL = TInfo->getTypeLoc(); TL; TL = TL.getNextTypeLoc())
if (ContainsLocation(TL))
return TypeLocResolver(Ctx, Loc, D).Visit(TL);
@@ -504,11 +504,11 @@ ASTLocation LocResolverBase::ResolveInDeclarator(Decl *D, Stmt *Stm,
return ASTLocation(D, Stm);
}
-LocResolverBase::RangePos LocResolverBase::CheckRange(DeclaratorInfo *DInfo) {
- if (!DInfo)
+LocResolverBase::RangePos LocResolverBase::CheckRange(TypeSourceInfo *TInfo) {
+ if (!TInfo)
return BeforeLoc; // Keep looking.
- for (TypeLoc TL = DInfo->getTypeLoc(); TL; TL = TL.getNextTypeLoc())
+ for (TypeLoc TL = TInfo->getTypeLoc(); TL; TL = TL.getNextTypeLoc())
if (ContainsLocation(TL))
return ContainsLoc;
OpenPOWER on IntegriCloud