@@ -1327,19 +1327,16 @@ CompilerType TypeSystemClang::CreateRecordType(
1327
1327
decl->setAnonymousStructOrUnion (true );
1328
1328
}
1329
1329
1330
- if (decl) {
1331
- if (metadata)
1332
- SetMetadata (decl, *metadata);
1330
+ if (metadata)
1331
+ SetMetadata (decl, *metadata);
1333
1332
1334
- if (access_type != eAccessNone)
1335
- decl->setAccess (ConvertAccessTypeToAccessSpecifier (access_type));
1333
+ if (access_type != eAccessNone)
1334
+ decl->setAccess (ConvertAccessTypeToAccessSpecifier (access_type));
1336
1335
1337
- if (decl_ctx)
1338
- decl_ctx->addDecl (decl);
1336
+ if (decl_ctx)
1337
+ decl_ctx->addDecl (decl);
1339
1338
1340
- return GetType (ast.getTagDeclType (decl));
1341
- }
1342
- return CompilerType ();
1339
+ return GetType (ast.getTagDeclType (decl));
1343
1340
}
1344
1341
1345
1342
namespace {
@@ -1605,15 +1602,13 @@ ClassTemplateDecl *TypeSystemClang::CreateClassTemplateDecl(
1605
1602
template_cxx_decl->setDescribedClassTemplate (class_template_decl);
1606
1603
SetOwningModule (class_template_decl, owning_module);
1607
1604
1608
- if (class_template_decl) {
1609
- if (access_type != eAccessNone)
1610
- class_template_decl->setAccess (
1611
- ConvertAccessTypeToAccessSpecifier (access_type));
1605
+ if (access_type != eAccessNone)
1606
+ class_template_decl->setAccess (
1607
+ ConvertAccessTypeToAccessSpecifier (access_type));
1612
1608
1613
- decl_ctx->addDecl (class_template_decl);
1609
+ decl_ctx->addDecl (class_template_decl);
1614
1610
1615
- VerifyDecl (class_template_decl);
1616
- }
1611
+ VerifyDecl (class_template_decl);
1617
1612
1618
1613
return class_template_decl;
1619
1614
}
@@ -1803,7 +1798,7 @@ CompilerType TypeSystemClang::CreateObjCClass(
1803
1798
decl->setImplicit (isInternal);
1804
1799
SetOwningModule (decl, owning_module);
1805
1800
1806
- if (decl && metadata)
1801
+ if (metadata)
1807
1802
SetMetadata (decl, *metadata);
1808
1803
1809
1804
return GetType (ast.getObjCInterfaceType (decl));
@@ -2141,8 +2136,7 @@ FunctionDecl *TypeSystemClang::CreateFunctionDeclaration(
2141
2136
? ConstexprSpecKind::Constexpr
2142
2137
: ConstexprSpecKind::Unspecified);
2143
2138
SetOwningModule (func_decl, owning_module);
2144
- if (func_decl)
2145
- decl_ctx->addDecl (func_decl);
2139
+ decl_ctx->addDecl (func_decl);
2146
2140
2147
2141
VerifyDecl (func_decl);
2148
2142
@@ -2305,18 +2299,15 @@ CompilerType TypeSystemClang::CreateEnumerationType(
2305
2299
enum_decl->setScopedUsingClassTag (is_scoped);
2306
2300
enum_decl->setFixed (false );
2307
2301
SetOwningModule (enum_decl, owning_module);
2308
- if (enum_decl) {
2309
- if (decl_ctx)
2310
- decl_ctx->addDecl (enum_decl);
2302
+ if (decl_ctx)
2303
+ decl_ctx->addDecl (enum_decl);
2311
2304
2312
- // TODO: check if we should be setting the promotion type too?
2313
- enum_decl->setIntegerType (ClangUtil::GetQualType (integer_clang_type));
2305
+ // TODO: check if we should be setting the promotion type too?
2306
+ enum_decl->setIntegerType (ClangUtil::GetQualType (integer_clang_type));
2314
2307
2315
- enum_decl->setAccess (AS_public); // TODO respect what's in the debug info
2308
+ enum_decl->setAccess (AS_public); // TODO respect what's in the debug info
2316
2309
2317
- return GetType (ast.getTagDeclType (enum_decl));
2318
- }
2319
- return CompilerType ();
2310
+ return GetType (ast.getTagDeclType (enum_decl));
2320
2311
}
2321
2312
2322
2313
CompilerType TypeSystemClang::GetIntTypeFromBitSize (size_t bit_size,
0 commit comments