aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Basic/ObjCRuntime.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/Basic/ObjCRuntime.h')
-rw-r--r--include/clang/Basic/ObjCRuntime.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/include/clang/Basic/ObjCRuntime.h b/include/clang/Basic/ObjCRuntime.h
index da3ecca0f8..b24fe7cd91 100644
--- a/include/clang/Basic/ObjCRuntime.h
+++ b/include/clang/Basic/ObjCRuntime.h
@@ -170,6 +170,34 @@ public:
llvm_unreachable("bad kind");
}
+ /// \brief Does this runtime allow sizeof or alignof on object types?
+ bool allowsSizeofAlignof() const {
+ return isFragile();
+ }
+
+ /// \brief Does this runtime allow pointer arithmetic on objects?
+ ///
+ /// This covers +, -, ++, --, and (if isSubscriptPointerArithmetic()
+ /// yields true) [].
+ bool allowsPointerArithmetic() const {
+ switch (getKind()) {
+ case FragileMacOSX:
+ case GCC:
+ return true;
+ case MacOSX:
+ case iOS:
+ case GNUstep:
+ case ObjFW:
+ return false;
+ }
+ llvm_unreachable("bad kind");
+ }
+
+ /// \brief Is subscripting pointer arithmetic?
+ bool isSubscriptPointerArithmetic() const {
+ return allowsPointerArithmetic();
+ }
+
/// \brief Does this runtime provide an objc_terminate function?
///
/// This is used in handlers for exceptions during the unwind process;