Fix Clang-tidy misc-use-override warnings in include/lldb/Expression and include/lldb/Initialization, unify inclusion guards

patch by Eugene Zelenko.

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

llvm-svn: 245283
This commit is contained in:
Pavel Labath 2015-08-18 09:18:19 +00:00
parent 04ec69aa9e
commit 083645bc5c
12 changed files with 119 additions and 119 deletions

View File

@ -51,7 +51,7 @@ public:
//----------------------------------------------------------------------
/// Destructor
//----------------------------------------------------------------------
~ASTResultSynthesizer();
~ASTResultSynthesizer() override;
//----------------------------------------------------------------------
/// Link this consumer with a particular AST context
@ -60,7 +60,7 @@ public:
/// This AST context will be used for types and identifiers, and also
/// forwarded to the passthrough consumer, if one exists.
//----------------------------------------------------------------------
void Initialize(clang::ASTContext &Context);
void Initialize(clang::ASTContext &Context) override;
//----------------------------------------------------------------------
/// Examine a list of Decls to find the function $__lldb_expr and
@ -71,32 +71,32 @@ public:
/// which need to be searched recursively. That job falls to
/// TransformTopLevelDecl.
//----------------------------------------------------------------------
bool HandleTopLevelDecl(clang::DeclGroupRef D);
bool HandleTopLevelDecl(clang::DeclGroupRef D) override;
//----------------------------------------------------------------------
/// Passthrough stub
//----------------------------------------------------------------------
void HandleTranslationUnit(clang::ASTContext &Ctx);
void HandleTranslationUnit(clang::ASTContext &Ctx) override;
//----------------------------------------------------------------------
/// Passthrough stub
//----------------------------------------------------------------------
void HandleTagDeclDefinition(clang::TagDecl *D);
void HandleTagDeclDefinition(clang::TagDecl *D) override;
//----------------------------------------------------------------------
/// Passthrough stub
//----------------------------------------------------------------------
void CompleteTentativeDefinition(clang::VarDecl *D);
void CompleteTentativeDefinition(clang::VarDecl *D) override;
//----------------------------------------------------------------------
/// Passthrough stub
//----------------------------------------------------------------------
void HandleVTable(clang::CXXRecordDecl *RD);
void HandleVTable(clang::CXXRecordDecl *RD) override;
//----------------------------------------------------------------------
/// Passthrough stub
//----------------------------------------------------------------------
void PrintStats();
void PrintStats() override;
//----------------------------------------------------------------------
/// Set the Sema object to use when performing transforms, and pass it on
@ -105,12 +105,13 @@ public:
/// The Sema to use. Because Sema isn't externally visible, this class
/// casts it to an Action for actual use.
//----------------------------------------------------------------------
void InitializeSema(clang::Sema &S);
void InitializeSema(clang::Sema &S) override;
//----------------------------------------------------------------------
/// Reset the Sema to NULL now that transformations are done
//----------------------------------------------------------------------
void ForgetSema();
void ForgetSema() override;
private:
//----------------------------------------------------------------------
/// Hunt the given Decl for FunctionDecls named $__lldb_expr, recursing
@ -179,6 +180,6 @@ private:
clang::Sema *m_sema; ///< The Sema to use.
};
}
} // namespace lldb_private
#endif
#endif // liblldb_ASTResultSynthesizer_h_

View File

@ -59,7 +59,7 @@ public:
//----------------------------------------------------------------------
/// Destructor
//----------------------------------------------------------------------
virtual ~ASTStructExtractor();
~ASTStructExtractor() override;
//----------------------------------------------------------------------
/// Link this consumer with a particular AST context
@ -68,7 +68,7 @@ public:
/// This AST context will be used for types and identifiers, and also
/// forwarded to the passthrough consumer, if one exists.
//----------------------------------------------------------------------
void Initialize(clang::ASTContext &Context);
void Initialize(clang::ASTContext &Context) override;
//----------------------------------------------------------------------
/// Examine a list of Decls to find the function $__lldb_expr and
@ -79,32 +79,32 @@ public:
/// which need to be searched recursively. That job falls to
/// TransformTopLevelDecl.
//----------------------------------------------------------------------
bool HandleTopLevelDecl(clang::DeclGroupRef D);
bool HandleTopLevelDecl(clang::DeclGroupRef D) override;
//----------------------------------------------------------------------
/// Passthrough stub
//----------------------------------------------------------------------
void HandleTranslationUnit(clang::ASTContext &Ctx);
void HandleTranslationUnit(clang::ASTContext &Ctx) override;
//----------------------------------------------------------------------
/// Passthrough stub
//----------------------------------------------------------------------
void HandleTagDeclDefinition(clang::TagDecl *D);
void HandleTagDeclDefinition(clang::TagDecl *D) override;
//----------------------------------------------------------------------
/// Passthrough stub
//----------------------------------------------------------------------
void CompleteTentativeDefinition(clang::VarDecl *D);
void CompleteTentativeDefinition(clang::VarDecl *D) override;
//----------------------------------------------------------------------
/// Passthrough stub
//----------------------------------------------------------------------
void HandleVTable(clang::CXXRecordDecl *RD);
void HandleVTable(clang::CXXRecordDecl *RD) override;
//----------------------------------------------------------------------
/// Passthrough stub
//----------------------------------------------------------------------
void PrintStats();
void PrintStats() override;
//----------------------------------------------------------------------
/// Set the Sema object to use when performing transforms, and pass it on
@ -113,12 +113,13 @@ public:
/// The Sema to use. Because Sema isn't externally visible, this class
/// casts it to an Action for actual use.
//----------------------------------------------------------------------
void InitializeSema(clang::Sema &S);
void InitializeSema(clang::Sema &S) override;
//----------------------------------------------------------------------
/// Reset the Sema to NULL now that transformations are done
//----------------------------------------------------------------------
void ForgetSema();
void ForgetSema() override;
private:
//----------------------------------------------------------------------
/// Hunt the given FunctionDecl for the argument struct and place
@ -151,6 +152,6 @@ private:
std::string m_struct_name; ///< The name of the structure to extract.
};
}
} // namespace lldb_private
#endif
#endif // liblldb_ASTStructExtractor_h_

View File

@ -60,7 +60,7 @@ public:
//------------------------------------------------------------------
/// Destructor
//------------------------------------------------------------------
~ClangASTSource();
~ClangASTSource() override;
//------------------------------------------------------------------
/// Interface stubs.
@ -521,6 +521,6 @@ struct NameSearchContext {
void AddNamedDecl (clang::NamedDecl *decl);
};
}
} // namespace lldb_private
#endif
#endif // liblldb_ClangASTSource_h_

View File

@ -80,7 +80,7 @@ public:
//------------------------------------------------------------------
/// Destructor
//------------------------------------------------------------------
~ClangExpressionDeclMap ();
~ClangExpressionDeclMap() override;
//------------------------------------------------------------------
/// Enable the state needed for parsing and IR transformation.
@ -354,7 +354,7 @@ public:
/// True on success; false otherwise.
//------------------------------------------------------------------
void
FindExternalVisibleDecls (NameSearchContext &context);
FindExternalVisibleDecls(NameSearchContext &context) override;
//------------------------------------------------------------------
/// Find all entities matching a given name in a given module/namespace,
@ -702,4 +702,4 @@ private:
} // namespace lldb_private
#endif // liblldb_ClangExpressionDeclMap_h_
#endif // liblldb_ClangExpressionDeclMap_h_

View File

@ -7,8 +7,8 @@
//
//===----------------------------------------------------------------------===//
#ifndef lldb_ClangFunction_h_
#define lldb_ClangFunction_h_
#ifndef liblldb_ClangFunction_h_
#define liblldb_ClangFunction_h_
// C Includes
// C++ Includes
@ -122,8 +122,7 @@ public:
//------------------------------------------------------------------
/// Destructor
//------------------------------------------------------------------
virtual
~ClangFunction();
~ClangFunction() override;
//------------------------------------------------------------------
/// Compile the wrapper function
@ -335,7 +334,7 @@ public:
/// translation unit.
//------------------------------------------------------------------
const char *
Text ()
Text() override
{
return m_wrapper_function_text.c_str();
}
@ -346,7 +345,7 @@ public:
/// function.
//------------------------------------------------------------------
const char *
FunctionName ()
FunctionName() override
{
return m_wrapper_function_name.c_str();
}
@ -356,7 +355,7 @@ public:
/// values. May be NULL if everything should be self-contained.
//------------------------------------------------------------------
ClangExpressionDeclMap *
DeclMap ()
DeclMap() override
{
return NULL;
}
@ -380,14 +379,14 @@ public:
/// the ASTs to after transformation.
//------------------------------------------------------------------
clang::ASTConsumer *
ASTTransformer (clang::ASTConsumer *passthrough);
ASTTransformer(clang::ASTConsumer *passthrough) override;
//------------------------------------------------------------------
/// Return true if validation code should be inserted into the
/// expression.
//------------------------------------------------------------------
bool
NeedsValidation ()
NeedsValidation() override
{
return false;
}
@ -397,7 +396,7 @@ public:
/// resolved.
//------------------------------------------------------------------
bool
NeedsVariableResolution ()
NeedsVariableResolution() override
{
return false;
}
@ -448,4 +447,4 @@ private:
} // Namespace lldb_private
#endif // lldb_ClangFunction_h_
#endif // liblldb_ClangFunction_h_

View File

@ -7,8 +7,8 @@
//
//===----------------------------------------------------------------------===//
#ifndef _liblldb_ClangModulesDeclVendor_
#define _liblldb_ClangModulesDeclVendor_
#ifndef liblldb_ClangModulesDeclVendor_h
#define liblldb_ClangModulesDeclVendor_h
#include "lldb/Core/ArchSpec.h"
#include "lldb/Core/ClangForward.h"
@ -29,8 +29,7 @@ public:
//------------------------------------------------------------------
ClangModulesDeclVendor();
virtual
~ClangModulesDeclVendor();
~ClangModulesDeclVendor() override;
static ClangModulesDeclVendor *
Create(Target &target);
@ -122,8 +121,8 @@ public:
//------------------------------------------------------------------
static bool
LanguageSupportsClangModules (lldb::LanguageType language);
};
}
#endif /* defined(_lldb_ClangModulesDeclVendor_) */
} // namespace lldb_private
#endif // liblldb_ClangModulesDeclVendor_h

View File

@ -74,8 +74,7 @@ public:
//------------------------------------------------------------------
/// Destructor
//------------------------------------------------------------------
virtual
~ClangUserExpression ();
~ClangUserExpression() override;
//------------------------------------------------------------------
/// Parse the expression
@ -183,7 +182,7 @@ public:
/// translation unit.
//------------------------------------------------------------------
const char *
Text ()
Text() override
{
return m_transformed_text.c_str();
}
@ -203,7 +202,7 @@ public:
/// function.
//------------------------------------------------------------------
const char *
FunctionName ()
FunctionName() override
{
return "$__lldb_expr";
}
@ -212,8 +211,8 @@ public:
/// Return the language that should be used when parsing. To use
/// the default, return eLanguageTypeUnknown.
//------------------------------------------------------------------
virtual lldb::LanguageType
Language ()
lldb::LanguageType
Language() override
{
return m_language;
}
@ -223,7 +222,7 @@ public:
/// values. May be NULL if everything should be self-contained.
//------------------------------------------------------------------
ClangExpressionDeclMap *
DeclMap ()
DeclMap() override
{
return m_expr_decl_map.get();
}
@ -237,14 +236,14 @@ public:
/// the ASTs to after transformation.
//------------------------------------------------------------------
clang::ASTConsumer *
ASTTransformer (clang::ASTConsumer *passthrough);
ASTTransformer(clang::ASTConsumer *passthrough) override;
//------------------------------------------------------------------
/// Return the desired result type of the function, or
/// eResultTypeAny if indifferent.
//------------------------------------------------------------------
virtual ResultType
DesiredResultType ()
ResultType
DesiredResultType() override
{
return m_desired_type;
}
@ -254,7 +253,7 @@ public:
/// expression.
//------------------------------------------------------------------
bool
NeedsValidation ()
NeedsValidation() override
{
return true;
}
@ -264,7 +263,7 @@ public:
/// resolved.
//------------------------------------------------------------------
bool
NeedsVariableResolution ()
NeedsVariableResolution() override
{
return true;
}
@ -362,4 +361,4 @@ private:
} // namespace lldb_private
#endif // liblldb_ClangUserExpression_h_
#endif // liblldb_ClangUserExpression_h_

View File

@ -51,8 +51,7 @@ public:
ClangUtilityFunction (const char *text,
const char *name);
virtual
~ClangUtilityFunction ();
~ClangUtilityFunction() override;
//------------------------------------------------------------------
/// Install the utility function into a process
@ -96,7 +95,7 @@ public:
/// translation unit.
//------------------------------------------------------------------
const char *
Text ()
Text() override
{
return m_function_text.c_str();
}
@ -107,7 +106,7 @@ public:
/// function.
//------------------------------------------------------------------
const char *
FunctionName ()
FunctionName() override
{
return m_function_name.c_str();
}
@ -117,7 +116,7 @@ public:
/// values. May be NULL if everything should be self-contained.
//------------------------------------------------------------------
ClangExpressionDeclMap *
DeclMap ()
DeclMap() override
{
return m_expr_decl_map.get();
}
@ -141,7 +140,7 @@ public:
/// the ASTs to after transformation.
//------------------------------------------------------------------
clang::ASTConsumer *
ASTTransformer (clang::ASTConsumer *passthrough)
ASTTransformer(clang::ASTConsumer *passthrough) override
{
return NULL;
}
@ -151,7 +150,7 @@ public:
/// expression.
//------------------------------------------------------------------
bool
NeedsValidation ()
NeedsValidation() override
{
return false;
}
@ -161,7 +160,7 @@ public:
/// resolved.
//------------------------------------------------------------------
bool
NeedsVariableResolution ()
NeedsVariableResolution() override
{
return false;
}
@ -176,4 +175,4 @@ private:
} // namespace lldb_private
#endif // liblldb_ClangUtilityFunction_h_
#endif // liblldb_ClangUtilityFunction_h_

View File

@ -24,7 +24,7 @@ namespace llvm {
class Value;
}
namespace lldb_private
namespace lldb_private
{
class ClangExpressionDeclMap;
@ -114,7 +114,7 @@ public:
//------------------------------------------------------------------
/// Destructor
//------------------------------------------------------------------
virtual ~IRDynamicChecks();
~IRDynamicChecks() override;
//------------------------------------------------------------------
/// Run this IR transformer on a single module
@ -127,18 +127,19 @@ public:
/// @return
/// True on success; false otherwise
//------------------------------------------------------------------
bool runOnModule(llvm::Module &M);
bool runOnModule(llvm::Module &M) override;
//------------------------------------------------------------------
/// Interface stub
//------------------------------------------------------------------
void assignPassManager(llvm::PMStack &PMS,
llvm::PassManagerType T = llvm::PMT_ModulePassManager);
llvm::PassManagerType T = llvm::PMT_ModulePassManager) override;
//------------------------------------------------------------------
/// Returns PMT_ModulePassManager
//------------------------------------------------------------------
llvm::PassManagerType getPotentialPassManagerType() const;
llvm::PassManagerType getPotentialPassManagerType() const override;
private:
//------------------------------------------------------------------
/// A basic block-level pass to find all pointer dereferences and
@ -164,6 +165,6 @@ private:
DynamicCheckerFunctions &m_checker_functions; ///< The checker functions for the process
};
}
} // namespace lldb_private
#endif
#endif // liblldb_IRDynamicChecks_h_

View File

@ -7,8 +7,8 @@
//
//===----------------------------------------------------------------------===//
#ifndef lldb_IRExecutionUnit_h_
#define lldb_IRExecutionUnit_h_
#ifndef liblldb_IRExecutionUnit_h_
#define liblldb_IRExecutionUnit_h_
// C Includes
// C++ Includes
@ -79,7 +79,7 @@ public:
//------------------------------------------------------------------
/// Destructor
//------------------------------------------------------------------
~IRExecutionUnit();
~IRExecutionUnit() override;
llvm::Module *
GetModule()
@ -118,22 +118,22 @@ public:
//------------------------------------------------------------------
/// ObjectFileJITDelegate overrides
//------------------------------------------------------------------
virtual lldb::ByteOrder
GetByteOrder () const;
lldb::ByteOrder
GetByteOrder() const override;
virtual uint32_t
GetAddressByteSize () const;
uint32_t
GetAddressByteSize() const override;
virtual void
PopulateSymtab (lldb_private::ObjectFile *obj_file,
lldb_private::Symtab &symtab);
void
PopulateSymtab(lldb_private::ObjectFile *obj_file,
lldb_private::Symtab &symtab) override;
virtual void
PopulateSectionList (lldb_private::ObjectFile *obj_file,
lldb_private::SectionList &section_list);
void
PopulateSectionList(lldb_private::ObjectFile *obj_file,
lldb_private::SectionList &section_list) override;
virtual bool
GetArchitecture (lldb_private::ArchSpec &arch);
bool
GetArchitecture(lldb_private::ArchSpec &arch) override;
lldb::ModuleSP
GetJITModule ();
@ -215,7 +215,7 @@ private:
public:
MemoryManager (IRExecutionUnit &parent);
virtual ~MemoryManager();
~MemoryManager() override;
//------------------------------------------------------------------
/// Allocate space for executable code, and add it to the
@ -233,9 +233,9 @@ private:
/// @return
/// Allocated space.
//------------------------------------------------------------------
virtual uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,
unsigned SectionID,
llvm::StringRef SectionName);
uint8_t *allocateCodeSection(uintptr_t Size, unsigned Alignment,
unsigned SectionID,
llvm::StringRef SectionName) override;
//------------------------------------------------------------------
/// Allocate space for data, and add it to the m_spaceBlocks map
@ -255,10 +255,10 @@ private:
/// @return
/// Allocated space.
//------------------------------------------------------------------
virtual uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment,
unsigned SectionID,
llvm::StringRef SectionName,
bool IsReadOnly);
uint8_t *allocateDataSection(uintptr_t Size, unsigned Alignment,
unsigned SectionID,
llvm::StringRef SectionName,
bool IsReadOnly) override;
//------------------------------------------------------------------
/// Called when object loading is complete and section page
@ -270,7 +270,7 @@ private:
/// @return
/// True in case of failure, false in case of success.
//------------------------------------------------------------------
virtual bool finalizeMemory(std::string *ErrMsg) {
bool finalizeMemory(std::string *ErrMsg) override {
// TODO: Ensure that the instruction cache is flushed because
// relocations are updated by dy-load. See:
// sys::Memory::InvalidateInstructionCache
@ -278,17 +278,17 @@ private:
return false;
}
virtual void registerEHFrames(uint8_t *Addr, uint64_t LoadAddr, size_t Size) {
return;
void registerEHFrames(uint8_t *Addr, uint64_t LoadAddr, size_t Size) override {
}
//------------------------------------------------------------------
/// Passthrough interface stub
//------------------------------------------------------------------
virtual uint64_t getSymbolAddress(const std::string &Name);
uint64_t getSymbolAddress(const std::string &Name) override;
void *getPointerToNamedFunction(const std::string &Name,
bool AbortOnFailure = true) override;
virtual void *getPointerToNamedFunction(const std::string &Name,
bool AbortOnFailure = true);
private:
std::unique_ptr<SectionMemoryManager> m_default_mm_ap; ///< The memory allocator to use in actually creating space. All calls are passed through to it.
IRExecutionUnit &m_parent; ///< The execution unit this is a proxy for.
@ -403,4 +403,4 @@ private:
} // namespace lldb_private
#endif // lldb_IRExecutionUnit_h_
#endif // liblldb_IRExecutionUnit_h_

View File

@ -107,7 +107,7 @@ public:
//------------------------------------------------------------------
/// Destructor
//------------------------------------------------------------------
virtual ~IRForTarget();
~IRForTarget() override;
//------------------------------------------------------------------
/// Run this IR transformer on a single module
@ -126,8 +126,8 @@ public:
/// @return
/// True on success; false otherwise
//------------------------------------------------------------------
virtual bool
runOnModule (llvm::Module &llvm_module);
bool
runOnModule(llvm::Module &llvm_module) override;
//------------------------------------------------------------------
/// Interface stub
@ -135,9 +135,9 @@ public:
/// Implementation of the llvm::ModulePass::assignPassManager()
/// function.
//------------------------------------------------------------------
virtual void
assignPassManager (llvm::PMStack &pass_mgr_stack,
llvm::PassManagerType pass_mgr_type = llvm::PMT_ModulePassManager);
void
assignPassManager(llvm::PMStack &pass_mgr_stack,
llvm::PassManagerType pass_mgr_type = llvm::PMT_ModulePassManager) override;
//------------------------------------------------------------------
/// Returns PMT_ModulePassManager
@ -145,8 +145,8 @@ public:
/// Implementation of the llvm::ModulePass::getPotentialPassManagerType()
/// function.
//------------------------------------------------------------------
virtual llvm::PassManagerType
getPotentialPassManagerType() const;
llvm::PassManagerType
getPotentialPassManagerType() const override;
private:
//------------------------------------------------------------------
@ -742,4 +742,4 @@ private:
};
#endif
#endif // liblldb_IRForTarget_h_

View File

@ -28,11 +28,12 @@ class SystemInitializerCommon : public SystemInitializer
{
public:
SystemInitializerCommon();
virtual ~SystemInitializerCommon();
~SystemInitializerCommon() override;
void Initialize() override;
void Terminate() override;
};
}
#endif
} // namespace lldb_private
#endif // LLDB_INITIALIZATION_SYSTEM_INITIALIZER_COMMON_H