diff options
author | Sean Silva <chisophugis@gmail.com> | 2015-01-28 10:26:29 +0000 |
---|---|---|
committer | Sean Silva <chisophugis@gmail.com> | 2015-01-28 10:26:29 +0000 |
commit | b1548edf25bebe6b5d1139bf6dbdac6edf5ea6a4 (patch) | |
tree | 0f75202fc75068513305b08b459db1fc50da4029 /llvm/docs/HowToSetUpLLVMStyleRTTI.rst | |
parent | 7b0dd39db6373a07a876983116a04d72b09c4df8 (diff) | |
download | bcm5719-llvm-b1548edf25bebe6b5d1139bf6dbdac6edf5ea6a4.tar.gz bcm5719-llvm-b1548edf25bebe6b5d1139bf6dbdac6edf5ea6a4.zip |
[docs] [cleanup] No need for a comment around C++11 override
llvm-svn: 227304
Diffstat (limited to 'llvm/docs/HowToSetUpLLVMStyleRTTI.rst')
-rw-r--r-- | llvm/docs/HowToSetUpLLVMStyleRTTI.rst | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/docs/HowToSetUpLLVMStyleRTTI.rst b/llvm/docs/HowToSetUpLLVMStyleRTTI.rst index 96275e7dc23..c293b4e4069 100644 --- a/llvm/docs/HowToSetUpLLVMStyleRTTI.rst +++ b/llvm/docs/HowToSetUpLLVMStyleRTTI.rst @@ -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; |