llvm.org GIT mirror llvm / bfd007f
Fix Clang-tidy misc-use-override warnings, other minor fixes Patch by Eugene Zelenko! Differential Revision: http://reviews.llvm.org/D12740 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247216 91177308-0d34-0410-b5e6-96231b3b80d8 Hans Wennborg 5 years ago
9 changed file(s) with 97 addition(s) and 98 deletion(s). Raw diff Collapse all Expand all
None //===- MIRParser.h - MIR serialization format parser ----------------------===//
0 //===- MIRParser.h - MIR serialization format parser ------------*- C++ -*-===//
11 //
22 // The LLVM Compiler Infrastructure
33 //
3636 public:
3737 MIRParser(std::unique_ptr Impl);
3838 MIRParser(const MIRParser &) = delete;
39 ~MIRParser();
39 ~MIRParser() override;
4040
4141 /// Parse the optional LLVM IR module that's embedded in the MIR file.
4242 ///
7777
7878 } // end namespace llvm
7979
80 #endif
80 #endif // LLVM_CODEGEN_MIRPARSER_MIRPARSER_H
6868 virtual object::OwningBinary
6969 getObjectForDebug(const object::ObjectFile &Obj) const = 0;
7070
71 uint64_t getSectionLoadAddress(const object::SectionRef &Sec) const;
71 uint64_t
72 getSectionLoadAddress(const object::SectionRef &Sec) const override;
7273
7374 protected:
7475 virtual void anchor();
9495 /// \brief Memory Management.
9596 class MemoryManager {
9697 public:
97 virtual ~MemoryManager() {}
98 virtual ~MemoryManager() = default;
9899
99100 /// Allocate a memory block of (at least) the given size suitable for
100101 /// executable code. The SectionID is a unique identifier assigned by the
156157 /// \brief Symbol resolution.
157158 class SymbolResolver {
158159 public:
159 virtual ~SymbolResolver() {}
160 virtual ~SymbolResolver() = default;
160161
161162 /// This method returns the address of the specified function or variable.
162163 /// It is used to resolve symbols during module linking.
251252
252253 } // end namespace llvm
253254
254 #endif
255 #endif // LLVM_EXECUTIONENGINE_RUNTIMEDYLD_H
506506 explicit raw_svector_ostream(SmallVectorImpl &O) : OS(O) {
507507 SetUnbuffered();
508508 }
509 ~raw_svector_ostream() override {}
509 ~raw_svector_ostream() override = default;
510510
511511 void flush() = delete;
512512
535535
536536 public:
537537 buffer_ostream(raw_ostream &OS) : raw_svector_ostream(Buffer), OS(OS) {}
538 ~buffer_ostream() { OS << str(); }
538 ~buffer_ostream() override { OS << str(); }
539539 };
540540
541541 } // end llvm namespace
542542
543 #endif
543 #endif // LLVM_SUPPORT_RAW_OSTREAM_H
5757 RecTyKind getRecTyKind() const { return Kind; }
5858
5959 RecTy(RecTyKind K) : Kind(K) {}
60 virtual ~RecTy() {}
60 virtual ~RecTy() = default;
6161
6262 virtual std::string getAsString() const = 0;
6363 void print(raw_ostream &OS) const { OS << getAsString(); }
266266 explicit Init(InitKind K) : Kind(K) {}
267267
268268 public:
269 virtual ~Init() {}
269 virtual ~Init() = default;
270270
271271 /// isComplete - This virtual method should be overridden by values that may
272272 /// not be completely specified yet.
365365
366366 protected:
367367 explicit TypedInit(InitKind K, RecTy *T) : Init(K), Ty(T) {}
368 ~TypedInit() {
368 ~TypedInit() override {
369369 // If this is a DefInit we need to delete the RecordRecTy.
370370 if (getKind() == IK_DefInit)
371371 delete Ty;
15861586 Init *QualifyName(Record &CurRec, MultiClass *CurMultiClass,
15871587 const std::string &Name, const std::string &Scoper);
15881588
1589 } // End llvm namespace
1590
1591 #endif
1589 } // end llvm namespace
1590
1591 #endif // LLVM_TABLEGEN_RECORD_H
3939 MachineFunctionPass::getAnalysisUsage(AU);
4040 }
4141
42 virtual bool runOnMachineFunction(MachineFunction &MF) override {
42 bool runOnMachineFunction(MachineFunction &MF) override {
4343 std::string Str;
4444 raw_string_ostream StrOS(Str);
4545 printMIR(StrOS, MF);
4747 return false;
4848 }
4949
50 virtual bool doFinalization(Module &M) override {
50 bool doFinalization(Module &M) override {
5151 printMIR(OS, M);
5252 OS << MachineFunctions;
5353 return false;
222222 /// FindFunctionNamed - Search all of the active modules to find the function that
223223 /// defines FnName. This is very slow operation and shouldn't be used for
224224 /// general code.
225 virtual Function *FindFunctionNamed(const char *FnName) override;
226
227 /// FindGlobalVariableNamed - Search all of the active modules to find the global variable
228 /// that defines Name. This is very slow operation and shouldn't be used for
229 /// general code.
230 virtual GlobalVariable *FindGlobalVariableNamed(const char *Name, bool AllowInternal = false) override;
225 Function *FindFunctionNamed(const char *FnName) override;
226
227 /// FindGlobalVariableNamed - Search all of the active modules to find the
228 /// global variable that defines Name. This is very slow operation and
229 /// shouldn't be used for general code.
230 GlobalVariable *FindGlobalVariableNamed(const char *Name,
231 bool AllowInternal = false) override;
231232
232233 /// Sets the object manager that MCJIT should use to avoid compilation.
233234 void setObjectCache(ObjectCache *manager) override;
334335 bool CheckFunctionsOnly);
335336 };
336337
337 } // End llvm namespace
338
339 #endif
338 } // end llvm namespace
339
340 #endif // LLVM_LIB_EXECUTIONENGINE_MCJIT_MCJIT_H
184184 X86AddressSanitizer(const MCSubtargetInfo &STI)
185185 : X86AsmInstrumentation(STI), RepPrefix(false), OrigSPOffset(0) {}
186186
187 virtual ~X86AddressSanitizer() {}
187 ~X86AddressSanitizer() override = default;
188188
189189 // X86AsmInstrumentation implementation:
190 virtual void InstrumentAndEmitInstruction(const MCInst &Inst,
191 OperandVector &Operands,
192 MCContext &Ctx,
193 const MCInstrInfo &MII,
194 MCStreamer &Out) override {
190 void InstrumentAndEmitInstruction(const MCInst &Inst,
191 OperandVector &Operands,
192 MCContext &Ctx,
193 const MCInstrInfo &MII,
194 MCStreamer &Out) override {
195195 InstrumentMOVS(Inst, Operands, Ctx, MII, Out);
196196 if (RepPrefix)
197197 EmitInstruction(Out, MCInstBuilder(X86::REP_PREFIX));
505505 X86AddressSanitizer32(const MCSubtargetInfo &STI)
506506 : X86AddressSanitizer(STI) {}
507507
508 virtual ~X86AddressSanitizer32() {}
508 ~X86AddressSanitizer32() override = default;
509509
510510 unsigned GetFrameReg(const MCContext &Ctx, MCStreamer &Out) {
511511 unsigned FrameReg = GetFrameRegGeneric(Ctx, Out);
534534 OrigSPOffset += 4;
535535 }
536536
537 virtual void InstrumentMemOperandPrologue(const RegisterContext &RegCtx,
538 MCContext &Ctx,
539 MCStreamer &Out) override {
537 void InstrumentMemOperandPrologue(const RegisterContext &RegCtx,
538 MCContext &Ctx,
539 MCStreamer &Out) override {
540540 unsigned LocalFrameReg = RegCtx.ChooseFrameReg(MVT::i32);
541541 assert(LocalFrameReg != X86::NoRegister);
542542
564564 StoreFlags(Out);
565565 }
566566
567 virtual void InstrumentMemOperandEpilogue(const RegisterContext &RegCtx,
568 MCContext &Ctx,
569 MCStreamer &Out) override {
567 void InstrumentMemOperandEpilogue(const RegisterContext &RegCtx,
568 MCContext &Ctx,
569 MCStreamer &Out) override {
570570 unsigned LocalFrameReg = RegCtx.ChooseFrameReg(MVT::i32);
571571 assert(LocalFrameReg != X86::NoRegister);
572572
585585 }
586586 }
587587
588 virtual void InstrumentMemOperandSmall(X86Operand &Op, unsigned AccessSize,
589 bool IsWrite,
590 const RegisterContext &RegCtx,
591 MCContext &Ctx,
592 MCStreamer &Out) override;
593 virtual void InstrumentMemOperandLarge(X86Operand &Op, unsigned AccessSize,
594 bool IsWrite,
595 const RegisterContext &RegCtx,
596 MCContext &Ctx,
597 MCStreamer &Out) override;
598 virtual void InstrumentMOVSImpl(unsigned AccessSize, MCContext &Ctx,
599 MCStreamer &Out) override;
588 void InstrumentMemOperandSmall(X86Operand &Op, unsigned AccessSize,
589 bool IsWrite,
590 const RegisterContext &RegCtx,
591 MCContext &Ctx,
592 MCStreamer &Out) override;
593 void InstrumentMemOperandLarge(X86Operand &Op, unsigned AccessSize,
594 bool IsWrite,
595 const RegisterContext &RegCtx,
596 MCContext &Ctx,
597 MCStreamer &Out) override;
598 void InstrumentMOVSImpl(unsigned AccessSize, MCContext &Ctx,
599 MCStreamer &Out) override;
600600
601601 private:
602602 void EmitCallAsanReport(unsigned AccessSize, bool IsWrite, MCContext &Ctx,
762762 X86AddressSanitizer64(const MCSubtargetInfo &STI)
763763 : X86AddressSanitizer(STI) {}
764764
765 virtual ~X86AddressSanitizer64() {}
765 ~X86AddressSanitizer64() override = default;
766766
767767 unsigned GetFrameReg(const MCContext &Ctx, MCStreamer &Out) {
768768 unsigned FrameReg = GetFrameRegGeneric(Ctx, Out);
791791 OrigSPOffset += 8;
792792 }
793793
794 virtual void InstrumentMemOperandPrologue(const RegisterContext &RegCtx,
795 MCContext &Ctx,
796 MCStreamer &Out) override {
794 void InstrumentMemOperandPrologue(const RegisterContext &RegCtx,
795 MCContext &Ctx,
796 MCStreamer &Out) override {
797797 unsigned LocalFrameReg = RegCtx.ChooseFrameReg(MVT::i64);
798798 assert(LocalFrameReg != X86::NoRegister);
799799
822822 StoreFlags(Out);
823823 }
824824
825 virtual void InstrumentMemOperandEpilogue(const RegisterContext &RegCtx,
826 MCContext &Ctx,
827 MCStreamer &Out) override {
825 void InstrumentMemOperandEpilogue(const RegisterContext &RegCtx,
826 MCContext &Ctx,
827 MCStreamer &Out) override {
828828 unsigned LocalFrameReg = RegCtx.ChooseFrameReg(MVT::i64);
829829 assert(LocalFrameReg != X86::NoRegister);
830830
844844 }
845845 }
846846
847 virtual void InstrumentMemOperandSmall(X86Operand &Op, unsigned AccessSize,
848 bool IsWrite,
849 const RegisterContext &RegCtx,
850 MCContext &Ctx,
851 MCStreamer &Out) override;
852 virtual void InstrumentMemOperandLarge(X86Operand &Op, unsigned AccessSize,
853 bool IsWrite,
854 const RegisterContext &RegCtx,
855 MCContext &Ctx,
856 MCStreamer &Out) override;
857 virtual void InstrumentMOVSImpl(unsigned AccessSize, MCContext &Ctx,
858 MCStreamer &Out) override;
847 void InstrumentMemOperandSmall(X86Operand &Op, unsigned AccessSize,
848 bool IsWrite,
849 const RegisterContext &RegCtx,
850 MCContext &Ctx,
851 MCStreamer &Out) override;
852 void InstrumentMemOperandLarge(X86Operand &Op, unsigned AccessSize,
853 bool IsWrite,
854 const RegisterContext &RegCtx,
855 MCContext &Ctx,
856 MCStreamer &Out) override;
857 void InstrumentMOVSImpl(unsigned AccessSize, MCContext &Ctx,
858 MCStreamer &Out) override;
859859
860860 private:
861861 void EmitAdjustRSP(MCContext &Ctx, MCStreamer &Out, long Offset) {
10791079 return new X86AsmInstrumentation(STI);
10801080 }
10811081
1082 } // End llvm namespace
1082 } // end llvm namespace
219219 initializeSafeStackPass(*PassRegistry::getPassRegistry());
220220 }
221221
222 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
222 void getAnalysisUsage(AnalysisUsage &AU) const override {
223223 AU.addRequired();
224224 }
225225
226 virtual bool doInitialization(Module &M) {
226 bool doInitialization(Module &M) override {
227227 DL = &M.getDataLayout();
228228
229229 StackPtrTy = Type::getInt8PtrTy(M.getContext());
234234 return false;
235235 }
236236
237 bool runOnFunction(Function &F);
238
237 bool runOnFunction(Function &F) override;
239238 }; // class SafeStack
240239
241240 Constant *SafeStack::getOrCreateUnsafeStackPtr(Module &M) {
None //===- InstrInfoEmitter.cpp - Generate a Instruction Set Desc. ------------===//
0 //===- InstrInfoEmitter.cpp - Generate a Instruction Set Desc. --*- C++ -*-===//
11 //
22 // The LLVM Compiler Infrastructure
33 //
1010 // instruction set for the code generator.
1111 //
1212 //===----------------------------------------------------------------------===//
13
1413
1514 #include "CodeGenDAGPatterns.h"
1615 #include "CodeGenSchedule.h"
2524 #include
2625 #include
2726 #include
27
2828 using namespace llvm;
2929
3030 namespace {
6969 void EmitOperandInfo(raw_ostream &OS, OperandInfoMapTy &OperandInfoIDs);
7070 std::vector GetOperandInfo(const CodeGenInstruction &Inst);
7171 };
72 } // End anonymous namespace
72 } // end anonymous namespace
7373
7474 static void PrintDefList(const std::vector &Uses,
7575 unsigned Num, raw_ostream &OS) {
188188 OS << "};\n";
189189 }
190190 }
191
192191
193192 /// Initialize data structures for generating operand name mappings.
194193 ///
256255
257256 OS << "OPERAND_LAST";
258257 OS << "\n};\n";
259 OS << "} // End namespace OpName\n";
260 OS << "} // End namespace " << Namespace << "\n";
261 OS << "} // End namespace llvm\n";
258 OS << "} // end namespace OpName\n";
259 OS << "} // end namespace " << Namespace << "\n";
260 OS << "} // end namespace llvm\n";
262261 OS << "#endif //GET_INSTRINFO_OPERAND_ENUM\n";
263262
264263 OS << "#ifdef GET_INSTRINFO_NAMED_OPS\n";
297296 OS << " return -1;\n";
298297 }
299298 OS << "}\n";
300 OS << "} // End namespace " << Namespace << "\n";
301 OS << "} // End namespace llvm\n";
299 OS << "} // end namespace " << Namespace << "\n";
300 OS << "} // end namespace llvm\n";
302301 OS << "#endif //GET_INSTRINFO_NAMED_OPS\n";
303302
304303 }
327326 }
328327
329328 OS << " OPERAND_TYPE_LIST_END" << "\n};\n";
330 OS << "} // End namespace OpTypes\n";
331 OS << "} // End namespace " << Namespace << "\n";
332 OS << "} // End namespace llvm\n";
329 OS << "} // end namespace OpTypes\n";
330 OS << "} // end namespace " << Namespace << "\n";
331 OS << "} // end namespace llvm\n";
333332 OS << "#endif // GET_INSTRINFO_OPERAND_TYPES_ENUM\n";
334333 }
335334
418417 << TargetName << "InstrNameIndices, " << TargetName << "InstrNameData, "
419418 << NumberedInstructions.size() << ");\n}\n\n";
420419
421 OS << "} // End llvm namespace \n";
420 OS << "} // end llvm namespace \n";
422421
423422 OS << "#endif // GET_INSTRINFO_MC_DESC\n\n";
424423
431430 OS << "struct " << ClassName << " : public TargetInstrInfo {\n"
432431 << " explicit " << ClassName
433432 << "(int CFSetupOpcode = -1, int CFDestroyOpcode = -1);\n"
434 << " virtual ~" << ClassName << "();\n"
433 << " ~" << ClassName << "() override = default;\n"
435434 << "};\n";
436 OS << "} // End llvm namespace \n";
435 OS << "} // end llvm namespace \n";
437436
438437 OS << "#endif // GET_INSTRINFO_HEADER\n\n";
439438
449448 << " : TargetInstrInfo(CFSetupOpcode, CFDestroyOpcode) {\n"
450449 << " InitMCInstrInfo(" << TargetName << "Insts, " << TargetName
451450 << "InstrNameIndices, " << TargetName << "InstrNameData, "
452 << NumberedInstructions.size() << ");\n}\n"
453 << ClassName << "::~" << ClassName << "() {}\n";
454 OS << "} // End llvm namespace \n";
451 << NumberedInstructions.size() << ");\n}\n";
452 OS << "} // end llvm namespace \n";
455453
456454 OS << "#endif // GET_INSTRINFO_CTOR_DTOR\n\n";
457455
595593 OS << " " << Class.Name << "\t= " << Num++ << ",\n";
596594 OS << " SCHED_LIST_END = " << SchedModels.numInstrSchedClasses() << "\n";
597595 OS << " };\n";
598 OS << "} // End Sched namespace\n";
599 OS << "} // End " << Namespace << " namespace\n";
600 OS << "} // End llvm namespace \n";
596 OS << "} // end Sched namespace\n";
597 OS << "} // end " << Namespace << " namespace\n";
598 OS << "} // end llvm namespace \n";
601599
602600 OS << "#endif // GET_INSTRINFO_ENUM\n\n";
603601 }
609607 EmitMapTable(RK, OS);
610608 }
611609
612 } // End llvm namespace
610 } // end llvm namespace