Fix Clang-tidy misc-use-override warnings in include/lldb/DataFormatters and include/lldb/Host, unify closing inclusion guards

patch by Eugene Zelenko.

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

llvm-svn: 245279
This commit is contained in:
Pavel Labath 2015-08-18 09:06:31 +00:00
parent 9f4374d361
commit 04b7f51250
11 changed files with 198 additions and 205 deletions

View File

@ -203,23 +203,23 @@ namespace lldb_private {
public:
LibcxxVectorBoolSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);
virtual size_t
CalculateNumChildren ();
size_t
CalculateNumChildren() override;
virtual lldb::ValueObjectSP
GetChildAtIndex (size_t idx);
lldb::ValueObjectSP
GetChildAtIndex(size_t idx) override;
virtual bool
Update();
bool
Update() override;
virtual bool
MightHaveChildren ();
bool
MightHaveChildren() override;
virtual size_t
GetIndexOfChildWithName (const ConstString &name);
size_t
GetIndexOfChildWithName(const ConstString &name) override;
~LibcxxVectorBoolSyntheticFrontEnd() override;
virtual
~LibcxxVectorBoolSyntheticFrontEnd ();
private:
CompilerType m_bool_type;
ExecutionContextRef m_exe_ctx_ref;
@ -238,23 +238,23 @@ namespace lldb_private {
public:
LibstdcppMapIteratorSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);
virtual size_t
CalculateNumChildren ();
size_t
CalculateNumChildren() override;
virtual lldb::ValueObjectSP
GetChildAtIndex (size_t idx);
lldb::ValueObjectSP
GetChildAtIndex(size_t idx) override;
virtual bool
Update();
bool
Update() override;
virtual bool
MightHaveChildren ();
bool
MightHaveChildren() override;
virtual size_t
GetIndexOfChildWithName (const ConstString &name);
size_t
GetIndexOfChildWithName (const ConstString &name) override;
~LibstdcppMapIteratorSyntheticFrontEnd() override;
virtual
~LibstdcppMapIteratorSyntheticFrontEnd ();
private:
ExecutionContextRef m_exe_ctx_ref;
lldb::addr_t m_pair_address;
@ -270,23 +270,23 @@ namespace lldb_private {
public:
LibCxxMapIteratorSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);
virtual size_t
CalculateNumChildren ();
size_t
CalculateNumChildren() override;
virtual lldb::ValueObjectSP
GetChildAtIndex (size_t idx);
lldb::ValueObjectSP
GetChildAtIndex(size_t idx) override;
virtual bool
Update();
bool
Update() override;
virtual bool
MightHaveChildren ();
bool
MightHaveChildren() override;
virtual size_t
GetIndexOfChildWithName (const ConstString &name);
size_t
GetIndexOfChildWithName(const ConstString &name) override;
~LibCxxMapIteratorSyntheticFrontEnd() override;
virtual
~LibCxxMapIteratorSyntheticFrontEnd ();
private:
ValueObject *m_pair_ptr;
};
@ -299,23 +299,23 @@ namespace lldb_private {
VectorIteratorSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp,
ConstString item_name);
virtual size_t
CalculateNumChildren ();
size_t
CalculateNumChildren() override;
virtual lldb::ValueObjectSP
GetChildAtIndex (size_t idx);
lldb::ValueObjectSP
GetChildAtIndex(size_t idx) override;
virtual bool
Update();
bool
Update() override;
virtual bool
MightHaveChildren ();
bool
MightHaveChildren() override;
virtual size_t
GetIndexOfChildWithName (const ConstString &name);
size_t
GetIndexOfChildWithName(const ConstString &name) override;
~VectorIteratorSyntheticFrontEnd() override;
virtual
~VectorIteratorSyntheticFrontEnd ();
private:
ExecutionContextRef m_exe_ctx_ref;
ConstString m_item_name;
@ -331,23 +331,23 @@ namespace lldb_private {
public:
LibcxxSharedPtrSyntheticFrontEnd (lldb::ValueObjectSP valobj_sp);
virtual size_t
CalculateNumChildren ();
size_t
CalculateNumChildren() override;
virtual lldb::ValueObjectSP
GetChildAtIndex (size_t idx);
lldb::ValueObjectSP
GetChildAtIndex(size_t idx) override;
virtual bool
Update();
bool
Update() override;
virtual bool
MightHaveChildren ();
bool
MightHaveChildren() override;
virtual size_t
GetIndexOfChildWithName (const ConstString &name);
size_t
GetIndexOfChildWithName(const ConstString &name) override;
~LibcxxSharedPtrSyntheticFrontEnd() override;
virtual
~LibcxxSharedPtrSyntheticFrontEnd ();
private:
ValueObject* m_cntrl;
lldb::ValueObjectSP m_count_sp;

View File

@ -226,19 +226,19 @@ public:
ShouldPrintAsOneLiner (ValueObject& valobj);
void
Changed ()
Changed () override
{
++m_last_revision;
m_format_cache.Clear ();
}
uint32_t
GetCurrentRevision ()
GetCurrentRevision () override
{
return m_last_revision;
}
~FormatManager ()
~FormatManager () override
{
}

View File

@ -159,16 +159,19 @@ namespace lldb_private {
{
return m_flags.GetCascades();
}
bool
SkipsPointers () const
{
return m_flags.GetSkipPointers();
}
bool
SkipsReferences () const
{
return m_flags.GetSkipReferences();
}
bool
NonCacheable () const
{
@ -257,7 +260,7 @@ namespace lldb_private {
typedef std::shared_ptr<TypeFormatImpl_Format> SharedPointer;
typedef bool(*ValueCallback)(void*, ConstString, const TypeFormatImpl_Format::SharedPointer&);
virtual ~TypeFormatImpl_Format ();
~TypeFormatImpl_Format() override;
lldb::Format
GetFormat () const
@ -271,18 +274,18 @@ namespace lldb_private {
m_format = fmt;
}
virtual TypeFormatImpl::Type
GetType ()
TypeFormatImpl::Type
GetType() override
{
return TypeFormatImpl::Type::eTypeFormat;
}
virtual bool
FormatObject (ValueObject *valobj,
std::string& dest) const;
bool
FormatObject(ValueObject *valobj,
std::string& dest) const override;
virtual std::string
GetDescription();
std::string
GetDescription() override;
protected:
lldb::Format m_format;
@ -300,7 +303,7 @@ namespace lldb_private {
typedef std::shared_ptr<TypeFormatImpl_EnumType> SharedPointer;
typedef bool(*ValueCallback)(void*, ConstString, const TypeFormatImpl_EnumType::SharedPointer&);
~TypeFormatImpl_EnumType ();
~TypeFormatImpl_EnumType() override;
ConstString
GetTypeName ()
@ -314,18 +317,18 @@ namespace lldb_private {
m_enum_type = enum_type;
}
virtual TypeFormatImpl::Type
GetType ()
TypeFormatImpl::Type
GetType() override
{
return TypeFormatImpl::Type::eTypeEnum;
}
virtual bool
FormatObject (ValueObject *valobj,
std::string& dest) const;
bool
FormatObject(ValueObject *valobj,
std::string& dest) const override;
virtual std::string
GetDescription();
std::string
GetDescription() override;
protected:
ConstString m_enum_type;

View File

@ -430,8 +430,7 @@ namespace lldb_private {
StringSummaryFormat(const TypeSummaryImpl::Flags& flags,
const char* f);
virtual
~StringSummaryFormat()
~StringSummaryFormat() override
{
}
@ -444,23 +443,22 @@ namespace lldb_private {
void
SetSummaryString (const char* f);
virtual bool
bool
FormatObject(ValueObject *valobj,
std::string& dest,
const TypeSummaryOptions& options);
const TypeSummaryOptions& options) override;
virtual std::string
GetDescription();
std::string
GetDescription() override;
virtual bool
IsScripted ()
bool
IsScripted() override
{
return false;
}
virtual Type
GetType ()
Type
GetType() override
{
return TypeSummaryImpl::eTypeString;
}
@ -512,27 +510,26 @@ namespace lldb_private {
m_description.clear();
}
virtual
~CXXFunctionSummaryFormat ()
~CXXFunctionSummaryFormat() override
{
}
virtual bool
FormatObject (ValueObject *valobj,
bool
FormatObject(ValueObject *valobj,
std::string& dest,
const TypeSummaryOptions& options);
const TypeSummaryOptions& options) override;
virtual std::string
GetDescription ();
std::string
GetDescription() override;
virtual bool
IsScripted ()
bool
IsScripted() override
{
return false;
}
virtual Type
GetType ()
Type
GetType() override
{
return TypeSummaryImpl::eTypeCallback;
}
@ -587,34 +584,32 @@ namespace lldb_private {
m_python_script.clear();
}
virtual
~ScriptSummaryFormat ()
~ScriptSummaryFormat() override
{
}
virtual bool
FormatObject (ValueObject *valobj,
bool
FormatObject(ValueObject *valobj,
std::string& dest,
const TypeSummaryOptions& options);
const TypeSummaryOptions& options) override;
virtual std::string
GetDescription ();
std::string
GetDescription() override;
virtual bool
IsScripted ()
bool
IsScripted() override
{
return true;
}
virtual Type
GetType ()
Type
GetType() override
{
return TypeSummaryImpl::eTypeScript;
}
typedef std::shared_ptr<ScriptSummaryFormat> SharedPointer;
private:
DISALLOW_COPY_AND_ASSIGN(ScriptSummaryFormat);
};

View File

@ -118,28 +118,27 @@ namespace lldb_private {
SyntheticChildrenFrontEnd(backend)
{}
virtual
~SyntheticValueProviderFrontEnd ()
~SyntheticValueProviderFrontEnd() override
{
}
virtual size_t
CalculateNumChildren () { return 0; }
size_t
CalculateNumChildren() override { return 0; }
virtual lldb::ValueObjectSP
GetChildAtIndex (size_t idx) { return nullptr; }
lldb::ValueObjectSP
GetChildAtIndex(size_t idx) override { return nullptr; }
virtual size_t
GetIndexOfChildWithName (const ConstString &name) { return UINT32_MAX; }
size_t
GetIndexOfChildWithName(const ConstString &name) override { return UINT32_MAX; }
virtual bool
Update () { return false; }
bool
Update() override { return false; }
virtual bool
MightHaveChildren () { return false; }
bool
MightHaveChildren () override { return false; }
virtual lldb::ValueObjectSP
GetSyntheticValue () = 0;
lldb::ValueObjectSP
GetSyntheticValue() override = 0;
private:
DISALLOW_COPY_AND_ASSIGN(SyntheticValueProviderFrontEnd);
@ -417,13 +416,13 @@ namespace lldb_private {
SetExpressionPathAtIndex (size_t i, const std::string& path);
bool
IsScripted ()
IsScripted() override
{
return false;
}
std::string
GetDescription ();
GetDescription() override;
class FrontEnd : public SyntheticChildrenFrontEnd
{
@ -437,36 +436,35 @@ namespace lldb_private {
filter(flt)
{}
virtual
~FrontEnd ()
~FrontEnd() override
{
}
virtual size_t
CalculateNumChildren ()
size_t
CalculateNumChildren() override
{
return filter->GetCount();
}
virtual lldb::ValueObjectSP
GetChildAtIndex (size_t idx)
lldb::ValueObjectSP
GetChildAtIndex(size_t idx) override
{
if (idx >= filter->GetCount())
return lldb::ValueObjectSP();
return m_backend.GetSyntheticExpressionPathChild(filter->GetExpressionPathAtIndex(idx), true);
}
virtual bool
Update() { return false; }
bool
Update() override { return false; }
virtual bool
MightHaveChildren ()
bool
MightHaveChildren() override
{
return filter->GetCount() > 0;
}
virtual size_t
GetIndexOfChildWithName (const ConstString &name);
size_t
GetIndexOfChildWithName(const ConstString &name) override;
typedef std::shared_ptr<SyntheticChildrenFrontEnd> SharedPointer;
@ -474,8 +472,8 @@ namespace lldb_private {
DISALLOW_COPY_AND_ASSIGN(FrontEnd);
};
virtual SyntheticChildrenFrontEnd::AutoPointer
GetFrontEnd(ValueObject &backend)
SyntheticChildrenFrontEnd::AutoPointer
GetFrontEnd(ValueObject &backend) override
{
return SyntheticChildrenFrontEnd::AutoPointer(new FrontEnd(this, backend));
}
@ -502,16 +500,16 @@ namespace lldb_private {
}
bool
IsScripted ()
IsScripted() override
{
return false;
}
std::string
GetDescription ();
GetDescription() override;
virtual SyntheticChildrenFrontEnd::AutoPointer
GetFrontEnd (ValueObject &backend)
SyntheticChildrenFrontEnd::AutoPointer
GetFrontEnd(ValueObject &backend) override
{
return SyntheticChildrenFrontEnd::AutoPointer(m_create_callback(this, backend.GetSP()));
}
@ -567,10 +565,10 @@ namespace lldb_private {
}
std::string
GetDescription ();
GetDescription() override;
bool
IsScripted ()
IsScripted() override
{
return true;
}
@ -589,26 +587,25 @@ namespace lldb_private {
bool
IsValid ();
virtual
~FrontEnd ();
~FrontEnd() override;
virtual size_t
CalculateNumChildren ();
size_t
CalculateNumChildren() override;
virtual lldb::ValueObjectSP
GetChildAtIndex (size_t idx);
lldb::ValueObjectSP
GetChildAtIndex(size_t idx) override;
virtual bool
Update ();
bool
Update() override;
virtual bool
MightHaveChildren ();
bool
MightHaveChildren() override;
virtual size_t
GetIndexOfChildWithName (const ConstString &name);
size_t
GetIndexOfChildWithName(const ConstString &name) override;
virtual lldb::ValueObjectSP
GetSyntheticValue ();
lldb::ValueObjectSP
GetSyntheticValue() override;
typedef std::shared_ptr<SyntheticChildrenFrontEnd> SharedPointer;
@ -616,8 +613,8 @@ namespace lldb_private {
DISALLOW_COPY_AND_ASSIGN(FrontEnd);
};
virtual SyntheticChildrenFrontEnd::AutoPointer
GetFrontEnd(ValueObject &backend)
SyntheticChildrenFrontEnd::AutoPointer
GetFrontEnd(ValueObject &backend) override
{
auto synth_ptr = SyntheticChildrenFrontEnd::AutoPointer(new FrontEnd(m_python_class, backend));
if (synth_ptr && ((FrontEnd*)synth_ptr.get())->IsValid())

View File

@ -267,7 +267,7 @@ public:
typedef std::shared_ptr<TypeValidatorImpl_CXX> SharedPointer;
typedef bool(*ValueCallback)(void*, ConstString, const TypeValidatorImpl_CXX::SharedPointer&);
virtual ~TypeValidatorImpl_CXX ();
~TypeValidatorImpl_CXX() override;
ValidatorFunction
GetValidatorFunction () const
@ -281,17 +281,17 @@ public:
m_validator_function = f;
}
virtual TypeValidatorImpl::Type
GetType ()
TypeValidatorImpl::Type
GetType() override
{
return TypeValidatorImpl::Type::eTypeCXX;
}
virtual ValidationResult
FormatObject (ValueObject *valobj) const;
ValidationResult
FormatObject(ValueObject *valobj) const override;
virtual std::string
GetDescription();
std::string
GetDescription() override;
protected:
std::string m_description;

View File

@ -9,7 +9,6 @@
#ifndef liblldb_File_h_
#define liblldb_File_h_
#if defined(__cplusplus)
#include <stdarg.h>
#include <stdio.h>
@ -133,11 +132,10 @@ public:
///
/// The destructor is virtual in case this class is subclassed.
//------------------------------------------------------------------
virtual
~File ();
~File() override;
bool
IsValid () const
IsValid() const override
{
return DescriptorIsValid() || StreamIsValid();
}
@ -216,7 +214,7 @@ public:
uint32_t permissions = lldb::eFilePermissionsFileDefault);
Error
Close ();
Close() override;
Error
Duplicate (const File &rhs);
@ -225,8 +223,7 @@ public:
GetDescriptor() const;
WaitableHandle
GetWaitableHandle();
GetWaitableHandle() override;
void
SetDescriptor(int fd, bool transfer_ownership);
@ -256,7 +253,7 @@ public:
/// failure.
//------------------------------------------------------------------
Error
Read (void *buf, size_t &num_bytes);
Read(void *buf, size_t &num_bytes) override;
//------------------------------------------------------------------
/// Write bytes to a file at the current file position.
@ -278,7 +275,7 @@ public:
/// failure.
//------------------------------------------------------------------
Error
Write (const void *buf, size_t &num_bytes);
Write(const void *buf, size_t &num_bytes) override;
//------------------------------------------------------------------
/// Seek to an offset relative to the beginning of the file.
@ -553,5 +550,4 @@ protected:
} // namespace lldb_private
#endif // #if defined(__cplusplus)
#endif // liblldb_File_h_

View File

@ -51,7 +51,7 @@ public:
static const NativeSocket kInvalidSocketValue;
Socket(NativeSocket socket, SocketProtocol protocol, bool should_close);
~Socket();
~Socket() override;
// Initialize a Tcp Socket object in listening mode. listen and accept are implemented
// separately because the caller may wish to manipulate or query the socket after it is
@ -95,14 +95,14 @@ public:
NativeSocket GetNativeSocket () const { return m_socket; }
SocketProtocol GetSocketProtocol () const { return m_protocol; }
virtual Error Read (void *buf, size_t &num_bytes);
virtual Error Write (const void *buf, size_t &num_bytes);
Error Read (void *buf, size_t &num_bytes) override;
Error Write (const void *buf, size_t &num_bytes) override;
virtual Error PreDisconnect ();
virtual Error Close ();
Error Close() override;
virtual bool IsValid () const { return m_socket != kInvalidSocketValue; }
virtual WaitableHandle GetWaitableHandle ();
bool IsValid () const override { return m_socket != kInvalidSocketValue; }
WaitableHandle GetWaitableHandle () override;
static bool
DecodeHostAndPort (llvm::StringRef host_and_port,
@ -116,6 +116,7 @@ protected:
NativeSocket m_socket;
SocketAddress m_udp_send_sockaddr; // Send address used for UDP connections.
};
}
#endif
} // namespace lldb_private
#endif // liblldb_Host_Socket_h_

View File

@ -40,7 +40,7 @@ class ConnectionFileDescriptor : public Connection
ConnectionFileDescriptor(Socket* socket);
virtual ~ConnectionFileDescriptor();
~ConnectionFileDescriptor() override;
bool IsConnected() const override;

View File

@ -22,13 +22,14 @@ class HostThreadPosix : public HostNativeThreadBase
public:
HostThreadPosix();
HostThreadPosix(lldb::thread_t thread);
virtual ~HostThreadPosix();
~HostThreadPosix() override;
Error Join(lldb::thread_result_t *result) override;
Error Cancel() override;
Error Detach();
};
}
#endif
} // namespace lldb_private
#endif // lldb_Host_posix_HostThreadPosix_h_

View File

@ -18,7 +18,7 @@ class LockFilePosix : public LockFileBase
{
public:
explicit LockFilePosix (int fd);
~LockFilePosix ();
~LockFilePosix () override;
protected:
Error