diff options
| author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-07-18 00:34:35 +0000 |
|---|---|---|
| committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-07-18 00:34:35 +0000 |
| commit | 91ff94d6d9befda562a1384f43ecde6e43b9db99 (patch) | |
| tree | a3918123c44353daa1f6a4e96931a905350670e1 /clang/lib/AST/Decl.cpp | |
| parent | 6b7e37616077495adc4f0fedccb7458b51817d66 (diff) | |
| download | bcm5719-llvm-91ff94d6d9befda562a1384f43ecde6e43b9db99.tar.gz bcm5719-llvm-91ff94d6d9befda562a1384f43ecde6e43b9db99.zip | |
Remove getFirstDeclaration/getLatestDeclaration from FunctionDecl and VarDecl.
Their usefulness is questionable since redecl_iterator was introduced.
llvm-svn: 76275
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
| -rw-r--r-- | clang/lib/AST/Decl.cpp | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index 0a6f28d3fb7..23782d62236 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -369,7 +369,8 @@ void VarDecl::setPreviousDeclaration(VarDecl *PrevDecl) { PreviousDeclaration.setInt(0); // First one will point to this one as latest. - VarDecl *First = PrevDecl->getFirstDeclaration(); + // getCanonicalDecl returns the first one. + VarDecl *First = PrevDecl->getCanonicalDecl(); assert(First->PreviousDeclaration.getInt() == 1 && "Expected first"); First->PreviousDeclaration.setPointer(this); } else { @@ -379,14 +380,6 @@ void VarDecl::setPreviousDeclaration(VarDecl *PrevDecl) { } } -VarDecl *VarDecl::getFirstDeclaration() { - VarDecl *First = this; - while (First->getPreviousDeclaration()) - First = First->getPreviousDeclaration(); - - return First; -} - VarDecl *VarDecl::getCanonicalDecl() { VarDecl *Var = this; while (Var->getPreviousDeclaration()) @@ -599,7 +592,8 @@ FunctionDecl::setPreviousDeclaration(FunctionDecl *PrevDecl) { PreviousDeclaration.setInt(0); // First one will point to this one as latest. - FunctionDecl *First = PrevDecl->getFirstDeclaration(); + // getCanonicalDecl returns the first one. + FunctionDecl *First = PrevDecl->getCanonicalDecl(); assert(First->PreviousDeclaration.getInt() == 1 && "Expected first"); First->PreviousDeclaration.setPointer(this); } else { @@ -616,14 +610,6 @@ FunctionDecl::setPreviousDeclaration(FunctionDecl *PrevDecl) { } } -FunctionDecl *FunctionDecl::getFirstDeclaration() { - FunctionDecl *First = this; - while (First->getPreviousDeclaration()) - First = First->getPreviousDeclaration(); - - return First; -} - FunctionDecl *FunctionDecl::getCanonicalDecl() { FunctionDecl *FD = this; while (FD->getPreviousDeclaration()) |

