Fix Clang-tidy modernize-use-override warnings in some files in source/Plugins; other minor fixes.

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

llvm-svn: 250872
This commit is contained in:
Eugene Zelenko 2015-10-21 01:03:30 +00:00
parent 9a6940cef4
commit 4c3f2b9446
16 changed files with 342 additions and 348 deletions

View File

@ -7,8 +7,9 @@
//
//===----------------------------------------------------------------------===//
#include "DisassemblerLLVMC.h"
// C Includes
// C++ Includes
// Project includes
#include "llvm-c/Disassembler.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCContext.h"
@ -25,6 +26,8 @@
#include "llvm/Support/TargetSelect.h"
#include "llvm/ADT/SmallString.h"
// Other libraries and framework includes
#include "DisassemblerLLVMC.h"
#include "lldb/Core/Address.h"
#include "lldb/Core/DataExtractor.h"
@ -58,13 +61,10 @@ public:
{
}
virtual
~InstructionLLVMC ()
{
}
~InstructionLLVMC() override = default;
virtual bool
DoesBranch ()
bool
DoesBranch() override
{
if (m_does_branch == eLazyBoolCalculate)
{
@ -100,8 +100,8 @@ public:
return m_does_branch == eLazyBoolYes;
}
virtual bool
HasDelaySlot ()
bool
HasDelaySlot() override
{
if (m_has_delay_slot == eLazyBoolCalculate)
{
@ -155,10 +155,10 @@ public:
return llvm_disasm.m_disasm_ap.get();
}
virtual size_t
Decode (const lldb_private::Disassembler &disassembler,
const lldb_private::DataExtractor &data,
lldb::offset_t data_offset)
size_t
Decode(const lldb_private::Disassembler &disassembler,
const lldb_private::DataExtractor &data,
lldb::offset_t data_offset) override
{
// All we have to do is read the opcode which can be easy for some
// architectures
@ -272,8 +272,8 @@ public:
}
}
virtual void
CalculateMnemonicOperandsAndComment (const lldb_private::ExecutionContext *exe_ctx)
void
CalculateMnemonicOperandsAndComment(const lldb_private::ExecutionContext *exe_ctx) override
{
DataExtractor data;
const AddressClass address_class = GetAddressClass ();
@ -452,8 +452,6 @@ protected:
bool m_using_file_addr;
};
DisassemblerLLVMC::LLVMCDisassembler::LLVMCDisassembler (const char *triple, const char *cpu, const char *features_str, unsigned flavor, DisassemblerLLVMC &owner):
m_is_valid(true)
{
@ -521,10 +519,6 @@ DisassemblerLLVMC::LLVMCDisassembler::LLVMCDisassembler (const char *triple, con
m_is_valid = false;
}
DisassemblerLLVMC::LLVMCDisassembler::~LLVMCDisassembler()
{
}
uint64_t
DisassemblerLLVMC::LLVMCDisassembler::GetMCInst (const uint8_t *opcode_data,
size_t opcode_data_len,
@ -605,7 +599,6 @@ DisassemblerLLVMC::FlavorValidForArchSpec (const lldb_private::ArchSpec &arch, c
return false;
}
Disassembler *
DisassemblerLLVMC::CreateInstance (const ArchSpec &arch, const char *flavor)
{
@ -782,10 +775,6 @@ DisassemblerLLVMC::DisassemblerLLVMC (const ArchSpec &arch, const char *flavor_s
}
}
DisassemblerLLVMC::~DisassemblerLLVMC()
{
}
size_t
DisassemblerLLVMC::DecodeInstructions (const Address &base_addr,
const DataExtractor& data,

View File

@ -10,10 +10,19 @@
#ifndef liblldb_DisassemblerLLVMC_h_
#define liblldb_DisassemblerLLVMC_h_
// C Includes
// C++ Includes
#include <string>
// Other libraries and framework includes
#include "llvm-c/Disassembler.h"
// Project includes
#include "lldb/Core/Address.h"
#include "lldb/Core/Disassembler.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Host/Mutex.h"
// Opaque references to C++ Objects in LLVM's MC.
namespace llvm
{
@ -25,12 +34,7 @@ namespace llvm
class MCInstPrinter;
class MCAsmInfo;
class MCSubtargetInfo;
}
#include "lldb/Core/Address.h"
#include "lldb/Core/Disassembler.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Host/Mutex.h"
} // namespace llvm
class InstructionLLVMC;
@ -43,7 +47,7 @@ class DisassemblerLLVMC : public lldb_private::Disassembler
public:
LLVMCDisassembler (const char *triple, const char *cpu, const char *features_str, unsigned flavor, DisassemblerLLVMC &owner);
~LLVMCDisassembler();
~LLVMCDisassembler() = default;
uint64_t GetMCInst (const uint8_t *opcode_data, size_t opcode_data_len, lldb::addr_t pc, llvm::MCInst &mc_inst);
uint64_t PrintMCInst (llvm::MCInst &mc_inst, char *output_buffer, size_t out_buffer_len);
@ -67,6 +71,10 @@ class DisassemblerLLVMC : public lldb_private::Disassembler
};
public:
DisassemblerLLVMC(const lldb_private::ArchSpec &arch, const char *flavor /* = NULL */);
~DisassemblerLLVMC() override = default;
//------------------------------------------------------------------
// Static Functions
//------------------------------------------------------------------
@ -82,33 +90,28 @@ public:
static lldb_private::Disassembler *
CreateInstance(const lldb_private::ArchSpec &arch, const char *flavor);
DisassemblerLLVMC(const lldb_private::ArchSpec &arch, const char *flavor /* = NULL */);
virtual
~DisassemblerLLVMC();
virtual size_t
DecodeInstructions (const lldb_private::Address &base_addr,
const lldb_private::DataExtractor& data,
lldb::offset_t data_offset,
size_t num_instructions,
bool append,
bool data_from_file);
size_t
DecodeInstructions(const lldb_private::Address &base_addr,
const lldb_private::DataExtractor& data,
lldb::offset_t data_offset,
size_t num_instructions,
bool append,
bool data_from_file) override;
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
virtual lldb_private::ConstString
GetPluginName();
lldb_private::ConstString
GetPluginName() override;
virtual uint32_t
GetPluginVersion();
uint32_t
GetPluginVersion() override;
protected:
friend class InstructionLLVMC;
virtual bool
FlavorValidForArchSpec (const lldb_private::ArchSpec &arch, const char *flavor);
bool
FlavorValidForArchSpec(const lldb_private::ArchSpec &arch, const char *flavor) override;
bool
IsValid()
@ -164,4 +167,4 @@ protected:
std::unique_ptr<LLVMCDisassembler> m_alternate_disasm_ap;
};
#endif // liblldb_DisassemblerLLVM_h_
#endif // liblldb_DisassemblerLLVM_h_

View File

@ -12,12 +12,11 @@
// C Includes
// C++ Includes
#include <map>
#include <vector>
#include <string>
// Other libraries and framework includes
// Project includes
#include "lldb/Target/DynamicLoader.h"
#include "lldb/Host/FileSpec.h"
#include "lldb/Host/TimeValue.h"
@ -28,6 +27,10 @@
class DynamicLoaderDarwinKernel : public lldb_private::DynamicLoader
{
public:
DynamicLoaderDarwinKernel(lldb_private::Process *process, lldb::addr_t kernel_addr);
~DynamicLoaderDarwinKernel() override;
//------------------------------------------------------------------
// Static Functions
//------------------------------------------------------------------
@ -49,38 +52,33 @@ public:
static void
DebuggerInitialize (lldb_private::Debugger &debugger);
DynamicLoaderDarwinKernel (lldb_private::Process *process, lldb::addr_t kernel_addr);
virtual
~DynamicLoaderDarwinKernel ();
//------------------------------------------------------------------
/// Called after attaching a process.
///
/// Allow DynamicLoader plug-ins to execute some code after
/// attaching to a process.
//------------------------------------------------------------------
virtual void
DidAttach ();
void
DidAttach() override;
virtual void
DidLaunch ();
void
DidLaunch() override;
virtual lldb::ThreadPlanSP
GetStepThroughTrampolinePlan (lldb_private::Thread &thread,
bool stop_others);
lldb::ThreadPlanSP
GetStepThroughTrampolinePlan(lldb_private::Thread &thread,
bool stop_others) override;
virtual lldb_private::Error
CanLoadImage ();
lldb_private::Error
CanLoadImage() override;
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
virtual lldb_private::ConstString
GetPluginName();
lldb_private::ConstString
GetPluginName() override;
virtual uint32_t
GetPluginVersion();
uint32_t
GetPluginVersion() override;
protected:
void
@ -263,7 +261,6 @@ protected:
lldb::addr_t m_load_address;
uint64_t m_size;
bool m_kernel_image; // true if this is the kernel, false if this is a kext
};
struct OSKextLoadedKextSummaryHeader
@ -371,4 +368,4 @@ private:
DISALLOW_COPY_AND_ASSIGN (DynamicLoaderDarwinKernel);
};
#endif // liblldb_DynamicLoaderDarwinKernel_h_
#endif // liblldb_DynamicLoaderDarwinKernel_h_

View File

@ -7,12 +7,13 @@
//
//===----------------------------------------------------------------------===//
#ifndef liblldb_DynamicLoaderHexagon_H_
#define liblldb_DynamicLoaderHexagon_H_
#ifndef liblldb_DynamicLoaderHexagonDYLD_h_
#define liblldb_DynamicLoaderHexagonDYLD_h_
// C Includes
// C++ Includes
// Other libraries and framework includes
// Project includes
#include "lldb/Breakpoint/StoppointCallbackContext.h"
#include "lldb/Target/DynamicLoader.h"
@ -21,6 +22,9 @@
class DynamicLoaderHexagonDYLD : public lldb_private::DynamicLoader
{
public:
DynamicLoaderHexagonDYLD(lldb_private::Process *process);
~DynamicLoaderHexagonDYLD() override;
static void
Initialize();
@ -37,38 +41,33 @@ public:
static lldb_private::DynamicLoader *
CreateInstance(lldb_private::Process *process, bool force);
DynamicLoaderHexagonDYLD(lldb_private::Process *process);
virtual
~DynamicLoaderHexagonDYLD();
//------------------------------------------------------------------
// DynamicLoader protocol
//------------------------------------------------------------------
virtual void
void
DidAttach() override;
virtual void
void
DidLaunch() override;
lldb::ThreadPlanSP
GetStepThroughTrampolinePlan(lldb_private::Thread &thread,
bool stop_others) override;
virtual lldb_private::Error
lldb_private::Error
CanLoadImage() override;
virtual lldb::addr_t
GetThreadLocalData (const lldb::ModuleSP module, const lldb::ThreadSP thread) override;
lldb::addr_t
GetThreadLocalData(const lldb::ModuleSP module, const lldb::ThreadSP thread) override;
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
virtual lldb_private::ConstString
lldb_private::ConstString
GetPluginName() override;
virtual uint32_t
uint32_t
GetPluginVersion() override;
protected:
@ -168,10 +167,10 @@ protected:
FindRendezvousBreakpointAddress( );
private:
DISALLOW_COPY_AND_ASSIGN(DynamicLoaderHexagonDYLD);
const lldb_private::SectionList *
GetSectionListFromModule(const lldb::ModuleSP module) const;
DISALLOW_COPY_AND_ASSIGN(DynamicLoaderHexagonDYLD);
};
#endif // liblldb_DynamicLoaderHexagonDYLD_H_
#endif // liblldb_DynamicLoaderHexagonDYLD_h_

View File

@ -12,23 +12,25 @@
// C Includes
// C++ Includes
#include <map>
#include <vector>
#include <string>
// Other libraries and framework includes
// Project includes
#include "lldb/Target/DynamicLoader.h"
#include "lldb/Host/FileSpec.h"
#include "lldb/Core/StructuredData.h"
#include "lldb/Core/UUID.h"
#include "lldb/Host/Mutex.h"
#include "lldb/Target/Process.h"
// Other libraries and framework includes
#include "lldb/Utility/SafeMachO.h"
class DynamicLoaderMacOSXDYLD : public lldb_private::DynamicLoader
{
public:
DynamicLoaderMacOSXDYLD(lldb_private::Process *process);
~DynamicLoaderMacOSXDYLD() override;
//------------------------------------------------------------------
// Static Functions
//------------------------------------------------------------------
@ -47,48 +49,44 @@ public:
static lldb_private::DynamicLoader *
CreateInstance (lldb_private::Process *process, bool force);
DynamicLoaderMacOSXDYLD (lldb_private::Process *process);
virtual
~DynamicLoaderMacOSXDYLD ();
//------------------------------------------------------------------
/// Called after attaching a process.
///
/// Allow DynamicLoader plug-ins to execute some code after
/// attaching to a process.
//------------------------------------------------------------------
virtual void
DidAttach ();
void
DidAttach() override;
virtual void
DidLaunch ();
void
DidLaunch() override;
virtual bool
ProcessDidExec ();
bool
ProcessDidExec() override;
virtual lldb::ThreadPlanSP
GetStepThroughTrampolinePlan (lldb_private::Thread &thread,
bool stop_others);
lldb::ThreadPlanSP
GetStepThroughTrampolinePlan(lldb_private::Thread &thread,
bool stop_others) override;
virtual size_t
FindEquivalentSymbols (lldb_private::Symbol *original_symbol,
lldb_private::ModuleList &module_list,
lldb_private::SymbolContextList &equivalent_symbols);
size_t
FindEquivalentSymbols(lldb_private::Symbol *original_symbol,
lldb_private::ModuleList &module_list,
lldb_private::SymbolContextList &equivalent_symbols) override;
virtual lldb_private::Error
CanLoadImage ();
lldb_private::Error
CanLoadImage() override;
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
virtual lldb_private::ConstString
GetPluginName();
lldb_private::ConstString
GetPluginName() override;
virtual uint32_t
GetPluginVersion();
uint32_t
GetPluginVersion() override;
virtual bool
AlwaysRelyOnEHUnwindInfo (lldb_private::SymbolContext &sym_ctx);
bool
AlwaysRelyOnEHUnwindInfo(lldb_private::SymbolContext &sym_ctx) override;
protected:
void
@ -97,6 +95,7 @@ protected:
void
PrivateProcessStateChanged (lldb_private::Process *process,
lldb::StateType state);
bool
LocateDYLD ();
@ -128,10 +127,10 @@ protected:
ReadMachHeader (lldb::addr_t addr,
llvm::MachO::mach_header *header,
lldb_private::DataExtractor *load_command_data);
class Segment
{
public:
Segment() :
name(),
vmaddr(LLDB_INVALID_ADDRESS),
@ -383,4 +382,4 @@ private:
DISALLOW_COPY_AND_ASSIGN (DynamicLoaderMacOSXDYLD);
};
#endif // liblldb_DynamicLoaderMacOSXDYLD_h_
#endif // liblldb_DynamicLoaderMacOSXDYLD_h_

View File

@ -1,4 +1,4 @@
//===-- DynamicLoaderPOSIX.h ------------------------------------*- C++ -*-===//
//===-- DynamicLoaderPOSIXDYLD.h --------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@ -7,12 +7,13 @@
//
//===----------------------------------------------------------------------===//
#ifndef liblldb_DynamicLoaderPOSIX_H_
#define liblldb_DynamicLoaderPOSIX_H_
#ifndef liblldb_DynamicLoaderPOSIXDYLD_h_
#define liblldb_DynamicLoaderPOSIXDYLD_h_
// C Includes
// C++ Includes
// Other libraries and framework includes
// Project includes
#include "lldb/Breakpoint/StoppointCallbackContext.h"
#include "lldb/Target/DynamicLoader.h"
@ -23,6 +24,9 @@ class AuxVector;
class DynamicLoaderPOSIXDYLD : public lldb_private::DynamicLoader
{
public:
DynamicLoaderPOSIXDYLD(lldb_private::Process *process);
~DynamicLoaderPOSIXDYLD() override;
static void
Initialize();
@ -39,38 +43,33 @@ public:
static lldb_private::DynamicLoader *
CreateInstance(lldb_private::Process *process, bool force);
DynamicLoaderPOSIXDYLD(lldb_private::Process *process);
virtual
~DynamicLoaderPOSIXDYLD();
//------------------------------------------------------------------
// DynamicLoader protocol
//------------------------------------------------------------------
virtual void
void
DidAttach() override;
virtual void
void
DidLaunch() override;
lldb::ThreadPlanSP
GetStepThroughTrampolinePlan(lldb_private::Thread &thread,
bool stop_others) override;
virtual lldb_private::Error
lldb_private::Error
CanLoadImage() override;
virtual lldb::addr_t
GetThreadLocalData (const lldb::ModuleSP module, const lldb::ThreadSP thread) override;
lldb::addr_t
GetThreadLocalData(const lldb::ModuleSP module, const lldb::ThreadSP thread) override;
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
virtual lldb_private::ConstString
lldb_private::ConstString
GetPluginName() override;
virtual uint32_t
uint32_t
GetPluginVersion() override;
protected:
@ -168,4 +167,4 @@ private:
DISALLOW_COPY_AND_ASSIGN(DynamicLoaderPOSIXDYLD);
};
#endif // liblldb_DynamicLoaderPOSIXDYLD_H_
#endif // liblldb_DynamicLoaderPOSIXDYLD_h_

View File

@ -12,12 +12,8 @@
// C Includes
// C++ Includes
#include <map>
#include <vector>
#include <string>
// Other libraries and framework includes
// Project includes
#include "lldb/Target/DynamicLoader.h"
#include "lldb/Host/FileSpec.h"
#include "lldb/Core/UUID.h"
@ -27,6 +23,10 @@
class DynamicLoaderStatic : public lldb_private::DynamicLoader
{
public:
DynamicLoaderStatic(lldb_private::Process *process);
~DynamicLoaderStatic() override;
//------------------------------------------------------------------
// Static Functions
//------------------------------------------------------------------
@ -45,37 +45,33 @@ public:
static lldb_private::DynamicLoader *
CreateInstance (lldb_private::Process *process, bool force);
DynamicLoaderStatic (lldb_private::Process *process);
virtual
~DynamicLoaderStatic ();
//------------------------------------------------------------------
/// Called after attaching a process.
///
/// Allow DynamicLoader plug-ins to execute some code after
/// attaching to a process.
//------------------------------------------------------------------
virtual void
DidAttach ();
void
DidAttach() override;
virtual void
DidLaunch ();
void
DidLaunch() override;
virtual lldb::ThreadPlanSP
GetStepThroughTrampolinePlan (lldb_private::Thread &thread,
bool stop_others);
lldb::ThreadPlanSP
GetStepThroughTrampolinePlan(lldb_private::Thread &thread,
bool stop_others) override;
virtual lldb_private::Error
CanLoadImage ();
lldb_private::Error
CanLoadImage() override;
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
virtual lldb_private::ConstString
GetPluginName();
lldb_private::ConstString
GetPluginName() override;
virtual uint32_t
GetPluginVersion();
uint32_t
GetPluginVersion() override;
private:
void
@ -84,4 +80,4 @@ private:
DISALLOW_COPY_AND_ASSIGN (DynamicLoaderStatic);
};
#endif // liblldb_DynamicLoaderStatic_h_
#endif // liblldb_DynamicLoaderStatic_h_

View File

@ -1,4 +1,4 @@
//===-- DynamicLoaderWindowsDYLDh ----------------------------------*- C++ -*-===//
//===-- DynamicLoaderWindowsDYLD.h ------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@ -7,9 +7,13 @@
//
//===----------------------------------------------------------------------===//
#ifndef liblldb_Plugins_Process_Windows_DynamicLoaderWindowsDYLD_H_
#define liblldb_Plugins_Process_Windows_DynamicLoaderWindowsDYLD_H_
#ifndef liblldb_Plugins_Process_Windows_DynamicLoaderWindowsDYLD_h_
#define liblldb_Plugins_Process_Windows_DynamicLoaderWindowsDYLD_h_
// C Includes
// C++ Includes
// Other libraries and framework includes
// Project includes
#include "lldb/lldb-forward.h"
#include "lldb/Target/DynamicLoader.h"
@ -18,15 +22,16 @@ namespace lldb_private
class DynamicLoaderWindowsDYLD : public DynamicLoader
{
public:
public:
DynamicLoaderWindowsDYLD(Process *process);
~DynamicLoaderWindowsDYLD() override;
static void Initialize();
static void Terminate();
static ConstString GetPluginNameStatic();
static const char *GetPluginDescriptionStatic();
DynamicLoaderWindowsDYLD(Process *process);
virtual ~DynamicLoaderWindowsDYLD();
static DynamicLoader *CreateInstance(Process *process, bool force);
void DidAttach() override;
@ -37,6 +42,7 @@ class DynamicLoaderWindowsDYLD : public DynamicLoader
ConstString GetPluginName() override;
uint32_t GetPluginVersion() override;
};
}
#endif
} // namespace lldb_private
#endif // liblldb_Plugins_Process_Windows_DynamicLoaderWindowsDYLD_h_

View File

@ -7,36 +7,9 @@
//
//===----------------------------------------------------------------------===//
#include "ClangExpressionParser.h"
#include "ClangASTSource.h"
#include "ClangExpressionHelper.h"
#include "ClangExpressionDeclMap.h"
#include "ClangModulesDeclVendor.h"
#include "ClangPersistentVariables.h"
#include "IRForTarget.h"
#include "lldb/Core/ArchSpec.h"
#include "lldb/Core/DataBufferHeap.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/Disassembler.h"
#include "lldb/Core/Log.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/Stream.h"
#include "lldb/Core/StreamFile.h"
#include "lldb/Core/StreamString.h"
#include "lldb/Expression/IRExecutionUnit.h"
#include "lldb/Expression/IRDynamicChecks.h"
#include "lldb/Expression/IRInterpreter.h"
#include "lldb/Host/File.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Symbol/ClangASTContext.h"
#include "lldb/Symbol/SymbolVendor.h"
#include "lldb/Target/ExecutionContext.h"
#include "lldb/Target/ObjCLanguageRuntime.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/Target.h"
// C Includes
// C++ Includes
// Other libraries and framework includes
#include "clang/AST/ASTContext.h"
#include "clang/AST/ExternalASTSource.h"
#include "clang/Basic/FileManager.h"
@ -73,6 +46,37 @@
#include "llvm/Support/Host.h"
#include "llvm/Support/Signals.h"
// Project includes
#include "ClangExpressionParser.h"
#include "ClangASTSource.h"
#include "ClangExpressionHelper.h"
#include "ClangExpressionDeclMap.h"
#include "ClangModulesDeclVendor.h"
#include "ClangPersistentVariables.h"
#include "IRForTarget.h"
#include "lldb/Core/ArchSpec.h"
#include "lldb/Core/DataBufferHeap.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/Disassembler.h"
#include "lldb/Core/Log.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/Stream.h"
#include "lldb/Core/StreamFile.h"
#include "lldb/Core/StreamString.h"
#include "lldb/Expression/IRExecutionUnit.h"
#include "lldb/Expression/IRDynamicChecks.h"
#include "lldb/Expression/IRInterpreter.h"
#include "lldb/Host/File.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Symbol/ClangASTContext.h"
#include "lldb/Symbol/SymbolVendor.h"
#include "lldb/Target/ExecutionContext.h"
#include "lldb/Target/ObjCLanguageRuntime.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/Target.h"
using namespace clang;
using namespace llvm;
using namespace lldb_private;
@ -103,6 +107,7 @@ class ClangExpressionParser::LLDBPreprocessorCallbacks : public PPCallbacks
ClangPersistentVariables &m_persistent_vars;
StreamString m_error_stream;
bool m_has_errors = false;
public:
LLDBPreprocessorCallbacks(ClangModulesDeclVendor &decl_vendor,
ClangPersistentVariables &persistent_vars) :
@ -111,9 +116,10 @@ public:
{
}
virtual void moduleImport(SourceLocation import_location,
clang::ModuleIdPath path,
const clang::Module * /*null*/)
void
moduleImport(SourceLocation import_location,
clang::ModuleIdPath path,
const clang::Module * /*null*/) override
{
std::vector<ConstString> string_path;

View File

@ -1,4 +1,4 @@
//===-- ClangFunctionCaller.h -----------------------------------------*- C++ -*-===//
//===-- ClangFunctionCaller.h -----------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@ -12,8 +12,6 @@
// C Includes
// C++ Includes
#include <vector>
#include <list>
// Other libraries and framework includes
// Project includes
#include "ClangExpressionHelper.h"
@ -78,7 +76,7 @@ class ClangFunctionCaller : public FunctionCaller
{
}
~ClangFunctionCallerHelper() {}
~ClangFunctionCallerHelper() override = default;
//------------------------------------------------------------------
/// Return the object that the parser should use when resolving external
@ -100,6 +98,7 @@ class ClangFunctionCaller : public FunctionCaller
//------------------------------------------------------------------
clang::ASTConsumer *
ASTTransformer(clang::ASTConsumer *passthrough) override;
private:
ClangFunctionCaller &m_owner;
std::unique_ptr<ASTStructExtractor> m_struct_extractor; ///< The class that generates the argument struct layout.
@ -133,9 +132,6 @@ public:
const ValueList &arg_value_list,
const char *name);
//------------------------------------------------------------------
/// Destructor
//------------------------------------------------------------------
~ClangFunctionCaller() override;
//------------------------------------------------------------------
@ -155,11 +151,13 @@ public:
{
return &m_type_system_helper;
}
protected:
const char *GetWrapperStructName()
{
return m_wrapper_struct_name.c_str();
}
private:
//------------------------------------------------------------------
// For ClangFunctionCaller only
@ -168,9 +166,8 @@ private:
// Note: the parser needs to be destructed before the execution unit, so
// declare the execution unit first.
ClangFunctionCallerHelper m_type_system_helper;
};
} // Namespace lldb_private
} // namespace lldb_private
#endif // liblldb_ClangFunctionCaller_h_

View File

@ -7,8 +7,20 @@
//
//===----------------------------------------------------------------------===//
#include <mutex> // std::once
// C Includes
// C++ Includes
#include <mutex>
// Other libraries and framework includes
#include "clang/Basic/TargetInfo.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/FrontendActions.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Parse/Parser.h"
#include "clang/Sema/Lookup.h"
#include "clang/Serialization/ASTReader.h"
// Project includes
#include "ClangModulesDeclVendor.h"
#include "lldb/Core/Log.h"
@ -20,15 +32,6 @@
#include "lldb/Target/Target.h"
#include "lldb/Utility/LLDBAssert.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/FrontendActions.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Parse/Parser.h"
#include "clang/Sema/Lookup.h"
#include "clang/Serialization/ASTReader.h"
using namespace lldb_private;
namespace {
@ -38,14 +41,17 @@ namespace {
{
public:
StoringDiagnosticConsumer ();
void
HandleDiagnostic (clang::DiagnosticsEngine::Level DiagLevel, const clang::Diagnostic &info);
HandleDiagnostic(clang::DiagnosticsEngine::Level DiagLevel,
const clang::Diagnostic &info) override;
void
ClearDiagnostics ();
void
DumpDiagnostics (Stream &error_stream);
private:
typedef std::pair<clang::DiagnosticsEngine::Level, std::string> IDAndDiagnostic;
std::vector<IDAndDiagnostic> m_diagnostics;
@ -62,28 +68,28 @@ namespace {
std::unique_ptr<clang::CompilerInstance> &&compiler_instance,
std::unique_ptr<clang::Parser> &&parser);
virtual bool
~ClangModulesDeclVendorImpl() override = default;
bool
AddModule(ModulePath &path,
ModuleVector *exported_modules,
Stream &error_stream) override;
virtual bool
bool
AddModulesForCompileUnit(CompileUnit &cu,
ModuleVector &exported_modules,
Stream &error_stream) override;
virtual uint32_t
FindDecls (const ConstString &name,
bool append,
uint32_t max_matches,
std::vector <clang::NamedDecl*> &decls) override;
uint32_t
FindDecls(const ConstString &name,
bool append,
uint32_t max_matches,
std::vector <clang::NamedDecl*> &decls) override;
virtual void
void
ForEachMacro(const ModuleVector &modules,
std::function<bool (const std::string &)> handler) override;
~ClangModulesDeclVendorImpl();
private:
void
ReportModuleExportsHelper (std::set<ClangModulesDeclVendor::ModuleID> &exports,
@ -110,7 +116,7 @@ namespace {
ImportedModuleMap m_imported_modules;
ImportedModuleSet m_user_imported_modules;
};
}
} // anonymous namespace
StoringDiagnosticConsumer::StoringDiagnosticConsumer ()
{
@ -164,7 +170,6 @@ GetResourceDir ()
return g_cached_resource_dir;
}
ClangModulesDeclVendor::ClangModulesDeclVendor()
{
}
@ -318,7 +323,6 @@ ClangModulesDeclVendorImpl::AddModule(ModulePath &path,
return false;
}
bool
ClangModulesDeclVendor::LanguageSupportsClangModules (lldb::LanguageType language)
{
@ -597,10 +601,6 @@ ClangModulesDeclVendorImpl::ForEachMacro(const ClangModulesDeclVendor::ModuleVec
}
}
ClangModulesDeclVendorImpl::~ClangModulesDeclVendorImpl()
{
}
clang::ModuleLoadResult
ClangModulesDeclVendorImpl::DoGetModule(clang::ModuleIdPath path,
bool make_visible)

View File

@ -10,13 +10,17 @@
#ifndef liblldb_ClangPersistentVariables_h_
#define liblldb_ClangPersistentVariables_h_
// C Includes
// C++ Includes
// Other libraries and framework includes
#include "llvm/ADT/DenseMap.h"
// Project includes
#include "ClangExpressionVariable.h"
#include "ClangModulesDeclVendor.h"
#include "lldb/Expression/ExpressionVariable.h"
#include "llvm/ADT/DenseMap.h"
namespace lldb_private
{
@ -31,13 +35,9 @@ namespace lldb_private
class ClangPersistentVariables : public PersistentExpressionState
{
public:
ClangPersistentVariables();
//----------------------------------------------------------------------
/// Constructor
//----------------------------------------------------------------------
ClangPersistentVariables ();
~ClangPersistentVariables () { }
~ClangPersistentVariables() override = default;
//------------------------------------------------------------------
// llvm casting support
@ -101,6 +101,6 @@ private:
///< priority source for macros.
};
}
} // namespace lldb_private
#endif
#endif // liblldb_ClangPersistentVariables_h_

View File

@ -12,13 +12,10 @@
// C Includes
// C++ Includes
#include <string>
#include <map>
#include <vector>
// Other libraries and framework includes
// Project includes
#include "ASTStructExtractor.h"
#include "ASTResultSynthesizer.h"
#include "ClangExpressionDeclMap.h"
@ -49,10 +46,8 @@ namespace lldb_private
class ClangUserExpression : public UserExpression
{
public:
enum { kDefaultTimeout = 500000u };
class ClangUserExpressionHelper : public ClangExpressionHelper
{
public:
@ -61,7 +56,7 @@ public:
{
}
~ClangUserExpressionHelper() {}
~ClangUserExpressionHelper() override = default;
//------------------------------------------------------------------
/// Return the object that the parser should use when resolving external
@ -92,6 +87,7 @@ public:
//------------------------------------------------------------------
clang::ASTConsumer *
ASTTransformer(clang::ASTConsumer *passthrough) override;
private:
Target &m_target;
std::unique_ptr<ClangExpressionDeclMap> m_expr_decl_map_up;
@ -124,9 +120,6 @@ public:
lldb::LanguageType language,
ResultType desired_type);
//------------------------------------------------------------------
/// Destructor
//------------------------------------------------------------------
~ClangUserExpression() override;
//------------------------------------------------------------------
@ -209,6 +202,7 @@ private:
void RegisterPersistentState(PersistentExpressionState *persistent_state);
lldb::ExpressionVariableSP &GetVariable();
private:
PersistentExpressionState *m_persistent_state;
lldb::ExpressionVariableSP m_variable;

View File

@ -1,4 +1,4 @@
//===-- EmulateInstructionARM64.h ------------------------------------*- C++ -*-===//
//===-- EmulateInstructionARM64.h -------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@ -10,6 +10,10 @@
#ifndef EmulateInstructionARM64_h_
#define EmulateInstructionARM64_h_
// C Includes
// C++ Includes
// Other libraries and framework includes
// Project includes
#include "lldb/Core/EmulateInstruction.h"
#include "lldb/Core/Error.h"
#include "lldb/Interpreter/OptionValue.h"
@ -18,6 +22,14 @@
class EmulateInstructionARM64 : public lldb_private::EmulateInstruction
{
public:
EmulateInstructionARM64 (const lldb_private::ArchSpec &arch) :
EmulateInstruction (arch),
m_opcode_pstate (),
m_emulated_pstate (),
m_ignore_conditions (false)
{
}
static void
Initialize ();
@ -50,54 +62,45 @@ public:
return false;
}
virtual lldb_private::ConstString
GetPluginName();
lldb_private::ConstString
GetPluginName() override;
virtual uint32_t
GetPluginVersion()
uint32_t
GetPluginVersion() override
{
return 1;
}
bool
SetTargetTriple (const lldb_private::ArchSpec &arch);
SetTargetTriple(const lldb_private::ArchSpec &arch) override;
EmulateInstructionARM64 (const lldb_private::ArchSpec &arch) :
EmulateInstruction (arch),
m_opcode_pstate (),
m_emulated_pstate (),
m_ignore_conditions (false)
{
}
virtual bool
SupportsEmulatingInstructionsOfType (lldb_private::InstructionType inst_type)
bool
SupportsEmulatingInstructionsOfType(lldb_private::InstructionType inst_type) override
{
return SupportsEmulatingInstructionsOfTypeStatic (inst_type);
}
virtual bool
ReadInstruction ();
bool
ReadInstruction() override;
virtual bool
EvaluateInstruction (uint32_t evaluate_options);
bool
EvaluateInstruction(uint32_t evaluate_options) override;
virtual bool
TestEmulation (lldb_private::Stream *out_stream,
lldb_private::ArchSpec &arch,
lldb_private::OptionValueDictionary *test_data)
bool
TestEmulation(lldb_private::Stream *out_stream,
lldb_private::ArchSpec &arch,
lldb_private::OptionValueDictionary *test_data) override
{
return false;
}
virtual bool
GetRegisterInfo (lldb::RegisterKind reg_kind,
uint32_t reg_num,
lldb_private::RegisterInfo &reg_info);
virtual bool
CreateFunctionEntryUnwind (lldb_private::UnwindPlan &unwind_plan);
bool
GetRegisterInfo(lldb::RegisterKind reg_kind,
uint32_t reg_num,
lldb_private::RegisterInfo &reg_info) override;
bool
CreateFunctionEntryUnwind(lldb_private::UnwindPlan &unwind_plan) override;
typedef enum
{
@ -136,7 +139,6 @@ public:
BitwiseOp_RBIT
} BitwiseOp;
typedef enum
{
EL0 = 0,
@ -246,7 +248,6 @@ public:
} ProcState;
protected:
typedef struct
{
uint32_t mask;
@ -297,4 +298,4 @@ protected:
bool m_ignore_conditions;
};
#endif // EmulateInstructionARM64_h_
#endif // EmulateInstructionARM64_h_

View File

@ -1,4 +1,4 @@
//===-- EmulateInstructionMIPS64.h ------------------------------------*- C++ -*-===//
//===-- EmulateInstructionMIPS64.h ------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@ -10,6 +10,14 @@
#ifndef EmulateInstructionMIPS64_h_
#define EmulateInstructionMIPS64_h_
// C Includes
// C++ Includes
// Other libraries and framework includes
// Project includes
#include "lldb/Core/EmulateInstruction.h"
#include "lldb/Core/Error.h"
#include "lldb/Interpreter/OptionValue.h"
namespace llvm
{
class MCDisassembler;
@ -19,15 +27,13 @@ namespace llvm
class MCContext;
class MCInstrInfo;
class MCInst;
}
#include "lldb/Core/EmulateInstruction.h"
#include "lldb/Core/Error.h"
#include "lldb/Interpreter/OptionValue.h"
} // namespace llvm
class EmulateInstructionMIPS64 : public lldb_private::EmulateInstruction
{
public:
EmulateInstructionMIPS64(const lldb_private::ArchSpec &arch);
static void
Initialize ();
@ -60,51 +66,47 @@ public:
return false;
}
virtual lldb_private::ConstString
GetPluginName();
lldb_private::ConstString
GetPluginName() override;
virtual uint32_t
GetPluginVersion()
uint32_t
GetPluginVersion() override
{
return 1;
}
bool
SetTargetTriple (const lldb_private::ArchSpec &arch);
SetTargetTriple(const lldb_private::ArchSpec &arch) override;
EmulateInstructionMIPS64 (const lldb_private::ArchSpec &arch);
virtual bool
SupportsEmulatingInstructionsOfType (lldb_private::InstructionType inst_type)
bool
SupportsEmulatingInstructionsOfType(lldb_private::InstructionType inst_type) override
{
return SupportsEmulatingInstructionsOfTypeStatic (inst_type);
}
virtual bool
ReadInstruction ();
bool
ReadInstruction() override;
virtual bool
EvaluateInstruction (uint32_t evaluate_options);
bool
EvaluateInstruction(uint32_t evaluate_options) override;
virtual bool
TestEmulation (lldb_private::Stream *out_stream,
lldb_private::ArchSpec &arch,
lldb_private::OptionValueDictionary *test_data)
bool
TestEmulation(lldb_private::Stream *out_stream,
lldb_private::ArchSpec &arch,
lldb_private::OptionValueDictionary *test_data) override
{
return false;
}
virtual bool
GetRegisterInfo (lldb::RegisterKind reg_kind,
uint32_t reg_num,
lldb_private::RegisterInfo &reg_info);
virtual bool
CreateFunctionEntryUnwind (lldb_private::UnwindPlan &unwind_plan);
bool
GetRegisterInfo(lldb::RegisterKind reg_kind,
uint32_t reg_num,
lldb_private::RegisterInfo &reg_info) override;
bool
CreateFunctionEntryUnwind(lldb_private::UnwindPlan &unwind_plan) override;
protected:
typedef struct
{
const char *op_name;
@ -346,4 +348,4 @@ private:
std::unique_ptr<llvm::MCInstrInfo> m_insn_info;
};
#endif // EmulateInstructionMIPS64_h_
#endif // EmulateInstructionMIPS64_h_

View File

@ -10,6 +10,10 @@
#ifndef liblldb_AddressSanitizerRuntime_h_
#define liblldb_AddressSanitizerRuntime_h_
// C Includes
// C++ Includes
// Other libraries and framework includes
// Project includes
#include "lldb/lldb-private.h"
#include "lldb/Target/ABI.h"
#include "lldb/Target/InstrumentationRuntime.h"
@ -21,6 +25,7 @@ namespace lldb_private {
class AddressSanitizerRuntime : public lldb_private::InstrumentationRuntime
{
public:
~AddressSanitizerRuntime() override;
static lldb::InstrumentationRuntimeSP
CreateInstance (const lldb::ProcessSP &process_sp);
@ -37,25 +42,29 @@ public:
static lldb::InstrumentationRuntimeType
GetTypeStatic();
virtual
~AddressSanitizerRuntime();
virtual lldb_private::ConstString
GetPluginName() { return GetPluginNameStatic(); }
lldb_private::ConstString
GetPluginName() override
{
return GetPluginNameStatic();
}
virtual lldb::InstrumentationRuntimeType
GetType() { return GetTypeStatic(); }
virtual uint32_t
GetPluginVersion() { return 1; }
uint32_t
GetPluginVersion() override
{
return 1;
}
virtual void
ModulesDidLoad(lldb_private::ModuleList &module_list);
void
ModulesDidLoad(lldb_private::ModuleList &module_list) override;
virtual bool
IsActive();
bool
IsActive() override;
private:
AddressSanitizerRuntime(const lldb::ProcessSP &process_sp);
lldb::ProcessSP
GetProcessSP ()
@ -63,8 +72,6 @@ private:
return m_process_wp.lock();
}
AddressSanitizerRuntime(const lldb::ProcessSP &process_sp);
void
Activate();
@ -84,9 +91,8 @@ private:
lldb::ModuleSP m_runtime_module;
lldb::ProcessWP m_process_wp;
lldb::user_id_t m_breakpoint_id;
};
} // namespace lldb_private
#endif // liblldb_InstrumentationRuntime_h_
#endif // liblldb_AddressSanitizerRuntime_h_