@@ -446,11 +446,10 @@ static auto ClangLookup(Context& context, SemIR::NameScopeId scope_id,
446
446
auto scope_clang_decl_context_id =
447
447
context.name_scopes ().Get (scope_id).clang_decl_context_id ();
448
448
bool found = sema.LookupQualifiedName (
449
- lookup,
450
- clang::dyn_cast<clang::DeclContext>(context.sem_ir ()
451
- .clang_decls ()
452
- .Get (scope_clang_decl_context_id)
453
- .decl ));
449
+ lookup, dyn_cast<clang::DeclContext>(context.sem_ir ()
450
+ .clang_decls ()
451
+ .Get (scope_clang_decl_context_id)
452
+ .decl ));
454
453
455
454
if (!found) {
456
455
return std::nullopt;
@@ -720,7 +719,7 @@ static auto ImportClassObjectRepr(Context& context, SemIR::ClassId class_id,
720
719
721
720
// Import fields.
722
721
for (auto * decl : clang_def->decls ()) {
723
- auto * field = clang:: dyn_cast<clang::FieldDecl>(decl);
722
+ auto * field = dyn_cast<clang::FieldDecl>(decl);
724
723
725
724
// Track the chain of fields from the class to this field. This chain is
726
725
// only one element long unless the field is a member of an anonymous struct
@@ -731,7 +730,7 @@ static auto ImportClassObjectRepr(Context& context, SemIR::ClassId class_id,
731
730
// If this isn't a field, it might be an indirect field in an anonymous
732
731
// struct or union.
733
732
if (!field) {
734
- auto * indirect_field = clang:: dyn_cast<clang::IndirectFieldDecl>(decl);
733
+ auto * indirect_field = dyn_cast<clang::IndirectFieldDecl>(decl);
735
734
if (!indirect_field) {
736
735
continue ;
737
736
}
@@ -773,12 +772,12 @@ static auto ImportClassObjectRepr(Context& context, SemIR::ClassId class_id,
773
772
774
773
// Compute the offset to the field that appears directly in the class.
775
774
uint64_t offset = clang_layout.getFieldOffset (
776
- clang:: cast<clang::FieldDecl>(chain.front ())->getFieldIndex ());
775
+ cast<clang::FieldDecl>(chain.front ())->getFieldIndex ());
777
776
778
777
// If this is an indirect field, walk the path and accumulate the offset to
779
778
// the named field.
780
779
for (auto * inner_decl : chain.drop_front ()) {
781
- auto * inner_field = clang:: cast<clang::FieldDecl>(inner_decl);
780
+ auto * inner_field = cast<clang::FieldDecl>(inner_decl);
782
781
const auto & inner_layout =
783
782
context.ast_context ().getASTRecordLayout (inner_field->getParent ());
784
783
offset += inner_layout.getFieldOffset (inner_field->getFieldIndex ());
@@ -930,7 +929,7 @@ static auto MapBuiltinType(Context& context, clang::QualType qual_type,
930
929
// Maps a C++ record type to a Carbon type.
931
930
static auto MapRecordType (Context& context, const clang::RecordType& type)
932
931
-> TypeExpr {
933
- auto * record_decl = clang:: dyn_cast<clang::CXXRecordDecl>(type.getDecl ());
932
+ auto * record_decl = dyn_cast<clang::CXXRecordDecl>(type.getDecl ());
934
933
if (!record_decl) {
935
934
return {.inst_id = SemIR::TypeInstId::None, .type_id = SemIR::TypeId::None};
936
935
}
@@ -1407,7 +1406,7 @@ static auto AddDependentUnimportedDecls(const Context& context,
1407
1406
1408
1407
if (auto * clang_function_decl = clang_decl->getAsFunction ()) {
1409
1408
AddDependentUnimportedFunctionDecls (context, *clang_function_decl, decls);
1410
- } else if (auto * type_decl = clang:: dyn_cast<clang::TypeDecl>(clang_decl)) {
1409
+ } else if (auto * type_decl = dyn_cast<clang::TypeDecl>(clang_decl)) {
1411
1410
AddDependentUnimportedTypeDecls (
1412
1411
context, type_decl->getASTContext ().getTypeDeclType (type_decl), decls);
1413
1412
}
@@ -1422,11 +1421,10 @@ static auto ImportDeclAfterDependencies(Context& context, SemIR::LocId loc_id,
1422
1421
if (auto * clang_function_decl = clang_decl->getAsFunction ()) {
1423
1422
return ImportFunctionDecl (context, loc_id, clang_function_decl);
1424
1423
}
1425
- if (auto * clang_namespace_decl =
1426
- clang::dyn_cast<clang::NamespaceDecl>(clang_decl)) {
1424
+ if (auto * clang_namespace_decl = dyn_cast<clang::NamespaceDecl>(clang_decl)) {
1427
1425
return ImportNamespaceDecl (context, clang_namespace_decl);
1428
1426
}
1429
- if (auto * type_decl = clang:: dyn_cast<clang::TypeDecl>(clang_decl)) {
1427
+ if (auto * type_decl = dyn_cast<clang::TypeDecl>(clang_decl)) {
1430
1428
auto type = type_decl->getASTContext ().getTypeDeclType (type_decl);
1431
1429
auto type_inst_id = MapType (context, loc_id, type).inst_id ;
1432
1430
if (!type_inst_id.has_value ()) {
@@ -1436,7 +1434,7 @@ static auto ImportDeclAfterDependencies(Context& context, SemIR::LocId loc_id,
1436
1434
}
1437
1435
return type_inst_id;
1438
1436
}
1439
- if (clang:: isa<clang::FieldDecl, clang::IndirectFieldDecl>(clang_decl)) {
1437
+ if (isa<clang::FieldDecl, clang::IndirectFieldDecl>(clang_decl)) {
1440
1438
// Usable fields get imported as a side effect of importing the class.
1441
1439
if (SemIR::InstId existing_inst_id =
1442
1440
LookupClangDeclInstId (context, clang_decl);
0 commit comments