[Lldb-commits] [lldb] r331323 - Update lldb to match clang r331244 (addition of char8_t).
Author: rsmith Date: Tue May 1 19:43:22 2018 New Revision: 331323 URL: http://llvm.org/viewvc/llvm-project?rev=331323&view=rev Log: Update lldb to match clang r331244 (addition of char8_t). Also fix misclassification of char16_t and char32_t: these are unsigned types, not signed types. Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=331323&r1=331322&r2=331323&view=diff == --- lldb/trunk/source/Symbol/ClangASTContext.cpp (original) +++ lldb/trunk/source/Symbol/ClangASTContext.cpp Tue May 1 19:43:22 2018 @@ -4914,8 +4914,6 @@ lldb::Encoding ClangASTContext::GetEncod case clang::BuiltinType::Char_S: case clang::BuiltinType::SChar: case clang::BuiltinType::WChar_S: -case clang::BuiltinType::Char16: -case clang::BuiltinType::Char32: case clang::BuiltinType::Short: case clang::BuiltinType::Int: case clang::BuiltinType::Long: @@ -4926,6 +4924,9 @@ lldb::Encoding ClangASTContext::GetEncod case clang::BuiltinType::Char_U: case clang::BuiltinType::UChar: case clang::BuiltinType::WChar_U: +case clang::BuiltinType::Char8: +case clang::BuiltinType::Char16: +case clang::BuiltinType::Char32: case clang::BuiltinType::UShort: case clang::BuiltinType::UInt: case clang::BuiltinType::ULong: ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r331406 - Use conventional spelling of always-failing assert.
Author: rsmith Date: Wed May 2 15:21:11 2018 New Revision: 331406 URL: http://llvm.org/viewvc/llvm-project?rev=331406&view=rev Log: Use conventional spelling of always-failing assert. Fixes -Wstring-conversion warning that was breaking -Werror builds. Modified: lldb/trunk/source/Core/Module.cpp Modified: lldb/trunk/source/Core/Module.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Module.cpp?rev=331406&r1=331405&r2=331406&view=diff == --- lldb/trunk/source/Core/Module.cpp (original) +++ lldb/trunk/source/Core/Module.cpp Wed May 2 15:21:11 2018 @@ -342,7 +342,7 @@ void Module::SetUUID(const lldb_private: m_uuid = uuid; m_did_set_uuid = true; } else { -lldbassert(!"Attempting to overwrite the existing module UUID"); +lldbassert(0 && "Attempting to overwrite the existing module UUID"); } } ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r301483 - Update lldb to match clang r301442.
Author: rsmith Date: Wed Apr 26 17:10:53 2017 New Revision: 301483 URL: http://llvm.org/viewvc/llvm-project?rev=301483&view=rev Log: Update lldb to match clang r301442. This code really doesn't make any sense: there is only ever one InputKind here. Plus, this is an incomplete and out-of-date copy-paste of some Clang code. This really ought to be revisited, but this change should get the bots green again. Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=301483&r1=301482&r2=301483&view=diff == --- lldb/trunk/source/Symbol/ClangASTContext.cpp (original) +++ lldb/trunk/source/Symbol/ClangASTContext.cpp Wed Apr 26 17:10:53 2017 @@ -378,10 +378,9 @@ static void ParseLangArgs(LangOptions &O // Set some properties which depend solely on the input kind; it would be nice // to move these to the language standard, and have the driver resolve the // input kind + language standard. - if (IK == IK_Asm) { + if (IK.getLanguage() == InputKind::Asm) { Opts.AsmPreprocessor = 1; - } else if (IK == IK_ObjC || IK == IK_ObjCXX || IK == IK_PreprocessedObjC || - IK == IK_PreprocessedObjCXX) { + } else if (IK.isObjectiveC()) { Opts.ObjC1 = Opts.ObjC2 = 1; } @@ -389,30 +388,24 @@ static void ParseLangArgs(LangOptions &O if (LangStd == LangStandard::lang_unspecified) { // Based on the base language, pick one. -switch (IK) { -case IK_None: -case IK_AST: -case IK_LLVM_IR: -case IK_RenderScript: +switch (IK.getLanguage()) { +case InputKind::Unknown: +case InputKind::LLVM_IR: +case InputKind::RenderScript: llvm_unreachable("Invalid input kind!"); -case IK_OpenCL: +case InputKind::OpenCL: LangStd = LangStandard::lang_opencl; break; -case IK_CUDA: -case IK_PreprocessedCuda: +case InputKind::CUDA: LangStd = LangStandard::lang_cuda; break; -case IK_Asm: -case IK_C: -case IK_PreprocessedC: -case IK_ObjC: -case IK_PreprocessedObjC: +case InputKind::Asm: +case InputKind::C: +case InputKind::ObjC: LangStd = LangStandard::lang_gnu99; break; -case IK_CXX: -case IK_PreprocessedCXX: -case IK_ObjCXX: -case IK_PreprocessedObjCXX: +case InputKind::CXX: +case InputKind::ObjCXX: LangStd = LangStandard::lang_gnucxx98; break; } @@ -784,8 +777,8 @@ IdentifierTable *ClangASTContext::getIde LangOptions *ClangASTContext::getLanguageOptions() { if (m_language_options_ap.get() == nullptr) { m_language_options_ap.reset(new LangOptions()); -ParseLangArgs(*m_language_options_ap, IK_ObjCXX, GetTargetTriple()); -//InitializeLangOptions(*m_language_options_ap, IK_ObjCXX); +ParseLangArgs(*m_language_options_ap, InputKind::ObjCXX, GetTargetTriple()); +//InitializeLangOptions(*m_language_options_ap, InputKind::ObjCXX); } return m_language_options_ap.get(); } ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r354173 - Fix AST generated for a class template to connect the class inside a
Author: rsmith Date: Fri Feb 15 13:48:09 2019 New Revision: 354173 URL: http://llvm.org/viewvc/llvm-project?rev=354173&view=rev Log: Fix AST generated for a class template to connect the class inside a class template back to the template. Previously, when the ASTImporter imported the class, it didn't know that it was the pattern of a class template, so made the class a name lookup result for the name of the template, resulting in ambiguity errors when naming the template. Due to a clang bug (fixed in r354091, reverted and soon to be re-committed), ambiguity errors between a template and a non-template were previously not diagnosed. Once r354091 is re-committed, this will be covered by existing lldb tests. Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=354173&r1=354172&r2=354173&view=diff == --- lldb/trunk/source/Symbol/ClangASTContext.cpp (original) +++ lldb/trunk/source/Symbol/ClangASTContext.cpp Fri Feb 15 13:48:09 2019 @@ -1654,6 +1654,7 @@ ClassTemplateDecl *ClangASTContext::Crea decl_ctx, // What decl context do we use here? TU? The actual decl // context? SourceLocation(), decl_name, template_param_list, template_cxx_decl); + template_cxx_decl->setDescribedClassTemplate(class_template_decl); if (class_template_decl) { if (access_type != eAccessNone) ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r354185 - Temporarily disable test:
Author: rsmith Date: Fri Feb 15 16:13:26 2019 New Revision: 354185 URL: http://llvm.org/viewvc/llvm-project?rev=354185&view=rev Log: Temporarily disable test: test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py It fails on Mac OS; apparently a VarDecl 'void *&C' is implicitly declared there, making the class template name C ambiguous. Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py?rev=354185&r1=354184&r2=354185&view=diff == --- lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/lang/cpp/class-template-parameter-pack/TestClassTemplateParameterPack.py Fri Feb 15 16:13:26 2019 @@ -4,4 +4,7 @@ from lldbsuite.test import decorators lldbinline.MakeInlineTest( __file__, globals(), [ decorators.expectedFailureAll( -compiler="gcc")]) +compiler="gcc"), +decorators.expectedFailureAll( +oslist=['ios', 'watchos', 'tvos', 'bridgeos'], +bugnumber="rdar://problem/48128064: class template declaration unexpectedly shadowed by VarDecl on MacOS")]) ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r291738 - Update to match clang r291737.
Author: rsmith Date: Wed Jan 11 20:37:54 2017 New Revision: 291738 URL: http://llvm.org/viewvc/llvm-project?rev=291738&view=rev Log: Update to match clang r291737. Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp?rev=291738&r1=291737&r2=291738&view=diff == --- lldb/trunk/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp (original) +++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp Wed Jan 11 20:37:54 2017 @@ -346,8 +346,7 @@ bool ASTResultSynthesizer::SynthesizeBod ExprResult address_of_expr = m_sema->CreateBuiltinUnaryOp(SourceLocation(), UO_AddrOf, last_expr); if (address_of_expr.get()) - m_sema->AddInitializerToDecl(result_decl, address_of_expr.get(), true, - false); + m_sema->AddInitializerToDecl(result_decl, address_of_expr.get(), true); else return false; } else { @@ -359,7 +358,7 @@ bool ASTResultSynthesizer::SynthesizeBod if (!result_decl) return false; -m_sema->AddInitializerToDecl(result_decl, last_expr, true, false); +m_sema->AddInitializerToDecl(result_decl, last_expr, true); } DC->addDecl(result_decl); ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [PATCH] D18530: Move some functions from ClangASTContext to ClangUtil
rsmith added a comment. In http://reviews.llvm.org/D18530#387230, @zturner wrote: > I'm curious now what clang does in this regard, so +rsmith in case he has > some insight into what happens in clang when someone wants to re-organize > some code and how other downstream customers (for example, swift) deal with > this. Clang has no API stability guarantees for its C++ interface. We reserve the right to reorganize at will, and to update, rename, and remove interfaces. This applies doubly to our internal code organization. Yes, this creates a burden on people maintaining out-of-tree patches, but in some ways that's a benefit, as it encourages patches to be contributed upstream when they make sense, or at least for patches to be proposed to refactor upstream so that the local changes are cleanly separable from the upstream code. Organizational changes do have a cost to upstream development in many ways (people are no longer familiar with the code organization, merging fixes to point releases is harder, work-in-progress changes may need non-trivial work to rebase, ...), so we'd only make them when they make sense from a technical / organizational perspective, but in the long term, it's not possible to maintain a healthy codebase if cleanup changes are held back due to those short-term costs. http://reviews.llvm.org/D18530 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r245397 - Fix LLDB after Clang r245346.
Author: rsmith Date: Tue Aug 18 20:05:34 2015 New Revision: 245397 URL: http://llvm.org/viewvc/llvm-project?rev=245397&view=rev Log: Fix LLDB after Clang r245346. The right thing to do here would be to give the ASTConsumer to the CompilerInstance so it can set things up for us, but we can't do that because we don't own it. So instead just initialize it ourselves. Modified: lldb/trunk/source/Expression/ClangExpressionParser.cpp Modified: lldb/trunk/source/Expression/ClangExpressionParser.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionParser.cpp?rev=245397&r1=245396&r2=245397&view=diff == --- lldb/trunk/source/Expression/ClangExpressionParser.cpp (original) +++ lldb/trunk/source/Expression/ClangExpressionParser.cpp Tue Aug 18 20:05:34 2015 @@ -410,6 +410,7 @@ ClangExpressionParser::Parse (Stream &st diag_buf->BeginSourceFile(m_compiler->getLangOpts(), &m_compiler->getPreprocessor()); ASTConsumer *ast_transformer = m_expr.ASTTransformer(m_code_generator.get()); +ast_transformer->Initialize(m_compiler->getASTContext()); if (ClangExpressionDeclMap *decl_map = m_expr.DeclMap()) decl_map->InstallCodeGenerator(m_code_generator.get()); ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [lldb] eee687a - [lldb] Add minidump save-core functionality to ELF object files
The new test fails under MSan: Uninitialized bytes in __interceptor_write at offset 2 inside [0x7fb1f42ed000, 18438530) ==3871==WARNING: MemorySanitizer: use-of-uninitialized-value #0 0x55f5706515d9 in RetryAfterSignal llvm-project/llvm/include/llvm/Support/Errno.h:38:11 #1 0x55f5706515d9 in lldb_private::NativeFile::Write(void const*, unsigned long&) llvm-project/lldb/source/Host/common/File.cpp:585:9 #2 0x55f570badbf5 in MinidumpFileBuilder::Dump(std::__msan::unique_ptr >&) const llvm-project/lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp:739:22 #3 0x55f570bb075c in ObjectFileMinidump::SaveCore(std::__msan::shared_ptr const&, lldb_private::FileSpec const&, lldb::SaveCoreStyle&, lldb_private::Status&) llvm-project/lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.cpp:114:19 #4 0x55f57048960b in lldb_private::PluginManager::SaveCore(std::__msan::shared_ptr const&, lldb_private::FileSpec const&, lldb::SaveCoreStyle&, lldb_private::ConstString) llvm-project/lldb/source/Core/PluginManager.cpp:696:9 Please can you take a look? On Wed, 1 Sept 2021 at 06:19, Andy Yankovsky via lldb-commits < lldb-commits@lists.llvm.org> wrote: > > Author: Andrej Korman > Date: 2021-09-01T15:14:29+02:00 > New Revision: eee687a66d76bf0b6e3746f7b8d09b0d871bff27 > > URL: > https://github.com/llvm/llvm-project/commit/eee687a66d76bf0b6e3746f7b8d09b0d871bff27 > DIFF: > https://github.com/llvm/llvm-project/commit/eee687a66d76bf0b6e3746f7b8d09b0d871bff27.diff > > LOG: [lldb] Add minidump save-core functionality to ELF object files > > This change adds save-core functionality into the ObjectFileELF that > enables > saving minidump of a stopped process. This change is mainly targeting Linux > running on x86_64 machines. Minidump should contain basic information > needed > to examine state of threads, local variables and stack traces. Full support > for other platforms is not so far implemented. API tests are using LLDB's > MinidumpParser. > > This relands commit aafa05e, reverted in 1f986f6. > Failed tests were fixed. > > Reviewed By: clayborg > > Differential Revision: https://reviews.llvm.org/D108233 > > Added: > lldb/source/Plugins/ObjectFile/Minidump/CMakeLists.txt > lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.cpp > lldb/source/Plugins/ObjectFile/Minidump/MinidumpFileBuilder.h > lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.cpp > lldb/source/Plugins/ObjectFile/Minidump/ObjectFileMinidump.h > lldb/test/API/functionalities/process_save_core_minidump/Makefile > > lldb/test/API/functionalities/process_save_core_minidump/TestProcessSaveCoreMinidump.py > lldb/test/API/functionalities/process_save_core_minidump/main.cpp > > Modified: > lldb/include/lldb/Core/PluginManager.h > lldb/source/API/SBProcess.cpp > lldb/source/Commands/CommandObjectProcess.cpp > lldb/source/Commands/Options.td > lldb/source/Core/PluginManager.cpp > lldb/source/Plugins/ObjectFile/CMakeLists.txt > > Removed: > > > > > > diff --git a/lldb/include/lldb/Core/PluginManager.h > b/lldb/include/lldb/Core/PluginManager.h > index be91929c62e13..2bee2edea6360 100644 > --- a/lldb/include/lldb/Core/PluginManager.h > +++ b/lldb/include/lldb/Core/PluginManager.h > @@ -192,7 +192,8 @@ class PluginManager { > >static Status SaveCore(const lldb::ProcessSP &process_sp, > const FileSpec &outfile, > - lldb::SaveCoreStyle &core_style); > + lldb::SaveCoreStyle &core_style, > + const ConstString plugin_name); > >// ObjectContainer >static bool > > diff --git a/lldb/source/API/SBProcess.cpp b/lldb/source/API/SBProcess.cpp > index 47c35a23b0781..a965814be1b98 100644 > --- a/lldb/source/API/SBProcess.cpp > +++ b/lldb/source/API/SBProcess.cpp > @@ -1228,7 +1228,8 @@ lldb::SBError SBProcess::SaveCore(const char > *file_name) { > >FileSpec core_file(file_name); >SaveCoreStyle core_style = SaveCoreStyle::eSaveCoreFull; > - error.ref() = PluginManager::SaveCore(process_sp, core_file, > core_style); > + error.ref() = > + PluginManager::SaveCore(process_sp, core_file, core_style, > ConstString()); >return LLDB_RECORD_RESULT(error); > } > > > diff --git a/lldb/source/Commands/CommandObjectProcess.cpp > b/lldb/source/Commands/CommandObjectProcess.cpp > index bb6220a53d4e8..b3e2f6a1a02b7 100644 > --- a/lldb/source/Commands/CommandObjectProcess.cpp > +++ b/lldb/source/Commands/CommandObjectProcess.cpp > @@ -1180,12 +1180,13 @@ static constexpr OptionEnumValues SaveCoreStyles() > { > class CommandObjectProcessSaveCore : public CommandObjectParsed { > public: >CommandObjectProcessSaveCore(CommandInterpreter &interpreter) > - : CommandObjectParsed(interpreter, "process save-core", > -"Save the current process as a core file > using
[Lldb-commits] [lldb] 2f95c50 - Fix use of wrong printf format specifier for size_t argument.
Author: Richard Smith Date: 2020-09-29T16:02:08-07:00 New Revision: 2f95c50a8b713970c5134dabc246270111a48c6d URL: https://github.com/llvm/llvm-project/commit/2f95c50a8b713970c5134dabc246270111a48c6d DIFF: https://github.com/llvm/llvm-project/commit/2f95c50a8b713970c5134dabc246270111a48c6d.diff LOG: Fix use of wrong printf format specifier for size_t argument. This causes a build break under -Werror=format. Added: Modified: lldb/bindings/python/python-wrapper.swig Removed: diff --git a/lldb/bindings/python/python-wrapper.swig b/lldb/bindings/python/python-wrapper.swig index c00deba6073b..443ddfb8dd20 100644 --- a/lldb/bindings/python/python-wrapper.swig +++ b/lldb/bindings/python/python-wrapper.swig @@ -521,7 +521,7 @@ LLDBSwigPythonCreateScriptedStopHook size_t num_args = (*args_info).max_positional_args; if (num_args != 2) { error.SetErrorStringWithFormat("Wrong number of args for " - "handle_stop callback, should be 2 (excluding self), got: %d", + "handle_stop callback, should be 2 (excluding self), got: %zu", num_args); Py_RETURN_NONE; } else ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r373685 - Properly handle instantiation-dependent array bounds.
Author: rsmith Date: Thu Oct 3 18:25:59 2019 New Revision: 373685 URL: http://llvm.org/viewvc/llvm-project?rev=373685&view=rev Log: Properly handle instantiation-dependent array bounds. We previously failed to treat an array with an instantiation-dependent but not value-dependent bound as being an instantiation-dependent type. We now track the array bound expression as part of a constant array type if it's an instantiation-dependent expression. Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=373685&r1=373684&r2=373685&view=diff == --- lldb/trunk/source/Symbol/ClangASTContext.cpp (original) +++ lldb/trunk/source/Symbol/ClangASTContext.cpp Thu Oct 3 18:25:59 2019 @@ -2180,7 +2180,7 @@ CompilerType ClangASTContext::CreateArra } else { return CompilerType(this, ast->getConstantArrayType( ClangUtil::GetQualType(element_type), - ap_element_count, + ap_element_count, nullptr, clang::ArrayType::Normal, 0) .getAsOpaquePtr()); } @@ -4469,7 +4469,7 @@ CompilerType ClangASTContext::GetArrayTy return CompilerType( this, ast_ctx ->getConstantArrayType( - qual_type, llvm::APInt(64, size), + qual_type, llvm::APInt(64, size), nullptr, clang::ArrayType::ArraySizeModifier::Normal, 0) .getAsOpaquePtr()); else ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r371817 - For PR17164: split -fno-lax-vector-conversion into three different
Author: rsmith Date: Thu Sep 12 23:02:15 2019 New Revision: 371817 URL: http://llvm.org/viewvc/llvm-project?rev=371817&view=rev Log: For PR17164: split -fno-lax-vector-conversion into three different levels: -- none: no lax vector conversions [new GCC default] -- integer: only conversions between integer vectors [old GCC default] -- all: all conversions between same-size vectors [Clang default] For now, Clang still defaults to "all" mode, but per my proposal on cfe-dev (2019-04-10) the default will be changed to "integer" as soon as that doesn't break lots of testcases. (Eventually I'd like to change the default to "none" to match GCC and general sanity.) Following GCC's behavior, the driver flag -flax-vector-conversions is translated to -flax-vector-conversions=integer. This reinstates r371805, reverted in r371813, with an additional fix for lldb. Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=371817&r1=371816&r2=371817&view=diff == --- lldb/trunk/source/Symbol/ClangASTContext.cpp (original) +++ lldb/trunk/source/Symbol/ClangASTContext.cpp Thu Sep 12 23:02:15 2019 @@ -494,7 +494,7 @@ static void ParseLangArgs(LangOptions &O Opts.OpenCL = 1; Opts.AltiVec = 1; Opts.CXXOperatorNames = 1; -Opts.LaxVectorConversions = 1; +Opts.setLaxVectorConversions(LangOptions::LaxVectorConversionKind::All); } // OpenCL and C++ both have bool, true, false keywords. ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r360312 - Fix up lldb after clang r360311.
Author: rsmith Date: Wed May 8 21:40:57 2019 New Revision: 360312 URL: http://llvm.org/viewvc/llvm-project?rev=360312&view=rev Log: Fix up lldb after clang r360311. Patch by Tyker! Differential Revision: https://reviews.llvm.org/D60934 Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=360312&r1=360311&r2=360312&view=diff == --- lldb/trunk/source/Symbol/ClangASTContext.cpp (original) +++ lldb/trunk/source/Symbol/ClangASTContext.cpp Wed May 8 21:40:57 2019 @@ -8173,6 +8173,10 @@ clang::CXXMethodDecl *ClangASTContext::A if (is_artificial) return nullptr; // skip everything artificial + const clang::ExplicitSpecifier explicit_spec( + nullptr /*expr*/, is_explicit +? clang::ExplicitSpecKind::ResolvedTrue +: clang::ExplicitSpecKind::ResolvedFalse); if (name[0] == '~') { cxx_dtor_decl = clang::CXXDestructorDecl::Create( *getASTContext(), cxx_record_decl, clang::SourceLocation(), @@ -8191,7 +8195,7 @@ clang::CXXMethodDecl *ClangASTContext::A clang::SourceLocation()), method_qual_type, nullptr, // TypeSourceInfo * -is_explicit, is_inline, is_artificial, false /*is_constexpr*/); +explicit_spec, is_inline, is_artificial, false /*is_constexpr*/); cxx_method_decl = cxx_ctor_decl; } else { clang::StorageClass SC = is_static ? clang::SC_Static : clang::SC_None; @@ -8226,7 +8230,7 @@ clang::CXXMethodDecl *ClangASTContext::A clang::SourceLocation()), method_qual_type, nullptr, // TypeSourceInfo * -is_inline, is_explicit, false /*is_constexpr*/, +is_inline, explicit_spec, false /*is_constexpr*/, clang::SourceLocation()); } } ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
Re: [Lldb-commits] [lldb] r361565 - [lldb] followup fix for https://reviews.llvm.org/D62305
On Thu, 23 May 2019 at 15:39, Konrad Kleine via lldb-commits < lldb-commits@lists.llvm.org> wrote: > Author: kwk > Date: Thu May 23 15:39:13 2019 > New Revision: 361565 > > URL: http://llvm.org/viewvc/llvm-project?rev=361565&view=rev > Log: > [lldb] followup fix for https://reviews.llvm.org/D62305 > > Summary: > Fixing this error on windows build bot: > > ``` > E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Host\common\HostNativeThreadBase.cpp(21): > error C2440: 'initializing': cannot convert from 'nullptr' to > 'lldb::thread_result_t' > E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Host\common\HostNativeThreadBase.cpp(21): > note: A native nullptr can only be converted to bool or, using > reinterpret_cast, to an integral type > E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Host\common\HostNativeThreadBase.cpp(21): > error C2439: 'lldb_private::HostNativeThreadBase::m_result': member could > not be initialized > E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\include\lldb/Host/HostNativeThreadBase.h(48): > note: see declaration of 'lldb_private::HostNativeThreadBase::m_result' > E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Host\common\HostNativeThreadBase.cpp(24): > error C2440: 'initializing': cannot convert from 'nullptr' to > 'lldb::thread_result_t' > E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Host\common\HostNativeThreadBase.cpp(24): > note: A native nullptr can only be converted to bool or, using > reinterpret_cast, to an integral type > E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Host\common\HostNativeThreadBase.cpp(24): > error C2439: 'lldb_private::HostNativeThreadBase::m_result': member could > not be initialized > E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\include\lldb/Host/HostNativeThreadBase.h(48): > note: see declaration of 'lldb_private::HostNativeThreadBase::m_result' > E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Host\common\HostNativeThreadBase.cpp(40): > error C2440: '=': cannot convert from 'nullptr' to 'lldb::thread_result_t' > E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Host\common\HostNativeThreadBase.cpp(40): > note: A native nullptr can only be converted to bool or, using > reinterpret_cast, to an integral type > E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Host\common\HostNativeThreadBase.cpp(50): > error C2440: '=': cannot convert from 'nullptr' to 'lldb::thread_result_t' > E:\build_slave\lldb-x64-windows-ninja\llvm\tools\lldb\source\Host\common\HostNativeThreadBase.cpp(50): > note: A native nullptr can only be converted to bool or, using > reinterpret_cast, to an integral type > ``` > > see > http://lab.llvm.org:8011/builders/lldb-x64-windows-ninja/builds/5050/steps/build/logs/stdio > > Reviewers: stella.stamenova, JDevlieghere > > Reviewed By: JDevlieghere > > Subscribers: lldb-commits > > Tags: #lldb > > Differential Revision: https://reviews.llvm.org/D62337 > > Modified: > lldb/trunk/source/Host/common/HostNativeThreadBase.cpp > > Modified: lldb/trunk/source/Host/common/HostNativeThreadBase.cpp > URL: > http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/HostNativeThreadBase.cpp?rev=361565&r1=361564&r2=361565&view=diff > > == > --- lldb/trunk/source/Host/common/HostNativeThreadBase.cpp (original) > +++ lldb/trunk/source/Host/common/HostNativeThreadBase.cpp Thu May 23 > 15:39:13 2019 > @@ -18,10 +18,10 @@ using namespace lldb; > using namespace lldb_private; > > HostNativeThreadBase::HostNativeThreadBase() > -: m_thread(LLDB_INVALID_HOST_THREAD), m_result(0) {} > +: m_thread(LLDB_INVALID_HOST_THREAD), m_result({}) {} > > HostNativeThreadBase::HostNativeThreadBase(thread_t thread) > -: m_thread(thread), m_result(0) {} > +: m_thread(thread), m_result({}) {} > This change breaks the build with Clang: third_party/llvm/llvm/tools/lldb/source/Host/common/HostNativeThreadBase.cpp:21:43: error: cannot initialize non-class type 'lldb::thread_result_t' (aka 'void *') with a parenthesized initializer list : m_thread(LLDB_INVALID_HOST_THREAD), m_result({}) {} ^~~ > lldb::thread_t HostNativeThreadBase::GetSystemHandle() const { >return m_thread; > @@ -37,7 +37,7 @@ bool HostNativeThreadBase::IsJoinable() > > void HostNativeThreadBase::Reset() { >m_thread = LLDB_INVALID_HOST_THREAD; > - m_result = 0; > + m_result = {}; > } > > bool HostNativeThreadBase::EqualsThread(lldb::thread_t thread) const { > @@ -47,7 +47,7 @@ bool HostNativeThreadBase::EqualsThread( > lldb::thread_t HostNativeThreadBase::Release() { >lldb::thread_t result = m_thread; >m_thread = LLDB_INVALID_HOST_THREAD; > - m_result = 0; > + m_result = {}; > >return result; > } > > > ___ > lldb-commits mailing list > lldb-commits@li
[Lldb-commits] [lldb] 856fd98 - Generalize regex matching std::string variants to compensate for recent
Author: Richard Smith Date: 2020-11-11T17:55:47-08:00 New Revision: 856fd98a176240470dcc2b8ad54b5c17ef6a75b3 URL: https://github.com/llvm/llvm-project/commit/856fd98a176240470dcc2b8ad54b5c17ef6a75b3 DIFF: https://github.com/llvm/llvm-project/commit/856fd98a176240470dcc2b8ad54b5c17ef6a75b3.diff LOG: Generalize regex matching std::string variants to compensate for recent improvements to Clang's type printing. Added: Modified: lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp Removed: diff --git a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp index 83a140ebd5e7..7bc5b194514a 100644 --- a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp +++ b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp @@ -461,52 +461,52 @@ static void LoadLibCxxFormatters(lldb::TypeCategoryImplSP cpp_category_sp) { AddCXXSummary(cpp_category_sp, lldb_private::formatters::LibcxxStringSummaryProviderASCII, "std::string summary provider", -ConstString("^std::__[[:alnum:]]+::string$"), stl_summary_flags, +ConstString("^std::(__[[:alnum:]]+::)?string$"), stl_summary_flags, true); AddCXXSummary(cpp_category_sp, lldb_private::formatters::LibcxxStringSummaryProviderASCII, "std::string summary provider", -ConstString("^std::__[[:alnum:]]+::basic_string, " -"std::__[[:alnum:]]+::allocator >$"), +ConstString("^std::(__[[:alnum:]]+::)?basic_string, " +"std::(__[[:alnum:]]+::)?allocator )?>$"), stl_summary_flags, true); AddCXXSummary(cpp_category_sp, lldb_private::formatters::LibcxxStringSummaryProviderASCII, "std::string summary provider", -ConstString("^std::__[[:alnum:]]+::basic_string, " -"std::__[[:alnum:]]+::allocator >$"), +ConstString("^std::(__[[:alnum:]]+::)?basic_string, " +"std::(__[[:alnum:]]+::)?allocator )?>$"), stl_summary_flags, true); AddCXXSummary(cpp_category_sp, lldb_private::formatters::LibcxxStringSummaryProviderUTF16, "std::u16string summary provider", ConstString( -"^std::__[[:alnum:]]+::basic_string, " -"std::__[[:alnum:]]+::allocator >$"), +"^std::(__[[:alnum:]]+::)?basic_string, " +"std::(__[[:alnum:]]+::)?allocator )?>$"), stl_summary_flags, true); AddCXXSummary(cpp_category_sp, lldb_private::formatters::LibcxxStringSummaryProviderUTF32, "std::u32string summary provider", ConstString( -"^std::__[[:alnum:]]+::basic_string, " -"std::__[[:alnum:]]+::allocator >$"), +"^std::(__[[:alnum:]]+::)?basic_string, " +"std::(__[[:alnum:]]+::)?allocator )?>$"), stl_summary_flags, true); AddCXXSummary(cpp_category_sp, lldb_private::formatters::LibcxxWStringSummaryProvider, "std::wstring summary provider", -ConstString("^std::__[[:alnum:]]+::wstring$"), +ConstString("^std::(__[[:alnum:]]+::)?wstring$"), stl_summary_flags, true); AddCXXSummary(cpp_category_sp, lldb_private::formatters::LibcxxWStringSummaryProvider, "std::wstring summary provider", -ConstString("^std::__[[:alnum:]]+::basic_string, " -"std::__[[:alnum:]]+::allocator >$"), +ConstString("^std::(__[[:alnum:]]+::)?basic_string, " +"std::(__[[:alnum:]]+::)?allocator )?>$"), stl_summary_flags, true); SyntheticChildren::Flags stl_synth_flags; @@ -787,6 +787,10 @@ static void LoadLibStdcppFormatters(lldb::TypeCategoryImplSP cpp_category_sp) { ConstString("std::__cxx11::basic_string, " "std::allocator >"), cxx11_string_summary_sp); + cpp_category_sp->GetTypeSummariesContainer()->Add( + ConstString("std::basic_string, " + "std::allocator >"), + cxx11_string_summary_sp); cpp_category_sp->GetTypeSummariesContainer()->Add( ConstString("std::__cxx11::basic_string, " "std::allocator >"), ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] 4b57400 - [c++20] P1907R1: Support for generalized non-type template arguments of scalar type.
Author: Richard Smith Date: 2021-01-18T21:05:01-08:00 New Revision: 4b574008aef5a7235c1f894ab065fe300d26e786 URL: https://github.com/llvm/llvm-project/commit/4b574008aef5a7235c1f894ab065fe300d26e786 DIFF: https://github.com/llvm/llvm-project/commit/4b574008aef5a7235c1f894ab065fe300d26e786.diff LOG: [c++20] P1907R1: Support for generalized non-type template arguments of scalar type. Previously committed as 9e08e51a20d0d2b1c5724bb17e969d036fced4cd, and reverted because a dependency commit was reverted. This incorporates the following follow-on commits that were also reverted: 7e84aa1b81e72d44bcc58ffe1731bfc7abb73ce0 by Simon Pilgrim ed13d8c66781b50ff007cb089c5905f9bb9e8af2 by me 95c7b6cadbc9a3d4376ef44edbeb3c8bb5b8d7fc by Sam McCall 430d5d8429473c2b10b109991d7577a3cea41140 by Dave Zarzycki Added: clang/test/CodeGenCXX/template-arguments.cpp Modified: clang-tools-extra/clangd/DumpAST.cpp clang-tools-extra/clangd/FindTarget.cpp clang-tools-extra/clangd/index/remote/Client.cpp clang/include/clang/AST/ASTContext.h clang/include/clang/AST/PropertiesBase.td clang/include/clang/AST/RecursiveASTVisitor.h clang/include/clang/AST/TemplateArgumentVisitor.h clang/include/clang/AST/TemplateBase.h clang/include/clang/Basic/DiagnosticSemaKinds.td clang/include/clang/Sema/Sema.h clang/lib/AST/ASTContext.cpp clang/lib/AST/ASTImporter.cpp clang/lib/AST/ASTStructuralEquivalence.cpp clang/lib/AST/Decl.cpp clang/lib/AST/ItaniumMangle.cpp clang/lib/AST/MicrosoftMangle.cpp clang/lib/AST/ODRHash.cpp clang/lib/AST/StmtProfile.cpp clang/lib/AST/TemplateBase.cpp clang/lib/AST/TypeLoc.cpp clang/lib/CodeGen/CGDebugInfo.cpp clang/lib/CodeGen/CGExprConstant.cpp clang/lib/Index/USRGeneration.cpp clang/lib/Sema/SemaLookup.cpp clang/lib/Sema/SemaOverload.cpp clang/lib/Sema/SemaTemplate.cpp clang/lib/Sema/SemaTemplateDeduction.cpp clang/lib/Sema/SemaTemplateInstantiate.cpp clang/lib/Sema/SemaTemplateVariadic.cpp clang/lib/Sema/TreeTransform.h clang/lib/Serialization/ASTReader.cpp clang/lib/Serialization/ASTWriter.cpp clang/test/CodeGenCXX/mangle-ms-templates.cpp clang/test/CodeGenCXX/mangle-template.cpp clang/test/SemaTemplate/temp_arg_nontype_cxx17.cpp clang/test/SemaTemplate/temp_arg_nontype_cxx20.cpp clang/tools/libclang/CIndex.cpp clang/tools/libclang/CXCursor.cpp lldb/include/lldb/lldb-enumerations.h lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp Removed: diff --git a/clang-tools-extra/clangd/DumpAST.cpp b/clang-tools-extra/clangd/DumpAST.cpp index 588bcfcf2424..bf7675e7d949 100644 --- a/clang-tools-extra/clangd/DumpAST.cpp +++ b/clang-tools-extra/clangd/DumpAST.cpp @@ -143,6 +143,7 @@ class DumpVisitor : public RecursiveASTVisitor { TEMPLATE_ARGUMENT_KIND(Declaration); TEMPLATE_ARGUMENT_KIND(Template); TEMPLATE_ARGUMENT_KIND(TemplateExpansion); + TEMPLATE_ARGUMENT_KIND(UncommonValue); #undef TEMPLATE_ARGUMENT_KIND } llvm_unreachable("Unhandled ArgKind enum"); diff --git a/clang-tools-extra/clangd/FindTarget.cpp b/clang-tools-extra/clangd/FindTarget.cpp index 84316659daad..98ef8b3b6d76 100644 --- a/clang-tools-extra/clangd/FindTarget.cpp +++ b/clang-tools-extra/clangd/FindTarget.cpp @@ -1079,6 +1079,7 @@ class ExplicitReferenceCollector case TemplateArgument::Pack: case TemplateArgument::Type: case TemplateArgument::Expression: +case TemplateArgument::UncommonValue: break; // Handled by VisitType and VisitExpression. }; return RecursiveASTVisitor::TraverseTemplateArgumentLoc(A); diff --git a/clang-tools-extra/clangd/index/remote/Client.cpp b/clang-tools-extra/clangd/index/remote/Client.cpp index b09dbf915e46..a153a8812baf 100644 --- a/clang-tools-extra/clangd/index/remote/Client.cpp +++ b/clang-tools-extra/clangd/index/remote/Client.cpp @@ -152,7 +152,8 @@ class IndexClient : public clangd::SymbolIndex { }); } - llvm::unique_function indexedFiles() const { + llvm::unique_function + indexedFiles() const override { // FIXME: For now we always return "false" regardless of whether the file //was indexed or not. A possible implementation could be based on //the idea that we do not want to send a request at every diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h index 0c5d82b3e9aa..a9bfdb4d5fa5 100644 --- a/clang/include/clang/AST/ASTContext.h +++ b/clang/include/clang/AST/ASTContext.h @@ -2818,8 +2818,8 @@ class ASTContext : public RefCountedBase { /// for destruction. template void addDestruction(T *Ptr) const { if (!std::is_trivially_destructible::value) { - auto DestroyPtr = [](void *V) { static_cast(V)->~T(); }; - AddDeallocation(DestroyPtr, Ptr); + auto DestroyPtr =
Re: [Lldb-commits] [clang] c13dd74 - Set the captures on a CXXRecordDecl representing a lambda closure type
On Thu, 4 Jun 2020 at 23:45, Jonas Devlieghere via cfe-commits < cfe-comm...@lists.llvm.org> wrote: > Hey Richard, > > It appears this broke the lldb bots: > > http://lab.llvm.org:8011/builders/lldb-x86_64-debian > http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/20549/ > That's not caused by this NFC commit, it's the one after it. Thanks for the revert. > It's hitting an assertion in > llvm-project/clang/include/clang/AST/DeclCXX.h:887: > > Assertion `(data().DefaultedCopyAssignmentIsDeleted || > needsOverloadResolutionForCopyAssignment()) && "copy assignment should not > be deleted"' failed. > > I've reverted this commit and the subsequent one > (c57f8a3a20540fcf9fbf98c0a73f381ec32fce2a) to turn the bots green again > overnight. Could you please take a look tomorrow? > Looks like lldb is doing unusual things with special members when generating classes directly from debug info. It can't use Sema, so it's faking up some of what Sema would do, and needed to be extended to also fake up the new stuff for copy assignments in this patch. Re-landed with fix in 825e3bb58082eafa8db87a9034379b88f892ce9d. > Thanks, > Jonas > > > > On Thu, Jun 4, 2020 at 7:25 PM Richard Smith via cfe-commits < > cfe-comm...@lists.llvm.org> wrote: > >> >> Author: Richard Smith >> Date: 2020-06-04T19:19:01-07:00 >> New Revision: c13dd74e311d2ac70dd3ea663d800307d1aa5b6b >> >> URL: >> https://github.com/llvm/llvm-project/commit/c13dd74e311d2ac70dd3ea663d800307d1aa5b6b >> DIFF: >> https://github.com/llvm/llvm-project/commit/c13dd74e311d2ac70dd3ea663d800307d1aa5b6b.diff >> >> LOG: Set the captures on a CXXRecordDecl representing a lambda closure >> type >> before marking it complete. >> >> No functionality change intended. >> >> Added: >> >> >> Modified: >> clang/include/clang/AST/DeclCXX.h >> clang/include/clang/AST/ExprCXX.h >> clang/lib/AST/ASTImporter.cpp >> clang/lib/AST/DeclCXX.cpp >> clang/lib/AST/ExprCXX.cpp >> clang/lib/Sema/SemaLambda.cpp >> >> Removed: >> >> >> >> >> >> diff --git a/clang/include/clang/AST/DeclCXX.h >> b/clang/include/clang/AST/DeclCXX.h >> index 3a400a778e53..856717fa0abb 100644 >> --- a/clang/include/clang/AST/DeclCXX.h >> +++ b/clang/include/clang/AST/DeclCXX.h >> @@ -999,6 +999,9 @@ class CXXRecordDecl : public RecordDecl { >> return >> static_cast(getLambdaData().CaptureDefault); >>} >> >> + /// Set the captures for this lambda closure type. >> + void setCaptures(ArrayRef Captures); >> + >>/// For a closure type, retrieve the mapping from captured >>/// variables and \c this to the non-static data members that store the >>/// values or references of the captures. >> @@ -1030,6 +1033,8 @@ class CXXRecordDecl : public RecordDecl { >>: nullptr; >>} >> >> + unsigned capture_size() const { return getLambdaData().NumCaptures; } >> + >>using conversion_iterator = UnresolvedSetIterator; >> >>conversion_iterator conversion_begin() const { >> >> diff --git a/clang/include/clang/AST/ExprCXX.h >> b/clang/include/clang/AST/ExprCXX.h >> index 272ad138d14a..56b27d57bd5c 100644 >> --- a/clang/include/clang/AST/ExprCXX.h >> +++ b/clang/include/clang/AST/ExprCXX.h >> @@ -1862,10 +1862,9 @@ class LambdaExpr final : public Expr, >>/// Construct a lambda expression. >>LambdaExpr(QualType T, SourceRange IntroducerRange, >> LambdaCaptureDefault CaptureDefault, >> - SourceLocation CaptureDefaultLoc, ArrayRef >> Captures, >> - bool ExplicitParams, bool ExplicitResultType, >> - ArrayRef CaptureInits, SourceLocation ClosingBrace, >> - bool ContainsUnexpandedParameterPack); >> + SourceLocation CaptureDefaultLoc, bool ExplicitParams, >> + bool ExplicitResultType, ArrayRef CaptureInits, >> + SourceLocation ClosingBrace, bool >> ContainsUnexpandedParameterPack); >> >>/// Construct an empty lambda expression. >>LambdaExpr(EmptyShell Empty, unsigned NumCaptures) >> @@ -1888,9 +1887,9 @@ class LambdaExpr final : public Expr, >>static LambdaExpr * >>Create(const ASTContext &C, CXXRecordDecl *Class, SourceRange >> IntroducerRange, >> LambdaCaptureDefault CaptureDefault, SourceLocation >> CaptureDefaultLoc, >> - ArrayRef Captures, bool ExplicitParams, >> - bool ExplicitResultType, ArrayRef CaptureInits, >> - SourceLocation ClosingBrace, bool >> ContainsUnexpandedParameterPack); >> + bool ExplicitParams, bool ExplicitResultType, >> + ArrayRef CaptureInits, SourceLocation ClosingBrace, >> + bool ContainsUnexpandedParameterPack); >> >>/// Construct a new lambda expression that will be deserialized from >>/// an external source. >> >> diff --git a/clang/lib/AST/ASTImporter.cpp >> b/clang/lib/AST/ASTImporter.cpp >> index 10035162299e..a2a712e6b6ca 100644 >> --- a/clang/lib/AST/ASTIm
[Lldb-commits] [lldb] 825e3bb - PR46209: properly determine whether a copy assignment operator is
Author: Richard Smith Date: 2020-06-05T16:05:32-07:00 New Revision: 825e3bb58082eafa8db87a9034379b88f892ce9d URL: https://github.com/llvm/llvm-project/commit/825e3bb58082eafa8db87a9034379b88f892ce9d DIFF: https://github.com/llvm/llvm-project/commit/825e3bb58082eafa8db87a9034379b88f892ce9d.diff LOG: PR46209: properly determine whether a copy assignment operator is trivial. We previously took a shortcut by assuming that if a subobject had a trivial copy assignment operator (with a few side-conditions), we would always invoke it, and could avoid going through overload resolution. That turns out to not be correct in the presenve of ref-qualifiers (and also won't be the case for copy-assignments with requires-clauses either). Use the same logic for lazy declaration of copy-assignments that we use for all other special member functions. Previously committed as c57f8a3a20540fcf9fbf98c0a73f381ec32fce2a. This now also includes an extension of LLDB's workaround for handling special members without the help of Sema to cover copy assignments. Added: Modified: clang/include/clang/AST/CXXRecordDeclDefinitionBits.def clang/include/clang/AST/DeclCXX.h clang/lib/AST/ASTImporter.cpp clang/lib/AST/DeclCXX.cpp clang/lib/AST/JSONNodeDumper.cpp clang/lib/AST/TextNodeDumper.cpp clang/lib/Sema/SemaDeclCXX.cpp clang/test/AST/ast-dump-decl-context-json.cpp clang/test/AST/ast-dump-decl.cpp clang/test/AST/ast-dump-expr-json.cpp clang/test/AST/ast-dump-record-definition-data-json.cpp clang/test/AST/ast-dump-records-json.cpp clang/test/AST/ast-dump-records.cpp clang/test/AST/ast-dump-special-member-functions.cpp clang/test/AST/ast-dump-template-decls-json.cpp clang/test/SemaCXX/type-traits.cpp clang/test/SemaObjCXX/arc-0x.mm clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp Removed: diff --git a/clang/include/clang/AST/CXXRecordDeclDefinitionBits.def b/clang/include/clang/AST/CXXRecordDeclDefinitionBits.def index bd4d8247aeca..33e65f8ebf44 100644 --- a/clang/include/clang/AST/CXXRecordDeclDefinitionBits.def +++ b/clang/include/clang/AST/CXXRecordDeclDefinitionBits.def @@ -140,6 +140,7 @@ FIELD(HasInheritedAssignment, 1, NO_MERGE) /// @{ FIELD(NeedOverloadResolutionForCopyConstructor, 1, NO_MERGE) FIELD(NeedOverloadResolutionForMoveConstructor, 1, NO_MERGE) +FIELD(NeedOverloadResolutionForCopyAssignment, 1, NO_MERGE) FIELD(NeedOverloadResolutionForMoveAssignment, 1, NO_MERGE) FIELD(NeedOverloadResolutionForDestructor, 1, NO_MERGE) /// @} @@ -149,6 +150,7 @@ FIELD(NeedOverloadResolutionForDestructor, 1, NO_MERGE) /// @{ FIELD(DefaultedCopyConstructorIsDeleted, 1, NO_MERGE) FIELD(DefaultedMoveConstructorIsDeleted, 1, NO_MERGE) +FIELD(DefaultedCopyAssignmentIsDeleted, 1, NO_MERGE) FIELD(DefaultedMoveAssignmentIsDeleted, 1, NO_MERGE) FIELD(DefaultedDestructorIsDeleted, 1, NO_MERGE) /// @} diff --git a/clang/include/clang/AST/DeclCXX.h b/clang/include/clang/AST/DeclCXX.h index 856717fa0abb..2b8d7e879a0a 100644 --- a/clang/include/clang/AST/DeclCXX.h +++ b/clang/include/clang/AST/DeclCXX.h @@ -712,6 +712,13 @@ class CXXRecordDecl : public RecordDecl { !data().DefaultedMoveConstructorIsDeleted; } + /// \c true if we know for sure that this class has a single, + /// accessible, unambiguous copy assignment operator that is not deleted. + bool hasSimpleCopyAssignment() const { +return !hasUserDeclaredCopyAssignment() && + !data().DefaultedCopyAssignmentIsDeleted; + } + /// \c true if we know for sure that this class has a single, /// accessible, unambiguous move assignment operator that is not deleted. bool hasSimpleMoveAssignment() const { @@ -872,6 +879,15 @@ class CXXRecordDecl : public RecordDecl { return data().UserDeclaredSpecialMembers & SMF_CopyAssignment; } + /// Set that we attempted to declare an implicit copy assignment + /// operator, but overload resolution failed so we deleted it. + void setImplicitCopyAssignmentIsDeleted() { +assert((data().DefaultedCopyAssignmentIsDeleted || +needsOverloadResolutionForCopyAssignment()) && + "copy assignment should not be deleted"); +data().DefaultedCopyAssignmentIsDeleted = true; + } + /// Determine whether this class needs an implicit copy /// assignment operator to be lazily declared. bool needsImplicitCopyAssignment() const { @@ -881,7 +897,16 @@ class CXXRecordDecl : public RecordDecl { /// Determine whether we need to eagerly declare a defaulted copy /// assignment operator for this class. bool needsOverloadResolutionForCopyAssignment() const { -return data().HasMutableFields; +// C++20 [class.copy.assign]p2: +// If the class definition declares a move constructor or move assignment +// operator, the implicitl
[Lldb-commits] [libcxxabi] [lldb] [llvm] [WIP] [ItaniumDemangle] Add infrastructure to track location information of parts of a demangled function name (PR #133249)
@@ -6176,6 +6180,10 @@ struct ManglingParser : AbstractManglingParser, Alloc> { Alloc>::AbstractManglingParser; }; +inline void OutputBuffer::printLeft(const Node &N) { N.printLeft(*this); } zygoloid wrote: Thanks, yes. I agree that the duplication is not ideal, and I think it'd be fine to add a few more virtual function calls if it reduces the duplication, but this extension to the demangler looks nice and clean now. https://github.com/llvm/llvm-project/pull/133249 ___ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits