diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-04-16 16:01:22 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-04-16 16:01:22 +0000 |
commit | 71d5a2540a98c81f5bcaeb48805e0e2881f530ef (patch) | |
tree | 5343938942df402b49ec7300a1c25a2d4ccd5821 /include/llvm/ADT/StringRef.h | |
parent | 31bbf64f3a4974a2d6c8b3b27ad2f519caf74057 (diff) |
Diffstat (limited to 'include/llvm/ADT/StringRef.h')
-rw-r--r-- | include/llvm/ADT/StringRef.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/include/llvm/ADT/StringRef.h b/include/llvm/ADT/StringRef.h index d80a848c44a1..ce48f6d3bad3 100644 --- a/include/llvm/ADT/StringRef.h +++ b/include/llvm/ADT/StringRef.h @@ -557,6 +557,14 @@ namespace llvm { /// string is well-formed in the given radix. bool getAsInteger(unsigned Radix, APInt &Result) const; + /// Parse the current string as an IEEE double-precision floating + /// point value. The string must be a well-formed double. + /// + /// If \p AllowInexact is false, the function will fail if the string + /// cannot be represented exactly. Otherwise, the function only fails + /// in case of an overflow or underflow. + bool getAsDouble(double &Result, bool AllowInexact = true) const; + /// @} /// @name String Operations /// @{ @@ -600,7 +608,7 @@ namespace llvm { return drop_back(size() - N); } - /// Return a StringRef equal to 'this' but with only the first \p N + /// Return a StringRef equal to 'this' but with only the last \p N /// elements remaining. If \p N is greater than the length of the /// string, the entire string is returned. LLVM_NODISCARD |