summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-09-19 19:47:14 +0000
committerChris Lattner <sabre@nondot.org>2009-09-19 19:47:14 +0000
commitcea1438cf59c7cd3a632d61d78e68589315510d3 (patch)
tree59ff6f2ac9629a3a80cafa04852f75b6b5f734ad /include
parentc2fc1fec6c8c5360828aa778e8fcc446bb9c6ae9 (diff)
downloadllvm-cea1438cf59c7cd3a632d61d78e68589315510d3.tar.gz
llvm-cea1438cf59c7cd3a632d61d78e68589315510d3.tar.bz2
llvm-cea1438cf59c7cd3a632d61d78e68589315510d3.tar.xz
provide a "strtoull" operation that works on StringRef's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82322 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/ADT/StringRef.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/llvm/ADT/StringRef.h b/include/llvm/ADT/StringRef.h
index 74d3eaaf34..2015a66bd8 100644
--- a/include/llvm/ADT/StringRef.h
+++ b/include/llvm/ADT/StringRef.h
@@ -224,6 +224,23 @@ namespace llvm {
}
/// @}
+ /// @name Helpful Algorithms
+ /// @{
+
+ /// getAsInteger - Parse the current string as an integer of the specified
+ /// radix. If Radix is specified as zero, this does radix autosensing using
+ /// extended C rules: 0 is octal, 0x is hex, 0b is binary.
+ ///
+ /// If the string is invalid or if only a subset of the string is valid,
+ /// this returns true to signify the error. The string is considered
+ /// erroneous if empty.
+ ///
+ //bool getAsInteger(unsigned Radix, long long &Result) const;
+ bool getAsInteger(unsigned Radix, unsigned long long &Result) const;
+
+ // TODO: Provide overloads for int/unsigned that check for overflow.
+
+ /// @}
/// @name Substring Operations
/// @{