diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-04-28 00:57:14 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-04-28 00:57:14 +0000 |
commit | 86ae84b0d9f3b6222121d8df20495ce9f140b8a9 (patch) | |
tree | 64fdad950bf4af3c2e6c12bd1446435c26efb661 | |
parent | 7caac53729cb81f26ad4032d57467acd8a16d6f0 (diff) | |
download | bcm5719-llvm-86ae84b0d9f3b6222121d8df20495ce9f140b8a9.tar.gz bcm5719-llvm-86ae84b0d9f3b6222121d8df20495ce9f140b8a9.zip |
Fix bogus documentation for StringRef::slice in the End < Start case.
llvm-svn: 267831
-rw-r--r-- | llvm/include/llvm/ADT/StringRef.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/include/llvm/ADT/StringRef.h b/llvm/include/llvm/ADT/StringRef.h index f1189690ffb..97ba177e546 100644 --- a/llvm/include/llvm/ADT/StringRef.h +++ b/llvm/include/llvm/ADT/StringRef.h @@ -446,9 +446,10 @@ namespace llvm { /// empty substring will be returned. /// /// \param End The index following the last character to include in the - /// substring. If this is npos, or less than \p Start, or exceeds the - /// number of characters remaining in the string, the string suffix - /// (starting with \p Start) will be returned. + /// substring. If this is npos or exceeds the number of characters + /// remaining in the string, the string suffix (starting with \p Start) + /// will be returned. If this is less than \p Start, an empty string will + /// be returned. LLVM_ATTRIBUTE_ALWAYS_INLINE StringRef slice(size_t Start, size_t End) const { Start = std::min(Start, Length); |