forked from OSchip/llvm-project
[C++11] Add 'override' keyword to virtual methods that override their base class.
llvm-svn: 202946
This commit is contained in:
parent
e9ba759c81
commit
8548299aa8
|
@ -209,7 +209,7 @@ class ValueMapCallbackVH : public CallbackVH {
|
||||||
public:
|
public:
|
||||||
KeyT Unwrap() const { return cast_or_null<KeySansPointerT>(getValPtr()); }
|
KeyT Unwrap() const { return cast_or_null<KeySansPointerT>(getValPtr()); }
|
||||||
|
|
||||||
virtual void deleted() {
|
void deleted() override {
|
||||||
// Make a copy that won't get changed even when *this is destroyed.
|
// Make a copy that won't get changed even when *this is destroyed.
|
||||||
ValueMapCallbackVH Copy(*this);
|
ValueMapCallbackVH Copy(*this);
|
||||||
sys::Mutex *M = Config::getMutex(Copy.Map->Data);
|
sys::Mutex *M = Config::getMutex(Copy.Map->Data);
|
||||||
|
@ -220,7 +220,7 @@ public:
|
||||||
if (M)
|
if (M)
|
||||||
M->release();
|
M->release();
|
||||||
}
|
}
|
||||||
virtual void allUsesReplacedWith(Value *new_key) {
|
void allUsesReplacedWith(Value *new_key) override {
|
||||||
assert(isa<KeySansPointerT>(new_key) &&
|
assert(isa<KeySansPointerT>(new_key) &&
|
||||||
"Invalid RAUW on key of ValueMap<>");
|
"Invalid RAUW on key of ValueMap<>");
|
||||||
// Make a copy that won't get changed even when *this is destroyed.
|
// Make a copy that won't get changed even when *this is destroyed.
|
||||||
|
|
|
@ -120,7 +120,7 @@ private:
|
||||||
|
|
||||||
struct ListCompleterConcept : CompleterConcept {
|
struct ListCompleterConcept : CompleterConcept {
|
||||||
~ListCompleterConcept();
|
~ListCompleterConcept();
|
||||||
CompletionAction complete(StringRef Buffer, size_t Pos) const;
|
CompletionAction complete(StringRef Buffer, size_t Pos) const override;
|
||||||
static std::string getCommonPrefix(const std::vector<Completion> &Comps);
|
static std::string getCommonPrefix(const std::vector<Completion> &Comps);
|
||||||
virtual std::vector<Completion> getCompletions(StringRef Buffer,
|
virtual std::vector<Completion> getCompletions(StringRef Buffer,
|
||||||
size_t Pos) const = 0;
|
size_t Pos) const = 0;
|
||||||
|
@ -129,7 +129,7 @@ private:
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct CompleterModel : CompleterConcept {
|
struct CompleterModel : CompleterConcept {
|
||||||
CompleterModel(T Value) : Value(Value) {}
|
CompleterModel(T Value) : Value(Value) {}
|
||||||
CompletionAction complete(StringRef Buffer, size_t Pos) const {
|
CompletionAction complete(StringRef Buffer, size_t Pos) const override {
|
||||||
return Value(Buffer, Pos);
|
return Value(Buffer, Pos);
|
||||||
}
|
}
|
||||||
T Value;
|
T Value;
|
||||||
|
@ -138,7 +138,8 @@ private:
|
||||||
template <typename T>
|
template <typename T>
|
||||||
struct ListCompleterModel : ListCompleterConcept {
|
struct ListCompleterModel : ListCompleterConcept {
|
||||||
ListCompleterModel(T Value) : Value(Value) {}
|
ListCompleterModel(T Value) : Value(Value) {}
|
||||||
std::vector<Completion> getCompletions(StringRef Buffer, size_t Pos) const {
|
std::vector<Completion> getCompletions(StringRef Buffer,
|
||||||
|
size_t Pos) const override {
|
||||||
return Value(Buffer, Pos);
|
return Value(Buffer, Pos);
|
||||||
}
|
}
|
||||||
T Value;
|
T Value;
|
||||||
|
|
|
@ -67,7 +67,7 @@ protected:
|
||||||
SymbolRef::Type &Res) const override;
|
SymbolRef::Type &Res) const override;
|
||||||
error_code getSymbolSection(DataRefImpl Symb,
|
error_code getSymbolSection(DataRefImpl Symb,
|
||||||
section_iterator &Res) const override;
|
section_iterator &Res) const override;
|
||||||
error_code getSymbolValue(DataRefImpl Symb, uint64_t &Val) const;
|
error_code getSymbolValue(DataRefImpl Symb, uint64_t &Val) const override;
|
||||||
|
|
||||||
error_code getLibraryNext(DataRefImpl Data,
|
error_code getLibraryNext(DataRefImpl Data,
|
||||||
LibraryRef &Result) const override;
|
LibraryRef &Result) const override;
|
||||||
|
@ -77,19 +77,19 @@ protected:
|
||||||
error_code getSectionName(DataRefImpl Sec, StringRef &Res) const override;
|
error_code getSectionName(DataRefImpl Sec, StringRef &Res) const override;
|
||||||
error_code getSectionAddress(DataRefImpl Sec, uint64_t &Res) const override;
|
error_code getSectionAddress(DataRefImpl Sec, uint64_t &Res) const override;
|
||||||
error_code getSectionSize(DataRefImpl Sec, uint64_t &Res) const override;
|
error_code getSectionSize(DataRefImpl Sec, uint64_t &Res) const override;
|
||||||
error_code getSectionContents(DataRefImpl Sec, StringRef &Res) const;
|
error_code getSectionContents(DataRefImpl Sec, StringRef &Res) const override;
|
||||||
error_code getSectionAlignment(DataRefImpl Sec, uint64_t &Res) const override;
|
error_code getSectionAlignment(DataRefImpl Sec, uint64_t &Res) const override;
|
||||||
error_code isSectionText(DataRefImpl Sec, bool &Res) const override;
|
error_code isSectionText(DataRefImpl Sec, bool &Res) const override;
|
||||||
error_code isSectionData(DataRefImpl Sec, bool &Res) const;
|
error_code isSectionData(DataRefImpl Sec, bool &Res) const override;
|
||||||
error_code isSectionBSS(DataRefImpl Sec, bool &Res) const override;
|
error_code isSectionBSS(DataRefImpl Sec, bool &Res) const override;
|
||||||
error_code isSectionRequiredForExecution(DataRefImpl Sec,
|
error_code isSectionRequiredForExecution(DataRefImpl Sec,
|
||||||
bool &Res) const override;
|
bool &Res) const override;
|
||||||
error_code isSectionVirtual(DataRefImpl Sec, bool &Res) const;
|
error_code isSectionVirtual(DataRefImpl Sec, bool &Res) const override;
|
||||||
error_code isSectionZeroInit(DataRefImpl Sec, bool &Res) const override;
|
error_code isSectionZeroInit(DataRefImpl Sec, bool &Res) const override;
|
||||||
error_code isSectionReadOnlyData(DataRefImpl Sec, bool &Res) const;
|
error_code isSectionReadOnlyData(DataRefImpl Sec, bool &Res) const override;
|
||||||
error_code sectionContainsSymbol(DataRefImpl Sec, DataRefImpl Symb,
|
error_code sectionContainsSymbol(DataRefImpl Sec, DataRefImpl Symb,
|
||||||
bool &Result) const override;
|
bool &Result) const override;
|
||||||
relocation_iterator section_rel_begin(DataRefImpl Sec) const;
|
relocation_iterator section_rel_begin(DataRefImpl Sec) const override;
|
||||||
relocation_iterator section_rel_end(DataRefImpl Sec) const override;
|
relocation_iterator section_rel_end(DataRefImpl Sec) const override;
|
||||||
section_iterator getRelocatedSection(DataRefImpl Sec) const override;
|
section_iterator getRelocatedSection(DataRefImpl Sec) const override;
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ protected:
|
||||||
uint64_t &Res) const override;
|
uint64_t &Res) const override;
|
||||||
error_code getRelocationOffset(DataRefImpl Rel, uint64_t &Res) const override;
|
error_code getRelocationOffset(DataRefImpl Rel, uint64_t &Res) const override;
|
||||||
symbol_iterator getRelocationSymbol(DataRefImpl Rel) const override;
|
symbol_iterator getRelocationSymbol(DataRefImpl Rel) const override;
|
||||||
error_code getRelocationType(DataRefImpl Rel, uint64_t &Res) const;
|
error_code getRelocationType(DataRefImpl Rel, uint64_t &Res) const override;
|
||||||
error_code getRelocationTypeName(DataRefImpl Rel,
|
error_code getRelocationTypeName(DataRefImpl Rel,
|
||||||
SmallVectorImpl<char> &Result) const override;
|
SmallVectorImpl<char> &Result) const override;
|
||||||
error_code getRelocationValueString(DataRefImpl Rel,
|
error_code getRelocationValueString(DataRefImpl Rel,
|
||||||
|
|
|
@ -223,7 +223,7 @@ protected:
|
||||||
// modified externally. It's UB otherwise.
|
// modified externally. It's UB otherwise.
|
||||||
friend class SymbolRef;
|
friend class SymbolRef;
|
||||||
virtual error_code getSymbolName(DataRefImpl Symb, StringRef &Res) const = 0;
|
virtual error_code getSymbolName(DataRefImpl Symb, StringRef &Res) const = 0;
|
||||||
virtual error_code printSymbolName(raw_ostream &OS, DataRefImpl Symb) const;
|
error_code printSymbolName(raw_ostream &OS, DataRefImpl Symb) const override;
|
||||||
virtual error_code getSymbolAddress(DataRefImpl Symb, uint64_t &Res) const = 0;
|
virtual error_code getSymbolAddress(DataRefImpl Symb, uint64_t &Res) const = 0;
|
||||||
virtual error_code getSymbolFileOffset(DataRefImpl Symb, uint64_t &Res)const=0;
|
virtual error_code getSymbolFileOffset(DataRefImpl Symb, uint64_t &Res)const=0;
|
||||||
virtual error_code getSymbolAlignment(DataRefImpl Symb, uint32_t &Res) const;
|
virtual error_code getSymbolAlignment(DataRefImpl Symb, uint32_t &Res) const;
|
||||||
|
|
|
@ -307,11 +307,11 @@ public:
|
||||||
InputArgList(const char* const *ArgBegin, const char* const *ArgEnd);
|
InputArgList(const char* const *ArgBegin, const char* const *ArgEnd);
|
||||||
~InputArgList();
|
~InputArgList();
|
||||||
|
|
||||||
virtual const char *getArgString(unsigned Index) const {
|
const char *getArgString(unsigned Index) const override {
|
||||||
return ArgStrings[Index];
|
return ArgStrings[Index];
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual unsigned getNumInputArgStrings() const {
|
unsigned getNumInputArgStrings() const override {
|
||||||
return NumInputArgStrings;
|
return NumInputArgStrings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -323,7 +323,7 @@ public:
|
||||||
unsigned MakeIndex(StringRef String0) const;
|
unsigned MakeIndex(StringRef String0) const;
|
||||||
unsigned MakeIndex(StringRef String0, StringRef String1) const;
|
unsigned MakeIndex(StringRef String0, StringRef String1) const;
|
||||||
|
|
||||||
virtual const char *MakeArgString(StringRef Str) const;
|
const char *MakeArgString(StringRef Str) const override;
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
};
|
};
|
||||||
|
@ -341,11 +341,11 @@ public:
|
||||||
DerivedArgList(const InputArgList &BaseArgs);
|
DerivedArgList(const InputArgList &BaseArgs);
|
||||||
~DerivedArgList();
|
~DerivedArgList();
|
||||||
|
|
||||||
virtual const char *getArgString(unsigned Index) const {
|
const char *getArgString(unsigned Index) const override {
|
||||||
return BaseArgs.getArgString(Index);
|
return BaseArgs.getArgString(Index);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual unsigned getNumInputArgStrings() const {
|
unsigned getNumInputArgStrings() const override {
|
||||||
return BaseArgs.getNumInputArgStrings();
|
return BaseArgs.getNumInputArgStrings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -362,7 +362,7 @@ public:
|
||||||
SynthesizedArgs.push_back(A);
|
SynthesizedArgs.push_back(A);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual const char *MakeArgString(StringRef Str) const;
|
const char *MakeArgString(StringRef Str) const override;
|
||||||
|
|
||||||
/// AddFlagArg - Construct a new FlagArg for the given option \p Id and
|
/// AddFlagArg - Construct a new FlagArg for the given option \p Id and
|
||||||
/// append it to the argument list.
|
/// append it to the argument list.
|
||||||
|
|
|
@ -247,11 +247,11 @@ public:
|
||||||
/// when the reader is destroyed.
|
/// when the reader is destroyed.
|
||||||
void setBufferOwned(bool Owned) { BufferOwned = Owned; }
|
void setBufferOwned(bool Owned) { BufferOwned = Owned; }
|
||||||
|
|
||||||
virtual bool isMaterializable(const GlobalValue *GV) const;
|
bool isMaterializable(const GlobalValue *GV) const override;
|
||||||
virtual bool isDematerializable(const GlobalValue *GV) const;
|
bool isDematerializable(const GlobalValue *GV) const override;
|
||||||
virtual error_code Materialize(GlobalValue *GV);
|
error_code Materialize(GlobalValue *GV) override;
|
||||||
virtual error_code MaterializeModule(Module *M);
|
error_code MaterializeModule(Module *M) override;
|
||||||
virtual void Dematerialize(GlobalValue *GV);
|
void Dematerialize(GlobalValue *GV) override;
|
||||||
|
|
||||||
/// @brief Main interface to parsing a bitcode buffer.
|
/// @brief Main interface to parsing a bitcode buffer.
|
||||||
/// @returns true if an error occurred.
|
/// @returns true if an error occurred.
|
||||||
|
|
|
@ -31,9 +31,9 @@ namespace {
|
||||||
explicit WriteBitcodePass(raw_ostream &o)
|
explicit WriteBitcodePass(raw_ostream &o)
|
||||||
: ModulePass(ID), OS(o) {}
|
: ModulePass(ID), OS(o) {}
|
||||||
|
|
||||||
const char *getPassName() const { return "Bitcode Writer"; }
|
const char *getPassName() const override { return "Bitcode Writer"; }
|
||||||
|
|
||||||
bool runOnModule(Module &M) {
|
bool runOnModule(Module &M) override {
|
||||||
WriteBitcodeToFile(&M, OS);
|
WriteBitcodeToFile(&M, OS);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,7 @@ public:
|
||||||
return DICtx->getKind() == CK_DWARF;
|
return DICtx->getKind() == CK_DWARF;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void dump(raw_ostream &OS, DIDumpType DumpType = DIDT_All);
|
void dump(raw_ostream &OS, DIDumpType DumpType = DIDT_All) override;
|
||||||
|
|
||||||
/// Get the number of compile units in this context.
|
/// Get the number of compile units in this context.
|
||||||
unsigned getNumCompileUnits() {
|
unsigned getNumCompileUnits() {
|
||||||
|
@ -148,12 +148,12 @@ public:
|
||||||
const DWARFDebugLine::LineTable *
|
const DWARFDebugLine::LineTable *
|
||||||
getLineTableForCompileUnit(DWARFCompileUnit *cu);
|
getLineTableForCompileUnit(DWARFCompileUnit *cu);
|
||||||
|
|
||||||
virtual DILineInfo getLineInfoForAddress(uint64_t Address,
|
DILineInfo getLineInfoForAddress(uint64_t Address,
|
||||||
DILineInfoSpecifier Specifier = DILineInfoSpecifier());
|
DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
|
||||||
virtual DILineInfoTable getLineInfoForAddressRange(uint64_t Address,
|
DILineInfoTable getLineInfoForAddressRange(uint64_t Address, uint64_t Size,
|
||||||
uint64_t Size, DILineInfoSpecifier Specifier = DILineInfoSpecifier());
|
DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
|
||||||
virtual DIInliningInfo getInliningInfoForAddress(uint64_t Address,
|
DIInliningInfo getInliningInfoForAddress(uint64_t Address,
|
||||||
DILineInfoSpecifier Specifier = DILineInfoSpecifier());
|
DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
|
||||||
|
|
||||||
virtual bool isLittleEndian() const = 0;
|
virtual bool isLittleEndian() const = 0;
|
||||||
virtual uint8_t getAddressSize() const = 0;
|
virtual uint8_t getAddressSize() const = 0;
|
||||||
|
@ -231,35 +231,35 @@ class DWARFContextInMemory : public DWARFContext {
|
||||||
public:
|
public:
|
||||||
DWARFContextInMemory(object::ObjectFile *);
|
DWARFContextInMemory(object::ObjectFile *);
|
||||||
~DWARFContextInMemory();
|
~DWARFContextInMemory();
|
||||||
virtual bool isLittleEndian() const { return IsLittleEndian; }
|
bool isLittleEndian() const override { return IsLittleEndian; }
|
||||||
virtual uint8_t getAddressSize() const { return AddressSize; }
|
uint8_t getAddressSize() const override { return AddressSize; }
|
||||||
virtual const Section &getInfoSection() { return InfoSection; }
|
const Section &getInfoSection() override { return InfoSection; }
|
||||||
virtual const TypeSectionMap &getTypesSections() { return TypesSections; }
|
const TypeSectionMap &getTypesSections() override { return TypesSections; }
|
||||||
virtual StringRef getAbbrevSection() { return AbbrevSection; }
|
StringRef getAbbrevSection() override { return AbbrevSection; }
|
||||||
virtual const Section &getLocSection() { return LocSection; }
|
const Section &getLocSection() override { return LocSection; }
|
||||||
virtual StringRef getARangeSection() { return ARangeSection; }
|
StringRef getARangeSection() override { return ARangeSection; }
|
||||||
virtual StringRef getDebugFrameSection() { return DebugFrameSection; }
|
StringRef getDebugFrameSection() override { return DebugFrameSection; }
|
||||||
virtual const Section &getLineSection() { return LineSection; }
|
const Section &getLineSection() override { return LineSection; }
|
||||||
virtual const Section &getLineDWOSection() { return LineDWOSection; }
|
const Section &getLineDWOSection() override { return LineDWOSection; }
|
||||||
virtual StringRef getStringSection() { return StringSection; }
|
StringRef getStringSection() override { return StringSection; }
|
||||||
virtual StringRef getRangeSection() { return RangeSection; }
|
StringRef getRangeSection() override { return RangeSection; }
|
||||||
virtual StringRef getPubNamesSection() { return PubNamesSection; }
|
StringRef getPubNamesSection() override { return PubNamesSection; }
|
||||||
virtual StringRef getPubTypesSection() { return PubTypesSection; }
|
StringRef getPubTypesSection() override { return PubTypesSection; }
|
||||||
virtual StringRef getGnuPubNamesSection() { return GnuPubNamesSection; }
|
StringRef getGnuPubNamesSection() override { return GnuPubNamesSection; }
|
||||||
virtual StringRef getGnuPubTypesSection() { return GnuPubTypesSection; }
|
StringRef getGnuPubTypesSection() override { return GnuPubTypesSection; }
|
||||||
|
|
||||||
// Sections for DWARF5 split dwarf proposal.
|
// Sections for DWARF5 split dwarf proposal.
|
||||||
virtual const Section &getInfoDWOSection() { return InfoDWOSection; }
|
const Section &getInfoDWOSection() override { return InfoDWOSection; }
|
||||||
virtual const TypeSectionMap &getTypesDWOSections() {
|
const TypeSectionMap &getTypesDWOSections() override {
|
||||||
return TypesDWOSections;
|
return TypesDWOSections;
|
||||||
}
|
}
|
||||||
virtual StringRef getAbbrevDWOSection() { return AbbrevDWOSection; }
|
StringRef getAbbrevDWOSection() override { return AbbrevDWOSection; }
|
||||||
virtual StringRef getStringDWOSection() { return StringDWOSection; }
|
StringRef getStringDWOSection() override { return StringDWOSection; }
|
||||||
virtual StringRef getStringOffsetDWOSection() {
|
StringRef getStringOffsetDWOSection() override {
|
||||||
return StringOffsetDWOSection;
|
return StringOffsetDWOSection;
|
||||||
}
|
}
|
||||||
virtual StringRef getRangeDWOSection() { return RangeDWOSection; }
|
StringRef getRangeDWOSection() override { return RangeDWOSection; }
|
||||||
virtual StringRef getAddrSection() {
|
StringRef getAddrSection() override {
|
||||||
return AddrSection;
|
return AddrSection;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -214,7 +214,7 @@ public:
|
||||||
~CIE() {
|
~CIE() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void dumpHeader(raw_ostream &OS) const {
|
void dumpHeader(raw_ostream &OS) const override {
|
||||||
OS << format("%08x %08x %08x CIE",
|
OS << format("%08x %08x %08x CIE",
|
||||||
(uint32_t)Offset, (uint32_t)Length, DW_CIE_ID)
|
(uint32_t)Offset, (uint32_t)Length, DW_CIE_ID)
|
||||||
<< "\n";
|
<< "\n";
|
||||||
|
@ -258,7 +258,7 @@ public:
|
||||||
~FDE() {
|
~FDE() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void dumpHeader(raw_ostream &OS) const {
|
void dumpHeader(raw_ostream &OS) const override {
|
||||||
OS << format("%08x %08x %08x FDE ",
|
OS << format("%08x %08x %08x FDE ",
|
||||||
(uint32_t)Offset, (uint32_t)Length, (int32_t)LinkedCIEOffset);
|
(uint32_t)Offset, (uint32_t)Length, (int32_t)LinkedCIEOffset);
|
||||||
OS << format("cie=%08x pc=%08x...%08x\n",
|
OS << format("cie=%08x pc=%08x...%08x\n",
|
||||||
|
|
|
@ -231,7 +231,7 @@ public:
|
||||||
struct DumpingState : public State {
|
struct DumpingState : public State {
|
||||||
DumpingState(raw_ostream &OS) : OS(OS) {}
|
DumpingState(raw_ostream &OS) : OS(OS) {}
|
||||||
virtual ~DumpingState();
|
virtual ~DumpingState();
|
||||||
virtual void finalize();
|
void finalize() override;
|
||||||
private:
|
private:
|
||||||
raw_ostream &OS;
|
raw_ostream &OS;
|
||||||
};
|
};
|
||||||
|
|
|
@ -87,7 +87,7 @@ public:
|
||||||
private:
|
private:
|
||||||
Type *getImpl(Type *T);
|
Type *getImpl(Type *T);
|
||||||
/// remapType - Implement the ValueMapTypeRemapper interface.
|
/// remapType - Implement the ValueMapTypeRemapper interface.
|
||||||
Type *remapType(Type *SrcTy) {
|
Type *remapType(Type *SrcTy) override {
|
||||||
return get(SrcTy);
|
return get(SrcTy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -372,7 +372,7 @@ namespace {
|
||||||
LazilyLinkFunctions(LazilyLinkFunctions) {
|
LazilyLinkFunctions(LazilyLinkFunctions) {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual Value *materializeValueFor(Value *V);
|
Value *materializeValueFor(Value *V) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// ModuleLinker - This is an implementation class for the LinkModules
|
/// ModuleLinker - This is an implementation class for the LinkModules
|
||||||
|
|
Loading…
Reference in New Issue