1//===--- ObjCRuntime.h - Objective C runtime features -----------*- C++ -*-===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9 10#ifndef CLANG_DRIVER_OBJCRUNTIME_H_ 11#define CLANG_DRIVER_OBJCRUNTIME_H_ 12 13namespace clang { 14namespace driver { 15 16class ObjCRuntime { 17public: 18 enum Kind { GNU, NeXT }; 19private: 20 unsigned RuntimeKind : 1; 21public: 22 void setKind(Kind k) { RuntimeKind = k; } 23 Kind getKind() const { return static_cast<Kind>(RuntimeKind); } 24 25 /// True if the runtime provides native ARC entrypoints. ARC may 26 /// still be usable without this if the tool-chain provides a 27 /// statically-linked runtime support library. 28 unsigned HasARC : 1; 29 30 /// True if the runtime supports ARC zeroing __weak. 31 unsigned HasWeak : 1; 32 33 /// True if the runtime provides the following entrypoint: 34 /// void objc_terminate(void); 35 /// If available, this will be called instead of abort() when an 36 /// exception is thrown out of an EH cleanup. 37 unsigned HasTerminate : 1; 38 39 ObjCRuntime() : RuntimeKind(NeXT), HasARC(false), HasWeak(false), 40 HasTerminate(false) {} 41}; 42 43} 44} 45 46#endif 47