summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-01-13 04:50:20 +0000
committerChris Lattner <sabre@nondot.org>2010-01-13 04:50:20 +0000
commite192d377c5533419d05c00748f720acdad985b1a (patch)
tree0bbb6e4b8f845590fbe4aa5225db18ea1bd63039 /llvm
parent8e26d19cb343ccb211fd45294a10f61b5a562b94 (diff)
downloadbcm5719-llvm-e192d377c5533419d05c00748f720acdad985b1a.tar.gz
bcm5719-llvm-e192d377c5533419d05c00748f720acdad985b1a.zip
give StringRef a const_iterator member.
llvm-svn: 93294
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/ADT/StringRef.h12
1 files changed, 3 insertions, 9 deletions
diff --git a/llvm/include/llvm/ADT/StringRef.h b/llvm/include/llvm/ADT/StringRef.h
index 14efb824a8b..3064af3abbc 100644
--- a/llvm/include/llvm/ADT/StringRef.h
+++ b/llvm/include/llvm/ADT/StringRef.h
@@ -29,6 +29,7 @@ namespace llvm {
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;
@@ -42,15 +43,8 @@ namespace llvm {
// Workaround PR5482: nearly all gcc 4.x miscompile StringRef and std::min()
// Changing the arg of min to be an integer, instead of a reference to an
// integer works around this bug.
- size_t min(size_t a, size_t b) const
- {
- return a < b ? a : b;
- }
-
- size_t max(size_t a, size_t b) const
- {
- return a > b ? a : b;
- }
+ size_t min(size_t a, size_t b) const { return a < b ? a : b; }
+ size_t max(size_t a, size_t b) const { return a > b ? a : b; }
public:
/// @name Constructors
OpenPOWER on IntegriCloud