llvm.org GIT mirror llvm / 01394fb
[C++11] Add 'override' keyword to virtual methods that override their base class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202946 91177308-0d34-0410-b5e6-96231b3b80d8 Craig Topper 6 years ago
11 changed file(s) with 62 addition(s) and 61 deletion(s). Raw diff Collapse all Expand all
208208 public:
209209 KeyT Unwrap() const { return cast_or_null(getValPtr()); }
210210
211 virtual void deleted() {
211 void deleted() override {
212212 // Make a copy that won't get changed even when *this is destroyed.
213213 ValueMapCallbackVH Copy(*this);
214214 sys::Mutex *M = Config::getMutex(Copy.Map->Data);
219219 if (M)
220220 M->release();
221221 }
222 virtual void allUsesReplacedWith(Value *new_key) {
222 void allUsesReplacedWith(Value *new_key) override {
223223 assert(isa(new_key) &&
224224 "Invalid RAUW on key of ValueMap<>");
225225 // Make a copy that won't get changed even when *this is destroyed.
119119
120120 struct ListCompleterConcept : CompleterConcept {
121121 ~ListCompleterConcept();
122 CompletionAction complete(StringRef Buffer, size_t Pos) const;
122 CompletionAction complete(StringRef Buffer, size_t Pos) const override;
123123 static std::string getCommonPrefix(const std::vector &Comps);
124124 virtual std::vector getCompletions(StringRef Buffer,
125125 size_t Pos) const = 0;
128128 template
129129 struct CompleterModel : CompleterConcept {
130130 CompleterModel(T Value) : Value(Value) {}
131 CompletionAction complete(StringRef Buffer, size_t Pos) const {
131 CompletionAction complete(StringRef Buffer, size_t Pos) const override {
132132 return Value(Buffer, Pos);
133133 }
134134 T Value;
137137 template
138138 struct ListCompleterModel : ListCompleterConcept {
139139 ListCompleterModel(T Value) : Value(Value) {}
140 std::vector getCompletions(StringRef Buffer, size_t Pos) const {
140 std::vector getCompletions(StringRef Buffer,
141 size_t Pos) const override {
141142 return Value(Buffer, Pos);
142143 }
143144 T Value;
6666 SymbolRef::Type &Res) const override;
6767 error_code getSymbolSection(DataRefImpl Symb,
6868 section_iterator &Res) const override;
69 error_code getSymbolValue(DataRefImpl Symb, uint64_t &Val) const;
69 error_code getSymbolValue(DataRefImpl Symb, uint64_t &Val) const override;
7070
7171 error_code getLibraryNext(DataRefImpl Data,
7272 LibraryRef &Result) const override;
7676 error_code getSectionName(DataRefImpl Sec, StringRef &Res) const override;
7777 error_code getSectionAddress(DataRefImpl Sec, uint64_t &Res) const override;
7878 error_code getSectionSize(DataRefImpl Sec, uint64_t &Res) const override;
79 error_code getSectionContents(DataRefImpl Sec, StringRef &Res) const;
79 error_code getSectionContents(DataRefImpl Sec, StringRef &Res) const override;
8080 error_code getSectionAlignment(DataRefImpl Sec, uint64_t &Res) const override;
8181 error_code isSectionText(DataRefImpl Sec, bool &Res) const override;
82 error_code isSectionData(DataRefImpl Sec, bool &Res) const;
82 error_code isSectionData(DataRefImpl Sec, bool &Res) const override;
8383 error_code isSectionBSS(DataRefImpl Sec, bool &Res) const override;
8484 error_code isSectionRequiredForExecution(DataRefImpl Sec,
8585 bool &Res) const override;
86 error_code isSectionVirtual(DataRefImpl Sec, bool &Res) const;
86 error_code isSectionVirtual(DataRefImpl Sec, bool &Res) const override;
8787 error_code isSectionZeroInit(DataRefImpl Sec, bool &Res) const override;
88 error_code isSectionReadOnlyData(DataRefImpl Sec, bool &Res) const;
88 error_code isSectionReadOnlyData(DataRefImpl Sec, bool &Res) const override;
8989 error_code sectionContainsSymbol(DataRefImpl Sec, DataRefImpl Symb,
9090 bool &Result) const override;
91 relocation_iterator section_rel_begin(DataRefImpl Sec) const;
91 relocation_iterator section_rel_begin(DataRefImpl Sec) const override;
9292 relocation_iterator section_rel_end(DataRefImpl Sec) const override;
9393 section_iterator getRelocatedSection(DataRefImpl Sec) const override;
9494
9797 uint64_t &Res) const override;
9898 error_code getRelocationOffset(DataRefImpl Rel, uint64_t &Res) const override;
9999 symbol_iterator getRelocationSymbol(DataRefImpl Rel) const override;
100 error_code getRelocationType(DataRefImpl Rel, uint64_t &Res) const;
100 error_code getRelocationType(DataRefImpl Rel, uint64_t &Res) const override;
101101 error_code getRelocationTypeName(DataRefImpl Rel,
102102 SmallVectorImpl &Result) const override;
103103 error_code getRelocationValueString(DataRefImpl Rel,
222222 // modified externally. It's UB otherwise.
223223 friend class SymbolRef;
224224 virtual error_code getSymbolName(DataRefImpl Symb, StringRef &Res) const = 0;
225 virtual error_code printSymbolName(raw_ostream &OS, DataRefImpl Symb) const;
225 error_code printSymbolName(raw_ostream &OS, DataRefImpl Symb) const override;
226226 virtual error_code getSymbolAddress(DataRefImpl Symb, uint64_t &Res) const = 0;
227227 virtual error_code getSymbolFileOffset(DataRefImpl Symb, uint64_t &Res)const=0;
228228 virtual error_code getSymbolAlignment(DataRefImpl Symb, uint32_t &Res) const;
306306 InputArgList(const char* const *ArgBegin, const char* const *ArgEnd);
307307 ~InputArgList();
308308
309 virtual const char *getArgString(unsigned Index) const {
309 const char *getArgString(unsigned Index) const override {
310310 return ArgStrings[Index];
311311 }
312312
313 virtual unsigned getNumInputArgStrings() const {
313 unsigned getNumInputArgStrings() const override {
314314 return NumInputArgStrings;
315315 }
316316
322322 unsigned MakeIndex(StringRef String0) const;
323323 unsigned MakeIndex(StringRef String0, StringRef String1) const;
324324
325 virtual const char *MakeArgString(StringRef Str) const;
325 const char *MakeArgString(StringRef Str) const override;
326326
327327 /// @}
328328 };
340340 DerivedArgList(const InputArgList &BaseArgs);
341341 ~DerivedArgList();
342342
343 virtual const char *getArgString(unsigned Index) const {
343 const char *getArgString(unsigned Index) const override {
344344 return BaseArgs.getArgString(Index);
345345 }
346346
347 virtual unsigned getNumInputArgStrings() const {
347 unsigned getNumInputArgStrings() const override {
348348 return BaseArgs.getNumInputArgStrings();
349349 }
350350
361361 SynthesizedArgs.push_back(A);
362362 }
363363
364 virtual const char *MakeArgString(StringRef Str) const;
364 const char *MakeArgString(StringRef Str) const override;
365365
366366 /// AddFlagArg - Construct a new FlagArg for the given option \p Id and
367367 /// append it to the argument list.
246246 /// when the reader is destroyed.
247247 void setBufferOwned(bool Owned) { BufferOwned = Owned; }
248248
249 virtual bool isMaterializable(const GlobalValue *GV) const;
250 virtual bool isDematerializable(const GlobalValue *GV) const;
251 virtual error_code Materialize(GlobalValue *GV);
252 virtual error_code MaterializeModule(Module *M);
253 virtual void Dematerialize(GlobalValue *GV);
249 bool isMaterializable(const GlobalValue *GV) const override;
250 bool isDematerializable(const GlobalValue *GV) const override;
251 error_code Materialize(GlobalValue *GV) override;
252 error_code MaterializeModule(Module *M) override;
253 void Dematerialize(GlobalValue *GV) override;
254254
255255 /// @brief Main interface to parsing a bitcode buffer.
256256 /// @returns true if an error occurred.
3030 explicit WriteBitcodePass(raw_ostream &o)
3131 : ModulePass(ID), OS(o) {}
3232
33 const char *getPassName() const { return "Bitcode Writer"; }
33 const char *getPassName() const override { return "Bitcode Writer"; }
3434
35 bool runOnModule(Module &M) {
35 bool runOnModule(Module &M) override {
3636 WriteBitcodeToFile(&M, OS);
3737 return false;
3838 }
7070 return DICtx->getKind() == CK_DWARF;
7171 }
7272
73 virtual void dump(raw_ostream &OS, DIDumpType DumpType = DIDT_All);
73 void dump(raw_ostream &OS, DIDumpType DumpType = DIDT_All) override;
7474
7575 /// Get the number of compile units in this context.
7676 unsigned getNumCompileUnits() {
147147 const DWARFDebugLine::LineTable *
148148 getLineTableForCompileUnit(DWARFCompileUnit *cu);
149149
150 virtual DILineInfo getLineInfoForAddress(uint64_t Address,
151 DILineInfoSpecifier Specifier = DILineInfoSpecifier());
152 virtual DILineInfoTable getLineInfoForAddressRange(uint64_t Address,
153 uint64_t Size, DILineInfoSpecifier Specifier = DILineInfoSpecifier());
154 virtual DIInliningInfo getInliningInfoForAddress(uint64_t Address,
155 DILineInfoSpecifier Specifier = DILineInfoSpecifier());
150 DILineInfo getLineInfoForAddress(uint64_t Address,
151 DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
152 DILineInfoTable getLineInfoForAddressRange(uint64_t Address, uint64_t Size,
153 DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
154 DIInliningInfo getInliningInfoForAddress(uint64_t Address,
155 DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
156156
157157 virtual bool isLittleEndian() const = 0;
158158 virtual uint8_t getAddressSize() const = 0;
230230 public:
231231 DWARFContextInMemory(object::ObjectFile *);
232232 ~DWARFContextInMemory();
233 virtual bool isLittleEndian() const { return IsLittleEndian; }
234 virtual uint8_t getAddressSize() const { return AddressSize; }
235 virtual const Section &getInfoSection() { return InfoSection; }
236 virtual const TypeSectionMap &getTypesSections() { return TypesSections; }
237 virtual StringRef getAbbrevSection() { return AbbrevSection; }
238 virtual const Section &getLocSection() { return LocSection; }
239 virtual StringRef getARangeSection() { return ARangeSection; }
240 virtual StringRef getDebugFrameSection() { return DebugFrameSection; }
241 virtual const Section &getLineSection() { return LineSection; }
242 virtual const Section &getLineDWOSection() { return LineDWOSection; }
243 virtual StringRef getStringSection() { return StringSection; }
244 virtual StringRef getRangeSection() { return RangeSection; }
245 virtual StringRef getPubNamesSection() { return PubNamesSection; }
246 virtual StringRef getPubTypesSection() { return PubTypesSection; }
247 virtual StringRef getGnuPubNamesSection() { return GnuPubNamesSection; }
248 virtual StringRef getGnuPubTypesSection() { return GnuPubTypesSection; }
233 bool isLittleEndian() const override { return IsLittleEndian; }
234 uint8_t getAddressSize() const override { return AddressSize; }
235 const Section &getInfoSection() override { return InfoSection; }
236 const TypeSectionMap &getTypesSections() override { return TypesSections; }
237 StringRef getAbbrevSection() override { return AbbrevSection; }
238 const Section &getLocSection() override { return LocSection; }
239 StringRef getARangeSection() override { return ARangeSection; }
240 StringRef getDebugFrameSection() override { return DebugFrameSection; }
241 const Section &getLineSection() override { return LineSection; }
242 const Section &getLineDWOSection() override { return LineDWOSection; }
243 StringRef getStringSection() override { return StringSection; }
244 StringRef getRangeSection() override { return RangeSection; }
245 StringRef getPubNamesSection() override { return PubNamesSection; }
246 StringRef getPubTypesSection() override { return PubTypesSection; }
247 StringRef getGnuPubNamesSection() override { return GnuPubNamesSection; }
248 StringRef getGnuPubTypesSection() override { return GnuPubTypesSection; }
249249
250250 // Sections for DWARF5 split dwarf proposal.
251 virtual const Section &getInfoDWOSection() { return InfoDWOSection; }
252 virtual const TypeSectionMap &getTypesDWOSections() {
251 const Section &getInfoDWOSection() override { return InfoDWOSection; }
252 const TypeSectionMap &getTypesDWOSections() override {
253253 return TypesDWOSections;
254254 }
255 virtual StringRef getAbbrevDWOSection() { return AbbrevDWOSection; }
256 virtual StringRef getStringDWOSection() { return StringDWOSection; }
257 virtual StringRef getStringOffsetDWOSection() {
255 StringRef getAbbrevDWOSection() override { return AbbrevDWOSection; }
256 StringRef getStringDWOSection() override { return StringDWOSection; }
257 StringRef getStringOffsetDWOSection() override {
258258 return StringOffsetDWOSection;
259259 }
260 virtual StringRef getRangeDWOSection() { return RangeDWOSection; }
261 virtual StringRef getAddrSection() {
260 StringRef getRangeDWOSection() override { return RangeDWOSection; }
261 StringRef getAddrSection() override {
262262 return AddrSection;
263263 }
264264 };
213213 ~CIE() {
214214 }
215215
216 void dumpHeader(raw_ostream &OS) const {
216 void dumpHeader(raw_ostream &OS) const override {
217217 OS << format("%08x %08x %08x CIE",
218218 (uint32_t)Offset, (uint32_t)Length, DW_CIE_ID)
219219 << "\n";
257257 ~FDE() {
258258 }
259259
260 void dumpHeader(raw_ostream &OS) const {
260 void dumpHeader(raw_ostream &OS) const override {
261261 OS << format("%08x %08x %08x FDE ",
262262 (uint32_t)Offset, (uint32_t)Length, (int32_t)LinkedCIEOffset);
263263 OS << format("cie=%08x pc=%08x...%08x\n",
230230 struct DumpingState : public State {
231231 DumpingState(raw_ostream &OS) : OS(OS) {}
232232 virtual ~DumpingState();
233 virtual void finalize();
233 void finalize() override;
234234 private:
235235 raw_ostream &OS;
236236 };
8686 private:
8787 Type *getImpl(Type *T);
8888 /// remapType - Implement the ValueMapTypeRemapper interface.
89 Type *remapType(Type *SrcTy) {
89 Type *remapType(Type *SrcTy) override {
9090 return get(SrcTy);
9191 }
9292
371371 LazilyLinkFunctions(LazilyLinkFunctions) {
372372 }
373373
374 virtual Value *materializeValueFor(Value *V);
374 Value *materializeValueFor(Value *V) override;
375375 };
376376
377377 /// ModuleLinker - This is an implementation class for the LinkModules