aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2012-01-31 04:52:32 +0000
committerChandler Carruth <chandlerc@gmail.com>2012-01-31 04:52:32 +0000
commit6f72ac4799a1a20c07cd96cc994dd6394ebff9a2 (patch)
treea645d65aa202cf9c0a5042a86bd134a97ad007b8 /include
parent90f1d8a5da6f962175af0a3ebedb76aeffa42694 (diff)
downloadexternal_llvm-6f72ac4799a1a20c07cd96cc994dd6394ebff9a2.zip
external_llvm-6f72ac4799a1a20c07cd96cc994dd6394ebff9a2.tar.gz
external_llvm-6f72ac4799a1a20c07cd96cc994dd6394ebff9a2.tar.bz2
Add various coarse bit-width architecture predicates to llvm::Triple.
These are very useful for frontends and other utilities reasoning about or selecting between triples. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149353 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/ADT/Triple.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/llvm/ADT/Triple.h b/include/llvm/ADT/Triple.h
index d998ddd..6299e14 100644
--- a/include/llvm/ADT/Triple.h
+++ b/include/llvm/ADT/Triple.h
@@ -241,6 +241,25 @@ public:
/// @name Convenience Predicates
/// @{
+ /// \brief Test whether the architecture is 64-bit
+ ///
+ /// Note that this tests for 64-bit pointer width, and nothing else. Note
+ /// that we intentionally expose only three predicates, 64-bit, 32-bit, and
+ /// 16-bit. The inner details of pointer width for particular architectures
+ /// is not summed up in the triple, and so only a coarse grained predicate
+ /// system is provided.
+ bool isArch64Bit() const;
+
+ /// \brief Test whether the architecture is 32-bit
+ ///
+ /// Note that this tests for 32-bit pointer width, and nothing else.
+ bool isArch32Bit() const;
+
+ /// \brief Test whether the architecture is 16-bit
+ ///
+ /// Note that this tests for 16-bit pointer width, and nothing else.
+ bool isArch16Bit() const;
+
/// isOSVersionLT - Helper function for doing comparisons against version
/// numbers included in the target triple.
bool isOSVersionLT(unsigned Major, unsigned Minor = 0,