Skip to content

Commit 9c6b560

Browse files
hahnjoaugusto2112
authored andcommitted
[clang] Move and update comment in getASTRecordLayout, NFC.
isDefinition was already renamed to isCompleteDefinition by commit f937c02 in 2011, later the day the comment was originally written.
1 parent 1674c55 commit 9c6b560

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

clang/lib/AST/RecordLayoutBuilder.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3363,16 +3363,15 @@ void MicrosoftRecordLayoutBuilder::computeVtorDispSet(
33633363
/// position information.
33643364
const ASTRecordLayout &
33653365
ASTContext::getASTRecordLayout(const RecordDecl *D) const {
3366-
// These asserts test different things. A record has a definition
3367-
// as soon as we begin to parse the definition. That definition is
3368-
// not a complete definition (which is what isDefinition() tests)
3369-
// until we *finish* parsing the definition.
3370-
33713366
if (D->hasExternalLexicalStorage() && !D->getDefinition())
33723367
getExternalSource()->CompleteType(const_cast<RecordDecl*>(D));
33733368
// Complete the redecl chain (if necessary).
33743369
(void)D->getMostRecentDecl();
33753370

3371+
// These asserts test different things. A record has a definition
3372+
// as soon as we begin to parse the definition. That definition is
3373+
// not a complete definition (which is what isCompleteDefinition() tests)
3374+
// until we *finish* parsing the definition.
33763375
D = D->getDefinition();
33773376
assert(D && "Cannot get layout of forward declarations!");
33783377
assert(!D->isInvalidDecl() && "Cannot get layout of invalid decl!");

0 commit comments

Comments
 (0)