llvm.org GIT mirror llvm / 2515069
Revert r247216: "Fix Clang-tidy misc-use-override warnings, other minor fixes" This caused build breakges, e.g. http://lab.llvm.org:8011/builders/clang-x86_64-ubuntu-gdb-75/builds/24926 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247226 91177308-0d34-0410-b5e6-96231b3b80d8 Hans Wennborg 5 years ago
9 changed file(s) with 98 addition(s) and 97 deletion(s). Raw diff Collapse all Expand all
None //===- MIRParser.h - MIR serialization format parser ------------*- C++ -*-===//
0 //===- MIRParser.h - MIR serialization format parser ----------------------===//
11 //
22 // The LLVM Compiler Infrastructure
33 //
3636 public:
3737 MIRParser(std::unique_ptr Impl);
3838 MIRParser(const MIRParser &) = delete;
39 ~MIRParser() override;
39 ~MIRParser();
4040
4141 /// Parse the optional LLVM IR module that's embedded in the MIR file.
4242 ///
7777
7878 } // end namespace llvm
7979
80 #endif // LLVM_CODEGEN_MIRPARSER_MIRPARSER_H
80 #endif
6868 virtual object::OwningBinary
6969 getObjectForDebug(const object::ObjectFile &Obj) const = 0;
7070
71 uint64_t
72 getSectionLoadAddress(const object::SectionRef &Sec) const override;
71 uint64_t getSectionLoadAddress(const object::SectionRef &Sec) const;
7372
7473 protected:
7574 virtual void anchor();
9594 /// \brief Memory Management.
9695 class MemoryManager {
9796 public:
98 virtual ~MemoryManager() = default;
97 virtual ~MemoryManager() {}
9998
10099 /// Allocate a memory block of (at least) the given size suitable for
101100 /// executable code. The SectionID is a unique identifier assigned by the
157156 /// \brief Symbol resolution.
158157 class SymbolResolver {
159158 public:
160 virtual ~SymbolResolver() = default;
159 virtual ~SymbolResolver() {}
161160
162161 /// This method returns the address of the specified function or variable.
163162 /// It is used to resolve symbols during module linking.
252251
253252 } // end namespace llvm
254253
255 #endif // LLVM_EXECUTIONENGINE_RUNTIMEDYLD_H
254 #endif
506506 explicit raw_svector_ostream(SmallVectorImpl &O) : OS(O) {
507507 SetUnbuffered();
508508 }
509 ~raw_svector_ostream() override = default;
509 ~raw_svector_ostream() override {}
510510
511511 void flush() = delete;
512512
535535
536536 public:
537537 buffer_ostream(raw_ostream &OS) : raw_svector_ostream(Buffer), OS(OS) {}
538 ~buffer_ostream() override { OS << str(); }
538 ~buffer_ostream() { OS << str(); }
539539 };
540540
541541 } // end llvm namespace
542542
543 #endif // LLVM_SUPPORT_RAW_OSTREAM_H
543 #endif
5757 RecTyKind getRecTyKind() const { return Kind; }
5858
5959 RecTy(RecTyKind K) : Kind(K) {}
60 virtual ~RecTy() = default;
60 virtual ~RecTy() {}
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() = default;
269 virtual ~Init() {}
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() override {
368 ~TypedInit() {
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 // LLVM_TABLEGEN_RECORD_H
1589 } // End llvm namespace
1590
1591 #endif
3939 MachineFunctionPass::getAnalysisUsage(AU);
4040 }
4141
42 bool runOnMachineFunction(MachineFunction &MF) override {
42 virtual 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 bool doFinalization(Module &M) override {
50 virtual 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 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;
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;
232231
233232 /// Sets the object manager that MCJIT should use to avoid compilation.
234233 void setObjectCache(ObjectCache *manager) override;
335334 bool CheckFunctionsOnly);
336335 };
337336
338 } // end llvm namespace
339
340 #endif // LLVM_LIB_EXECUTIONENGINE_MCJIT_MCJIT_H
337 } // End llvm namespace
338
339 #endif
184184 X86AddressSanitizer(const MCSubtargetInfo &STI)
185185 : X86AsmInstrumentation(STI), RepPrefix(false), OrigSPOffset(0) {}
186186
187 ~X86AddressSanitizer() override = default;
187 virtual ~X86AddressSanitizer() {}
188188
189189 // X86AsmInstrumentation implementation:
190 void InstrumentAndEmitInstruction(const MCInst &Inst,
191 OperandVector &Operands,
192 MCContext &Ctx,
193 const MCInstrInfo &MII,
194 MCStreamer &Out) override {
190 virtual 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 ~X86AddressSanitizer32() override = default;
508 virtual ~X86AddressSanitizer32() {}
509509
510510 unsigned GetFrameReg(const MCContext &Ctx, MCStreamer &Out) {
511511 unsigned FrameReg = GetFrameRegGeneric(Ctx, Out);
534534 OrigSPOffset += 4;
535535 }
536536
537 void InstrumentMemOperandPrologue(const RegisterContext &RegCtx,
538 MCContext &Ctx,
539 MCStreamer &Out) override {
537 virtual 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 void InstrumentMemOperandEpilogue(const RegisterContext &RegCtx,
568 MCContext &Ctx,
569 MCStreamer &Out) override {
567 virtual 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 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;
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;
600600
601601 private:
602602 void EmitCallAsanReport(unsigned AccessSize, bool IsWrite, MCContext &Ctx,
762762 X86AddressSanitizer64(const MCSubtargetInfo &STI)
763763 : X86AddressSanitizer(STI) {}
764764
765 ~X86AddressSanitizer64() override = default;
765 virtual ~X86AddressSanitizer64() {}
766766
767767 unsigned GetFrameReg(const MCContext &Ctx, MCStreamer &Out) {
768768 unsigned FrameReg = GetFrameRegGeneric(Ctx, Out);
791791 OrigSPOffset += 8;
792792 }
793793
794 void InstrumentMemOperandPrologue(const RegisterContext &RegCtx,
795 MCContext &Ctx,
796 MCStreamer &Out) override {
794 virtual 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 void InstrumentMemOperandEpilogue(const RegisterContext &RegCtx,
826 MCContext &Ctx,
827 MCStreamer &Out) override {
825 virtual 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 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;
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;
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 void getAnalysisUsage(AnalysisUsage &AU) const override {
222 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
223223 AU.addRequired();
224224 }
225225
226 bool doInitialization(Module &M) override {
226 virtual bool doInitialization(Module &M) {
227227 DL = &M.getDataLayout();
228228
229229 StackPtrTy = Type::getInt8PtrTy(M.getContext());
234234 return false;
235235 }
236236
237 bool runOnFunction(Function &F) override;
237 bool runOnFunction(Function &F);
238
238239 }; // class SafeStack
239240
240241 Constant *SafeStack::getOrCreateUnsafeStackPtr(Module &M) {
None //===- InstrInfoEmitter.cpp - Generate a Instruction Set Desc. --*- C++ -*-===//
0 //===- InstrInfoEmitter.cpp - Generate a Instruction Set Desc. ------------===//
11 //
22 // The LLVM Compiler Infrastructure
33 //
1010 // instruction set for the code generator.
1111 //
1212 //===----------------------------------------------------------------------===//
13
1314
1415 #include "CodeGenDAGPatterns.h"
1516 #include "CodeGenSchedule.h"
2425 #include
2526 #include
2627 #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
191192
192193 /// Initialize data structures for generating operand name mappings.
193194 ///
255256
256257 OS << "OPERAND_LAST";
257258 OS << "\n};\n";
258 OS << "} // end namespace OpName\n";
259 OS << "} // end namespace " << Namespace << "\n";
260 OS << "} // end namespace llvm\n";
259 OS << "} // End namespace OpName\n";
260 OS << "} // End namespace " << Namespace << "\n";
261 OS << "} // End namespace llvm\n";
261262 OS << "#endif //GET_INSTRINFO_OPERAND_ENUM\n";
262263
263264 OS << "#ifdef GET_INSTRINFO_NAMED_OPS\n";
296297 OS << " return -1;\n";
297298 }
298299 OS << "}\n";
299 OS << "} // end namespace " << Namespace << "\n";
300 OS << "} // end namespace llvm\n";
300 OS << "} // End namespace " << Namespace << "\n";
301 OS << "} // End namespace llvm\n";
301302 OS << "#endif //GET_INSTRINFO_NAMED_OPS\n";
302303
303304 }
326327 }
327328
328329 OS << " OPERAND_TYPE_LIST_END" << "\n};\n";
329 OS << "} // end namespace OpTypes\n";
330 OS << "} // end namespace " << Namespace << "\n";
331 OS << "} // end namespace llvm\n";
330 OS << "} // End namespace OpTypes\n";
331 OS << "} // End namespace " << Namespace << "\n";
332 OS << "} // End namespace llvm\n";
332333 OS << "#endif // GET_INSTRINFO_OPERAND_TYPES_ENUM\n";
333334 }
334335
417418 << TargetName << "InstrNameIndices, " << TargetName << "InstrNameData, "
418419 << NumberedInstructions.size() << ");\n}\n\n";
419420
420 OS << "} // end llvm namespace \n";
421 OS << "} // End llvm namespace \n";
421422
422423 OS << "#endif // GET_INSTRINFO_MC_DESC\n\n";
423424
430431 OS << "struct " << ClassName << " : public TargetInstrInfo {\n"
431432 << " explicit " << ClassName
432433 << "(int CFSetupOpcode = -1, int CFDestroyOpcode = -1);\n"
433 << " ~" << ClassName << "() override = default;\n"
434 << " virtual ~" << ClassName << "();\n"
434435 << "};\n";
435 OS << "} // end llvm namespace \n";
436 OS << "} // End llvm namespace \n";
436437
437438 OS << "#endif // GET_INSTRINFO_HEADER\n\n";
438439
448449 << " : TargetInstrInfo(CFSetupOpcode, CFDestroyOpcode) {\n"
449450 << " InitMCInstrInfo(" << TargetName << "Insts, " << TargetName
450451 << "InstrNameIndices, " << TargetName << "InstrNameData, "
451 << NumberedInstructions.size() << ");\n}\n";
452 OS << "} // end llvm namespace \n";
452 << NumberedInstructions.size() << ");\n}\n"
453 << ClassName << "::~" << ClassName << "() {}\n";
454 OS << "} // End llvm namespace \n";
453455
454456 OS << "#endif // GET_INSTRINFO_CTOR_DTOR\n\n";
455457
593595 OS << " " << Class.Name << "\t= " << Num++ << ",\n";
594596 OS << " SCHED_LIST_END = " << SchedModels.numInstrSchedClasses() << "\n";
595597 OS << " };\n";
596 OS << "} // end Sched namespace\n";
597 OS << "} // end " << Namespace << " namespace\n";
598 OS << "} // end llvm namespace \n";
598 OS << "} // End Sched namespace\n";
599 OS << "} // End " << Namespace << " namespace\n";
600 OS << "} // End llvm namespace \n";
599601
600602 OS << "#endif // GET_INSTRINFO_ENUM\n\n";
601603 }
607609 EmitMapTable(RK, OS);
608610 }
609611
610 } // end llvm namespace
612 } // End llvm namespace