diff options
| author | Raphael Isemann <teemperor@gmail.com> | 2019-12-17 16:00:51 +0100 |
|---|---|---|
| committer | Raphael Isemann <teemperor@gmail.com> | 2019-12-17 16:10:34 +0100 |
| commit | 268f37df6e45c4b0603bd4d964483a0d84da44c1 (patch) | |
| tree | 11c24e6c9aee6c148b58494c603e33279657d0fb /lldb/source/Symbol | |
| parent | b1d8576b0a9fa1f6a1173c0b5c2f379389e01e3f (diff) | |
| download | bcm5719-llvm-268f37df6e45c4b0603bd4d964483a0d84da44c1.tar.gz bcm5719-llvm-268f37df6e45c4b0603bd4d964483a0d84da44c1.zip | |
[lldb][NFC] Use StringRef in CreateRecordType and CreateObjCClass
Diffstat (limited to 'lldb/source/Symbol')
| -rw-r--r-- | lldb/source/Symbol/ClangASTContext.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp index da29750215a..2e66b9a06c6 100644 --- a/lldb/source/Symbol/ClangASTContext.cpp +++ b/lldb/source/Symbol/ClangASTContext.cpp @@ -1285,9 +1285,12 @@ CompilerType ClangASTContext::GetTypeForDecl(ObjCInterfaceDecl *decl) { #pragma mark Structure, Unions, Classes -CompilerType ClangASTContext::CreateRecordType( - DeclContext *decl_ctx, AccessType access_type, const char *name, int kind, - LanguageType language, ClangASTMetadata *metadata, bool exports_symbols) { +CompilerType ClangASTContext::CreateRecordType(DeclContext *decl_ctx, + AccessType access_type, + llvm::StringRef name, int kind, + LanguageType language, + ClangASTMetadata *metadata, + bool exports_symbols) { ASTContext *ast = getASTContext(); assert(ast != nullptr); @@ -1307,7 +1310,7 @@ CompilerType ClangASTContext::CreateRecordType( // something is struct or a class, so we default to always use the more // complete definition just in case. - bool has_name = name && name[0]; + bool has_name = !name.empty(); CXXRecordDecl *decl = CXXRecordDecl::Create( *ast, (TagDecl::TagKind)kind, decl_ctx, SourceLocation(), @@ -1683,14 +1686,14 @@ bool ClangASTContext::RecordHasFields(const RecordDecl *record_decl) { #pragma mark Objective-C Classes -CompilerType ClangASTContext::CreateObjCClass(const char *name, +CompilerType ClangASTContext::CreateObjCClass(llvm::StringRef name, DeclContext *decl_ctx, bool isForwardDecl, bool isInternal, ClangASTMetadata *metadata) { ASTContext *ast = getASTContext(); assert(ast != nullptr); - assert(name && name[0]); + assert(!name.empty()); if (decl_ctx == nullptr) decl_ctx = ast->getTranslationUnitDecl(); |

