summaryrefslogtreecommitdiff
path: root/include/llvm/ADT/StringRef.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-05-17 20:22:39 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-05-17 20:22:39 +0000
commit7af96fb3afd6725a2824a0a5ca5dad34e5e0b056 (patch)
tree6661ffbabf869009597684462f5a3df3beccc952 /include/llvm/ADT/StringRef.h
parent6b3f41ed88e8e440e11a4fbf20b6600529f80049 (diff)
Vendor import of llvm trunk r303291:vendor/llvm/llvm-trunk-r303291
Notes
svn path=/vendor/llvm/dist/; revision=318414 svn path=/vendor/llvm/llvm-trunk-r303291/; revision=318415; tag=vendor/llvm/llvm-trunk-r303291
Diffstat (limited to 'include/llvm/ADT/StringRef.h')
-rw-r--r--include/llvm/ADT/StringRef.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/include/llvm/ADT/StringRef.h b/include/llvm/ADT/StringRef.h
index ce48f6d3bad3..4b25f56432df 100644
--- a/include/llvm/ADT/StringRef.h
+++ b/include/llvm/ADT/StringRef.h
@@ -1,4 +1,4 @@
-//===--- StringRef.h - Constant String Reference Wrapper --------*- C++ -*-===//
+//===- StringRef.h - Constant String Reference Wrapper ----------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -15,16 +15,18 @@
#include "llvm/Support/Compiler.h"
#include <algorithm>
#include <cassert>
+#include <cstddef>
#include <cstring>
#include <limits>
+#include <type_traits>
#include <string>
#include <utility>
namespace llvm {
- template <typename T>
- class SmallVectorImpl;
+
class APInt;
class hash_code;
+ template <typename T> class SmallVectorImpl;
class StringRef;
/// Helper functions for StringRef::getAsInteger.
@@ -46,10 +48,11 @@ namespace llvm {
/// general safe to store a StringRef.
class StringRef {
public:
- typedef const char *iterator;
- typedef const char *const_iterator;
static const size_t npos = ~size_t(0);
- typedef size_t size_type;
+
+ using iterator = const char *;
+ using const_iterator = const char *;
+ using size_type = size_t;
private:
/// The start of the string, in an external buffer.
@@ -906,6 +909,7 @@ namespace llvm {
// StringRefs can be treated like a POD type.
template <typename T> struct isPodLike;
template <> struct isPodLike<StringRef> { static const bool value = true; };
-}
-#endif
+} // end namespace llvm
+
+#endif // LLVM_ADT_STRINGREF_H