[YAML] Make Node's destructor non-virtual.

Nodes aren't supposed to be destroyed polymorphically. Also make all subclasses
final to avoid non-virtual dtor warnings.

llvm-svn: 237801
This commit is contained in:
Benjamin Kramer 2015-05-20 15:38:29 +00:00
parent a8512b1784
commit 4e3cb46b14
1 changed files with 8 additions and 8 deletions

View File

@ -159,7 +159,7 @@ protected:
void operator delete(void *) throw() {} void operator delete(void *) throw() {}
virtual ~Node() {} ~Node() = default;
private: private:
unsigned int TypeID; unsigned int TypeID;
@ -172,7 +172,7 @@ private:
/// ///
/// Example: /// Example:
/// !!null null /// !!null null
class NullNode : public Node { class NullNode final : public Node {
void anchor() override; void anchor() override;
public: public:
@ -187,7 +187,7 @@ public:
/// ///
/// Example: /// Example:
/// Adena /// Adena
class ScalarNode : public Node { class ScalarNode final : public Node {
void anchor() override; void anchor() override;
public: public:
@ -230,7 +230,7 @@ private:
/// | /// |
/// Hello /// Hello
/// World /// World
class BlockScalarNode : public Node { class BlockScalarNode final : public Node {
void anchor() override; void anchor() override;
public: public:
@ -260,7 +260,7 @@ private:
/// ///
/// Example: /// Example:
/// Section: .text /// Section: .text
class KeyValueNode : public Node { class KeyValueNode final : public Node {
void anchor() override; void anchor() override;
public: public:
@ -371,7 +371,7 @@ template <class CollectionType> void skip(CollectionType &C) {
/// Example: /// Example:
/// Name: _main /// Name: _main
/// Scope: Global /// Scope: Global
class MappingNode : public Node { class MappingNode final : public Node {
void anchor() override; void anchor() override;
public: public:
@ -418,7 +418,7 @@ private:
/// Example: /// Example:
/// - Hello /// - Hello
/// - World /// - World
class SequenceNode : public Node { class SequenceNode final : public Node {
void anchor() override; void anchor() override;
public: public:
@ -471,7 +471,7 @@ private:
/// ///
/// Example: /// Example:
/// *AnchorName /// *AnchorName
class AliasNode : public Node { class AliasNode final : public Node {
void anchor() override; void anchor() override;
public: public: