| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | #ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_DARWIN_H |
| 10 | #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_DARWIN_H |
| 11 | |
| 12 | #include "Cuda.h" |
| 13 | #include "clang/Driver/DarwinSDKInfo.h" |
| 14 | #include "clang/Driver/Tool.h" |
| 15 | #include "clang/Driver/ToolChain.h" |
| 16 | #include "clang/Driver/XRayArgs.h" |
| 17 | |
| 18 | namespace clang { |
| 19 | namespace driver { |
| 20 | |
| 21 | namespace toolchains { |
| 22 | class MachO; |
| 23 | } |
| 24 | |
| 25 | namespace tools { |
| 26 | |
| 27 | namespace darwin { |
| 28 | llvm::Triple::ArchType getArchTypeForMachOArchName(StringRef Str); |
| 29 | void setTripleTypeForMachOArchName(llvm::Triple &T, StringRef Str); |
| 30 | |
| 31 | class LLVM_LIBRARY_VISIBILITY MachOTool : public Tool { |
| 32 | virtual void anchor(); |
| 33 | |
| 34 | protected: |
| 35 | void AddMachOArch(const llvm::opt::ArgList &Args, |
| 36 | llvm::opt::ArgStringList &CmdArgs) const; |
| 37 | |
| 38 | const toolchains::MachO &getMachOToolChain() const { |
| 39 | return reinterpret_cast<const toolchains::MachO &>(getToolChain()); |
| 40 | } |
| 41 | |
| 42 | public: |
| 43 | MachOTool( |
| 44 | const char *Name, const char *ShortName, const ToolChain &TC, |
| 45 | ResponseFileSupport ResponseSupport = RF_None, |
| 46 | llvm::sys::WindowsEncodingMethod ResponseEncoding = llvm::sys::WEM_UTF8, |
| 47 | const char *ResponseFlag = "@") |
| 48 | : Tool(Name, ShortName, TC, ResponseSupport, ResponseEncoding, |
| 49 | ResponseFlag) {} |
| 50 | }; |
| 51 | |
| 52 | class LLVM_LIBRARY_VISIBILITY Assembler : public MachOTool { |
| 53 | public: |
| 54 | Assembler(const ToolChain &TC) |
| 55 | : MachOTool("darwin::Assembler", "assembler", TC) {} |
| 56 | |
| 57 | bool hasIntegratedCPP() const override { return false; } |
| 58 | |
| 59 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 60 | const InputInfo &Output, const InputInfoList &Inputs, |
| 61 | const llvm::opt::ArgList &TCArgs, |
| 62 | const char *LinkingOutput) const override; |
| 63 | }; |
| 64 | |
| 65 | class LLVM_LIBRARY_VISIBILITY Linker : public MachOTool { |
| 66 | bool NeedsTempPath(const InputInfoList &Inputs) const; |
| 67 | void AddLinkArgs(Compilation &C, const llvm::opt::ArgList &Args, |
| 68 | llvm::opt::ArgStringList &CmdArgs, |
| 69 | const InputInfoList &Inputs) const; |
| 70 | |
| 71 | public: |
| 72 | Linker(const ToolChain &TC) |
| 73 | : MachOTool("darwin::Linker", "linker", TC, RF_FileList, |
| 74 | llvm::sys::WEM_UTF8, "-filelist") {} |
| 75 | |
| 76 | bool hasIntegratedCPP() const override { return false; } |
| 77 | bool isLinkJob() const override { return true; } |
| 78 | |
| 79 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 80 | const InputInfo &Output, const InputInfoList &Inputs, |
| 81 | const llvm::opt::ArgList &TCArgs, |
| 82 | const char *LinkingOutput) const override; |
| 83 | }; |
| 84 | |
| 85 | class LLVM_LIBRARY_VISIBILITY Lipo : public MachOTool { |
| 86 | public: |
| 87 | Lipo(const ToolChain &TC) : MachOTool("darwin::Lipo", "lipo", TC) {} |
| 88 | |
| 89 | bool hasIntegratedCPP() const override { return false; } |
| 90 | |
| 91 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 92 | const InputInfo &Output, const InputInfoList &Inputs, |
| 93 | const llvm::opt::ArgList &TCArgs, |
| 94 | const char *LinkingOutput) const override; |
| 95 | }; |
| 96 | |
| 97 | class LLVM_LIBRARY_VISIBILITY Dsymutil : public MachOTool { |
| 98 | public: |
| 99 | Dsymutil(const ToolChain &TC) |
| 100 | : MachOTool("darwin::Dsymutil", "dsymutil", TC) {} |
| 101 | |
| 102 | bool hasIntegratedCPP() const override { return false; } |
| 103 | bool isDsymutilJob() const override { return true; } |
| 104 | |
| 105 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 106 | const InputInfo &Output, const InputInfoList &Inputs, |
| 107 | const llvm::opt::ArgList &TCArgs, |
| 108 | const char *LinkingOutput) const override; |
| 109 | }; |
| 110 | |
| 111 | class LLVM_LIBRARY_VISIBILITY VerifyDebug : public MachOTool { |
| 112 | public: |
| 113 | VerifyDebug(const ToolChain &TC) |
| 114 | : MachOTool("darwin::VerifyDebug", "dwarfdump", TC) {} |
| 115 | |
| 116 | bool hasIntegratedCPP() const override { return false; } |
| 117 | |
| 118 | void ConstructJob(Compilation &C, const JobAction &JA, |
| 119 | const InputInfo &Output, const InputInfoList &Inputs, |
| 120 | const llvm::opt::ArgList &TCArgs, |
| 121 | const char *LinkingOutput) const override; |
| 122 | }; |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | namespace toolchains { |
| 127 | |
| 128 | class LLVM_LIBRARY_VISIBILITY MachO : public ToolChain { |
| 129 | protected: |
| 130 | Tool *buildAssembler() const override; |
| 131 | Tool *buildLinker() const override; |
| 132 | Tool *getTool(Action::ActionClass AC) const override; |
| 133 | |
| 134 | private: |
| 135 | mutable std::unique_ptr<tools::darwin::Lipo> Lipo; |
| 136 | mutable std::unique_ptr<tools::darwin::Dsymutil> Dsymutil; |
| 137 | mutable std::unique_ptr<tools::darwin::VerifyDebug> VerifyDebug; |
| 138 | |
| 139 | public: |
| 140 | MachO(const Driver &D, const llvm::Triple &Triple, |
| 141 | const llvm::opt::ArgList &Args); |
| 142 | ~MachO() override; |
| 143 | |
| 144 | |
| 145 | |
| 146 | |
| 147 | |
| 148 | |
| 149 | StringRef getMachOArchName(const llvm::opt::ArgList &Args) const; |
| 150 | |
| 151 | |
| 152 | virtual void AddLinkARCArgs(const llvm::opt::ArgList &Args, |
| 153 | llvm::opt::ArgStringList &CmdArgs) const {} |
| 154 | |
| 155 | |
| 156 | |
| 157 | |
| 158 | |
| 159 | virtual void AddLinkRuntimeLibArgs(const llvm::opt::ArgList &Args, |
| 160 | llvm::opt::ArgStringList &CmdArgs) const; |
| 161 | |
| 162 | virtual void addStartObjectFileArgs(const llvm::opt::ArgList &Args, |
| 163 | llvm::opt::ArgStringList &CmdArgs) const { |
| 164 | } |
| 165 | |
| 166 | virtual void addMinVersionArgs(const llvm::opt::ArgList &Args, |
| 167 | llvm::opt::ArgStringList &CmdArgs) const {} |
| 168 | |
| 169 | |
| 170 | |
| 171 | virtual bool isKernelStatic() const { return false; } |
| 172 | |
| 173 | |
| 174 | bool isTargetIOSBased() const { return false; } |
| 175 | |
| 176 | |
| 177 | enum RuntimeLinkOptions : unsigned { |
| 178 | |
| 179 | RLO_AlwaysLink = 1 << 0, |
| 180 | |
| 181 | |
| 182 | RLO_IsEmbedded = 1 << 1, |
| 183 | |
| 184 | |
| 185 | RLO_AddRPath = 1 << 2, |
| 186 | |
| 187 | |
| 188 | RLO_FirstLink = 1 << 3, |
| 189 | }; |
| 190 | |
| 191 | |
| 192 | void AddLinkRuntimeLib(const llvm::opt::ArgList &Args, |
| 193 | llvm::opt::ArgStringList &CmdArgs, StringRef Component, |
| 194 | RuntimeLinkOptions Opts = RuntimeLinkOptions(), |
| 195 | bool IsShared = false) const; |
| 196 | |
| 197 | |
| 198 | |
| 199 | void addProfileRTLibs(const llvm::opt::ArgList &Args, |
| 200 | llvm::opt::ArgStringList &CmdArgs) const override { |
| 201 | |
| 202 | } |
| 203 | |
| 204 | |
| 205 | |
| 206 | |
| 207 | |
| 208 | types::ID LookupTypeForExtension(StringRef Ext) const override; |
| 209 | |
| 210 | bool HasNativeLLVMSupport() const override; |
| 211 | |
| 212 | llvm::opt::DerivedArgList * |
| 213 | TranslateArgs(const llvm::opt::DerivedArgList &Args, StringRef BoundArch, |
| 214 | Action::OffloadKind DeviceOffloadKind) const override; |
| 215 | |
| 216 | bool IsBlocksDefault() const override { |
| 217 | |
| 218 | |
| 219 | return true; |
| 220 | } |
| 221 | bool IsIntegratedAssemblerDefault() const override { |
| 222 | |
| 223 | return true; |
| 224 | } |
| 225 | |
| 226 | bool IsMathErrnoDefault() const override { return false; } |
| 227 | |
| 228 | bool IsEncodeExtendedBlockSignatureDefault() const override { return true; } |
| 229 | |
| 230 | bool IsObjCNonFragileABIDefault() const override { |
| 231 | |
| 232 | return getTriple().getArch() != llvm::Triple::x86; |
| 233 | } |
| 234 | |
| 235 | bool UseObjCMixedDispatch() const override { return true; } |
| 236 | |
| 237 | bool IsUnwindTablesDefault(const llvm::opt::ArgList &Args) const override; |
| 238 | |
| 239 | RuntimeLibType GetDefaultRuntimeLibType() const override { |
| 240 | return ToolChain::RLT_CompilerRT; |
| 241 | } |
| 242 | |
| 243 | bool isPICDefault() const override; |
| 244 | bool isPIEDefault() const override; |
| 245 | bool isPICDefaultForced() const override; |
| 246 | |
| 247 | bool SupportsProfiling() const override; |
| 248 | |
| 249 | bool UseDwarfDebugFlags() const override; |
| 250 | |
| 251 | llvm::ExceptionHandling |
| 252 | GetExceptionModel(const llvm::opt::ArgList &Args) const override { |
| 253 | return llvm::ExceptionHandling::None; |
| 254 | } |
| 255 | |
| 256 | virtual StringRef getOSLibraryNameSuffix(bool IgnoreSim = false) const { |
| 257 | return ""; |
| 258 | } |
| 259 | |
| 260 | |
| 261 | }; |
| 262 | |
| 263 | |
| 264 | class LLVM_LIBRARY_VISIBILITY Darwin : public MachO { |
| 265 | public: |
| 266 | |
| 267 | |
| 268 | |
| 269 | |
| 270 | |
| 271 | mutable bool TargetInitialized; |
| 272 | |
| 273 | enum DarwinPlatformKind { |
| 274 | MacOS, |
| 275 | IPhoneOS, |
| 276 | TvOS, |
| 277 | WatchOS, |
| 278 | LastDarwinPlatform = WatchOS |
| 279 | }; |
| 280 | enum DarwinEnvironmentKind { |
| 281 | NativeEnvironment, |
| 282 | Simulator, |
| 283 | }; |
| 284 | |
| 285 | mutable DarwinPlatformKind TargetPlatform; |
| 286 | mutable DarwinEnvironmentKind TargetEnvironment; |
| 287 | |
| 288 | |
| 289 | mutable VersionTuple TargetVersion; |
| 290 | |
| 291 | |
| 292 | mutable Optional<DarwinSDKInfo> SDKInfo; |
| 293 | |
| 294 | CudaInstallationDetector CudaInstallation; |
| 295 | |
| 296 | private: |
| 297 | void AddDeploymentTarget(llvm::opt::DerivedArgList &Args) const; |
| 298 | |
| 299 | public: |
| 300 | Darwin(const Driver &D, const llvm::Triple &Triple, |
| 301 | const llvm::opt::ArgList &Args); |
| 302 | ~Darwin() override; |
| 303 | |
| 304 | std::string ComputeEffectiveClangTriple(const llvm::opt::ArgList &Args, |
| 305 | types::ID InputType) const override; |
| 306 | |
| 307 | |
| 308 | |
| 309 | |
| 310 | void addMinVersionArgs(const llvm::opt::ArgList &Args, |
| 311 | llvm::opt::ArgStringList &CmdArgs) const override; |
| 312 | |
| 313 | void addStartObjectFileArgs(const llvm::opt::ArgList &Args, |
| 314 | llvm::opt::ArgStringList &CmdArgs) const override; |
| 315 | |
| 316 | bool isKernelStatic() const override { |
| 317 | return (!(isTargetIPhoneOS() && !isIPhoneOSVersionLT(6, 0)) && |
| 318 | !isTargetWatchOS()); |
| 319 | } |
| 320 | |
| 321 | void addProfileRTLibs(const llvm::opt::ArgList &Args, |
| 322 | llvm::opt::ArgStringList &CmdArgs) const override; |
| 323 | |
| 324 | protected: |
| 325 | |
| 326 | |
| 327 | |
| 328 | |
| 329 | |
| 330 | |
| 331 | void setTarget(DarwinPlatformKind Platform, DarwinEnvironmentKind Environment, |
| 332 | unsigned Major, unsigned Minor, unsigned Micro) const { |
| 333 | |
| 334 | |
| 335 | if (TargetInitialized && TargetPlatform == Platform && |
| 336 | TargetEnvironment == Environment && |
| 337 | TargetVersion == VersionTuple(Major, Minor, Micro)) |
| 338 | return; |
| 339 | |
| 340 | (0) . __assert_fail ("!TargetInitialized && \"Target already initialized!\"", "/home/seafit/code_projects/clang_source/clang/lib/Driver/ToolChains/Darwin.h", 340, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(!TargetInitialized && "Target already initialized!"); |
| 341 | TargetInitialized = true; |
| 342 | TargetPlatform = Platform; |
| 343 | TargetEnvironment = Environment; |
| 344 | TargetVersion = VersionTuple(Major, Minor, Micro); |
| 345 | if (Environment == Simulator) |
| 346 | const_cast<Darwin *>(this)->setTripleEnvironment(llvm::Triple::Simulator); |
| 347 | } |
| 348 | |
| 349 | bool isTargetIPhoneOS() const { |
| 350 | (0) . __assert_fail ("TargetInitialized && \"Target not initialized!\"", "/home/seafit/code_projects/clang_source/clang/lib/Driver/ToolChains/Darwin.h", 350, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(TargetInitialized && "Target not initialized!"); |
| 351 | return (TargetPlatform == IPhoneOS || TargetPlatform == TvOS) && |
| 352 | TargetEnvironment == NativeEnvironment; |
| 353 | } |
| 354 | |
| 355 | bool isTargetIOSSimulator() const { |
| 356 | (0) . __assert_fail ("TargetInitialized && \"Target not initialized!\"", "/home/seafit/code_projects/clang_source/clang/lib/Driver/ToolChains/Darwin.h", 356, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(TargetInitialized && "Target not initialized!"); |
| 357 | return (TargetPlatform == IPhoneOS || TargetPlatform == TvOS) && |
| 358 | TargetEnvironment == Simulator; |
| 359 | } |
| 360 | |
| 361 | bool isTargetIOSBased() const { |
| 362 | (0) . __assert_fail ("TargetInitialized && \"Target not initialized!\"", "/home/seafit/code_projects/clang_source/clang/lib/Driver/ToolChains/Darwin.h", 362, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(TargetInitialized && "Target not initialized!"); |
| 363 | return isTargetIPhoneOS() || isTargetIOSSimulator(); |
| 364 | } |
| 365 | |
| 366 | bool isTargetTvOS() const { |
| 367 | (0) . __assert_fail ("TargetInitialized && \"Target not initialized!\"", "/home/seafit/code_projects/clang_source/clang/lib/Driver/ToolChains/Darwin.h", 367, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(TargetInitialized && "Target not initialized!"); |
| 368 | return TargetPlatform == TvOS && TargetEnvironment == NativeEnvironment; |
| 369 | } |
| 370 | |
| 371 | bool isTargetTvOSSimulator() const { |
| 372 | (0) . __assert_fail ("TargetInitialized && \"Target not initialized!\"", "/home/seafit/code_projects/clang_source/clang/lib/Driver/ToolChains/Darwin.h", 372, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(TargetInitialized && "Target not initialized!"); |
| 373 | return TargetPlatform == TvOS && TargetEnvironment == Simulator; |
| 374 | } |
| 375 | |
| 376 | bool isTargetTvOSBased() const { |
| 377 | (0) . __assert_fail ("TargetInitialized && \"Target not initialized!\"", "/home/seafit/code_projects/clang_source/clang/lib/Driver/ToolChains/Darwin.h", 377, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(TargetInitialized && "Target not initialized!"); |
| 378 | return TargetPlatform == TvOS; |
| 379 | } |
| 380 | |
| 381 | bool isTargetWatchOS() const { |
| 382 | (0) . __assert_fail ("TargetInitialized && \"Target not initialized!\"", "/home/seafit/code_projects/clang_source/clang/lib/Driver/ToolChains/Darwin.h", 382, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(TargetInitialized && "Target not initialized!"); |
| 383 | return TargetPlatform == WatchOS && TargetEnvironment == NativeEnvironment; |
| 384 | } |
| 385 | |
| 386 | bool isTargetWatchOSSimulator() const { |
| 387 | (0) . __assert_fail ("TargetInitialized && \"Target not initialized!\"", "/home/seafit/code_projects/clang_source/clang/lib/Driver/ToolChains/Darwin.h", 387, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(TargetInitialized && "Target not initialized!"); |
| 388 | return TargetPlatform == WatchOS && TargetEnvironment == Simulator; |
| 389 | } |
| 390 | |
| 391 | bool isTargetWatchOSBased() const { |
| 392 | (0) . __assert_fail ("TargetInitialized && \"Target not initialized!\"", "/home/seafit/code_projects/clang_source/clang/lib/Driver/ToolChains/Darwin.h", 392, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(TargetInitialized && "Target not initialized!"); |
| 393 | return TargetPlatform == WatchOS; |
| 394 | } |
| 395 | |
| 396 | bool isTargetMacOS() const { |
| 397 | (0) . __assert_fail ("TargetInitialized && \"Target not initialized!\"", "/home/seafit/code_projects/clang_source/clang/lib/Driver/ToolChains/Darwin.h", 397, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(TargetInitialized && "Target not initialized!"); |
| 398 | return TargetPlatform == MacOS; |
| 399 | } |
| 400 | |
| 401 | bool isTargetInitialized() const { return TargetInitialized; } |
| 402 | |
| 403 | VersionTuple getTargetVersion() const { |
| 404 | (0) . __assert_fail ("TargetInitialized && \"Target not initialized!\"", "/home/seafit/code_projects/clang_source/clang/lib/Driver/ToolChains/Darwin.h", 404, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(TargetInitialized && "Target not initialized!"); |
| 405 | return TargetVersion; |
| 406 | } |
| 407 | |
| 408 | bool isIPhoneOSVersionLT(unsigned V0, unsigned V1 = 0, |
| 409 | unsigned V2 = 0) const { |
| 410 | (0) . __assert_fail ("isTargetIOSBased() && \"Unexpected call for non iOS target!\"", "/home/seafit/code_projects/clang_source/clang/lib/Driver/ToolChains/Darwin.h", 410, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isTargetIOSBased() && "Unexpected call for non iOS target!"); |
| 411 | return TargetVersion < VersionTuple(V0, V1, V2); |
| 412 | } |
| 413 | |
| 414 | bool isMacosxVersionLT(unsigned V0, unsigned V1 = 0, unsigned V2 = 0) const { |
| 415 | (0) . __assert_fail ("isTargetMacOS() && \"Unexpected call for non OS X target!\"", "/home/seafit/code_projects/clang_source/clang/lib/Driver/ToolChains/Darwin.h", 415, __PRETTY_FUNCTION__))" file_link="../../../../include/assert.h.html#88" macro="true">assert(isTargetMacOS() && "Unexpected call for non OS X target!"); |
| 416 | return TargetVersion < VersionTuple(V0, V1, V2); |
| 417 | } |
| 418 | |
| 419 | |
| 420 | |
| 421 | |
| 422 | bool isAlignedAllocationUnavailable() const; |
| 423 | |
| 424 | void addClangTargetOptions(const llvm::opt::ArgList &DriverArgs, |
| 425 | llvm::opt::ArgStringList &CC1Args, |
| 426 | Action::OffloadKind DeviceOffloadKind) const override; |
| 427 | |
| 428 | StringRef getPlatformFamily() const; |
| 429 | StringRef getOSLibraryNameSuffix(bool IgnoreSim = false) const override; |
| 430 | |
| 431 | public: |
| 432 | static StringRef getSDKName(StringRef isysroot); |
| 433 | |
| 434 | |
| 435 | |
| 436 | |
| 437 | |
| 438 | |
| 439 | |
| 440 | |
| 441 | bool isCrossCompiling() const override { return false; } |
| 442 | |
| 443 | llvm::opt::DerivedArgList * |
| 444 | TranslateArgs(const llvm::opt::DerivedArgList &Args, StringRef BoundArch, |
| 445 | Action::OffloadKind DeviceOffloadKind) const override; |
| 446 | |
| 447 | CXXStdlibType GetDefaultCXXStdlibType() const override; |
| 448 | ObjCRuntime getDefaultObjCRuntime(bool isNonFragile) const override; |
| 449 | bool hasBlocksRuntime() const override; |
| 450 | |
| 451 | void AddCudaIncludeArgs(const llvm::opt::ArgList &DriverArgs, |
| 452 | llvm::opt::ArgStringList &CC1Args) const override; |
| 453 | |
| 454 | bool UseObjCMixedDispatch() const override { |
| 455 | |
| 456 | |
| 457 | |
| 458 | return !(isTargetMacOS() && isMacosxVersionLT(10, 6)); |
| 459 | } |
| 460 | |
| 461 | unsigned GetDefaultStackProtectorLevel(bool KernelOrKext) const override { |
| 462 | |
| 463 | |
| 464 | if (isTargetIOSBased() || isTargetWatchOSBased()) |
| 465 | return 1; |
| 466 | else if (isTargetMacOS() && !isMacosxVersionLT(10, 6)) |
| 467 | return 1; |
| 468 | else if (isTargetMacOS() && !isMacosxVersionLT(10, 5) && !KernelOrKext) |
| 469 | return 1; |
| 470 | |
| 471 | return 0; |
| 472 | } |
| 473 | |
| 474 | void CheckObjCARC() const override; |
| 475 | |
| 476 | llvm::ExceptionHandling GetExceptionModel( |
| 477 | const llvm::opt::ArgList &Args) const override; |
| 478 | |
| 479 | bool SupportsEmbeddedBitcode() const override; |
| 480 | |
| 481 | SanitizerMask getSupportedSanitizers() const override; |
| 482 | |
| 483 | void printVerboseInfo(raw_ostream &OS) const override; |
| 484 | }; |
| 485 | |
| 486 | |
| 487 | class LLVM_LIBRARY_VISIBILITY DarwinClang : public Darwin { |
| 488 | public: |
| 489 | DarwinClang(const Driver &D, const llvm::Triple &Triple, |
| 490 | const llvm::opt::ArgList &Args); |
| 491 | |
| 492 | |
| 493 | |
| 494 | |
| 495 | RuntimeLibType GetRuntimeLibType(const llvm::opt::ArgList &Args) const override; |
| 496 | |
| 497 | void AddLinkRuntimeLibArgs(const llvm::opt::ArgList &Args, |
| 498 | llvm::opt::ArgStringList &CmdArgs) const override; |
| 499 | |
| 500 | void AddClangCXXStdlibIncludeArgs( |
| 501 | const llvm::opt::ArgList &DriverArgs, |
| 502 | llvm::opt::ArgStringList &CC1Args) const override; |
| 503 | |
| 504 | void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args, |
| 505 | llvm::opt::ArgStringList &CmdArgs) const override; |
| 506 | |
| 507 | void AddCCKextLibArgs(const llvm::opt::ArgList &Args, |
| 508 | llvm::opt::ArgStringList &CmdArgs) const override; |
| 509 | |
| 510 | void addClangWarningOptions(llvm::opt::ArgStringList &CC1Args) const override; |
| 511 | |
| 512 | void AddLinkARCArgs(const llvm::opt::ArgList &Args, |
| 513 | llvm::opt::ArgStringList &CmdArgs) const override; |
| 514 | |
| 515 | unsigned GetDefaultDwarfVersion() const override; |
| 516 | |
| 517 | |
| 518 | bool GetDefaultStandaloneDebug() const override { return true; } |
| 519 | llvm::DebuggerKind getDefaultDebuggerTuning() const override { |
| 520 | return llvm::DebuggerKind::LLDB; |
| 521 | } |
| 522 | |
| 523 | |
| 524 | |
| 525 | private: |
| 526 | void AddLinkSanitizerLibArgs(const llvm::opt::ArgList &Args, |
| 527 | llvm::opt::ArgStringList &CmdArgs, |
| 528 | StringRef Sanitizer, |
| 529 | bool shared = true) const; |
| 530 | }; |
| 531 | |
| 532 | } |
| 533 | } |
| 534 | } |
| 535 | |
| 536 | #endif |
| 537 | |