diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-01-14 16:38:05 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-01-14 16:38:05 +0000 |
commit | ef96ee0be5f100789f451641542a69cd719144d2 (patch) | |
tree | 657c479e4155abe55bc69e1313498d0d997377ae /tools/libclang | |
parent | 09dd3798e100ace40defdc5541277502346213f2 (diff) |
De-virtualize getPreviousDecl() and getMostRecentDecl() when we know
we have a redeclarable type, and only use the new virtual versions
(getPreviousDeclImpl() and getMostRecentDeclImpl()) when we don't have
that type information. This keeps us from penalizing users with strict
type information (and is the moral equivalent of a "final" method).
Plus, settle on the names getPreviousDecl() and getMostRecentDecl()
throughout.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148187 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/libclang')
-rw-r--r-- | tools/libclang/IndexingContext.cpp | 4 | ||||
-rw-r--r-- | tools/libclang/IndexingContext.h | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/tools/libclang/IndexingContext.cpp b/tools/libclang/IndexingContext.cpp index 299d1c93d8..befdce9045 100644 --- a/tools/libclang/IndexingContext.cpp +++ b/tools/libclang/IndexingContext.cpp @@ -343,7 +343,7 @@ bool IndexingContext::handleObjCInterface(const ObjCInterfaceDecl *D) { return false; // already occurred. // FIXME: This seems like the wrong definition for redeclaration. - bool isRedeclaration = D->hasDefinition() || D->getPreviousDeclaration(); + bool isRedeclaration = D->hasDefinition() || D->getPreviousDecl(); ObjCContainerDeclInfo ContDInfo(/*isForwardRef=*/true, isRedeclaration, /*isImplementation=*/false); return handleObjCContainer(D, D->getLocation(), @@ -397,7 +397,7 @@ bool IndexingContext::handleObjCProtocol(const ObjCProtocolDecl *D) { return false; // already occurred. // FIXME: This seems like the wrong definition for redeclaration. - bool isRedeclaration = D->hasDefinition() || D->getPreviousDeclaration(); + bool isRedeclaration = D->hasDefinition() || D->getPreviousDecl(); ObjCContainerDeclInfo ContDInfo(/*isForwardRef=*/true, isRedeclaration, /*isImplementation=*/false); diff --git a/tools/libclang/IndexingContext.h b/tools/libclang/IndexingContext.h index 4a321204a8..26b8ecb75d 100644 --- a/tools/libclang/IndexingContext.h +++ b/tools/libclang/IndexingContext.h @@ -127,7 +127,7 @@ struct ObjCInterfaceDeclInfo : public ObjCContainerDeclInfo { ObjCInterfaceDeclInfo(const ObjCInterfaceDecl *D) : ObjCContainerDeclInfo(Info_ObjCInterface, /*isForwardRef=*/false, - /*isRedeclaration=*/D->getPreviousDeclaration() != 0, + /*isRedeclaration=*/D->getPreviousDecl() != 0, /*isImplementation=*/false) { } static bool classof(const DeclInfo *D) { @@ -142,7 +142,7 @@ struct ObjCProtocolDeclInfo : public ObjCContainerDeclInfo { ObjCProtocolDeclInfo(const ObjCProtocolDecl *D) : ObjCContainerDeclInfo(Info_ObjCProtocol, /*isForwardRef=*/false, - /*isRedeclaration=*/D->getPreviousDeclaration(), + /*isRedeclaration=*/D->getPreviousDecl(), /*isImplementation=*/false) { } static bool classof(const DeclInfo *D) { |