clang API Documentation

ObjCRuntime.h
Go to the documentation of this file.
00001 //===--- ObjCRuntime.h - Objective C runtime features -----------*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 
00010 #ifndef CLANG_DRIVER_OBJCRUNTIME_H_
00011 #define CLANG_DRIVER_OBJCRUNTIME_H_
00012 
00013 namespace clang {
00014 namespace driver {
00015 
00016 class ObjCRuntime {
00017 public:
00018   enum Kind { GNU, NeXT };
00019 private:
00020   unsigned RuntimeKind : 1;
00021 public:
00022   void setKind(Kind k) { RuntimeKind = k; }
00023   Kind getKind() const { return static_cast<Kind>(RuntimeKind); }
00024 
00025   /// True if the runtime provides native ARC entrypoints.  ARC may
00026   /// still be usable without this if the tool-chain provides a
00027   /// statically-linked runtime support library.
00028   unsigned HasARC : 1;
00029 
00030   /// True if the runtime supports ARC zeroing __weak.
00031   unsigned HasWeak : 1;
00032 
00033   /// \brief True if the runtime supports subscripting methods.
00034   unsigned HasSubscripting : 1;
00035 
00036   /// True if the runtime provides the following entrypoint:
00037   ///   void objc_terminate(void);
00038   /// If available, this will be called instead of abort() when an
00039   /// exception is thrown out of an EH cleanup.
00040   unsigned HasTerminate : 1;
00041 
00042   ObjCRuntime() : RuntimeKind(NeXT), HasARC(false), HasWeak(false),
00043     HasSubscripting(false), HasTerminate(false) {}
00044 };
00045 
00046 }
00047 }
00048 
00049 #endif