llvm.org GIT mirror llvm / 98f54c0
[C++11] Add 'override' keyword to IR library. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202939 91177308-0d34-0410-b5e6-96231b3b80d8 Craig Topper 6 years ago
22 changed file(s) with 212 addition(s) and 207 deletion(s). Raw diff Collapse all Expand all
4040 class Constant : public User {
4141 void operator=(const Constant &) LLVM_DELETED_FUNCTION;
4242 Constant(const Constant &) LLVM_DELETED_FUNCTION;
43 virtual void anchor();
44
43 void anchor() override;
44
4545 protected:
4646 Constant(Type *ty, ValueTy vty, Use *Ops, unsigned NumOps)
4747 : User(ty, vty, Ops, NumOps) {}
4848 /// represents both boolean and integral constants.
4949 /// @brief Class for constant integers.
5050 class ConstantInt : public Constant {
51 virtual void anchor();
51 void anchor() override;
5252 void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
5353 ConstantInt(const ConstantInt &) LLVM_DELETED_FUNCTION;
5454 ConstantInt(IntegerType *Ty, const APInt& V);
230230 ///
231231 class ConstantFP : public Constant {
232232 APFloat Val;
233 virtual void anchor();
233 void anchor() override;
234234 void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
235235 ConstantFP(const ConstantFP &) LLVM_DELETED_FUNCTION;
236236 friend class LLVMContextImpl;
307307 public:
308308 static ConstantAggregateZero *get(Type *Ty);
309309
310 virtual void destroyConstant();
310 void destroyConstant() override;
311311
312312 /// getSequentialElement - If this CAZ has array or vector type, return a zero
313313 /// with the right element type.
355355 return cast(Value::getType());
356356 }
357357
358 virtual void destroyConstant();
359 virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U);
358 void destroyConstant() override;
359 void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U) override;
360360
361361 /// Methods for support type inquiry through isa, cast, and dyn_cast:
362362 static bool classof(const Value *V) {
413413 return cast(Value::getType());
414414 }
415415
416 virtual void destroyConstant();
417 virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U);
416 void destroyConstant() override;
417 void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U) override;
418418
419419 /// Methods for support type inquiry through isa, cast, and dyn_cast:
420420 static bool classof(const Value *V) {
460460 /// elements have the same value, return that value. Otherwise return NULL.
461461 Constant *getSplatValue() const;
462462
463 virtual void destroyConstant();
464 virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U);
463 void destroyConstant() override;
464 void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U) override;
465465
466466 /// Methods for support type inquiry through isa, cast, and dyn_cast:
467467 static bool classof(const Value *V) {
496496 /// get() - Static factory methods - Return objects of the specified value
497497 static ConstantPointerNull *get(PointerType *T);
498498
499 virtual void destroyConstant();
499 void destroyConstant() override;
500500
501501 /// getType - Specialize the getType() method to always return an PointerType,
502502 /// which reduces the amount of casting needed in parts of the compiler.
623623 /// host endianness of the data elements.
624624 StringRef getRawDataValues() const;
625625
626 virtual void destroyConstant();
626 void destroyConstant() override;
627627
628628 /// Methods for support type inquiry through isa, cast, and dyn_cast:
629629 ///
644644 class ConstantDataArray : public ConstantDataSequential {
645645 void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
646646 ConstantDataArray(const ConstantDataArray &) LLVM_DELETED_FUNCTION;
647 virtual void anchor();
647 void anchor() override;
648648 friend class ConstantDataSequential;
649649 explicit ConstantDataArray(Type *ty, const char *Data)
650650 : ConstantDataSequential(ty, ConstantDataArrayVal, Data) {}
696696 class ConstantDataVector : public ConstantDataSequential {
697697 void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
698698 ConstantDataVector(const ConstantDataVector &) LLVM_DELETED_FUNCTION;
699 virtual void anchor();
699 void anchor() override;
700700 friend class ConstantDataSequential;
701701 explicit ConstantDataVector(Type *ty, const char *Data)
702702 : ConstantDataSequential(ty, ConstantDataVectorVal, Data) {}
768768 Function *getFunction() const { return (Function*)Op<0>().get(); }
769769 BasicBlock *getBasicBlock() const { return (BasicBlock*)Op<1>().get(); }
770770
771 virtual void destroyConstant();
772 virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U);
771 void destroyConstant() override;
772 void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U) override;
773773
774774 /// Methods for support type inquiry through isa, cast, and dyn_cast:
775775 static inline bool classof(const Value *V) {
10981098 /// would make it harder to remove ConstantExprs altogether.
10991099 Instruction *getAsInstruction();
11001100
1101 virtual void destroyConstant();
1102 virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U);
1101 void destroyConstant() override;
1102 void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U) override;
11031103
11041104 /// Methods for support type inquiry through isa, cast, and dyn_cast:
11051105 static inline bool classof(const Value *V) {
11631163 /// index.
11641164 UndefValue *getElementValue(unsigned Idx) const;
11651165
1166 virtual void destroyConstant();
1166 void destroyConstant() override;
11671167
11681168 /// Methods for support type inquiry through isa, cast, and dyn_cast:
11691169 static bool classof(const Value *V) {
127127 const Instruction *getInstruction() const { return Instr; }
128128
129129 /// \see DiagnosticInfo::print.
130 virtual void print(DiagnosticPrinter &DP) const;
130 void print(DiagnosticPrinter &DP) const override;
131131
132132 /// Hand rolled RTTI.
133133 static bool classof(const DiagnosticInfo *DI) {
155155 unsigned getStackSize() const { return StackSize; }
156156
157157 /// \see DiagnosticInfo::print.
158 virtual void print(DiagnosticPrinter &DP) const;
158 void print(DiagnosticPrinter &DP) const override;
159159
160160 /// Hand rolled RTTI.
161161 static bool classof(const DiagnosticInfo *DI) {
184184 unsigned getMetadataVersion() const { return MetadataVersion; }
185185
186186 /// \see DiagnosticInfo::print.
187 virtual void print(DiagnosticPrinter &DP) const;
187 void print(DiagnosticPrinter &DP) const override;
188188
189189 /// Hand rolled RTTI.
190190 static bool classof(const DiagnosticInfo *DI) {
6161 DiagnosticPrinterRawOStream(raw_ostream &Stream) : Stream(Stream) {};
6262
6363 // Simple types.
64 virtual DiagnosticPrinter &operator<<(char C);
65 virtual DiagnosticPrinter &operator<<(unsigned char C);
66 virtual DiagnosticPrinter &operator<<(signed char C);
67 virtual DiagnosticPrinter &operator<<(StringRef Str);
68 virtual DiagnosticPrinter &operator<<(const char *Str);
69 virtual DiagnosticPrinter &operator<<(const std::string &Str);
70 virtual DiagnosticPrinter &operator<<(unsigned long N);
71 virtual DiagnosticPrinter &operator<<(long N);
72 virtual DiagnosticPrinter &operator<<(unsigned long long N);
73 virtual DiagnosticPrinter &operator<<(long long N);
74 virtual DiagnosticPrinter &operator<<(const void *P);
75 virtual DiagnosticPrinter &operator<<(unsigned int N);
76 virtual DiagnosticPrinter &operator<<(int N);
77 virtual DiagnosticPrinter &operator<<(double N);
78 virtual DiagnosticPrinter &operator<<(const Twine &Str);
64 DiagnosticPrinter &operator<<(char C) override;
65 DiagnosticPrinter &operator<<(unsigned char C) override;
66 DiagnosticPrinter &operator<<(signed char C) override;
67 DiagnosticPrinter &operator<<(StringRef Str) override;
68 DiagnosticPrinter &operator<<(const char *Str) override;
69 DiagnosticPrinter &operator<<(const std::string &Str) override;
70 DiagnosticPrinter &operator<<(unsigned long N) override;
71 DiagnosticPrinter &operator<<(long N) override;
72 DiagnosticPrinter &operator<<(unsigned long long N) override;
73 DiagnosticPrinter &operator<<(long long N) override;
74 DiagnosticPrinter &operator<<(const void *P) override;
75 DiagnosticPrinter &operator<<(unsigned int N) override;
76 DiagnosticPrinter &operator<<(int N) override;
77 DiagnosticPrinter &operator<<(double N) override;
78 DiagnosticPrinter &operator<<(const Twine &Str) override;
7979
8080 // IR related types.
81 virtual DiagnosticPrinter &operator<<(const Value &V);
82 virtual DiagnosticPrinter &operator<<(const Module &M);
81 DiagnosticPrinter &operator<<(const Value &V) override;
82 DiagnosticPrinter &operator<<(const Module &M) override;
8383 };
8484 } // End namespace llvm
8585
175175 DominatorTree &getDomTree() { return DT; }
176176 const DominatorTree &getDomTree() const { return DT; }
177177
178 virtual bool runOnFunction(Function &F);
178 bool runOnFunction(Function &F) override;
179179
180 virtual void verifyAnalysis() const;
180 void verifyAnalysis() const override;
181181
182 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
182 void getAnalysisUsage(AnalysisUsage &AU) const override {
183183 AU.setPreservesAll();
184184 }
185185
186 virtual void releaseMemory() { DT.releaseMemory(); }
186 void releaseMemory() override { DT.releaseMemory(); }
187187
188 virtual void print(raw_ostream &OS, const Module *M = 0) const;
188 void print(raw_ostream &OS, const Module *M = 0) const override;
189189 };
190190
191191 } // End llvm namespace
334334
335335 /// copyAttributesFrom - copy all additional attributes (those not needed to
336336 /// create a Function) from the Function Src to this one.
337 void copyAttributesFrom(const GlobalValue *Src);
337 void copyAttributesFrom(const GlobalValue *Src) override;
338338
339339 /// deleteBody - This method deletes the body of the function, and converts
340340 /// the linkage to external.
347347 /// removeFromParent - This method unlinks 'this' from the containing module,
348348 /// but does not delete it.
349349 ///
350 virtual void removeFromParent();
350 void removeFromParent() override;
351351
352352 /// eraseFromParent - This method unlinks 'this' from the containing module
353353 /// and deletes it.
354354 ///
355 virtual void eraseFromParent();
355 void eraseFromParent() override;
356356
357357
358358 /// Get the underlying elements of the Function... the basic block list is
4848 /// removeFromParent - This method unlinks 'this' from the containing module,
4949 /// but does not delete it.
5050 ///
51 virtual void removeFromParent();
51 void removeFromParent() override;
5252
5353 /// eraseFromParent - This method unlinks 'this' from the containing module
5454 /// and deletes it.
5555 ///
56 virtual void eraseFromParent();
56 void eraseFromParent() override;
5757
5858 /// set/getAliasee - These methods retrive and set alias target.
5959 void setAliasee(Constant *GV);
280280 /// @}
281281
282282 /// Override from Constant class.
283 virtual void destroyConstant();
283 void destroyConstant() override;
284284
285285 /// isDeclaration - Return true if the primary definition of this global
286286 /// value is outside of the current translation unit.
173173
174174 /// copyAttributesFrom - copy all additional attributes (those not needed to
175175 /// create a GlobalVariable) from the GlobalVariable Src to this one.
176 void copyAttributesFrom(const GlobalValue *Src);
176 void copyAttributesFrom(const GlobalValue *Src) override;
177177
178178 /// removeFromParent - This method unlinks 'this' from the containing module,
179179 /// but does not delete it.
180180 ///
181 virtual void removeFromParent();
181 void removeFromParent() override;
182182
183183 /// eraseFromParent - This method unlinks 'this' from the containing module
184184 /// and deletes it.
185185 ///
186 virtual void eraseFromParent();
186 void eraseFromParent() override;
187187
188188 /// Override Constant's implementation of this method so we can
189189 /// replace constant initializers.
190 virtual void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U);
190 void replaceUsesOfWithOnConstant(Value *From, Value *To, Use *U) override;
191191
192192 // Methods for support type inquiry through isa, cast, and dyn_cast:
193193 static inline bool classof(const Value *V) {
5656 ///
5757 class AllocaInst : public UnaryInstruction {
5858 protected:
59 virtual AllocaInst *clone_impl() const;
59 AllocaInst *clone_impl() const override;
6060 public:
6161 explicit AllocaInst(Type *Ty, Value *ArraySize = 0,
6262 const Twine &Name = "", Instruction *InsertBefore = 0);
149149 class LoadInst : public UnaryInstruction {
150150 void AssertOK();
151151 protected:
152 virtual LoadInst *clone_impl() const;
152 LoadInst *clone_impl() const override;
153153 public:
154154 LoadInst(Value *Ptr, const Twine &NameStr, Instruction *InsertBefore);
155155 LoadInst(Value *Ptr, const Twine &NameStr, BasicBlock *InsertAtEnd);
269269 void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
270270 void AssertOK();
271271 protected:
272 virtual StoreInst *clone_impl() const;
272 StoreInst *clone_impl() const override;
273273 public:
274274 // allocate space for exactly two operands
275275 void *operator new(size_t s) {
396396 void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
397397 void Init(AtomicOrdering Ordering, SynchronizationScope SynchScope);
398398 protected:
399 virtual FenceInst *clone_impl() const;
399 FenceInst *clone_impl() const override;
400400 public:
401401 // allocate space for exactly zero operands
402402 void *operator new(size_t s) {
464464 void Init(Value *Ptr, Value *Cmp, Value *NewVal,
465465 AtomicOrdering Ordering, SynchronizationScope SynchScope);
466466 protected:
467 virtual AtomicCmpXchgInst *clone_impl() const;
467 AtomicCmpXchgInst *clone_impl() const override;
468468 public:
469469 // allocate space for exactly three operands
470470 void *operator new(size_t s) {
569569 class AtomicRMWInst : public Instruction {
570570 void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
571571 protected:
572 virtual AtomicRMWInst *clone_impl() const;
572 AtomicRMWInst *clone_impl() const override;
573573 public:
574574 /// This enumeration lists the possible modifications atomicrmw can make. In
575575 /// the descriptions, 'p' is the pointer to the instruction's memory location,
734734 unsigned Values, const Twine &NameStr,
735735 BasicBlock *InsertAtEnd);
736736 protected:
737 virtual GetElementPtrInst *clone_impl() const;
737 GetElementPtrInst *clone_impl() const override;
738738 public:
739739 static GetElementPtrInst *Create(Value *Ptr, ArrayRef IdxList,
740740 const Twine &NameStr = "",
936936
937937 protected:
938938 /// \brief Clone an identical ICmpInst
939 virtual ICmpInst *clone_impl() const;
939 ICmpInst *clone_impl() const override;
940940 public:
941941 /// \brief Constructor with insert-before-instruction semantics.
942942 ICmpInst(
10681068 class FCmpInst: public CmpInst {
10691069 protected:
10701070 /// \brief Clone an identical FCmpInst
1071 virtual FCmpInst *clone_impl() const;
1071 FCmpInst *clone_impl() const override;
10721072 public:
10731073 /// \brief Constructor with insert-before-instruction semantics.
10741074 FCmpInst(
11911191 Instruction *InsertBefore);
11921192 CallInst(Value *F, const Twine &NameStr, BasicBlock *InsertAtEnd);
11931193 protected:
1194 virtual CallInst *clone_impl() const;
1194 CallInst *clone_impl() const override;
11951195 public:
11961196 static CallInst *Create(Value *Func,
11971197 ArrayRef Args,
14631463 setName(NameStr);
14641464 }
14651465 protected:
1466 virtual SelectInst *clone_impl() const;
1466 SelectInst *clone_impl() const override;
14671467 public:
14681468 static SelectInst *Create(Value *C, Value *S1, Value *S2,
14691469 const Twine &NameStr = "",
15181518 ///
15191519 class VAArgInst : public UnaryInstruction {
15201520 protected:
1521 virtual VAArgInst *clone_impl() const;
1521 VAArgInst *clone_impl() const override;
15221522
15231523 public:
15241524 VAArgInst(Value *List, Type *Ty, const Twine &NameStr = "",
15581558 ExtractElementInst(Value *Vec, Value *Idx, const Twine &NameStr,
15591559 BasicBlock *InsertAtEnd);
15601560 protected:
1561 virtual ExtractElementInst *clone_impl() const;
1561 ExtractElementInst *clone_impl() const override;
15621562
15631563 public:
15641564 static ExtractElementInst *Create(Value *Vec, Value *Idx,
16191619 InsertElementInst(Value *Vec, Value *NewElt, Value *Idx,
16201620 const Twine &NameStr, BasicBlock *InsertAtEnd);
16211621 protected:
1622 virtual InsertElementInst *clone_impl() const;
1622 InsertElementInst *clone_impl() const override;
16231623
16241624 public:
16251625 static InsertElementInst *Create(Value *Vec, Value *NewElt, Value *Idx,
16721672 ///
16731673 class ShuffleVectorInst : public Instruction {
16741674 protected:
1675 virtual ShuffleVectorInst *clone_impl() const;
1675 ShuffleVectorInst *clone_impl() const override;
16761676
16771677 public:
16781678 // allocate space for exactly three operands
17731773 return User::operator new(s, 1);
17741774 }
17751775 protected:
1776 virtual ExtractValueInst *clone_impl() const;
1776 ExtractValueInst *clone_impl() const override;
17771777
17781778 public:
17791779 static ExtractValueInst *Create(Value *Agg,
18841884 InsertValueInst(Value *Agg, Value *Val, unsigned Idx,
18851885 const Twine &NameStr, BasicBlock *InsertAtEnd);
18861886 protected:
1887 virtual InsertValueInst *clone_impl() const;
1887 InsertValueInst *clone_impl() const override;
18881888 public:
18891889 // allocate space for exactly two operands
18901890 void *operator new(size_t s) {
20192019 // values and pointers to the incoming blocks, all in one allocation.
20202020 Use *allocHungoffUses(unsigned) const;
20212021
2022 virtual PHINode *clone_impl() const;
2022 PHINode *clone_impl() const override;
20232023 public:
20242024 /// Constructors - NumReservedValues is a hint for the number of incoming
20252025 /// edges that this phi node will have (use 0 if you really have no idea).
22102210 unsigned NumReservedValues, const Twine &NameStr,
22112211 BasicBlock *InsertAtEnd);
22122212 protected:
2213 virtual LandingPadInst *clone_impl() const;
2213 LandingPadInst *clone_impl() const override;
22142214 public:
22152215 /// Constructors - NumReservedClauses is a hint for the number of incoming
22162216 /// clauses that this landingpad will have (use 0 if you really have no idea).
23082308 ReturnInst(LLVMContext &C, Value *retVal, BasicBlock *InsertAtEnd);
23092309 explicit ReturnInst(LLVMContext &C, BasicBlock *InsertAtEnd);
23102310 protected:
2311 virtual ReturnInst *clone_impl() const;
2311 ReturnInst *clone_impl() const override;
23122312 public:
23132313 static ReturnInst* Create(LLVMContext &C, Value *retVal = 0,
23142314 Instruction *InsertBefore = 0) {
23412341 return isa(V) && classof(cast(V));
23422342 }
23432343 private:
2344 virtual BasicBlock *getSuccessorV(unsigned idx) const;
2345 virtual unsigned getNumSuccessorsV() const;
2346 virtual void setSuccessorV(unsigned idx, BasicBlock *B);
2344 BasicBlock *getSuccessorV(unsigned idx) const override;
2345 unsigned getNumSuccessorsV() const override;
2346 void setSuccessorV(unsigned idx, BasicBlock *B) override;
23472347 };
23482348
23492349 template <>
23802380 BranchInst(BasicBlock *IfTrue, BasicBlock *IfFalse, Value *Cond,
23812381 BasicBlock *InsertAtEnd);
23822382 protected:
2383 virtual BranchInst *clone_impl() const;
2383 BranchInst *clone_impl() const override;
23842384 public:
23852385 static BranchInst *Create(BasicBlock *IfTrue, Instruction *InsertBefore = 0) {
23862386 return new(1) BranchInst(IfTrue, InsertBefore);
24402440 return isa(V) && classof(cast(V));
24412441 }
24422442 private:
2443 virtual BasicBlock *getSuccessorV(unsigned idx) const;
2444 virtual unsigned getNumSuccessorsV() const;
2445 virtual void setSuccessorV(unsigned idx, BasicBlock *B);
2443 BasicBlock *getSuccessorV(unsigned idx) const override;
2444 unsigned getNumSuccessorsV() const override;
2445 void setSuccessorV(unsigned idx, BasicBlock *B) override;
24462446 };
24472447
24482448 template <>
24862486 SwitchInst(Value *Value, BasicBlock *Default, unsigned NumCases,
24872487 BasicBlock *InsertAtEnd);
24882488 protected:
2489 virtual SwitchInst *clone_impl() const;
2489 SwitchInst *clone_impl() const override;
24902490 public:
24912491
24922492 // -2
27332733 return isa(V) && classof(cast(V));
27342734 }
27352735 private:
2736 virtual BasicBlock *getSuccessorV(unsigned idx) const;
2737 virtual unsigned getNumSuccessorsV() const;
2738 virtual void setSuccessorV(unsigned idx, BasicBlock *B);
2736 BasicBlock *getSuccessorV(unsigned idx) const override;
2737 unsigned getNumSuccessorsV() const override;
2738 void setSuccessorV(unsigned idx, BasicBlock *B) override;
27392739 };
27402740
27412741 template <>
27782778 /// autoinserts at the end of the specified BasicBlock.
27792779 IndirectBrInst(Value *Address, unsigned NumDests, BasicBlock *InsertAtEnd);
27802780 protected:
2781 virtual IndirectBrInst *clone_impl() const;
2781 IndirectBrInst *clone_impl() const override;
27822782 public:
27832783 static IndirectBrInst *Create(Value *Address, unsigned NumDests,
27842784 Instruction *InsertBefore = 0) {
28312831 return isa(V) && classof(cast(V));
28322832 }
28332833 private:
2834 virtual BasicBlock *getSuccessorV(unsigned idx) const;
2835 virtual unsigned getNumSuccessorsV() const;
2836 virtual void setSuccessorV(unsigned idx, BasicBlock *B);
2834 BasicBlock *getSuccessorV(unsigned idx) const override;
2835 unsigned getNumSuccessorsV() const override;
2836 void setSuccessorV(unsigned idx, BasicBlock *B) override;
28372837 };
28382838
28392839 template <>
28702870 ArrayRef Args, unsigned Values,
28712871 const Twine &NameStr, BasicBlock *InsertAtEnd);
28722872 protected:
2873 virtual InvokeInst *clone_impl() const;
2873 InvokeInst *clone_impl() const override;
28742874 public:
28752875 static InvokeInst *Create(Value *Func,
28762876 BasicBlock *IfNormal, BasicBlock *IfException,
30543054 }
30553055
30563056 private:
3057 virtual BasicBlock *getSuccessorV(unsigned idx) const;
3058 virtual unsigned getNumSuccessorsV() const;
3059 virtual void setSuccessorV(unsigned idx, BasicBlock *B);
3057 BasicBlock *getSuccessorV(unsigned idx) const override;
3058 unsigned getNumSuccessorsV() const override;
3059 void setSuccessorV(unsigned idx, BasicBlock *B) override;
30603060
30613061 bool hasFnAttrImpl(Attribute::AttrKind A) const;
30623062
31093109 explicit ResumeInst(Value *Exn, Instruction *InsertBefore=0);
31103110 ResumeInst(Value *Exn, BasicBlock *InsertAtEnd);
31113111 protected:
3112 virtual ResumeInst *clone_impl() const;
3112 ResumeInst *clone_impl() const override;
31133113 public:
31143114 static ResumeInst *Create(Value *Exn, Instruction *InsertBefore = 0) {
31153115 return new(1) ResumeInst(Exn, InsertBefore);
31343134 return isa(V) && classof(cast(V));
31353135 }
31363136 private:
3137 virtual BasicBlock *getSuccessorV(unsigned idx) const;
3138 virtual unsigned getNumSuccessorsV() const;
3139 virtual void setSuccessorV(unsigned idx, BasicBlock *B);
3137 BasicBlock *getSuccessorV(unsigned idx) const override;
3138 unsigned getNumSuccessorsV() const override;
3139 void setSuccessorV(unsigned idx, BasicBlock *B) override;
31403140 };
31413141
31423142 template <>
31583158 class UnreachableInst : public TerminatorInst {
31593159 void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
31603160 protected:
3161 virtual UnreachableInst *clone_impl() const;
3161 UnreachableInst *clone_impl() const override;
31623162
31633163 public:
31643164 // allocate space for exactly zero operands
31783178 return isa(V) && classof(cast(V));
31793179 }
31803180 private:
3181 virtual BasicBlock *getSuccessorV(unsigned idx) const;
3182 virtual unsigned getNumSuccessorsV() const;
3183 virtual void setSuccessorV(unsigned idx, BasicBlock *B);
3181 BasicBlock *getSuccessorV(unsigned idx) const override;
3182 unsigned getNumSuccessorsV() const override;
3183 void setSuccessorV(unsigned idx, BasicBlock *B) override;
31843184 };
31853185
31863186 //===----------------------------------------------------------------------===//
31913191 class TruncInst : public CastInst {
31923192 protected:
31933193 /// \brief Clone an identical TruncInst
3194 virtual TruncInst *clone_impl() const;
3194 TruncInst *clone_impl() const override;
31953195
31963196 public:
31973197 /// \brief Constructor with insert-before-instruction semantics
32273227 class ZExtInst : public CastInst {
32283228 protected:
32293229 /// \brief Clone an identical ZExtInst
3230 virtual ZExtInst *clone_impl() const;
3230 ZExtInst *clone_impl() const override;
32313231
32323232 public:
32333233 /// \brief Constructor with insert-before-instruction semantics
32633263 class SExtInst : public CastInst {
32643264 protected:
32653265 /// \brief Clone an identical SExtInst
3266 virtual SExtInst *clone_impl() const;
3266 SExtInst *clone_impl() const override;
32673267
32683268 public:
32693269 /// \brief Constructor with insert-before-instruction semantics
32993299 class FPTruncInst : public CastInst {
33003300 protected:
33013301 /// \brief Clone an identical FPTruncInst
3302 virtual FPTruncInst *clone_impl() const;
3302 FPTruncInst *clone_impl() const override;
33033303
33043304 public:
33053305 /// \brief Constructor with insert-before-instruction semantics
33353335 class FPExtInst : public CastInst {
33363336 protected:
33373337 /// \brief Clone an identical FPExtInst
3338 virtual FPExtInst *clone_impl() const;
3338 FPExtInst *clone_impl() const override;
33393339
33403340 public:
33413341 /// \brief Constructor with insert-before-instruction semantics
33713371 class UIToFPInst : public CastInst {
33723372 protected:
33733373 /// \brief Clone an identical UIToFPInst
3374 virtual UIToFPInst *clone_impl() const;
3374 UIToFPInst *clone_impl() const override;
33753375
33763376 public:
33773377 /// \brief Constructor with insert-before-instruction semantics
34073407 class SIToFPInst : public CastInst {
34083408 protected:
34093409 /// \brief Clone an identical SIToFPInst
3410 virtual SIToFPInst *clone_impl() const;
3410 SIToFPInst *clone_impl() const override;
34113411
34123412 public:
34133413 /// \brief Constructor with insert-before-instruction semantics
34433443 class FPToUIInst : public CastInst {
34443444 protected:
34453445 /// \brief Clone an identical FPToUIInst
3446 virtual FPToUIInst *clone_impl() const;
3446 FPToUIInst *clone_impl() const override;
34473447
34483448 public:
34493449 /// \brief Constructor with insert-before-instruction semantics
34793479 class FPToSIInst : public CastInst {
34803480 protected:
34813481 /// \brief Clone an identical FPToSIInst
3482 virtual FPToSIInst *clone_impl() const;
3482 FPToSIInst *clone_impl() const override;
34833483
34843484 public:
34853485 /// \brief Constructor with insert-before-instruction semantics
35313531 );
35323532
35333533 /// \brief Clone an identical IntToPtrInst
3534 virtual IntToPtrInst *clone_impl() const;
3534 IntToPtrInst *clone_impl() const override;
35353535
35363536 /// \brief Returns the address space of this instruction's pointer type.
35373537 unsigned getAddressSpace() const {
35553555 class PtrToIntInst : public CastInst {
35563556 protected:
35573557 /// \brief Clone an identical PtrToIntInst
3558 virtual PtrToIntInst *clone_impl() const;
3558 PtrToIntInst *clone_impl() const override;
35593559
35603560 public:
35613561 /// \brief Constructor with insert-before-instruction semantics
36033603 class BitCastInst : public CastInst {
36043604 protected:
36053605 /// \brief Clone an identical BitCastInst
3606 virtual BitCastInst *clone_impl() const;
3606 BitCastInst *clone_impl() const override;
36073607
36083608 public:
36093609 /// \brief Constructor with insert-before-instruction semantics
36403640 class AddrSpaceCastInst : public CastInst {
36413641 protected:
36423642 /// \brief Clone an identical AddrSpaceCastInst
3643 virtual AddrSpaceCastInst *clone_impl() const;
3643 AddrSpaceCastInst *clone_impl() const override;
36443644
36453645 public:
36463646 /// \brief Constructor with insert-before-instruction semantics
5454 /// the Pass to the PassManager. When the PassManager is destroyed, the pass
5555 /// will be destroyed as well, so there is no need to delete the pass. This
5656 /// implies that all passes MUST be allocated with 'new'.
57 void add(Pass *P);
57 void add(Pass *P) override;
5858
5959 /// run - Execute all of the passes scheduled for execution. Keep track of
6060 /// whether any of the passes modifies the module, and if so, return true.
7979 /// PassManager_X is destroyed, the pass will be destroyed as well, so
8080 /// there is no need to delete the pass.
8181 /// This implies that all passes MUST be allocated with 'new'.
82 void add(Pass *P);
82 void add(Pass *P) override;
8383
8484 /// run - Execute all of the passes scheduled for execution. Keep
8585 /// track of whether any of the passes modifies the function, and if
126126 : P(p), V(0), M(&m) {} // When P is run on M
127127
128128 /// print - Emit information about this stack frame to OS.
129 virtual void print(raw_ostream &OS) const;
129 void print(raw_ostream &OS) const override;
130130 };
131131
132132
413413 /// run - Execute all of the passes scheduled for execution. Keep track of
414414 /// whether any of the passes modifies the module, and if so, return true.
415415 bool runOnFunction(Function &F);
416 bool runOnModule(Module &M);
416 bool runOnModule(Module &M) override;
417417
418418 /// cleanup - After running all passes, clean up pass manager cache.
419419 void cleanup();
425425
426426 /// doInitialization - Run all of the initializers for the function passes.
427427 ///
428 bool doInitialization(Module &M);
428 bool doInitialization(Module &M) override;
429429
430430 /// doFinalization - Overrides ModulePass doFinalization for global
431431 /// finalization tasks
434434
435435 /// doFinalization - Run all of the finalizers for the function passes.
436436 ///
437 bool doFinalization(Module &M);
438
439 virtual PMDataManager *getAsPMDataManager() { return this; }
440 virtual Pass *getAsPass() { return this; }
437 bool doFinalization(Module &M) override;
438
439 PMDataManager *getAsPMDataManager() override { return this; }
440 Pass *getAsPass() override { return this; }
441441
442442 /// Pass Manager itself does not invalidate any analysis info.
443 void getAnalysisUsage(AnalysisUsage &Info) const {
443 void getAnalysisUsage(AnalysisUsage &Info) const override{
444444 Info.setPreservesAll();
445445 }
446446
447447 // Print passes managed by this manager
448 void dumpPassStructure(unsigned Offset);
449
450 virtual const char *getPassName() const {
448 void dumpPassStructure(unsigned Offset) override;
449
450 const char *getPassName() const override {
451451 return "Function Pass Manager";
452452 }
453453
457457 return FP;
458458 }
459459
460 virtual PassManagerType getPassManagerType() const {
460 PassManagerType getPassManagerType() const override {
461461 return PMT_FunctionPassManager;
462462 }
463463 };
6767
6868 // Implement the PassRegistrationListener callbacks used to populate our map
6969 //
70 virtual void passRegistered(const PassInfo *P) {
70 void passRegistered(const PassInfo *P) override {
7171 if (ignorablePass(P) || !Opt) return;
7272 if (findOption(P->getPassArgument()) != getNumOptions()) {
7373 errs() << "Two passes with the same argument (-"
7676 }
7777 addLiteralOption(P->getPassArgument(), P, P->getPassName());
7878 }
79 virtual void passEnumerate(const PassInfo *P) { passRegistered(P); }
79 void passEnumerate(const PassInfo *P) override { passRegistered(P); }
8080
8181 // printOptionInfo - Print out information about this option. Override the
8282 // default implementation to sort the table before we print...
83 virtual void printOptionInfo(const cl::Option &O, size_t GlobalWidth) const {
83 void printOptionInfo(const cl::Option &O, size_t GlobalWidth) const override {
8484 PassNameParser *PNP = const_cast(this);
8585 array_pod_sort(PNP->Values.begin(), PNP->Values.end(), ValLessThan);
8686 cl::parser::printOptionInfo(O, GlobalWidth);
106106 Filter filter;
107107
108108 public:
109 bool ignorablePassImpl(const PassInfo *P) const { return !filter(*P); }
109 bool ignorablePassImpl(const PassInfo *P) const override {
110 return !filter(*P);
111 }
110112 };
111113
112114 ///===----------------------------------------------------------------------===//
234234 class ModulePass : public Pass {
235235 public:
236236 /// createPrinterPass - Get a module printer pass.
237 Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const;
237 Pass *createPrinterPass(raw_ostream &O,
238 const std::string &Banner) const override;
238239
239240 /// runOnModule - Virtual method overriden by subclasses to process the module
240241 /// being operated on.
241242 virtual bool runOnModule(Module &M) = 0;
242243
243 virtual void assignPassManager(PMStack &PMS,
244 PassManagerType T);
244 void assignPassManager(PMStack &PMS, PassManagerType T) override;
245245
246246 /// Return what kind of Pass Manager can manage this pass.
247 virtual PassManagerType getPotentialPassManagerType() const;
247 PassManagerType getPotentialPassManagerType() const override;
248248
249249 explicit ModulePass(char &pid) : Pass(PT_Module, pid) {}
250250 // Force out-of-line virtual method.
267267 ///
268268 virtual void initializePass();
269269
270 virtual ImmutablePass *getAsImmutablePass() { return this; }
270 ImmutablePass *getAsImmutablePass() override { return this; }
271271
272272 /// ImmutablePasses are never run.
273273 ///
274 bool runOnModule(Module &) { return false; }
274 bool runOnModule(Module &) override { return false; }
275275
276276 explicit ImmutablePass(char &pid)
277277 : ModulePass(pid) {}
294294 explicit FunctionPass(char &pid) : Pass(PT_Function, pid) {}
295295
296296 /// createPrinterPass - Get a function printer pass.
297 Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const;
297 Pass *createPrinterPass(raw_ostream &O,
298 const std::string &Banner) const override;
298299
299300 /// runOnFunction - Virtual method overriden by subclasses to do the
300301 /// per-function processing of the pass.
301302 ///
302303 virtual bool runOnFunction(Function &F) = 0;
303304
304 virtual void assignPassManager(PMStack &PMS,
305 PassManagerType T);
305 void assignPassManager(PMStack &PMS, PassManagerType T) override;
306306
307307 /// Return what kind of Pass Manager can manage this pass.
308 virtual PassManagerType getPotentialPassManagerType() const;
308 PassManagerType getPotentialPassManagerType() const override;
309309
310310 protected:
311311 /// skipOptnoneFunction - This function has Attribute::OptimizeNone
330330 explicit BasicBlockPass(char &pid) : Pass(PT_BasicBlock, pid) {}
331331
332332 /// createPrinterPass - Get a basic block printer pass.
333 Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const;
333 Pass *createPrinterPass(raw_ostream &O,
334 const std::string &Banner) const override;
334335
335336 using llvm::Pass::doInitialization;
336337 using llvm::Pass::doFinalization;
350351 ///
351352 virtual bool doFinalization(Function &);
352353
353 virtual void assignPassManager(PMStack &PMS,
354 PassManagerType T);
354 void assignPassManager(PMStack &PMS, PassManagerType T) override;
355355
356356 /// Return what kind of Pass Manager can manage this pass.
357 virtual PassManagerType getPotentialPassManagerType() const;
357 PassManagerType getPotentialPassManagerType() const override;
358358
359359 protected:
360360 /// skipOptnoneFunction - Containing function has Attribute::OptimizeNone
108108 };
109109
110110 class AlignAttributeImpl : public EnumAttributeImpl {
111 virtual void anchor();
111 void anchor() override;
112112 unsigned Align;
113113
114114 public:
3131 /// UnaryConstantExpr - This class is private to Constants.cpp, and is used
3232 /// behind the scenes to implement unary constant exprs.
3333 class UnaryConstantExpr : public ConstantExpr {
34 virtual void anchor();
34 void anchor() override;
3535 void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
3636 public:
3737 // allocate space for exactly one operand
4848 /// BinaryConstantExpr - This class is private to Constants.cpp, and is used
4949 /// behind the scenes to implement binary constant exprs.
5050 class BinaryConstantExpr : public ConstantExpr {
51 virtual void anchor();
51 void anchor() override;
5252 void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
5353 public:
5454 // allocate space for exactly two operands
6969 /// SelectConstantExpr - This class is private to Constants.cpp, and is used
7070 /// behind the scenes to implement select constant exprs.
7171 class SelectConstantExpr : public ConstantExpr {
72 virtual void anchor();
72 void anchor() override;
7373 void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
7474 public:
7575 // allocate space for exactly three operands
9090 /// Constants.cpp, and is used behind the scenes to implement
9191 /// extractelement constant exprs.
9292 class ExtractElementConstantExpr : public ConstantExpr {
93 virtual void anchor();
93 void anchor() override;
9494 void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
9595 public:
9696 // allocate space for exactly two operands
111111 /// Constants.cpp, and is used behind the scenes to implement
112112 /// insertelement constant exprs.
113113 class InsertElementConstantExpr : public ConstantExpr {
114 virtual void anchor();
114 void anchor() override;
115115 void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
116116 public:
117117 // allocate space for exactly three operands
133133 /// Constants.cpp, and is used behind the scenes to implement
134134 /// shufflevector constant exprs.
135135 class ShuffleVectorConstantExpr : public ConstantExpr {
136 virtual void anchor();
136 void anchor() override;
137137 void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
138138 public:
139139 // allocate space for exactly three operands
158158 /// Constants.cpp, and is used behind the scenes to implement
159159 /// extractvalue constant exprs.
160160 class ExtractValueConstantExpr : public ConstantExpr {
161 virtual void anchor();
161 void anchor() override;
162162 void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
163163 public:
164164 // allocate space for exactly one operand
184184 /// Constants.cpp, and is used behind the scenes to implement
185185 /// insertvalue constant exprs.
186186 class InsertValueConstantExpr : public ConstantExpr {
187 virtual void anchor();
187 void anchor() override;
188188 void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
189189 public:
190190 // allocate space for exactly one operand
211211 /// GetElementPtrConstantExpr - This class is private to Constants.cpp, and is
212212 /// used behind the scenes to implement getelementpr constant exprs.
213213 class GetElementPtrConstantExpr : public ConstantExpr {
214 virtual void anchor();
214 void anchor() override;
215215 GetElementPtrConstantExpr(Constant *C, ArrayRef IdxList,
216216 Type *DestTy);
217217 public:
232232 // behind the scenes to implement ICmp and FCmp constant expressions. This is
233233 // needed in order to store the predicate value for these instructions.
234234 class CompareConstantExpr : public ConstantExpr {
235 virtual void anchor();
235 void anchor() override;
236236 void *operator new(size_t, unsigned) LLVM_DELETED_FUNCTION;
237237 public:
238238 // allocate space for exactly two operands
4848 PrintModulePassWrapper(raw_ostream &OS, const std::string &Banner)
4949 : ModulePass(ID), P(OS, Banner) {}
5050
51 bool runOnModule(Module &M) {
51 bool runOnModule(Module &M) override {
5252 P.run(&M);
5353 return false;
5454 }
5555
56 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
56 void getAnalysisUsage(AnalysisUsage &AU) const override {
5757 AU.setPreservesAll();
5858 }
5959 };
6868 : FunctionPass(ID), P(OS, Banner) {}
6969
7070 // This pass just prints a banner followed by the function as it's processed.
71 bool runOnFunction(Function &F) {
71 bool runOnFunction(Function &F) override {
7272 P.run(&F);
7373 return false;
7474 }
7575
76 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
76 void getAnalysisUsage(AnalysisUsage &AU) const override {
7777 AU.setPreservesAll();
7878 }
7979 };
8888 PrintBasicBlockPass(raw_ostream &Out, const std::string &Banner)
8989 : BasicBlockPass(ID), Out(Out), Banner(Banner) {}
9090
91 bool runOnBasicBlock(BasicBlock &BB) {
91 bool runOnBasicBlock(BasicBlock &BB) override {
9292 Out << Banner << BB;
9393 return false;
9494 }
9595
96 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
96 void getAnalysisUsage(AnalysisUsage &AU) const override{
9797 AU.setPreservesAll();
9898 }
9999 };
224224 MDNode *get() const {
225225 return cast_or_null(getValPtr());
226226 }
227
228 virtual void deleted();
229 virtual void allUsesReplacedWith(Value *VNew);
227
228 void deleted() override;
229 void allUsesReplacedWith(Value *VNew) override;
230230 };
231231
232232 class LLVMContextImpl {
163163
164164 /// Execute all of the passes scheduled for execution. Keep track of
165165 /// whether any of the passes modifies the function, and if so, return true.
166 bool runOnFunction(Function &F);
166 bool runOnFunction(Function &F) override;
167167
168168 /// Pass Manager itself does not invalidate any analysis info.
169 void getAnalysisUsage(AnalysisUsage &Info) const {
169 void getAnalysisUsage(AnalysisUsage &Info) const override {
170170 Info.setPreservesAll();
171171 }
172172
173 bool doInitialization(Module &M);
173 bool doInitialization(Module &M) override;
174174 bool doInitialization(Function &F);
175 bool doFinalization(Module &M);
175 bool doFinalization(Module &M) override;
176176 bool doFinalization(Function &F);
177177
178 virtual PMDataManager *getAsPMDataManager() { return this; }
179 virtual Pass *getAsPass() { return this; }
180
181 virtual const char *getPassName() const {
178 PMDataManager *getAsPMDataManager() override { return this; }
179 Pass *getAsPass() override { return this; }
180
181 const char *getPassName() const override {
182182 return "BasicBlock Pass Manager";
183183 }
184184
185185 // Print passes managed by this manager
186 void dumpPassStructure(unsigned Offset) {
186 void dumpPassStructure(unsigned Offset) override {
187187 dbgs().indent(Offset*2) << "BasicBlockPass Manager\n";
188188 for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
189189 BasicBlockPass *BP = getContainedPass(Index);
198198 return BP;
199199 }
200200
201 virtual PassManagerType getPassManagerType() const {
201 PassManagerType getPassManagerType() const override {
202202 return PMT_BasicBlockPassManager;
203203 }
204204 };
233233 }
234234
235235 /// createPrinterPass - Get a function printer pass.
236 Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const {
236 Pass *createPrinterPass(raw_ostream &O,
237 const std::string &Banner) const override {
237238 return createPrintFunctionPass(O, Banner);
238239 }
239240
247248
248249 /// doInitialization - Run all of the initializers for the function passes.
249250 ///
250 bool doInitialization(Module &M);
251 bool doInitialization(Module &M) override;
251252
252253 /// doFinalization - Run all of the finalizers for the function passes.
253254 ///
254 bool doFinalization(Module &M);
255
256
257 virtual PMDataManager *getAsPMDataManager() { return this; }
258 virtual Pass *getAsPass() { return this; }
259 virtual PassManagerType getTopLevelPassManagerType() {
255 bool doFinalization(Module &M) override;
256
257
258 PMDataManager *getAsPMDataManager() override { return this; }
259 Pass *getAsPass() override { return this; }
260 PassManagerType getTopLevelPassManagerType() override {
260261 return PMT_FunctionPassManager;
261262 }
262263
263264 /// Pass Manager itself does not invalidate any analysis info.
264 void getAnalysisUsage(AnalysisUsage &Info) const {
265 void getAnalysisUsage(AnalysisUsage &Info) const override {
265266 Info.setPreservesAll();
266267 }
267268
302303 }
303304
304305 /// createPrinterPass - Get a module printer pass.
305 Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const {
306 Pass *createPrinterPass(raw_ostream &O,
307 const std::string &Banner) const override {
306308 return createPrintModulePass(O, Banner);
307309 }
308310
322324 bool doFinalization();
323325
324326 /// Pass Manager itself does not invalidate any analysis info.
325 void getAnalysisUsage(AnalysisUsage &Info) const {
327 void getAnalysisUsage(AnalysisUsage &Info) const override {
326328 Info.setPreservesAll();
327329 }
328330
329331 /// Add RequiredPass into list of lower level passes required by pass P.
330332 /// RequiredPass is run on the fly by Pass Manager when P requests it
331333 /// through getAnalysis interface.
332 virtual void addLowerLevelRequiredPass(Pass *P, Pass *RequiredPass);
334 void addLowerLevelRequiredPass(Pass *P, Pass *RequiredPass) override;
333335
334336 /// Return function pass corresponding to PassInfo PI, that is
335337 /// required by module pass MP. Instantiate analysis pass, by using
336338 /// its runOnFunction() for function F.
337 virtual Pass* getOnTheFlyPass(Pass *MP, AnalysisID PI, Function &F);
338
339 virtual const char *getPassName() const {
339 Pass* getOnTheFlyPass(Pass *MP, AnalysisID PI, Function &F) override;
340
341 const char *getPassName() const override {
340342 return "Module Pass Manager";
341343 }
342344
343 virtual PMDataManager *getAsPMDataManager() { return this; }
344 virtual Pass *getAsPass() { return this; }
345 PMDataManager *getAsPMDataManager() override { return this; }
346 Pass *getAsPass() override { return this; }
345347
346348 // Print passes managed by this manager
347 void dumpPassStructure(unsigned Offset) {
349 void dumpPassStructure(unsigned Offset) override {
348350 dbgs().indent(Offset*2) << "ModulePass Manager\n";
349351 for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
350352 ModulePass *MP = getContainedPass(Index);
362364 return static_cast(PassVector[N]);
363365 }
364366
365 virtual PassManagerType getPassManagerType() const {
367 PassManagerType getPassManagerType() const override {
366368 return PMT_ModulePassManager;
367369 }
368370
402404 }
403405
404406 /// createPrinterPass - Get a module printer pass.
405 Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const {
407 Pass *createPrinterPass(raw_ostream &O,
408 const std::string &Banner) const override {
406409 return createPrintModulePass(O, Banner);
407410 }
408411
422425 bool doFinalization();
423426
424427 /// Pass Manager itself does not invalidate any analysis info.
425 void getAnalysisUsage(AnalysisUsage &Info) const {
428 void getAnalysisUsage(AnalysisUsage &Info) const override {
426429 Info.setPreservesAll();
427430 }
428431
429 virtual PMDataManager *getAsPMDataManager() { return this; }
430 virtual Pass *getAsPass() { return this; }
431 virtual PassManagerType getTopLevelPassManagerType() {
432 PMDataManager *getAsPMDataManager() override { return this; }
433 Pass *getAsPass() override { return this; }
434 PassManagerType getTopLevelPassManagerType() override {
432435 return PMT_ModulePassManager;
433436 }
434437
7777 /// the list.
7878 void setAsFirstOperand(unsigned V) { this->setValPtrInt(V); }
7979
80 virtual void deleted();
81 virtual void allUsesReplacedWith(Value *NV);
80 void deleted() override;
81 void allUsesReplacedWith(Value *NV) override;
8282 };
8383 } // end namespace llvm.
8484
251251 VectorType &CFGOnlyList;
252252 GetCFGOnlyPasses(VectorType &L) : CFGOnlyList(L) {}
253253
254 void passEnumerate(const PassInfo *P) {
254 void passEnumerate(const PassInfo *P) override {
255255 if (P->isCFGOnlyPass())
256256 CFGOnlyList.push_back(P->getTypeInfo());
257257 }
24022402 initializeVerifierLegacyPassPass(*PassRegistry::getPassRegistry());
24032403 }
24042404
2405 bool runOnFunction(Function &F) {
2405 bool runOnFunction(Function &F) override {
24062406 if (!V.verify(F) && FatalErrors)
24072407 report_fatal_error("Broken function found, compilation aborted!");
24082408
24092409 return false;
24102410 }
24112411
2412 bool doFinalization(Module &M) {
2412 bool doFinalization(Module &M) override {
24132413 if (!V.verify(M) && FatalErrors)
24142414 report_fatal_error("Broken module found, compilation aborted!");
24152415
24162416 return false;
24172417 }
24182418
2419 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
2419 void getAnalysisUsage(AnalysisUsage &AU) const override {
24202420 AU.setPreservesAll();
24212421 }
24222422 };