aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/ADT/Triple.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-08-12 06:19:40 +0000
committerChris Lattner <sabre@nondot.org>2009-08-12 06:19:40 +0000
commitdfc17f75e81250f3dcf06938f164481a77a50d60 (patch)
tree0f921e90a2ae9cb7c0b24857723645f46964f3b3 /include/llvm/ADT/Triple.h
parente14463832cd4bebc9c95981c74bf67085a521b60 (diff)
downloadexternal_llvm-dfc17f75e81250f3dcf06938f164481a77a50d60.zip
external_llvm-dfc17f75e81250f3dcf06938f164481a77a50d60.tar.gz
external_llvm-dfc17f75e81250f3dcf06938f164481a77a50d60.tar.bz2
add a couple of helpers to the Triple class for decoding
the darwin version string. This should help consolidate the variety of weird functions we have scattered around the codebase that do stuff like this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78792 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/Triple.h')
-rw-r--r--include/llvm/ADT/Triple.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/llvm/ADT/Triple.h b/include/llvm/ADT/Triple.h
index 31cf8ef..47f8b6e 100644
--- a/include/llvm/ADT/Triple.h
+++ b/include/llvm/ADT/Triple.h
@@ -158,6 +158,21 @@ public:
/// if the environment component is present).
StringRef getOSAndEnvironmentName() const;
+
+ /// getDarwinNumber - Parse the 'darwin number' out of the specific target
+ /// triple. For example, if we have darwin8.5 return 8,5,0. If any entry is
+ /// not defined, return 0's. This requires that the triple have an OSType of
+ /// darwin before it is called.
+ void getDarwinNumber(unsigned &Maj, unsigned &Min, unsigned &Revision) const;
+
+ /// getDarwinMajorNumber - Return just the major version number, this is
+ /// specialized because it is a common query.
+ unsigned getDarwinMajorNumber() const {
+ unsigned Maj, Min, Rev;
+ getDarwinNumber(Maj, Min, Rev);
+ return Maj;
+ }
+
/// @}
/// @name Mutators
/// @{