From b9c1b51e45b845debb76d8658edabca70ca56079 Mon Sep 17 00:00:00 2001 From: Kate Stone Date: Tue, 6 Sep 2016 20:57:50 +0000 Subject: *** This commit represents a complete reformatting of the LLDB source code *** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751 --- lldb/source/Plugins/Language/Go/GoLanguage.cpp | 164 +++++++++++-------------- 1 file changed, 72 insertions(+), 92 deletions(-) (limited to 'lldb/source/Plugins/Language/Go/GoLanguage.cpp') diff --git a/lldb/source/Plugins/Language/Go/GoLanguage.cpp b/lldb/source/Plugins/Language/Go/GoLanguage.cpp index ed010ffa4b2..85c41d1fe91 100644 --- a/lldb/source/Plugins/Language/Go/GoLanguage.cpp +++ b/lldb/source/Plugins/Language/Go/GoLanguage.cpp @@ -18,129 +18,109 @@ // Project includes #include "GoLanguage.h" +#include "Plugins/Language/Go/GoFormatterFunctions.h" #include "lldb/Core/ConstString.h" #include "lldb/Core/PluginManager.h" #include "lldb/DataFormatters/FormattersHelpers.h" #include "lldb/Symbol/GoASTContext.h" -#include "Plugins/Language/Go/GoFormatterFunctions.h" using namespace lldb; using namespace lldb_private; using namespace lldb_private::formatters; -void -GoLanguage::Initialize() -{ - PluginManager::RegisterPlugin(GetPluginNameStatic(), "Go Language", CreateInstance); +void GoLanguage::Initialize() { + PluginManager::RegisterPlugin(GetPluginNameStatic(), "Go Language", + CreateInstance); } -void -GoLanguage::Terminate() -{ - PluginManager::UnregisterPlugin(CreateInstance); +void GoLanguage::Terminate() { + PluginManager::UnregisterPlugin(CreateInstance); } -lldb_private::ConstString -GoLanguage::GetPluginNameStatic() -{ - static ConstString g_name("Go"); - return g_name; +lldb_private::ConstString GoLanguage::GetPluginNameStatic() { + static ConstString g_name("Go"); + return g_name; } //------------------------------------------------------------------ // PluginInterface protocol //------------------------------------------------------------------ -lldb_private::ConstString -GoLanguage::GetPluginName() -{ - return GetPluginNameStatic(); +lldb_private::ConstString GoLanguage::GetPluginName() { + return GetPluginNameStatic(); } -uint32_t -GoLanguage::GetPluginVersion() -{ - return 1; -} +uint32_t GoLanguage::GetPluginVersion() { return 1; } //------------------------------------------------------------------ // Static Functions //------------------------------------------------------------------ -Language * -GoLanguage::CreateInstance(lldb::LanguageType language) -{ - if (language == eLanguageTypeGo) - return new GoLanguage(); - return nullptr; +Language *GoLanguage::CreateInstance(lldb::LanguageType language) { + if (language == eLanguageTypeGo) + return new GoLanguage(); + return nullptr; } HardcodedFormatters::HardcodedSummaryFinder -GoLanguage::GetHardcodedSummaries() -{ - static std::once_flag g_initialize; - static HardcodedFormatters::HardcodedSummaryFinder g_formatters; +GoLanguage::GetHardcodedSummaries() { + static std::once_flag g_initialize; + static HardcodedFormatters::HardcodedSummaryFinder g_formatters; - std::call_once(g_initialize, []() -> void - { - g_formatters.push_back( - [](lldb_private::ValueObject &valobj, lldb::DynamicValueType, - FormatManager &) -> TypeSummaryImpl::SharedPointer - { - static CXXFunctionSummaryFormat::SharedPointer formatter_sp(new CXXFunctionSummaryFormat( - TypeSummaryImpl::Flags().SetDontShowChildren(true), - lldb_private::formatters::GoStringSummaryProvider, "Go string summary provider")); - if (GoASTContext::IsGoString(valobj.GetCompilerType())) - { - return formatter_sp; - } - if (GoASTContext::IsGoString(valobj.GetCompilerType().GetPointeeType())) - { - return formatter_sp; - } - return nullptr; - }); - g_formatters.push_back( - [](lldb_private::ValueObject &valobj, lldb::DynamicValueType, - FormatManager &) -> TypeSummaryImpl::SharedPointer - { - static lldb::TypeSummaryImplSP formatter_sp( - new StringSummaryFormat(TypeSummaryImpl::Flags().SetHideItemNames(true), - "(len ${var.len}, cap ${var.cap})")); - if (GoASTContext::IsGoSlice(valobj.GetCompilerType())) - { - return formatter_sp; - } - if (GoASTContext::IsGoSlice(valobj.GetCompilerType().GetPointeeType())) - { - return formatter_sp; - } - return nullptr; - }); - }); - return g_formatters; + std::call_once(g_initialize, []() -> void { + g_formatters.push_back( + [](lldb_private::ValueObject &valobj, lldb::DynamicValueType, + FormatManager &) -> TypeSummaryImpl::SharedPointer { + static CXXFunctionSummaryFormat::SharedPointer formatter_sp( + new CXXFunctionSummaryFormat( + TypeSummaryImpl::Flags().SetDontShowChildren(true), + lldb_private::formatters::GoStringSummaryProvider, + "Go string summary provider")); + if (GoASTContext::IsGoString(valobj.GetCompilerType())) { + return formatter_sp; + } + if (GoASTContext::IsGoString( + valobj.GetCompilerType().GetPointeeType())) { + return formatter_sp; + } + return nullptr; + }); + g_formatters.push_back( + [](lldb_private::ValueObject &valobj, lldb::DynamicValueType, + FormatManager &) -> TypeSummaryImpl::SharedPointer { + static lldb::TypeSummaryImplSP formatter_sp(new StringSummaryFormat( + TypeSummaryImpl::Flags().SetHideItemNames(true), + "(len ${var.len}, cap ${var.cap})")); + if (GoASTContext::IsGoSlice(valobj.GetCompilerType())) { + return formatter_sp; + } + if (GoASTContext::IsGoSlice( + valobj.GetCompilerType().GetPointeeType())) { + return formatter_sp; + } + return nullptr; + }); + }); + return g_formatters; } HardcodedFormatters::HardcodedSyntheticFinder -GoLanguage::GetHardcodedSynthetics() -{ - static std::once_flag g_initialize; - static HardcodedFormatters::HardcodedSyntheticFinder g_formatters; +GoLanguage::GetHardcodedSynthetics() { + static std::once_flag g_initialize; + static HardcodedFormatters::HardcodedSyntheticFinder g_formatters; - std::call_once(g_initialize, []() -> void - { - g_formatters.push_back( - [](lldb_private::ValueObject &valobj, lldb::DynamicValueType, - FormatManager &fmt_mgr) -> SyntheticChildren::SharedPointer - { - static CXXSyntheticChildren::SharedPointer formatter_sp( - new CXXSyntheticChildren(SyntheticChildren::Flags(), "slice synthetic children", - lldb_private::formatters::GoSliceSyntheticFrontEndCreator)); - if (GoASTContext::IsGoSlice(valobj.GetCompilerType())) - { - return formatter_sp; - } - return nullptr; - }); - }); + std::call_once(g_initialize, []() -> void { + g_formatters.push_back( + [](lldb_private::ValueObject &valobj, lldb::DynamicValueType, + FormatManager &fmt_mgr) -> SyntheticChildren::SharedPointer { + static CXXSyntheticChildren::SharedPointer formatter_sp( + new CXXSyntheticChildren( + SyntheticChildren::Flags(), "slice synthetic children", + lldb_private::formatters::GoSliceSyntheticFrontEndCreator)); + if (GoASTContext::IsGoSlice(valobj.GetCompilerType())) { + return formatter_sp; + } + return nullptr; + }); + }); - return g_formatters; + return g_formatters; } -- cgit v1.2.3