I have a patch to add LLVM_OVERRIDE and LLVM_FINAL that I'll commit shortly. Do we want virtual and override or just override? People are used to seeing virtual and know what it means. Just override at the end of the line is a little less obvious. We obviously have inconsistent usage of virtuals all over the tree today so would probably good to have a standard.<span></span><br>
<br>On Sunday, September 16, 2012, Craig Topper wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><br>On Sunday, September 16, 2012, Sean Silva wrote:<br>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Maybe we should add LLVM_OVERRIDE to our C++11-prep arsenal? This<br>
really isn't what the `virtual` keyword is meant for...<br>
<br>
--Sean Silva<br>
<br>
On Sun, Sep 16, 2012 at 3:39 AM, Craig Topper <<a>craig.topper@gmail.com</a>> wrote:<br>
> Author: ctopper<br>
> Date: Sun Sep 16 02:39:55 2012<br>
> New Revision: 163996<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=163996&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=163996&view=rev</a><br>
> Log:<br>
> Add explicit virtual keywords for methods that override base class.<br>
><br>
> Modified:<br>
> llvm/trunk/include/llvm/TableGen/Record.h<br>
><br>
> Modified: llvm/trunk/include/llvm/TableGen/Record.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/TableGen/Record.h?rev=163996&r1=163995&r2=163996&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/TableGen/Record.h?rev=163996&r1=163995&r2=163996&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/include/llvm/TableGen/Record.h (original)<br>
> +++ llvm/trunk/include/llvm/TableGen/Record.h Sun Sep 16 02:39:55 2012<br>
> @@ -152,9 +152,9 @@<br>
> virtual Init *convertValue( VarInit *VI) { return RecTy::convertValue(VI);}<br>
> virtual Init *convertValue( FieldInit *FI) { return RecTy::convertValue(FI);}<br>
><br>
> - std::string getAsString() const { return "bit"; }<br>
> + virtual std::string getAsString() const { return "bit"; }<br>
><br>
> - bool typeIsConvertibleTo(const RecTy *RHS) const {<br>
> + virtual bool typeIsConvertibleTo(const RecTy *RHS) const {<br>
> return RHS->baseClassOf(this);<br>
> }<br>
> virtual bool baseClassOf(const BitRecTy *RHS) const { return true; }<br>
> @@ -195,9 +195,9 @@<br>
> virtual Init *convertValue( VarInit *VI) { return RecTy::convertValue(VI);}<br>
> virtual Init *convertValue( FieldInit *FI) { return RecTy::convertValue(FI);}<br>
><br>
> - std::string getAsString() const;<br>
> + virtual std::string getAsString() const;<br>
><br>
> - bool typeIsConvertibleTo(const RecTy *RHS) const {<br>
> + virtual bool typeIsConvertibleTo(const RecTy *RHS) const {<br>
> return RHS->baseClassOf(this);<br>
> }<br>
> virtual bool baseClassOf(const BitRecTy *RHS) const { return Size == 1; }<br>
> @@ -237,9 +237,9 @@<br>
> virtual Init *convertValue( VarInit *VI) { return RecTy::convertValue(VI);}<br>
> virtual Init *convertValue( FieldInit *FI) { return RecTy::convertValue(FI);}<br>
><br>
> - std::string getAsString() const { return "int"; }<br>
> + virtual std::string getAsString() const { return "int"; }<br>
><br>
> - bool typeIsConvertibleTo(const RecTy *RHS) const {<br>
> + virtual bool typeIsConvertibleTo(const RecTy *RHS) const {<br>
> return RHS->baseClassOf(this);<br>
> }<br>
><br>
> @@ -278,9 +278,9 @@<br>
> virtual Init *convertValue( VarInit *VI) { return RecTy::convertValue(VI);}<br>
> virtual Init *convertValue( FieldInit *FI) { return RecTy::convertValue(FI);}<br>
><br>
> - std::string getAsString() const { return "string"; }<br>
> + virtual std::string getAsString() const { return "string"; }<br>
><br>
> - bool typeIsConvertibleTo(const RecTy *RHS) const {<br>
> + virtual bool typeIsConvertibleTo(const RecTy *RHS) const {<br>
> return RHS->baseClassOf(this);<br>
> }<br>
><br>
> @@ -322,9 +322,9 @@<br>
> virtual Init *convertValue( VarInit *VI) { return RecTy::convertValue(VI);}<br>
> virtual Init *convertValue( FieldInit *FI) { return RecTy::convertValue(FI);}<br>
><br>
> - std::string getAsString() const;<br>
> + virtual std::string getAsString() const;<br>
><br>
> - bool typeIsConvertibleTo(const RecTy *RHS) const {<br>
> + virtual bool typeIsConvertibleTo(const RecTy *RHS) const {<br>
> return RHS->baseClassOf(this);<br>
> }<br>
><br>
> @@ -363,9 +363,9 @@<br>
> virtual Init *convertValue( VarInit *VI) { return RecTy::convertValue(VI);}<br>
> virtual Init *convertValue( FieldInit *FI) { return RecTy::convertValue(FI);}<br>
><br>
> - std::string getAsString() const { return "dag"; }<br>
> + virtual std::string getAsString() const { return "dag"; }<br>
><br>
> - bool typeIsConvertibleTo(const RecTy *RHS) const {<br>
> + virtual bool typeIsConvertibleTo(const RecTy *RHS) const {<br>
> return RHS->baseClassOf(this);<br>
> }<br>
><br>
> @@ -407,9 +407,9 @@<br>
> </blockquote>-- <br>~Craig<br>
</blockquote><br><br>-- <br>~Craig<br>