diff options
author | Malcolm Parsons <malcolm.parsons@gmail.com> | 2016-11-02 20:34:10 +0000 |
---|---|---|
committer | Malcolm Parsons <malcolm.parsons@gmail.com> | 2016-11-02 20:34:10 +0000 |
commit | 771ef6d4f15452d76387cd66552a38122be60925 (patch) | |
tree | 78449c43ffd29ef2bd0801c9f8bf80fced0ef3e4 /lldb/source/Plugins/ExpressionParser | |
parent | 7463adadbf0ab2742b122a3d4adc8e2041c3ac01 (diff) | |
download | bcm5719-llvm-771ef6d4f15452d76387cd66552a38122be60925.tar.gz bcm5719-llvm-771ef6d4f15452d76387cd66552a38122be60925.zip |
Fix Clang-tidy readability-redundant-string-cstr warnings
Reviewers: zturner, labath
Subscribers: tberghammer, danalbert, lldb-commits
Differential Revision: https://reviews.llvm.org/D26233
llvm-svn: 285855
Diffstat (limited to 'lldb/source/Plugins/ExpressionParser')
5 files changed, 8 insertions, 10 deletions
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ASTDumper.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ASTDumper.cpp index 3c20b516c10..c74f1474e7b 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ASTDumper.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ASTDumper.cpp @@ -106,6 +106,4 @@ void ASTDumper::ToLog(Log *log, const char *prefix) { free(alloc); } -void ASTDumper::ToStream(lldb::StreamSP &stream) { - stream->PutCString(m_dump.c_str()); -} +void ASTDumper::ToStream(lldb::StreamSP &stream) { stream->PutCString(m_dump); } diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ASTStructExtractor.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ASTStructExtractor.cpp index 4081bc990c9..7bb784e8f9a 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ASTStructExtractor.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ASTStructExtractor.cpp @@ -60,7 +60,7 @@ void ASTStructExtractor::ExtractFromFunctionDecl(FunctionDecl *F) { RecordDecl *struct_decl = NULL; - StringRef desired_name(m_struct_name.c_str()); + StringRef desired_name(m_struct_name); for (CompoundStmt::const_body_iterator bi = body_compound_stmt->body_begin(), be = body_compound_stmt->body_end(); @@ -125,7 +125,7 @@ void ASTStructExtractor::ExtractFromTopLevelDecl(Decl *D) { if (m_ast_context && function_decl && !m_function.m_wrapper_function_name.compare( - function_decl->getNameAsString().c_str())) { + function_decl->getNameAsString())) { ExtractFromFunctionDecl(function_decl); } } diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp index 7a5f4f7a192..b55d6644845 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp @@ -922,7 +922,7 @@ static bool FindObjCMethodDeclsWithOrigin( std::string decl_name_string_without_colon(decl_name_string.c_str(), decl_name_string.length() - 1); IdentifierInfo *ident = - &original_ctx->Idents.get(decl_name_string_without_colon.c_str()); + &original_ctx->Idents.get(decl_name_string_without_colon); original_selector = original_ctx->Selectors.getSelector(1, &ident); } else { SmallVector<IdentifierInfo *, 4> idents; @@ -1293,7 +1293,7 @@ static bool FindObjCPropertyAndIvarDeclsWithOrigin( return false; std::string name_str = context.m_decl_name.getAsString(); - StringRef name(name_str.c_str()); + StringRef name(name_str); IdentifierInfo &name_identifier( origin_iface_decl->getASTContext().Idents.get(name)); diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp index 3c21de241c4..c542b36b674 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp @@ -131,7 +131,7 @@ void StoringDiagnosticConsumer::DumpDiagnostics(Stream &error_stream) { for (IDAndDiagnostic &diag : m_diagnostics) { switch (diag.first) { default: - error_stream.PutCString(diag.second.c_str()); + error_stream.PutCString(diag.second); error_stream.PutChar('\n'); break; case clang::DiagnosticsEngine::Level::Ignored: @@ -441,7 +441,7 @@ void ClangModulesDeclVendorImpl::ForEachMacro( if (macro_info) { std::string macro_expansion = "#define "; - macro_expansion.append(mi->first->getName().str().c_str()); + macro_expansion.append(mi->first->getName().str()); { if (macro_info->isFunctionLike()) { diff --git a/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp b/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp index 0956814cab8..ac6e93ce660 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp @@ -1149,7 +1149,7 @@ bool IRForTarget::RewritePersistentAlloc(llvm::Instruction *persistent_alloc) { GlobalVariable *persistent_global = new GlobalVariable( (*m_module), alloc->getType(), false, /* not constant */ GlobalValue::ExternalLinkage, NULL, /* no initializer */ - alloc->getName().str().c_str()); + alloc->getName().str()); // What we're going to do here is make believe this was a regular old external // variable. That means we need to make the metadata valid. |