clang API Documentation

Public Types | Public Member Functions | Public Attributes
clang::driver::toolchains::Darwin Class Reference

Darwin - The base Darwin tool chain. More...

#include <ToolChains.h>

Inheritance diagram for clang::driver::toolchains::Darwin:
Inheritance graph
[legend]
Collaboration diagram for clang::driver::toolchains::Darwin:
Collaboration graph
[legend]

List of all members.

Public Types

enum  DarwinPlatformKind { MacOS, IPhoneOS, IPhoneOSSimulator }

Public Member Functions

 Darwin (const Driver &D, const llvm::Triple &Triple, const llvm::opt::ArgList &Args)
 Darwin - Darwin tool chain for i386 and x86_64.
 ~Darwin ()
std::string ComputeEffectiveClangTriple (const llvm::opt::ArgList &Args, types::ID InputType) const override
Apple Specific Toolchain Implementation

{

void addMinVersionArgs (const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const override
void addStartObjectFileArgs (const llvm::opt::ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const override
bool isKernelStatic () const override
ToolChain Implementation

}

{

bool isCrossCompiling () const override
 Returns true if the toolchain is targeting a non-native architecture.
llvm::opt::DerivedArgList * TranslateArgs (const llvm::opt::DerivedArgList &Args, const char *BoundArch) const override
ObjCRuntime getDefaultObjCRuntime (bool isNonFragile) const override
 Darwin provides an ARC runtime starting in MacOS X 10.7 and iOS 5.0.
bool hasBlocksRuntime () const override
 Darwin provides a blocks runtime starting in MacOS X 10.6 and iOS 3.2.
bool UseObjCMixedDispatch () const override
unsigned GetDefaultStackProtectorLevel (bool KernelOrKext) const override
bool SupportsObjCGC () const override
 Does this tool chain support Objective-C garbage collection.
void CheckObjCARC () const override
 Complain if this tool chain doesn't support Objective-C ARC.
bool UseSjLjExceptions () const override
 UseSjLjExceptions - Does this tool chain use SjLj exceptions.

Public Attributes

unsigned DarwinVersion [3]
 The host version.
bool TargetInitialized
 Whether the information on the target has been initialized.
DarwinPlatformKind TargetPlatform
VersionTuple TargetVersion
 The OS version we are targeting.

Protected Member Functions

Darwin specific Toolchain functions

}

{

void setTarget (DarwinPlatformKind Platform, unsigned Major, unsigned Minor, unsigned Micro) const
bool isTargetIPhoneOS () const
bool isTargetIOSSimulator () const
bool isTargetIOSBased () const
 Is the target either iOS or an iOS simulator?
bool isTargetMacOS () const
bool isTargetInitialized () const
VersionTuple getTargetVersion () const
bool isIPhoneOSVersionLT (unsigned V0, unsigned V1=0, unsigned V2=0) const
bool isMacosxVersionLT (unsigned V0, unsigned V1=0, unsigned V2=0) const

Detailed Description

Darwin - The base Darwin tool chain.

Definition at line 310 of file ToolChains.h.


Member Enumeration Documentation

Enumerator:
MacOS 
IPhoneOS 
IPhoneOSSimulator 

Definition at line 322 of file ToolChains.h.


Constructor & Destructor Documentation

Darwin::Darwin ( const Driver D,
const llvm::Triple &  Triple,
const llvm::opt::ArgList &  Args 
)

Darwin - Darwin tool chain for i386 and x86_64.

Definition at line 55 of file ToolChains.cpp.

References DarwinVersion, clang::driver::Driver::Diag(), and clang::driver::ToolChain::getDriver().

Definition at line 179 of file ToolChains.cpp.


Member Function Documentation

void Darwin::addMinVersionArgs ( const llvm::opt::ArgList &  Args,
llvm::opt::ArgStringList &  CmdArgs 
) const [override, virtual]
void Darwin::addStartObjectFileArgs ( const llvm::opt::ArgList &  Args,
llvm::opt::ArgStringList &  CmdArgs 
) const [override, virtual]
void Darwin::CheckObjCARC ( ) const [override, virtual]

Complain if this tool chain doesn't support Objective-C ARC.

Reimplemented from clang::driver::ToolChain.

Definition at line 1087 of file ToolChains.cpp.

References clang::driver::Driver::Diag(), clang::driver::ToolChain::getDriver(), isMacosxVersionLT(), isTargetIOSBased(), and isTargetMacOS().

std::string Darwin::ComputeEffectiveClangTriple ( const llvm::opt::ArgList &  Args,
types::ID  InputType 
) const [override, virtual]

ComputeEffectiveClangTriple - Return the Clang triple to use for this target, which may take into account the command line arguments. For example, on Darwin the -mmacosx-version-min= command line argument (which sets the deployment target) determines the version in the triple passed to Clang.

Reimplemented from clang::driver::toolchains::MachO.

Definition at line 193 of file ToolChains.cpp.

References clang::driver::ToolChain::ComputeLLVMTriple(), clang::VersionTuple::getAsString(), getTargetVersion(), isTargetInitialized(), and isTargetIOSBased().

ObjCRuntime Darwin::getDefaultObjCRuntime ( bool  isNonFragile) const [override, virtual]

Darwin provides an ARC runtime starting in MacOS X 10.7 and iOS 5.0.

Reimplemented from clang::driver::ToolChain.

Definition at line 93 of file ToolChains.cpp.

References clang::ObjCRuntime::FragileMacOSX, clang::ObjCRuntime::iOS, isTargetIOSBased(), clang::ObjCRuntime::MacOSX, and TargetVersion.

Referenced by clang::driver::toolchains::DarwinClang::AddLinkARCArgs().

unsigned clang::driver::toolchains::Darwin::GetDefaultStackProtectorLevel ( bool  KernelOrKext) const [inline, override, virtual]

GetDefaultStackProtectorLevel - Get the default stack protector level for this tool chain (0=off, 1=on, 2=strong, 3=all).

Reimplemented from clang::driver::ToolChain.

Definition at line 450 of file ToolChains.h.

Definition at line 411 of file ToolChains.h.

Referenced by addMinVersionArgs(), and ComputeEffectiveClangTriple().

bool Darwin::hasBlocksRuntime ( ) const [override, virtual]

Darwin provides a blocks runtime starting in MacOS X 10.6 and iOS 3.2.

Reimplemented from clang::driver::ToolChain.

Definition at line 102 of file ToolChains.cpp.

References isIPhoneOSVersionLT(), isMacosxVersionLT(), isTargetIOSBased(), and isTargetMacOS().

bool clang::driver::toolchains::Darwin::isCrossCompiling ( ) const [inline, override, virtual]

Returns true if the toolchain is targeting a non-native architecture.

Reimplemented from clang::driver::ToolChain.

Definition at line 434 of file ToolChains.h.

bool clang::driver::toolchains::Darwin::isIPhoneOSVersionLT ( unsigned  V0,
unsigned  V1 = 0,
unsigned  V2 = 0 
) const [inline, protected]
bool clang::driver::toolchains::Darwin::isKernelStatic ( ) const [inline, override, virtual]

On some iOS platforms, kernel and kernel modules were built statically. Is this such a target?

Reimplemented from clang::driver::toolchains::MachO.

Definition at line 364 of file ToolChains.h.

bool clang::driver::toolchains::Darwin::isMacosxVersionLT ( unsigned  V0,
unsigned  V1 = 0,
unsigned  V2 = 0 
) const [inline, protected]

Definition at line 409 of file ToolChains.h.

Referenced by ComputeEffectiveClangTriple().

void clang::driver::toolchains::Darwin::setTarget ( DarwinPlatformKind  Platform,
unsigned  Major,
unsigned  Minor,
unsigned  Micro 
) const [inline, protected]

Definition at line 376 of file ToolChains.h.

bool Darwin::SupportsObjCGC ( ) const [override, virtual]

Does this tool chain support Objective-C garbage collection.

Reimplemented from clang::driver::toolchains::MachO.

Definition at line 1083 of file ToolChains.cpp.

References isTargetMacOS().

DerivedArgList * Darwin::TranslateArgs ( const llvm::opt::DerivedArgList &  Args,
const char *  BoundArch 
) const [override, virtual]

TranslateArgs - Create a new derived argument list for any argument translations this ToolChain may wish to perform, or 0 if no tool chain specific translations are needed.

Parameters:
BoundArch- The bound architecture name, or 0.

Reimplemented from clang::driver::toolchains::MachO.

Definition at line 886 of file ToolChains.cpp.

References clang::driver::ToolChain::CST_Libcxx, clang::driver::Driver::Diag(), clang::driver::ToolChain::getArch(), clang::driver::ToolChain::GetCXXStdlibType(), clang::driver::ToolChain::getDriver(), clang::driver::Driver::getOpts(), clang::driver::ToolChain::getTriple(), isIPhoneOSVersionLT(), isMacosxVersionLT(), isTargetIOSBased(), and isTargetMacOS().

bool clang::driver::toolchains::Darwin::UseObjCMixedDispatch ( ) const [inline, override, virtual]

UseObjCMixedDispatchDefault - When using non-legacy dispatch, should the mixed dispatch method be used?

Reimplemented from clang::driver::toolchains::MachO.

Definition at line 443 of file ToolChains.h.

bool Darwin::UseSjLjExceptions ( ) const [override, virtual]

UseSjLjExceptions - Does this tool chain use SjLj exceptions.

Reimplemented from clang::driver::toolchains::MachO.

Definition at line 957 of file ToolChains.cpp.

References clang::driver::ToolChain::getArch(), and clang::driver::ToolChain::getTriple().


Member Data Documentation

The host version.

Definition at line 313 of file ToolChains.h.

Referenced by Darwin().

Whether the information on the target has been initialized.

Definition at line 320 of file ToolChains.h.

Definition at line 328 of file ToolChains.h.

The OS version we are targeting.

Definition at line 331 of file ToolChains.h.

Referenced by addMinVersionArgs(), and getDefaultObjCRuntime().


The documentation for this class was generated from the following files: