diff options
Diffstat (limited to 'include/llvm/Support')
-rw-r--r-- | include/llvm/Support/Compression.h | 6 | ||||
-rw-r--r-- | include/llvm/Support/FileSystem.h | 1 | ||||
-rw-r--r-- | include/llvm/Support/StreamableMemoryObject.h | 5 | ||||
-rw-r--r-- | include/llvm/Support/YAMLParser.h | 36 | ||||
-rw-r--r-- | include/llvm/Support/YAMLTraits.h | 18 |
5 files changed, 30 insertions, 36 deletions
diff --git a/include/llvm/Support/Compression.h b/include/llvm/Support/Compression.h index ea3962ecd9..80eff5c628 100644 --- a/include/llvm/Support/Compression.h +++ b/include/llvm/Support/Compression.h @@ -15,11 +15,11 @@ #define LLVM_SUPPORT_COMPRESSION_H #include "llvm/Support/DataTypes.h" +#include <memory> namespace llvm { class MemoryBuffer; -template<typename T> class OwningPtr; class StringRef; namespace zlib { @@ -43,11 +43,11 @@ enum Status { bool isAvailable(); Status compress(StringRef InputBuffer, - OwningPtr<MemoryBuffer> &CompressedBuffer, + std::unique_ptr<MemoryBuffer> &CompressedBuffer, CompressionLevel Level = DefaultCompression); Status uncompress(StringRef InputBuffer, - OwningPtr<MemoryBuffer> &UncompressedBuffer, + std::unique_ptr<MemoryBuffer> &UncompressedBuffer, size_t UncompressedSize); uint32_t crc32(StringRef Buffer); diff --git a/include/llvm/Support/FileSystem.h b/include/llvm/Support/FileSystem.h index b57a8b07a3..1812d24ead 100644 --- a/include/llvm/Support/FileSystem.h +++ b/include/llvm/Support/FileSystem.h @@ -28,7 +28,6 @@ #define LLVM_SUPPORT_FILESYSTEM_H #include "llvm/ADT/IntrusiveRefCntPtr.h" -#include "llvm/ADT/OwningPtr.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/Twine.h" #include "llvm/Support/DataTypes.h" diff --git a/include/llvm/Support/StreamableMemoryObject.h b/include/llvm/Support/StreamableMemoryObject.h index 1eb4c32dbc..e2908756c3 100644 --- a/include/llvm/Support/StreamableMemoryObject.h +++ b/include/llvm/Support/StreamableMemoryObject.h @@ -11,10 +11,11 @@ #ifndef LLVM_SUPPORT_STREAMABLEMEMORYOBJECT_H #define LLVM_SUPPORT_STREAMABLEMEMORYOBJECT_H -#include "llvm/ADT/OwningPtr.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/DataStream.h" #include "llvm/Support/MemoryObject.h" +#include <cassert> +#include <memory> #include <vector> namespace llvm { @@ -137,7 +138,7 @@ public: private: const static uint32_t kChunkSize = 4096 * 4; mutable std::vector<unsigned char> Bytes; - OwningPtr<DataStreamer> Streamer; + std::unique_ptr<DataStreamer> Streamer; mutable size_t BytesRead; // Bytes read from stream size_t BytesSkipped;// Bytes skipped at start of stream (e.g. wrapper/header) mutable size_t ObjectSize; // 0 if unknown, set if wrapper seen or EOF reached diff --git a/include/llvm/Support/YAMLParser.h b/include/llvm/Support/YAMLParser.h index 492d6ec7fc..c11aa25094 100644 --- a/include/llvm/Support/YAMLParser.h +++ b/include/llvm/Support/YAMLParser.h @@ -38,7 +38,6 @@ #ifndef LLVM_SUPPORT_YAMLPARSER_H #define LLVM_SUPPORT_YAMLPARSER_H -#include "llvm/ADT/OwningPtr.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/Allocator.h" @@ -96,8 +95,8 @@ public: void printError(Node *N, const Twine &Msg); private: - OwningPtr<Scanner> scanner; - OwningPtr<Document> CurrentDoc; + std::unique_ptr<Scanner> scanner; + std::unique_ptr<Document> CurrentDoc; friend class Document; }; @@ -115,7 +114,7 @@ public: NK_Alias }; - Node(unsigned int Type, OwningPtr<Document> &, StringRef Anchor, + Node(unsigned int Type, std::unique_ptr<Document> &, StringRef Anchor, StringRef Tag); /// @brief Get the value of the anchor attached to this node. If it does not @@ -156,7 +155,7 @@ public: } protected: - OwningPtr<Document> &Doc; + std::unique_ptr<Document> &Doc; SMRange SourceRange; void operator delete(void *) throw() {} @@ -177,7 +176,7 @@ private: class NullNode : public Node { void anchor() override; public: - NullNode(OwningPtr<Document> &D) + NullNode(std::unique_ptr<Document> &D) : Node(NK_Null, D, StringRef(), StringRef()) {} static inline bool classof(const Node *N) { @@ -193,7 +192,7 @@ public: class ScalarNode : public Node { void anchor() override; public: - ScalarNode(OwningPtr<Document> &D, StringRef Anchor, StringRef Tag, + ScalarNode(std::unique_ptr<Document> &D, StringRef Anchor, StringRef Tag, StringRef Val) : Node(NK_Scalar, D, Anchor, Tag), Value(Val) { SMLoc Start = SMLoc::getFromPointer(Val.begin()); @@ -235,11 +234,8 @@ private: class KeyValueNode : public Node { void anchor() override; public: - KeyValueNode(OwningPtr<Document> &D) - : Node(NK_KeyValue, D, StringRef(), StringRef()) - , Key(0) - , Value(0) - {} + KeyValueNode(std::unique_ptr<Document> &D) + : Node(NK_KeyValue, D, StringRef(), StringRef()), Key(0), Value(0) {} /// @brief Parse and return the key. /// @@ -353,7 +349,7 @@ public: MT_Inline ///< An inline mapping node is used for "[key: value]". }; - MappingNode(OwningPtr<Document> &D, StringRef Anchor, StringRef Tag, + MappingNode(std::unique_ptr<Document> &D, StringRef Anchor, StringRef Tag, MappingType MT) : Node(NK_Mapping, D, Anchor, Tag), Type(MT), IsAtBeginning(true), IsAtEnd(false), CurrentEntry(0) {} @@ -410,7 +406,7 @@ public: ST_Indentless }; - SequenceNode(OwningPtr<Document> &D, StringRef Anchor, StringRef Tag, + SequenceNode(std::unique_ptr<Document> &D, StringRef Anchor, StringRef Tag, SequenceType ST) : Node(NK_Sequence, D, Anchor, Tag), SeqType(ST), IsAtBeginning(true), IsAtEnd(false), @@ -453,8 +449,8 @@ private: class AliasNode : public Node { void anchor() override; public: - AliasNode(OwningPtr<Document> &D, StringRef Val) - : Node(NK_Alias, D, StringRef(), StringRef()), Name(Val) {} + AliasNode(std::unique_ptr<Document> &D, StringRef Val) + : Node(NK_Alias, D, StringRef(), StringRef()), Name(Val) {} StringRef getName() const { return Name; } Node *getTarget(); @@ -531,7 +527,7 @@ private: class document_iterator { public: document_iterator() : Doc(0) {} - document_iterator(OwningPtr<Document> &D) : Doc(&D) {} + document_iterator(std::unique_ptr<Document> &D) : Doc(&D) {} bool operator ==(const document_iterator &Other) { if (isAtEnd() || Other.isAtEnd()) @@ -558,16 +554,14 @@ public: return *Doc->get(); } - OwningPtr<Document> &operator ->() { - return *Doc; - } + std::unique_ptr<Document> &operator->() { return *Doc; } private: bool isAtEnd() const { return !Doc || !*Doc; } - OwningPtr<Document> *Doc; + std::unique_ptr<Document> *Doc; }; } diff --git a/include/llvm/Support/YAMLTraits.h b/include/llvm/Support/YAMLTraits.h index b2f214b42e..e5d2308aee 100644 --- a/include/llvm/Support/YAMLTraits.h +++ b/include/llvm/Support/YAMLTraits.h @@ -852,15 +852,15 @@ public: void nextDocument(); private: - llvm::SourceMgr SrcMgr; // must be before Strm - OwningPtr<llvm::yaml::Stream> Strm; - OwningPtr<HNode> TopNode; - llvm::error_code EC; - llvm::BumpPtrAllocator StringAllocator; - llvm::yaml::document_iterator DocIterator; - std::vector<bool> BitValuesUsed; - HNode *CurrentNode; - bool ScalarMatchFound; + llvm::SourceMgr SrcMgr; // must be before Strm + std::unique_ptr<llvm::yaml::Stream> Strm; + std::unique_ptr<HNode> TopNode; + llvm::error_code EC; + llvm::BumpPtrAllocator StringAllocator; + llvm::yaml::document_iterator DocIterator; + std::vector<bool> BitValuesUsed; + HNode *CurrentNode; + bool ScalarMatchFound; }; |