@@ -1285,9 +1285,12 @@ CompilerType ClangASTContext::GetTypeForDecl(ObjCInterfaceDecl *decl) {
1285
1285
1286
1286
#pragma mark Structure, Unions, Classes
1287
1287
1288
- CompilerType ClangASTContext::CreateRecordType (
1289
- DeclContext *decl_ctx, AccessType access_type, const char *name, int kind,
1290
- LanguageType language, ClangASTMetadata *metadata, bool exports_symbols) {
1288
+ CompilerType ClangASTContext::CreateRecordType (DeclContext *decl_ctx,
1289
+ AccessType access_type,
1290
+ llvm::StringRef name, int kind,
1291
+ LanguageType language,
1292
+ ClangASTMetadata *metadata,
1293
+ bool exports_symbols) {
1291
1294
ASTContext *ast = getASTContext ();
1292
1295
assert (ast != nullptr );
1293
1296
@@ -1307,7 +1310,7 @@ CompilerType ClangASTContext::CreateRecordType(
1307
1310
// something is struct or a class, so we default to always use the more
1308
1311
// complete definition just in case.
1309
1312
1310
- bool has_name = name && name[ 0 ] ;
1313
+ bool has_name = ! name. empty () ;
1311
1314
1312
1315
CXXRecordDecl *decl = CXXRecordDecl::Create (
1313
1316
*ast, (TagDecl::TagKind)kind, decl_ctx, SourceLocation (),
@@ -1683,14 +1686,14 @@ bool ClangASTContext::RecordHasFields(const RecordDecl *record_decl) {
1683
1686
1684
1687
#pragma mark Objective-C Classes
1685
1688
1686
- CompilerType ClangASTContext::CreateObjCClass (const char * name,
1689
+ CompilerType ClangASTContext::CreateObjCClass (llvm::StringRef name,
1687
1690
DeclContext *decl_ctx,
1688
1691
bool isForwardDecl,
1689
1692
bool isInternal,
1690
1693
ClangASTMetadata *metadata) {
1691
1694
ASTContext *ast = getASTContext ();
1692
1695
assert (ast != nullptr );
1693
- assert (name && name[ 0 ] );
1696
+ assert (! name. empty () );
1694
1697
if (decl_ctx == nullptr )
1695
1698
decl_ctx = ast->getTranslationUnitDecl ();
1696
1699
0 commit comments