[llvm] r227304 - [docs] [cleanup] No need for a comment around C++11 override
Sean Silva
chisophugis at gmail.com
Wed Jan 28 02:26:29 PST 2015
Author: silvas
Date: Wed Jan 28 04:26:29 2015
New Revision: 227304
URL: http://llvm.org/viewvc/llvm-project?rev=227304&view=rev
Log:
[docs] [cleanup] No need for a comment around C++11 override
Modified:
llvm/trunk/docs/HowToSetUpLLVMStyleRTTI.rst
Modified: llvm/trunk/docs/HowToSetUpLLVMStyleRTTI.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/HowToSetUpLLVMStyleRTTI.rst?rev=227304&r1=227303&r2=227304&view=diff
==============================================================================
--- llvm/trunk/docs/HowToSetUpLLVMStyleRTTI.rst (original)
+++ llvm/trunk/docs/HowToSetUpLLVMStyleRTTI.rst Wed Jan 28 04:26:29 2015
@@ -40,14 +40,14 @@ RTTI for this class hierarchy:
double SideLength;
public:
Square(double S) : SideLength(S) {}
- double computeArea() /* override */;
+ double computeArea() override;
};
class Circle : public Shape {
double Radius;
public:
Circle(double R) : Radius(R) {}
- double computeArea() /* override */;
+ double computeArea() override;
};
The most basic working setup for LLVM-style RTTI requires the following
@@ -135,7 +135,7 @@ steps:
public:
- Square(double S) : SideLength(S) {}
+ Square(double S) : Shape(SK_Square), SideLength(S) {}
- double computeArea() /* override */;
+ double computeArea() override;
};
class Circle : public Shape {
@@ -143,7 +143,7 @@ steps:
public:
- Circle(double R) : Radius(R) {}
+ Circle(double R) : Shape(SK_Circle), Radius(R) {}
- double computeArea() /* override */;
+ double computeArea() override;
};
#. Finally, you need to inform LLVM's RTTI templates how to dynamically
@@ -175,7 +175,7 @@ steps:
double SideLength;
public:
Square(double S) : Shape(SK_Square), SideLength(S) {}
- double computeArea() /* override */;
+ double computeArea() override;
+
+ static bool classof(const Shape *S) {
+ return S->getKind() == SK_Square;
@@ -186,7 +186,7 @@ steps:
double Radius;
public:
Circle(double R) : Shape(SK_Circle), Radius(R) {}
- double computeArea() /* override */;
+ double computeArea() override;
+
+ static bool classof(const Shape *S) {
+ return S->getKind() == SK_Circle;
More information about the llvm-commits
mailing list