From 06210ae42d418d50d8d9365d5c9419308ae9e7ee Mon Sep 17 00:00:00 2001 From: dim Date: Mon, 26 Dec 2016 20:36:37 +0000 Subject: MFC r309124: Upgrade our copies of clang, llvm, lldb, compiler-rt and libc++ to 3.9.0 release, and add lld 3.9.0. Also completely revamp the build system for clang, llvm, lldb and their related tools. Please note that from 3.5.0 onwards, clang, llvm and lldb require C++11 support to build; see UPDATING for more information. Release notes for llvm, clang and lld are available here: Thanks to Ed Maste, Bryan Drewery, Andrew Turner, Antoine Brodin and Jan Beich for their help. Relnotes: yes MFC r309147: Pull in r282174 from upstream llvm trunk (by Krzysztof Parzyszek): [PPC] Set SP after loading data from stack frame, if no red zone is present Follow-up to r280705: Make sure that the SP is only restored after all data is loaded from the stack frame, if there is no red zone. This completes the fix for https://llvm.org/bugs/show_bug.cgi?id=26519. Differential Revision: https://reviews.llvm.org/D24466 Reported by: Mark Millard PR: 214433 MFC r309149: Pull in r283060 from upstream llvm trunk (by Hal Finkel): [PowerPC] Refactor soft-float support, and enable PPC64 soft float This change enables soft-float for PowerPC64, and also makes soft-float disable all vector instruction sets for both 32-bit and 64-bit modes. This latter part is necessary because the PPC backend canonicalizes many Altivec vector types to floating-point types, and so soft-float breaks scalarization support for many operations. Both for embedded targets and for operating-system kernels desiring soft-float support, it seems reasonable that disabling hardware floating-point also disables vector instructions (embedded targets without hardware floating point support are unlikely to have Altivec, etc. and operating system kernels desiring not to use floating-point registers to lower syscall cost are unlikely to want to use vector registers either). If someone needs this to work, we'll need to change the fact that we promote many Altivec operations to act on v4f32. To make it possible to disable Altivec when soft-float is enabled, hardware floating-point support needs to be expressed as a positive feature, like the others, and not a negative feature, because target features cannot have dependencies on the disabling of some other feature. So +soft-float has now become -hard-float. Fixes PR26970. Pull in r283061 from upstream clang trunk (by Hal Finkel): [PowerPC] Enable soft-float for PPC64, and +soft-float -> -hard-float Enable soft-float support on PPC64, as the backend now supports it. Also, the backend now uses -hard-float instead of +soft-float, so set the target features accordingly. Fixes PR26970. Reported by: Mark Millard PR: 214433 MFC r309212: Add a few missed clang 3.9.0 files to OptionalObsoleteFiles. MFC r309262: Fix packaging for clang, lldb and lld 3.9.0 During the upgrade of clang/llvm etc to 3.9.0 in r309124, the PACKAGE directive in the usr.bin/clang/*.mk files got dropped accidentally. Restore it, with a few minor changes and additions: * Correct license in clang.ucl to NCSA * Add PACKAGE=clang for clang and most of the "ll" tools * Put lldb in its own package * Put lld in its own package Reviewed by: gjb, jmallett Differential Revision: https://reviews.freebsd.org/D8666 MFC r309656: During the bootstrap phase, when building the minimal llvm library on PowerPC, add lib/Support/Atomic.cpp. This is needed because upstream llvm revision r271821 disabled the use of std::call_once, which causes some fallback functions from Atomic.cpp to be used instead. Reported by: Mark Millard PR: 214902 MFC r309835: Tentatively apply https://reviews.llvm.org/D18730 to work around gcc PR 70528 (bogus error: constructor required before non-static data member). This should fix buildworld with the external gcc package. Reported by: https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc/ MFC r310194: Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to 3.9.1 release. Please note that from 3.5.0 onwards, clang, llvm and lldb require C++11 support to build; see UPDATING for more information. Release notes for llvm, clang and lld will be available here: Relnotes: yes --- .../lldb/source/Commands/CommandObjectSettings.cpp | 306 ++++++++++----------- 1 file changed, 142 insertions(+), 164 deletions(-) (limited to 'contrib/llvm/tools/lldb/source/Commands/CommandObjectSettings.cpp') diff --git a/contrib/llvm/tools/lldb/source/Commands/CommandObjectSettings.cpp b/contrib/llvm/tools/lldb/source/Commands/CommandObjectSettings.cpp index 890d770..b76af20 100644 --- a/contrib/llvm/tools/lldb/source/Commands/CommandObjectSettings.cpp +++ b/contrib/llvm/tools/lldb/source/Commands/CommandObjectSettings.cpp @@ -12,6 +12,8 @@ // C Includes // C++ Includes // Other libraries and framework includes +#include "llvm/ADT/StringRef.h" + // Project includes #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/CommandReturnObject.h" @@ -20,7 +22,6 @@ using namespace lldb; using namespace lldb_private; -#include "llvm/ADT/StringRef.h" //------------------------------------------------------------------------- // CommandObjectSettingsSet @@ -29,12 +30,9 @@ using namespace lldb_private; class CommandObjectSettingsSet : public CommandObjectRaw { public: - CommandObjectSettingsSet (CommandInterpreter &interpreter) : - CommandObjectRaw (interpreter, - "settings set", - "Set or change the value of a single debugger setting variable.", - NULL), - m_options (interpreter) + CommandObjectSettingsSet(CommandInterpreter &interpreter) + : CommandObjectRaw(interpreter, "settings set", "Set the value of the specified debugger setting.", nullptr), + m_options(interpreter) { CommandArgumentEntry arg1; CommandArgumentEntry arg2; @@ -82,8 +80,7 @@ insert-before or insert-after." } - - ~CommandObjectSettingsSet () override {} + ~CommandObjectSettingsSet() override = default; // Overrides base class's behavior where WantsCompletion = !WantsRawCommandString. bool @@ -98,14 +95,13 @@ insert-before or insert-after." class CommandOptions : public Options { public: - CommandOptions (CommandInterpreter &interpreter) : Options (interpreter), m_global (false) { } - ~CommandOptions () override {} + ~CommandOptions() override = default; Error SetOptionValue (uint32_t option_idx, const char *option_arg) override @@ -160,7 +156,7 @@ insert-before or insert-after." std::string completion_str (input.GetArgumentAtIndex (cursor_index), cursor_char_position); const size_t argc = input.GetArgumentCount(); - const char *arg = NULL; + const char *arg = nullptr; int setting_var_idx; for (setting_var_idx = 1; setting_var_idx < static_cast(argc); ++setting_var_idx) @@ -172,14 +168,14 @@ insert-before or insert-after." if (cursor_index == setting_var_idx) { // Attempting to complete setting variable name - CommandCompletions::InvokeCommonCompletionCallbacks (m_interpreter, - CommandCompletions::eSettingsNameCompletion, - completion_str.c_str(), - match_start_point, - max_return_elements, - NULL, - word_complete, - matches); + CommandCompletions::InvokeCommonCompletionCallbacks(m_interpreter, + CommandCompletions::eSettingsNameCompletion, + completion_str.c_str(), + match_start_point, + max_return_elements, + nullptr, + word_complete, + matches); } else { @@ -231,7 +227,7 @@ protected: } const char *var_name = cmd_args.GetArgumentAtIndex (0); - if ((var_name == NULL) || (var_name[0] == '\0')) + if ((var_name == nullptr) || (var_name[0] == '\0')) { result.AppendError ("'settings set' command requires a valid variable name"); result.SetStatus (eReturnStatusFailed); @@ -246,10 +242,10 @@ protected: Error error; if (m_options.m_global) { - error = m_interpreter.GetDebugger().SetPropertyValue (NULL, - eVarSetOperationAssign, - var_name, - var_value_cstr); + error = m_interpreter.GetDebugger().SetPropertyValue(nullptr, + eVarSetOperationAssign, + var_name, + var_value_cstr); } if (error.Success()) @@ -280,6 +276,7 @@ protected: return result.Succeeded(); } + private: CommandOptions m_options; }; @@ -287,11 +284,10 @@ private: OptionDefinition CommandObjectSettingsSet::CommandOptions::g_option_table[] = { - { LLDB_OPT_SET_2, false, "global", 'g', OptionParser::eNoArgument, NULL, NULL, 0, eArgTypeNone, "Apply the new value to the global default value." }, - { 0, false, NULL, 0, 0, NULL, NULL, 0, eArgTypeNone, NULL } + { LLDB_OPT_SET_2, false, "global", 'g', OptionParser::eNoArgument, nullptr, nullptr, 0, eArgTypeNone, "Apply the new value to the global default value." }, + { 0, false, nullptr, 0, 0, nullptr, nullptr, 0, eArgTypeNone, nullptr } }; - //------------------------------------------------------------------------- // CommandObjectSettingsShow -- Show current values //------------------------------------------------------------------------- @@ -299,11 +295,10 @@ CommandObjectSettingsSet::CommandOptions::g_option_table[] = class CommandObjectSettingsShow : public CommandObjectParsed { public: - CommandObjectSettingsShow (CommandInterpreter &interpreter) : - CommandObjectParsed (interpreter, - "settings show", - "Show the specified internal debugger setting variable and its value, or show all the currently set variables and their values, if nothing is specified.", - NULL) + CommandObjectSettingsShow(CommandInterpreter &interpreter) + : CommandObjectParsed( + interpreter, "settings show", + "Show matching debugger settings and their current values. Defaults to showing all settings.", nullptr) { CommandArgumentEntry arg1; CommandArgumentData var_name_arg; @@ -319,8 +314,7 @@ public: m_arguments.push_back (arg1); } - ~CommandObjectSettingsShow () override {} - + ~CommandObjectSettingsShow() override = default; int HandleArgumentCompletion (Args &input, @@ -334,14 +328,14 @@ public: { std::string completion_str (input.GetArgumentAtIndex (cursor_index), cursor_char_position); - CommandCompletions::InvokeCommonCompletionCallbacks (m_interpreter, - CommandCompletions::eSettingsNameCompletion, - completion_str.c_str(), - match_start_point, - max_return_elements, - NULL, - word_complete, - matches); + CommandCompletions::InvokeCommonCompletionCallbacks(m_interpreter, + CommandCompletions::eSettingsNameCompletion, + completion_str.c_str(), + match_start_point, + max_return_elements, + nullptr, + word_complete, + matches); return matches.GetSize(); } @@ -354,7 +348,7 @@ protected: const size_t argc = args.GetArgumentCount (); if (argc > 0) { - for (size_t i=0; i []") +CommandObjectMultiwordSettings::CommandObjectMultiwordSettings(CommandInterpreter &interpreter) + : CommandObjectMultiword(interpreter, "settings", "Commands for managing LLDB settings.", + "settings []") { LoadSubCommand ("set", CommandObjectSP (new CommandObjectSettingsSet (interpreter))); LoadSubCommand ("show", CommandObjectSP (new CommandObjectSettingsShow (interpreter))); @@ -1194,6 +1174,4 @@ CommandObjectMultiwordSettings::CommandObjectMultiwordSettings (CommandInterpret LoadSubCommand ("clear", CommandObjectSP (new CommandObjectSettingsClear (interpreter))); } -CommandObjectMultiwordSettings::~CommandObjectMultiwordSettings () -{ -} +CommandObjectMultiwordSettings::~CommandObjectMultiwordSettings() = default; -- cgit v1.1