unsigned int getType() const { return TypeID; }
void *operator new(size_t Size, BumpPtrAllocator &Alloc,
- size_t Alignment = 16) throw() {
+ size_t Alignment = 16) LLVM_NOEXCEPT {
return Alloc.Allocate(Size, Alignment);
}
- void operator delete(void *Ptr, BumpPtrAllocator &Alloc, size_t Size) throw() {
+ void operator delete(void *Ptr, BumpPtrAllocator &Alloc,
+ size_t Size) LLVM_NOEXCEPT {
Alloc.Deallocate(Ptr, Size);
}
std::unique_ptr<Document> &Doc;
SMRange SourceRange;
- void operator delete(void *) throw() {}
+ void operator delete(void *) LLVM_NOEXCEPT = delete;
- virtual ~Node() {}
+ ~Node() = default;
private:
unsigned int TypeID;
///
/// Example:
/// !!null null
-class NullNode : public Node {
+class NullNode final : public Node {
void anchor() override;
public:
///
/// Example:
/// Adena
-class ScalarNode : public Node {
+class ScalarNode final : public Node {
void anchor() override;
public:
/// |
/// Hello
/// World
-class BlockScalarNode : public Node {
+class BlockScalarNode final : public Node {
void anchor() override;
public:
BlockScalarNode(std::unique_ptr<Document> &D, StringRef Anchor, StringRef Tag,
- std::string &Value, StringRef RawVal)
- : Node(NK_BlockScalar, D, Anchor, Tag), Value(std::move(Value)) {
+ StringRef Value, StringRef RawVal)
+ : Node(NK_BlockScalar, D, Anchor, Tag), Value(Value) {
SMLoc Start = SMLoc::getFromPointer(RawVal.begin());
SMLoc End = SMLoc::getFromPointer(RawVal.end());
SourceRange = SMRange(Start, End);
}
private:
- std::string Value;
+ StringRef Value;
};
/// \brief A key and value pair. While not technically a Node under the YAML
///
/// Example:
/// Section: .text
-class KeyValueNode : public Node {
+class KeyValueNode final : public Node {
void anchor() override;
public:
/// Example:
/// Name: _main
/// Scope: Global
-class MappingNode : public Node {
+class MappingNode final : public Node {
void anchor() override;
public:
/// Example:
/// - Hello
/// - World
-class SequenceNode : public Node {
+class SequenceNode final : public Node {
void anchor() override;
public:
///
/// Example:
/// *AnchorName
-class AliasNode : public Node {
+class AliasNode final : public Node {
void anchor() override;
public: