Skip to content

Commit

Permalink
Fix Clang-tidy modernize-use-override warnings in some files in sourc…
Browse files Browse the repository at this point in the history
…e/Plugins; other minor fixes.

Differential Revision: http://reviews.llvm.org/D13951

llvm-svn: 250925
  • Loading branch information
EugeneZelenko committed Oct 21, 2015
1 parent fa0adfd commit ab7f6d0
Show file tree
Hide file tree
Showing 12 changed files with 325 additions and 345 deletions.
35 changes: 17 additions & 18 deletions lldb/source/Plugins/JITLoader/GDB/JITLoaderGDB.h
Expand Up @@ -13,15 +13,19 @@
// C Includes
// C++ Includes
#include <map>
#include <vector>
#include <string>

// Other libraries and framework includes
// Project includes
#include "lldb/Target/JITLoader.h"
#include "lldb/Target/Process.h"

class JITLoaderGDB : public lldb_private::JITLoader
{
public:
JITLoaderGDB(lldb_private::Process *process);

~JITLoaderGDB() override;

//------------------------------------------------------------------
// Static Functions
//------------------------------------------------------------------
Expand All @@ -40,34 +44,29 @@ class JITLoaderGDB : public lldb_private::JITLoader
static lldb::JITLoaderSP
CreateInstance (lldb_private::Process *process, bool force);

JITLoaderGDB (lldb_private::Process *process);

static void
DebuggerInitialize(lldb_private::Debugger &debugger);

virtual
~JITLoaderGDB ();

//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
virtual lldb_private::ConstString
GetPluginName();
lldb_private::ConstString
GetPluginName() override;

virtual uint32_t
GetPluginVersion();
uint32_t
GetPluginVersion() override;

//------------------------------------------------------------------
// JITLoader interface
//------------------------------------------------------------------
virtual void
DidAttach ();
void
DidAttach() override;

virtual void
DidLaunch ();
void
DidLaunch() override;

virtual void
ModulesDidLoad (lldb_private::ModuleList &module_list);
void
ModulesDidLoad(lldb_private::ModuleList &module_list) override;

private:
lldb::addr_t
Expand Down Expand Up @@ -108,4 +107,4 @@ class JITLoaderGDB : public lldb_private::JITLoader

};

#endif
#endif // liblldb_JITLoaderGDB_h_
59 changes: 28 additions & 31 deletions lldb/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp
@@ -1,18 +1,20 @@
//===-- OperatingSystemGo.cpp --------------------------------*- C++ -*-===//
//===-- OperatingSystemGo.cpp -----------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "OperatingSystemGo.h"

// C Includes
// C++ Includes
#include <unordered_map>

// Other libraries and framework includes
// Project includes
#include "OperatingSystemGo.h"

#include "lldb/Core/DataBufferHeap.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/Module.h"
Expand Down Expand Up @@ -56,21 +58,21 @@ enum

class PluginProperties : public Properties
{
public:
static ConstString
GetSettingName()
{
return OperatingSystemGo::GetPluginNameStatic();
}

public:
PluginProperties()
: Properties()
{
m_collection_sp.reset(new OptionValueProperties(GetSettingName()));
m_collection_sp->Initialize(g_properties);
}

virtual ~PluginProperties() {}
~PluginProperties() override = default;

static ConstString
GetSettingName()
{
return OperatingSystemGo::GetPluginNameStatic();
}

bool
GetEnableGoroutines()
Expand Down Expand Up @@ -100,10 +102,7 @@ GetGlobalPluginProperties()

class RegisterContextGo : public RegisterContextMemory
{
public:
//------------------------------------------------------------------
// Constructors and Destructors
//------------------------------------------------------------------
public:
RegisterContextGo(lldb_private::Thread &thread, uint32_t concrete_frame_idx, DynamicRegisterInfo &reg_info,
lldb::addr_t reg_data_addr)
: RegisterContextMemory(thread, concrete_frame_idx, reg_info, reg_data_addr)
Expand All @@ -118,10 +117,11 @@ class RegisterContextGo : public RegisterContextMemory
m_reg_data.SetData(reg_data_sp);
}

virtual ~RegisterContextGo() {}
~RegisterContextGo() override = default;

virtual bool
ReadRegister(const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &reg_value)
bool
ReadRegister(const lldb_private::RegisterInfo *reg_info,
lldb_private::RegisterValue &reg_value) override
{
switch (reg_info->kinds[eRegisterKindGeneric])
{
Expand All @@ -134,8 +134,9 @@ class RegisterContextGo : public RegisterContextMemory
}
}

virtual bool
WriteRegister(const lldb_private::RegisterInfo *reg_info, const lldb_private::RegisterValue &reg_value)
bool
WriteRegister(const lldb_private::RegisterInfo *reg_info,
const lldb_private::RegisterValue &reg_value) override
{
switch (reg_info->kinds[eRegisterKindGeneric])
{
Expand All @@ -147,11 +148,11 @@ class RegisterContextGo : public RegisterContextMemory
}
}

private:
private:
DISALLOW_COPY_AND_ASSIGN(RegisterContextGo);
};

} // namespace
} // anonymous namespace

struct OperatingSystemGo::Goroutine
{
Expand Down Expand Up @@ -219,6 +220,12 @@ OperatingSystemGo::CreateInstance(Process *process, bool force)
return new OperatingSystemGo(process);
}

OperatingSystemGo::OperatingSystemGo(lldb_private::Process *process)
: OperatingSystem(process)
, m_reginfo(new DynamicRegisterInfo)
{
}

ConstString
OperatingSystemGo::GetPluginNameStatic()
{
Expand All @@ -232,16 +239,6 @@ OperatingSystemGo::GetPluginDescriptionStatic()
return "Operating system plug-in that reads runtime data-structures for goroutines.";
}

OperatingSystemGo::OperatingSystemGo(lldb_private::Process *process)
: OperatingSystem(process)
, m_reginfo(new DynamicRegisterInfo)
{
}

OperatingSystemGo::~OperatingSystemGo()
{
}

bool
OperatingSystemGo::Init(ThreadList &threads)
{
Expand Down
46 changes: 23 additions & 23 deletions lldb/source/Plugins/OperatingSystem/Go/OperatingSystemGo.h
@@ -1,24 +1,30 @@
//===-- OperatingSystemGo.h ----------------------------------*- C++ -*-===//
//===-- OperatingSystemGo.h -------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------------------===//
//===----------------------------------------------------------------------===//

#ifndef _liblldb_OperatingSystemGo_h_
#define _liblldb_OperatingSystemGo_h_

#include <iostream>

// C Includes
// C++ Includes
// Other libraries and framework includes
// Project includes
#include "lldb/Target/OperatingSystem.h"

class DynamicRegisterInfo;

class OperatingSystemGo : public lldb_private::OperatingSystem
{
public:
public:
OperatingSystemGo(lldb_private::Process *process);

~OperatingSystemGo() override = default;

//------------------------------------------------------------------
// Static Functions
//------------------------------------------------------------------
Expand All @@ -34,39 +40,33 @@ class OperatingSystemGo : public lldb_private::OperatingSystem

static const char *GetPluginDescriptionStatic();

//------------------------------------------------------------------
// Class Methods
//------------------------------------------------------------------
OperatingSystemGo(lldb_private::Process *process);

virtual ~OperatingSystemGo();

//------------------------------------------------------------------
// lldb_private::PluginInterface Methods
//------------------------------------------------------------------
virtual lldb_private::ConstString GetPluginName();
lldb_private::ConstString GetPluginName() override;

virtual uint32_t GetPluginVersion();
uint32_t GetPluginVersion() override;

//------------------------------------------------------------------
// lldb_private::OperatingSystem Methods
//------------------------------------------------------------------
virtual bool UpdateThreadList(lldb_private::ThreadList &old_thread_list, lldb_private::ThreadList &real_thread_list,
lldb_private::ThreadList &new_thread_list);
bool UpdateThreadList(lldb_private::ThreadList &old_thread_list,
lldb_private::ThreadList &real_thread_list,
lldb_private::ThreadList &new_thread_list) override;

virtual void ThreadWasSelected(lldb_private::Thread *thread);
void ThreadWasSelected(lldb_private::Thread *thread) override;

virtual lldb::RegisterContextSP CreateRegisterContextForThread(lldb_private::Thread *thread,
lldb::addr_t reg_data_addr);
lldb::RegisterContextSP CreateRegisterContextForThread(lldb_private::Thread *thread,
lldb::addr_t reg_data_addr) override;

virtual lldb::StopInfoSP CreateThreadStopReason(lldb_private::Thread *thread);
lldb::StopInfoSP CreateThreadStopReason(lldb_private::Thread *thread) override;

//------------------------------------------------------------------
// Method for lazy creation of threads on demand
//------------------------------------------------------------------
virtual lldb::ThreadSP CreateThread(lldb::tid_t tid, lldb::addr_t context);
lldb::ThreadSP CreateThread(lldb::tid_t tid, lldb::addr_t context) override;

private:
private:
struct Goroutine;

static lldb::ValueObjectSP FindGlobal(lldb::TargetSP target, const char *name);
Expand All @@ -82,4 +82,4 @@ class OperatingSystemGo : public lldb_private::OperatingSystem
lldb::ValueObjectSP m_allglen_sp;
};

#endif // #ifndef liblldb_OperatingSystemGo_h_
#endif // liblldb_OperatingSystemGo_h_

0 comments on commit ab7f6d0

Please sign in to comment.