llvm.org GIT mirror llvm / a96a182
Add LLVM_OVERRIDE to methods that override their base classes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164471 91177308-0d34-0410-b5e6-96231b3b80d8 Craig Topper 6 years ago
17 changed file(s) with 76 addition(s) and 69 deletion(s). Raw diff Collapse all Expand all
144144 const Twine &Name, Instruction *InsertBefore);
145145 BinaryOperator(BinaryOps iType, Value *S1, Value *S2, Type *Ty,
146146 const Twine &Name, BasicBlock *InsertAtEnd);
147 virtual BinaryOperator *clone_impl() const;
147 virtual BinaryOperator *clone_impl() const LLVM_OVERRIDE;
148148 public:
149149 // allocate space for exactly two operands
150150 void *operator new(size_t s) {
387387 /// if (isa(Instr)) { ... }
388388 /// @brief Base class of casting instructions.
389389 class CastInst : public UnaryInstruction {
390 virtual void anchor();
390 virtual void anchor() LLVM_OVERRIDE;
391391 protected:
392392 /// @brief Constructor with insert-before-instruction semantics for subclasses
393393 CastInst(Type *Ty, unsigned iType, Value *S,
637637 Value *LHS, Value *RHS, const Twine &Name,
638638 BasicBlock *InsertAtEnd);
639639
640 virtual void Anchor() const; // Out of line virtual method.
640 virtual void anchor() LLVM_OVERRIDE; // Out of line virtual method.
641641 public:
642642 /// This enumeration lists the possible predicates for CmpInst subclasses.
643643 /// Values in the range 0-31 are reserved for FCmpInst, while values in the
7878 public:
7979 MallocSlabAllocator() : Allocator() { }
8080 virtual ~MallocSlabAllocator();
81 virtual MemSlab *Allocate(size_t Size);
82 virtual void Deallocate(MemSlab *Slab);
81 virtual MemSlab *Allocate(size_t Size) LLVM_OVERRIDE;
82 virtual void Deallocate(MemSlab *Slab) LLVM_OVERRIDE;
8383 };
8484
8585 /// BumpPtrAllocator - This allocator is useful for containers that need
16071607 class alias : public Option {
16081608 Option *AliasFor;
16091609 virtual bool handleOccurrence(unsigned pos, StringRef /*ArgName*/,
1610 StringRef Arg) {
1610 StringRef Arg) LLVM_OVERRIDE {
16111611 return AliasFor->handleOccurrence(pos, AliasFor->ArgStr, Arg);
16121612 }
16131613 // Handle printing stuff...
1614 virtual size_t getOptionWidth() const;
1615 virtual void printOptionInfo(size_t GlobalWidth) const;
1614 virtual size_t getOptionWidth() const LLVM_OVERRIDE;
1615 virtual void printOptionInfo(size_t GlobalWidth) const LLVM_OVERRIDE;
16161616
16171617 // Aliases do not need to print their values.
1618 virtual void printOptionValue(size_t /*GlobalWidth*/, bool /*Force*/) const {}
1618 virtual void printOptionValue(size_t /*GlobalWidth*/,
1619 bool /*Force*/) const LLVM_OVERRIDE {}
16191620
16201621 void done() {
16211622 if (!hasArgStr())
5454 ///
5555 const char *Scanned;
5656
57 virtual void write_impl(const char *Ptr, size_t Size);
57 virtual void write_impl(const char *Ptr, size_t Size) LLVM_OVERRIDE;
5858
5959 /// current_pos - Return the current position within the stream,
6060 /// not counting the bytes currently in the buffer.
61 virtual uint64_t current_pos() const {
61 virtual uint64_t current_pos() const LLVM_OVERRIDE {
6262 // Our current position in the stream is all the contents which have been
6363 // written to the underlying stream (*not* the current position of the
6464 // underlying stream).
5353 const char *Str;
5454 public:
5555 PrettyStackTraceString(const char *str) : Str(str) {}
56 virtual void print(raw_ostream &OS) const;
56 virtual void print(raw_ostream &OS) const LLVM_OVERRIDE;
5757 };
5858
5959 /// PrettyStackTraceProgram - This object prints a specified program arguments
6464 public:
6565 PrettyStackTraceProgram(int argc, const char * const*argv)
6666 : ArgC(argc), ArgV(argv) {}
67 virtual void print(raw_ostream &OS) const;
67 virtual void print(raw_ostream &OS) const LLVM_OVERRIDE;
6868 };
6969
7070 } // end namespace llvm
107107 class StreamingMemoryObject : public StreamableMemoryObject {
108108 public:
109109 StreamingMemoryObject(DataStreamer *streamer);
110 virtual uint64_t getBase() const { return 0; }
111 virtual uint64_t getExtent() const;
112 virtual int readByte(uint64_t address, uint8_t* ptr) const;
110 virtual uint64_t getBase() const LLVM_OVERRIDE { return 0; }
111 virtual uint64_t getExtent() const LLVM_OVERRIDE;
112 virtual int readByte(uint64_t address, uint8_t* ptr) const LLVM_OVERRIDE;
113113 virtual int readBytes(uint64_t address,
114114 uint64_t size,
115115 uint8_t* buf,
116 uint64_t* copied) const ;
117 virtual const uint8_t *getPointer(uint64_t address, uint64_t size) const {
116 uint64_t* copied) const LLVM_OVERRIDE;
117 virtual const uint8_t *getPointer(uint64_t address,
118 uint64_t size) const LLVM_OVERRIDE {
118119 // This could be fixed by ensuring the bytes are fetched and making a copy,
119120 // requiring that the bitcode size be known, or otherwise ensuring that
120121 // the memory doesn't go away/get reallocated, but it's
122123 assert(0 && "getPointer in streaming memory objects not allowed");
123124 return NULL;
124125 }
125 virtual bool isValidAddress(uint64_t address) const;
126 virtual bool isObjectEnd(uint64_t address) const;
126 virtual bool isValidAddress(uint64_t address) const LLVM_OVERRIDE;
127 virtual bool isObjectEnd(uint64_t address) const LLVM_OVERRIDE;
127128
128129 /// Drop s bytes from the front of the stream, pushing the positions of the
129130 /// remaining bytes down by s. This is used to skip past the bitcode header,
240240 /// @returns The value, or nullptr if failed() == true.
241241 Node *getValue();
242242
243 virtual void skip() {
243 virtual void skip() LLVM_OVERRIDE {
244244 getKey()->skip();
245245 getValue()->skip();
246246 }
357357
358358 iterator end() { return iterator(); }
359359
360 virtual void skip() {
360 virtual void skip() LLVM_OVERRIDE {
361361 yaml::skip(*this);
362362 }
363363
420420
421421 iterator end() { return iterator(); }
422422
423 virtual void skip() {
423 virtual void skip() LLVM_OVERRIDE {
424424 yaml::skip(*this);
425425 }
426426
8080 Filled = false;
8181 }
8282
83 virtual void write_impl(const char *Ptr, size_t Size);
83 virtual void write_impl(const char *Ptr, size_t Size) LLVM_OVERRIDE;
8484
8585 /// current_pos - Return the current position within the stream,
8686 /// not counting the bytes currently in the buffer.
8787 ///
88 virtual uint64_t current_pos() const {
88 virtual uint64_t current_pos() const LLVM_OVERRIDE {
8989 // This has the same effect as calling TheStream.current_pos(),
9090 // but that interface is private.
9191 return TheStream->tell() - TheStream->GetNumBytesInBuffer();
2323 /// use the underlying stream to detect errors.
2424 class raw_os_ostream : public raw_ostream {
2525 std::ostream &OS;
26
26
2727 /// write_impl - See raw_ostream::write_impl.
28 virtual void write_impl(const char *Ptr, size_t Size);
29
28 virtual void write_impl(const char *Ptr, size_t Size) LLVM_OVERRIDE;
29
3030 /// current_pos - Return the current position within the stream, not
3131 /// counting the bytes currently in the buffer.
32 virtual uint64_t current_pos() const;
33
32 virtual uint64_t current_pos() const LLVM_OVERRIDE;
33
3434 public:
3535 raw_os_ostream(std::ostream &O) : OS(O) {}
3636 ~raw_os_ostream();
321321 uint64_t pos;
322322
323323 /// write_impl - See raw_ostream::write_impl.
324 virtual void write_impl(const char *Ptr, size_t Size);
324 virtual void write_impl(const char *Ptr, size_t Size) LLVM_OVERRIDE;
325325
326326 /// current_pos - Return the current position within the stream, not
327327 /// counting the bytes currently in the buffer.
328 virtual uint64_t current_pos() const { return pos; }
328 virtual uint64_t current_pos() const LLVM_OVERRIDE { return pos; }
329329
330330 /// preferred_buffer_size - Determine an efficient buffer size.
331 virtual size_t preferred_buffer_size() const;
331 virtual size_t preferred_buffer_size() const LLVM_OVERRIDE;
332332
333333 /// error_detected - Set the flag indicating that an output error has
334334 /// been encountered.
389389 }
390390
391391 virtual raw_ostream &changeColor(enum Colors colors, bool bold=false,
392 bool bg=false);
393 virtual raw_ostream &resetColor();
394
395 virtual raw_ostream &reverseColor();
396
397 virtual bool is_displayed() const;
398
399 virtual bool has_colors() const;
392 bool bg=false) LLVM_OVERRIDE;
393 virtual raw_ostream &resetColor() LLVM_OVERRIDE;
394
395 virtual raw_ostream &reverseColor() LLVM_OVERRIDE;
396
397 virtual bool is_displayed() const LLVM_OVERRIDE;
398
399 virtual bool has_colors() const LLVM_OVERRIDE;
400400
401401 /// has_error - Return the value of the flag in this raw_fd_ostream indicating
402402 /// whether an output error has been encountered.
442442 std::string &OS;
443443
444444 /// write_impl - See raw_ostream::write_impl.
445 virtual void write_impl(const char *Ptr, size_t Size);
445 virtual void write_impl(const char *Ptr, size_t Size) LLVM_OVERRIDE;
446446
447447 /// current_pos - Return the current position within the stream, not
448448 /// counting the bytes currently in the buffer.
449 virtual uint64_t current_pos() const { return OS.size(); }
449 virtual uint64_t current_pos() const LLVM_OVERRIDE { return OS.size(); }
450450 public:
451451 explicit raw_string_ostream(std::string &O) : OS(O) {}
452452 ~raw_string_ostream();
466466 SmallVectorImpl &OS;
467467
468468 /// write_impl - See raw_ostream::write_impl.
469 virtual void write_impl(const char *Ptr, size_t Size);
469 virtual void write_impl(const char *Ptr, size_t Size) LLVM_OVERRIDE;
470470
471471 /// current_pos - Return the current position within the stream, not
472472 /// counting the bytes currently in the buffer.
473 virtual uint64_t current_pos() const;
473 virtual uint64_t current_pos() const LLVM_OVERRIDE;
474474 public:
475475 /// Construct a new raw_svector_ostream.
476476 ///
492492 /// raw_null_ostream - A raw_ostream that discards all output.
493493 class raw_null_ostream : public raw_ostream {
494494 /// write_impl - See raw_ostream::write_impl.
495 virtual void write_impl(const char *Ptr, size_t size);
495 virtual void write_impl(const char *Ptr, size_t size) LLVM_OVERRIDE;
496496
497497 /// current_pos - Return the current position within the stream, not
498498 /// counting the bytes currently in the buffer.
499 virtual uint64_t current_pos() const;
499 virtual uint64_t current_pos() const LLVM_OVERRIDE;
500500
501501 public:
502502 explicit raw_null_ostream() {}
652652 class _do_message : public error_category
653653 {
654654 public:
655 virtual std::string message(int ev) const;
655 virtual std::string message(int ev) const LLVM_OVERRIDE;
656656 };
657657
658658 const error_category& generic_category();
162162 protected:
163163 /// UpdatedSearchState - Callback used when the search state changes.
164164 virtual void UpdatedSearchState(const changeset_ty &Changes,
165 const changesetlist_ty &Sets) {
165 const changesetlist_ty &Sets) LLVM_OVERRIDE {
166166 DDAI.UpdatedSearchState(Changes, Sets, Required);
167167 }
168168
169 virtual bool ExecuteOneTest(const changeset_ty &S) {
169 virtual bool ExecuteOneTest(const changeset_ty &S) LLVM_OVERRIDE {
170170 return DDAI.GetTestResult(S, Required);
171171 }
172172
5757 virtual ~DataFileStreamer() {
5858 close(Fd);
5959 }
60 virtual size_t GetBytes(unsigned char *buf, size_t len) {
60 virtual size_t GetBytes(unsigned char *buf, size_t len) LLVM_OVERRIDE {
6161 NumStreamFetches++;
6262 return read(Fd, buf, len);
6363 }
8080 init(InputData.begin(), InputData.end(), RequiresNullTerminator);
8181 }
8282
83 virtual const char *getBufferIdentifier() const {
83 virtual const char *getBufferIdentifier() const LLVM_OVERRIDE {
8484 // The name is stored after the class itself.
8585 return reinterpret_cast(this + 1);
8686 }
87
88 virtual BufferKind getBufferKind() const {
87
88 virtual BufferKind getBufferKind() const LLVM_OVERRIDE {
8989 return MemoryBuffer_Malloc;
9090 }
9191 };
193193 sys::Path::UnMapFilePages(reinterpret_cast(RealStart),
194194 RealSize);
195195 }
196
197 virtual BufferKind getBufferKind() const {
196
197 virtual BufferKind getBufferKind() const LLVM_OVERRIDE {
198198 return MemoryBuffer_MMap;
199199 }
200200 };
2323 assert(LastChar >= FirstChar && "Invalid start/end range");
2424 }
2525
26 virtual uint64_t getBase() const { return 0; }
27 virtual uint64_t getExtent() const { return LastChar - FirstChar; }
28 virtual int readByte(uint64_t address, uint8_t* ptr) const;
26 virtual uint64_t getBase() const LLVM_OVERRIDE { return 0; }
27 virtual uint64_t getExtent() const LLVM_OVERRIDE {
28 return LastChar - FirstChar;
29 }
30 virtual int readByte(uint64_t address, uint8_t* ptr) const LLVM_OVERRIDE;
2931 virtual int readBytes(uint64_t address,
3032 uint64_t size,
3133 uint8_t* buf,
32 uint64_t* copied) const;
33 virtual const uint8_t *getPointer(uint64_t address, uint64_t size) const;
34 virtual bool isValidAddress(uint64_t address) const {
34 uint64_t* copied) const LLVM_OVERRIDE;
35 virtual const uint8_t *getPointer(uint64_t address,
36 uint64_t size) const LLVM_OVERRIDE;
37 virtual bool isValidAddress(uint64_t address) const LLVM_OVERRIDE {
3538 return validAddress(address);
3639 }
37 virtual bool isObjectEnd(uint64_t address) const {return objectEnd(address);}
40 virtual bool isObjectEnd(uint64_t address) const LLVM_OVERRIDE {
41 return objectEnd(address);
42 }
3843
3944 private:
4045 const uint8_t* const FirstChar;
4747
4848 class _generic_error_category : public _do_message {
4949 public:
50 virtual const char* name() const;
51 virtual std::string message(int ev) const;
50 virtual const char* name() const LLVM_OVERRIDE;
51 virtual std::string message(int ev) const LLVM_OVERRIDE;
5252 };
5353
5454 const char*
7373
7474 class _system_error_category : public _do_message {
7575 public:
76 virtual const char* name() const;
77 virtual std::string message(int ev) const;
78 virtual error_condition default_error_condition(int ev) const;
76 virtual const char* name() const LLVM_OVERRIDE;
77 virtual std::string message(int ev) const LLVM_OVERRIDE;
78 virtual error_condition default_error_condition(int ev) const LLVM_OVERRIDE;
7979 };
8080
8181 const char*
28352835 // CmpInst Classes
28362836 //===----------------------------------------------------------------------===//
28372837
2838 void CmpInst::Anchor() const {}
2838 void CmpInst::anchor() {}
28392839
28402840 CmpInst::CmpInst(Type *ty, OtherOps op, unsigned short predicate,
28412841 Value *LHS, Value *RHS, const Twine &Name,