clang
10.0.0git
|
#include "Darwin.h"
#include "Arch/ARM.h"
#include "CommonArgs.h"
#include "clang/Basic/AlignedAllocation.h"
#include "clang/Basic/ObjCRuntime.h"
#include "clang/Config/config.h"
#include "clang/Driver/Compilation.h"
#include "clang/Driver/Driver.h"
#include "clang/Driver/DriverDiagnostic.h"
#include "clang/Driver/Options.h"
#include "clang/Driver/SanitizerArgs.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/Option/ArgList.h"
#include "llvm/ProfileData/InstrProf.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/ScopedPrinter.h"
#include "llvm/Support/TargetParser.h"
#include "llvm/Support/VirtualFileSystem.h"
#include <cstdlib>
Go to the source code of this file.
Functions | |
static bool | shouldLinkerNotDedup (bool IsLinkerOnlyAction, const ArgList &Args) |
Pass -no_deduplicate to ld64 under certain conditions: More... | |
static bool | isObjCRuntimeLinked (const ArgList &Args) |
Determine whether we are linking the ObjC runtime. More... | |
static const char * | ArmMachOArchName (StringRef Arch) |
static const char * | ArmMachOArchNameCPU (StringRef CPU) |
static StringRef | getXcodeDeveloperPath (StringRef PathIntoXcode) |
Take a path that speculatively points into Xcode and return the XCODE/Contents/Developer path if it is an Xcode path, or an empty path otherwise. More... | |
static bool | hasExportSymbolDirective (const ArgList &Args) |
Check if the link command contains a symbol export directive. More... | |
static void | addExportedSymbol (ArgStringList &CmdArgs, const char *Symbol) |
Add an export directive for Symbol to the link command. More... | |
static void | addSectalignToPage (const ArgList &Args, ArgStringList &CmdArgs, StringRef Segment, StringRef Section) |
Add a sectalign directive for Segment and Section to the maximum expected page size for Darwin. More... | |
static std::string | getSystemOrSDKMacOSVersion (StringRef MacOSSDKVersion) |
Returns the most appropriate macOS target version for the current process. More... | |
static const char * | getPlatformName (Darwin::DarwinPlatformKind Platform, Darwin::DarwinEnvironmentKind Environment) |
|
static |
Add an export directive for Symbol
to the link command.
Definition at line 1114 of file Darwin.cpp.
Referenced by clang::driver::toolchains::Darwin::addProfileRTLibs().
|
static |
Add a sectalign directive for Segment
and Section
to the maximum expected page size for Darwin.
On iPhone 6+ the max supported page size is 16K. On macOS, the max is 4K. Use a common alignment constant (16K) for now, and reduce the alignment on macOS if it proves important.
Definition at line 1125 of file Darwin.cpp.
Referenced by clang::driver::toolchains::Darwin::addProfileRTLibs().
|
static |
Definition at line 797 of file Darwin.cpp.
Referenced by clang::driver::toolchains::MachO::getMachOArchName().
|
static |
Definition at line 814 of file Darwin.cpp.
Referenced by clang::driver::toolchains::MachO::getMachOArchName().
|
static |
Definition at line 2517 of file Darwin.cpp.
References clang::driver::toolchains::Darwin::IPhoneOS, clang::driver::toolchains::Darwin::MacOS, clang::driver::toolchains::Darwin::NativeEnvironment, clang::driver::toolchains::Darwin::Simulator, clang::driver::toolchains::Darwin::TvOS, and clang::driver::toolchains::Darwin::WatchOS.
Referenced by clang::driver::toolchains::Darwin::addPlatformVersionArgs(), and clang::Sema::diagnoseUnavailableAlignedAllocation().
|
static |
Returns the most appropriate macOS target version for the current process.
If the macOS SDK version is the same or earlier than the system version, then the SDK version is returned. Otherwise the system version is returned.
Definition at line 1269 of file Darwin.cpp.
References clang::driver::ToolChain::getPlatform(), and clang::driver::Driver::GetReleaseVersion().
|
static |
Take a path that speculatively points into Xcode and return the XCODE/Contents/Developer
path if it is an Xcode path, or an empty path otherwise.
Definition at line 933 of file Darwin.cpp.
Referenced by clang::driver::toolchains::DarwinClang::AddLinkARCArgs().
|
static |
Check if the link command contains a symbol export directive.
Definition at line 1099 of file Darwin.cpp.
Referenced by clang::driver::toolchains::Darwin::addProfileRTLibs().
|
static |
Determine whether we are linking the ObjC runtime.
Definition at line 424 of file Darwin.cpp.
References clang::driver::tools::isObjCAutoRefCount().
Referenced by clang::driver::tools::darwin::Linker::ConstructJob().
Pass -no_deduplicate to ld64 under certain conditions:
Also do not add -no_deduplicate when no -O option is specified and this is just a link (we can't imply -O0)
Definition at line 186 of file Darwin.cpp.
References clang::driver::toolchains::MachO::addMinVersionArgs(), clang::driver::toolchains::MachO::addPlatformVersionArgs(), clang::driver::Compilation::addTempFile(), clang::driver::Driver::Diag(), clang::driver::Driver::Dir, clang::driver::Driver::embedBitcodeEnabled(), clang::driver::Driver::embedBitcodeMarkerOnly(), clang::driver::JobList::empty(), clang::driver::Compilation::getArgs(), clang::driver::Compilation::getDriver(), clang::driver::Compilation::getJobs(), clang::driver::Driver::getLTOMode(), clang::driver::Driver::GetReleaseVersion(), clang::driver::Compilation::getSysRoot(), clang::driver::Driver::GetTemporaryDirectory(), clang::driver::Driver::GetTemporaryPath(), clang::driver::types::getTypeTempSuffix(), clang::driver::toolchains::MachO::isTargetIOSBased(), clang::driver::Driver::isUsingLTO(), clang::driver::LTOK_Full, clang::driver::LTOK_Thin, P, and clang::driver::ToolChain::SupportsEmbeddedBitcode().