forked from OSchip/llvm-project
Minor optimization; if we have a CXXRecordDecl we can get the definition decl directly without iterating over the redeclarations.
llvm-svn: 116837
This commit is contained in:
parent
40338af47d
commit
54e6197d5a
|
@ -1580,6 +1580,8 @@ void TagDecl::completeDefinition() {
|
|||
TagDecl* TagDecl::getDefinition() const {
|
||||
if (isDefinition())
|
||||
return const_cast<TagDecl *>(this);
|
||||
if (const CXXRecordDecl *CXXRD = dyn_cast<CXXRecordDecl>(this))
|
||||
return CXXRD->getDefinition();
|
||||
|
||||
for (redecl_iterator R = redecls_begin(), REnd = redecls_end();
|
||||
R != REnd; ++R)
|
||||
|
|
Loading…
Reference in New Issue