Skip to content

Commit 6a44e87

Browse files
committed
Simplify CxxValueSemanticsKind
1 parent e1d7a7b commit 6a44e87

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/ClangImporter/ClangImporter.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8477,10 +8477,11 @@ CxxValueSemantics::evaluate(Evaluator &evaluator,
84778477
llvm::SmallDenseSet<const clang::RecordDecl *, 4> seen;
84788478

84798479
auto maybePushToStack = [&](const clang::Type *type) {
8480-
auto recordDecl = type->getAsRecordDecl();
8481-
if (!recordDecl)
8480+
const auto *recordType = type->getAs<clang::RecordType>();
8481+
if (!recordType)
84828482
return;
84838483

8484+
auto recordDecl = recordType->getDecl();
84848485
if (seen.insert(recordDecl).second) {
84858486
// When a reference type is copied, the pointer’s value is copied rather
84868487
// than the object’s storage. This means reference types can be imported
@@ -8503,7 +8504,6 @@ CxxValueSemantics::evaluate(Evaluator &evaluator,
85038504
while (!stack.empty()) {
85048505
const clang::RecordDecl *recordDecl = stack.back();
85058506
stack.pop_back();
8506-
85078507
if (!hasNonCopyableAttr(recordDecl)) {
85088508
auto injectedStlAnnotation =
85098509
recordDecl->isInStdNamespace()

0 commit comments

Comments
 (0)