summaryrefslogtreecommitdiffstats
path: root/lib/Driver/ToolChains/Darwin.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [driver][macOS] Link libarclite from the default toolchain when clangAlex Lorenz2019-04-261-1/+30
| | | | | | | | | | | | | | | is running in a toolchain outside of xcode 'libarclite' usually lives in the same toolchain as 'clang'. However, the Swift open source toolchains for macOS distribute Clang without 'libarclite'. In that case, to allow the linker to find 'libarclite', we point to the 'libarclite' that should be in the XcodeDefault toolchain instead. The path to the toolchain is inferred from the SDK path if it's specified. https://bugs.swift.org/browse/SR-9972 rdar://49947573 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359353 91177308-0d34-0410-b5e6-96231b3b80d8
* [LTO] Add plumbing to save stats during LTO on Darwin.Florian Hahn2019-04-191-0/+8
| | | | | | | | | | | | | | | | | | | | | Gold and ld on Linux already support saving stats, but the infrastructure is missing on Darwin. Unfortunately it seems like the configuration from lib/LTO/LTO.cpp is not used. This patch adds a new LTOStatsFile option and adds plumbing in Clang to use it on Darwin, similar to the way remarks are handled. Currnetly the handling of LTO flags seems quite spread out, with a bunch of duplication. But I am not sure if there is an easy way to improve that? Reviewers: anemet, tejohnson, thegameg, steven_wu Reviewed By: steven_wu Differential Revision: https://reviews.llvm.org/D60516 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358753 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] Add gcc 8's driver option -fsanitize=pointer-compare and ↵Pierre Gousseau2019-04-121-0/+2
| | | | | | | | | | | | | -fsanitize=pointer-substract. Disabled by default as this is still an experimental feature. Reviewed By: thakis Differential Revision: https://reviews.llvm.org/D59221 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358285 91177308-0d34-0410-b5e6-96231b3b80d8
* Make -mno-outline pass -enable-machine-outliner=never to ld in LTOJessica Paquette2019-03-261-6/+15
| | | | | | | | | | Since AArch64 has default outlining behaviour, we need to make sure that -mno-outline is actually passed along to the linker in this case. Otherwise, it will run by default on minsize functions even when -mno-outline is specified. Also fix the darwin-ld test for this, which wasn't actually doing anything. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357031 91177308-0d34-0410-b5e6-96231b3b80d8
* Reland "[Remarks] Add -foptimization-record-passes to filter remark emission"Francis Visoiu Mistrih2019-03-121-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently we have -Rpass for filtering the remarks that are displayed as diagnostics, but when using -fsave-optimization-record, there is no way to filter the remarks while generating them. This adds support for filtering remarks by passes using a regex. Ex: `clang -fsave-optimization-record -foptimization-record-passes=inline` will only emit the remarks coming from the pass `inline`. This adds: * `-fsave-optimization-record` to the driver * `-opt-record-passes` to cc1 * `-lto-pass-remarks-filter` to the LTOCodeGenerator * `--opt-remarks-passes` to lld * `-pass-remarks-filter` to llc, opt, llvm-lto, llvm-lto2 * `-opt-remarks-passes` to gold-plugin Differential Revision: https://reviews.llvm.org/D59268 Original llvm-svn: 355964 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355984 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[Remarks] Add -foptimization-record-passes to filter remark emission"Francis Visoiu Mistrih2019-03-121-8/+0
| | | | | | This reverts commit 20fff32b7d1f1a1bd417b22aa9f26ededd97a3e5. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355976 91177308-0d34-0410-b5e6-96231b3b80d8
* [Remarks] Add -foptimization-record-passes to filter remark emissionFrancis Visoiu Mistrih2019-03-121-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | Currently we have -Rpass for filtering the remarks that are displayed as diagnostics, but when using -fsave-optimization-record, there is no way to filter the remarks while generating them. This adds support for filtering remarks by passes using a regex. Ex: `clang -fsave-optimization-record -foptimization-record-passes=inline` will only emit the remarks coming from the pass `inline`. This adds: * `-fsave-optimization-record` to the driver * `-opt-record-passes` to cc1 * `-lto-pass-remarks-filter` to the LTOCodeGenerator * `--opt-remarks-passes` to lld * `-pass-remarks-filter` to llc, opt, llvm-lto, llvm-lto2 * `-opt-remarks-passes` to gold-plugin Differential Revision: https://reviews.llvm.org/D59268 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355964 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove esan.Nico Weber2019-03-111-2/+0
| | | | | | | | | | | It hasn't seen active development in years, and it hasn't reached a state where it was useful. Remove the code until someone is interested in working on it again. Differential Revision: https://reviews.llvm.org/D59133 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355862 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed failure on Darwin due to r354064Ana Pazos2019-02-151-1/+0
| | | | | | | | | | | | | | | | | Summary: instrprof-darwin-exports.c test fails on Darwin due to r354064. Updated clang list of exported symbols to fix the issue. Reviewers: vsk Reviewed By: vsk Subscribers: davidxl, efriedma Differential Revision: https://reviews.llvm.org/D58259 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354089 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver][Darwin] Emit an error when using -pg on OS without support for it.Volodymyr Sapsai2019-02-141-14/+19
| | | | | | | | | | | | | | | | | | Instead of letting a program fail at runtime, emit an error during compilation. rdar://problem/12206955 Reviewers: dexonsmith, bob.wilson, steven_wu Reviewed By: steven_wu Subscribers: jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D57991 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354084 91177308-0d34-0410-b5e6-96231b3b80d8
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351636 91177308-0d34-0410-b5e6-96231b3b80d8
* [Darwin][Driver] Don't pass a file as object_path_lto during ThinLTOSteven Wu2019-01-111-7/+14
| | | | | | | | | | | | | | | | | | | | | | Summary: After r327851, Driver::GetTemporaryPath will create the file rather than just create a potientially unqine filename. If clang driver pass the file as parameter as -object_path_lto, ld64 will pass it back to libLTO as GeneratedObjectsDirectory, which is going to cause a LLVM ERROR if it is not a directory. Now during thinLTO, pass a temp directory path to linker instread. rdar://problem/47194182 Reviewers: arphaman, dexonsmith Reviewed By: arphaman Subscribers: mehdi_amini, inglorion, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D56608 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@350970 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver] Fix libcxx detection on Darwin with clang run as ./clangIlya Biryukov2019-01-091-4/+5
| | | | | | | | | | | | | | | | | | | | | | Summary: By using '..' instead of fs::parent_path. The intention of the code was to go from 'path/to/clang/bin' to 'path/to/clang/include'. In most cases parent_path works, however it would fail when clang is run as './clang'. This was noticed in Chromium's bug tracker, see https://bugs.chromium.org/p/chromium/issues/detail?id=919761 Reviewers: arphaman, thakis, EricWF Reviewed By: arphaman, thakis Subscribers: christof, cfe-commits Differential Revision: https://reviews.llvm.org/D56446 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@350714 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver] Don't override '-march' when using '-arch x86_64h'Francis Visoiu Mistrih2018-12-171-5/+1
| | | | | | | | | | | | On Darwin, using '-arch x86_64h' would always override the option passed through '-march'. This patch allows users to use '-march' with x86_64h, while keeping the default to 'core-avx2' Differential Revision: https://reviews.llvm.org/D55775 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@349381 91177308-0d34-0410-b5e6-96231b3b80d8
* [darwin] parse the SDK settings from SDKSettings.json if it exists andAlex Lorenz2018-12-171-28/+87
| | | | | | | | | | | | | | | | | | | | | pass in the -target-sdk-version to the compiler and backend This commit adds support for reading the SDKSettings.json file in the Darwin driver. This file is used by the driver to determine the SDK's version, and it uses that information to pass it down to the compiler using the new -target-sdk-version= option. This option is then used to set the appropriate SDK Version module metadata introduced in r349119. Note: I had to adjust the two ast tests as the SDKROOT environment variable on macOS caused SDK version to be picked up for the compilation of source file but not the AST. rdar://45774000 Differential Revision: https://reviews.llvm.org/D55673 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@349380 91177308-0d34-0410-b5e6-96231b3b80d8
* Misc typos fixes in ./lib folderRaphael Isemann2018-12-101-1/+1
| | | | | | | | | | | | | | Summary: Found via `codespell -q 3 -I ../clang-whitelist.txt -L uint,importd,crasher,gonna,cant,ue,ons,orign,ned` Reviewers: teemperor Reviewed By: teemperor Subscribers: teemperor, jholewinski, jvesely, nhaehnle, whisperity, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D55475 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348755 91177308-0d34-0410-b5e6-96231b3b80d8
* Move detection of libc++ include dirs to Driver on MacOSIlya Biryukov2018-12-051-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The intention is to make the tools replaying compilations from 'compile_commands.json' (clang-tidy, clangd, etc.) find the same standard library as the original compiler specified in 'compile_commands.json'. Previously, the library detection logic was in the frontend (InitHeaderSearch.cpp) and relied on the value of resource dir as an approximation of the compiler install dir. The new logic uses the actual compiler install dir and is performed in the driver. This is consistent with the C++ standard library detection on other platforms and allows to override the resource dir in the tools using the compile_commands.json without altering the standard library detection mechanism. The tools have to override the resource dir to make sure they use a consistent version of the builtin headers. There is still logic in InitHeaderSearch that attemps to add the absolute includes for the the C++ standard library, so we keep passing the -stdlib=libc++ from the driver to the frontend via cc1 args to avoid breaking that. In the long run, we should move this logic to the driver too, but it could potentially break the library detection on other systems, so we don't tackle it in this patch to keep its scope manageable. This is a second attempt to fix the issue, first one was commited in r346652 and reverted in r346675. The original fix relied on an ad-hoc propagation (bypassing the cc1 flags) of the install dir from the driver to the frontend's HeaderSearchOptions. Unsurpisingly, the propagation was incomplete, it broke the libc++ detection in clang itself, which caused LLDB tests to break. The LLDB tests pass with new fix. Reviewers: JDevlieghere, arphaman, EricWF Reviewed By: arphaman Subscribers: mclow.lists, ldionne, dexonsmith, ioeric, christof, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D54630 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348365 91177308-0d34-0410-b5e6-96231b3b80d8
* [gcov/Darwin] Ensure external symbols are exported when using an export listVedant Kumar2018-12-031-4/+10
| | | | | | | | | | | | | | Make sure that symbols needed to implement runtime support for gcov are exported when using an export list on Darwin. Without the clang driver exporting these symbols, the linker hides them, resulting in tapi verification failures. rdar://45944768 Differential Revision: https://reviews.llvm.org/D55151 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348187 91177308-0d34-0410-b5e6-96231b3b80d8
* [Darwin] Export new weak external symbols when compiling with coverageVedant Kumar2018-11-061-0/+2
| | | | | | | | | | | Some weak external symbols were added to the profile runtime in D49953, and on Darwin, these need to be exported for tapi verification purposes. I've tightened the test so that future breakages can be caught earlier. rdar://45831054 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@346276 91177308-0d34-0410-b5e6-96231b3b80d8
* Lift VFS from clang to llvm (NFC)Jonas Devlieghere2018-10-101-1/+1
| | | | | | | | | | | | | | | | | | | This patch moves the virtual file system form clang to llvm so it can be used by more projects. Concretely the patch: - Moves VirtualFileSystem.{h|cpp} from clang/Basic to llvm/Support. - Moves the corresponding unit test from clang to llvm. - Moves the vfs namespace from clang::vfs to llvm::vfs. - Formats the lines affected by this change, mostly this is the result of the added llvm namespace. RFC on the mailing list: http://lists.llvm.org/pipermail/llvm-dev/2018-October/126657.html Differential revision: https://reviews.llvm.org/D52783 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344140 91177308-0d34-0410-b5e6-96231b3b80d8
* [ubsan] Enable -fsanitize=vptr on Apple devices and simulatorsVedant Kumar2018-08-281-2/+8
| | | | | | | | | It seems like an oversight that this check was not always enabled for on-device or device simulator targets. Differential Revision: https://reviews.llvm.org/D51239 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340849 91177308-0d34-0410-b5e6-96231b3b80d8
* [Xray] Darwin - Enable in the driver sideDavid Carlier2018-08-271-0/+7
| | | | | | | | | | | Reviewers: dberris Reviered By: dberris Differential Revision: https://reviews.llvm.org/D51269 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@340712 91177308-0d34-0410-b5e6-96231b3b80d8
* [Darwin Driver] Fix Simulator builtins and test casesChris Bieneman2018-08-151-7/+12
| | | | | | | | In r339807, I broke linking the builtins libraries for simulator targets, which itself was bad, but turns out it was all completely untested and marked with FIXME in the test suite. This fixes all the test cases so they actually work, and fixes the bug I introduced in r339807. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339829 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor Darwin driver to refer to runtimes by componentChris Bieneman2018-08-151-60/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In r335809, Petr Hosek lays out support for what he calls the multiarch runtimes layout. This new way of laying out the directories for runtime libraries is workable for all platforms. Petr did some of the common infrastructure and made it work for Linux and Fuscia. This patch is a cleanup to the Darwin and MachO drivers to serve as a step toward supporting it in Darwin. This patch does primarily two things: (1) Changes the APIs for how the Darwin driver refers to compiler-rt libraries to use the component names, similar to how Linux and Fuscia do (2) Removes some legacy functionality for supporting macOS versions before 10.6. This functionality is effectively dead code because in r339277, the support was removed from compiler-rt for generating the 10.4 runtime support library, and Xcode 10 (currently in beta) removes libgcc_s.10.4 and libgcc_s.10.5 from the macOS SDK. With this patch landed a subsequent patch can modify MachO::AddLinkRuntimeLib to support the multiarch runtimes layout. Worth noting: None of the removed functionality was actually covered in the test suite. So no test case updates are required. Reviewers: phosek, bruno, arphaman Reviewed By: phosek, arphaman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50618 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339807 91177308-0d34-0410-b5e6-96231b3b80d8
* SafeStack: Disable Darwin supportVlad Tsyrklevich2018-08-141-10/+0
| | | | | | | | | | | | | | | | Summary: Darwin support does not appear to be used as evidenced by the fact that the runtime has never supported non-trivial programs. Reviewers: pcc, kubamracek Reviewed By: pcc Subscribers: cfe-commits, kcc Differential Revision: https://reviews.llvm.org/D50724 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339720 91177308-0d34-0410-b5e6-96231b3b80d8
* [Preprocessor] Allow libc++ to detect when aligned allocation is unavailable.Volodymyr Sapsai2018-08-031-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Libc++ needs to know when aligned allocation is supported by clang, but is otherwise unavailable at link time. Otherwise, libc++ will incorrectly end up generating calls to `__builtin_operator_new`/`__builtin_operator_delete` with alignment arguments. This patch implements the following changes: * The `__cpp_aligned_new` feature test macro to no longer be defined when aligned allocation is otherwise enabled but unavailable. * The Darwin driver no longer passes `-faligned-alloc-unavailable` when the user manually specifies `-faligned-allocation` or `-fno-aligned-allocation`. * Instead of a warning Clang now generates a hard error when an aligned allocation or deallocation function is referenced but unavailable. Patch by Eric Fiselier. Reviewers: rsmith, vsapsai, erik.pilkington, ahatanak, dexonsmith Reviewed By: rsmith Subscribers: Quuxplusone, cfe-commits Differential Revision: https://reviews.llvm.org/D45015 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338934 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r337635 "[Driver] Sanitizer support based on runtime library presence"Reid Kleckner2018-07-311-51/+22
| | | | | | | | This change causes issues with distributed build systems, which may only have compiler binaries without any runtime libraries. See discussion about this on https://reviews.llvm.org/D15225. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@338444 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver] Sanitizer support based on runtime library presenceGeorge Karpenkov2018-07-201-22/+51
| | | | | | | | | | | | | | | The runtime libraries of sanitizers are built in compiler-rt, and Clang can be built without compiler-rt, or compiler-rt can be configured to only build certain sanitizers. The driver should provide reasonable diagnostics and not a link-time error when a runtime library is missing. This patch changes the driver for OS X to only support sanitizers of which we can find the runtime libraries. The discussion for this patch explains the rationale Differential Revision: https://reviews.llvm.org/D15225 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@337635 91177308-0d34-0410-b5e6-96231b3b80d8
* [MachineOutliner] Properly pass -moutline along to the toolchainJessica Paquette2018-07-061-0/+12
| | | | | | | | | | This moves the LTO-specific code for outlining from ToolChains/Clang.cpp to ToolChains/Darwin.cpp. Passing -mllvm flags isn't sufficient for making sure that the specified pass will actually run in LTO. This makes sure that when -moutline is passed, the MachineOutliner will actually be added to the LTO pass pipeline as expected. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@336471 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver][Darwin] Use Host Triple to infer target os versionSteven Wu2018-07-031-1/+7
| | | | | | | | | | | | | | | | | | | | Summary: When clang required to infer target os version from --target option and the os version is not specified in targets, check the host triple. If the host and target are both macOS, use host triple to infer target os version. rdar://problem/41651999 Reviewers: arphaman, dexonsmith Reviewed By: arphaman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D48849 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@336168 91177308-0d34-0410-b5e6-96231b3b80d8
* [Darwin] Remove _VPMergeHook from the auto-export listVedant Kumar2018-06-281-1/+0
| | | | | | | | | | | Remove _VPMergeHook from Darwin's automatically-exported symbol list for PGO. As of r328987 this symbol is no longer weak. An integration test in compiler-rt will follow. rdar://41470205 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335890 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-091-2/+2
| | | | | | | | | | | | | | | | | | | This is similar to the LLVM change https://reviews.llvm.org/D46290. We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\@brief'); do perl -pi -e 's/\@brief //g' $i & done for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46320 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331834 91177308-0d34-0410-b5e6-96231b3b80d8
* [driver][darwin] Do not infer -simulator environment for OS version env varsAlex Lorenz2018-04-251-3/+16
| | | | | | | | | with non-simulator SDKs rdar://37955008 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@330878 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver] Export profiling symbols for -exported_symbols_listVedant Kumar2018-04-131-0/+2
| | | | | | | | | When profiling is enabled and -exported_symbols_list is specified for the Darwin linker, export the requisite set of profiling symbols. rdar://39427167 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@330077 91177308-0d34-0410-b5e6-96231b3b80d8
* [driver][darwin] Do not infer -simulator environment for non-simulator SDKsAlex Lorenz2018-04-031-5/+19
| | | | | | | rdar://36369832 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329110 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver] Forward opt-remark hotness threshold to LTOAdam Nemet2018-02-261-1/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326108 91177308-0d34-0410-b5e6-96231b3b80d8
* [driver][darwin] Take the OS version from -m<os>-version-min argument whenAlex Lorenz2017-12-291-14/+33
| | | | | | | | | | | -target has no OS version This ensures that Clang won't warn about redundant -m<os>-version-min argument for an invocation like `-target x86_64-apple-macos -mmacos-version-min=10.11` git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321559 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid int to string conversion in Twine or raw_ostream contexts.Benjamin Kramer2017-12-281-2/+1
| | | | | | | Some output changes from uppercase hex to lowercase hex, no other functionality change intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321526 91177308-0d34-0410-b5e6-96231b3b80d8
* [darwin][driver] Warn about mismatching -<os>-version-min rather thanAlex Lorenz2017-12-201-4/+21
| | | | | | | | | | | superfluous -<os>-version-min compiler option rdar://35813850 Differential Revision: https://reviews.llvm.org/D41425 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321145 91177308-0d34-0410-b5e6-96231b3b80d8
* [driver][darwin] Set the 'simulator' environment when it's specifiedAlex Lorenz2017-12-191-6/+21
| | | | | | | | | | | in '-target' rdar://35742458 Differential Revision: https://reviews.llvm.org/D41076 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321102 91177308-0d34-0410-b5e6-96231b3b80d8
* [driver][darwin] Take the OS version specified in "-target" as the targetAlex Lorenz2017-12-191-47/+69
| | | | | | | | | | | | | | OS instead of inferring it from SDK / environment The OS version is specified in -target should be used instead of the one in an environment variable / SDK name. rdar://35813850 Differential Revision: https://reviews.llvm.org/D40998 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321099 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix MSVC 'not all control paths return a value' warningSimon Pilgrim2017-12-101-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@320297 91177308-0d34-0410-b5e6-96231b3b80d8
* [driver][darwin] Refactor the target selection code, NFCAlex Lorenz2017-12-091-245/+356
| | | | | | | | | | | | | | | | | | The simulator variant of Darwin's platforms is removed in favor of a new environment field. The code that selects the platform and the version is split into 4 different functions instead of being all in one function. This is an NFC commit, although it slightly improves the "invalid version number" diagnostic by displaying the environment variable instead of -m<os>-version-min if the OS version was derived from the environment. rdar://35813850 Differential Revision: https://reviews.llvm.org/D41035 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@320235 91177308-0d34-0410-b5e6-96231b3b80d8
* [driver] Set the 'simulator' environment for Darwin when compiling forAlex Lorenz2017-12-071-8/+0
| | | | | | | | | | | iOS/tvOS/watchOS simulator rdar://35135215 Differential Revision: https://reviews.llvm.org/D40682 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@320073 91177308-0d34-0410-b5e6-96231b3b80d8
* Toolchain: Normalize dwarf, sjlj and seh ehMartell Malone2017-11-291-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a re-apply of r319294. adds -fseh-exceptions and -fdwarf-exceptions flags clang will check if the user has specified an exception model flag, in the absense of specifying the exception model clang will then check the driver default and append the model flag for that target to cc1 -fno-exceptions has a higher priority then specifying the model move __SEH__ macro definitions out of Targets into InitPreprocessor behind the -fseh-exceptions flag move __ARM_DWARF_EH__ macrodefinitions out of verious targets and into InitPreprocessor behind the -fdwarf-exceptions flag and arm|thumb check remove unused USESEHExceptions from the MinGW Driver fold USESjLjExceptions into a new GetExceptionModel function that gives the toolchain classes more flexibility with eh models Reviewers: rnk, mstorsjo Differential Revision: https://reviews.llvm.org/D39673 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@319297 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Toolchain: Normalize dwarf, sjlj and seh eh"Martell Malone2017-11-291-7/+4
| | | | | | | | This reverts rL319294. The windows sanitizer does not like seh on x86. Will re apply with None type for x86 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@319295 91177308-0d34-0410-b5e6-96231b3b80d8
* Toolchain: Normalize dwarf, sjlj and seh ehMartell Malone2017-11-291-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | adds -fseh-exceptions and -fdwarf-exceptions flags clang will check if the user has specified an exception model flag, in the absense of specifying the exception model clang will then check the driver default and append the model flag for that target to cc1 clang cc1 assumes dwarf is the default if none is passed and -fno-exceptions has a higher priority then specifying the model move __SEH__ macro definitions out of Targets into InitPreprocessor behind the -fseh-exceptions flag move __ARM_DWARF_EH__ macrodefinitions out of verious targets and into InitPreprocessor behind the -fdwarf-exceptions flag and arm|thumb check remove unused USESEHExceptions from the MinGW Driver fold USESjLjExceptions into a new GetExceptionModel function that gives the toolchain classes more flexibility with eh models Reviewers: rnk, mstorsjo Differential Revision: https://reviews.llvm.org/D39673 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@319294 91177308-0d34-0410-b5e6-96231b3b80d8
* Driver: remove `SupportsObjCGC` (NFC)Saleem Abdulrasool2017-11-191-2/+0
| | | | | | This option is not used in the frontend. Remove the method. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@318609 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[XRay][darwin] Initial XRay in Darwin Support"Dean Michael Berris2017-11-101-6/+0
| | | | | | This reverts r317875. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317877 91177308-0d34-0410-b5e6-96231b3b80d8
* [XRay][darwin] Initial XRay in Darwin SupportDean Michael Berris2017-11-101-0/+6
| | | | | | | | | | | | | | | | | | | | | | Summary: This change implements the changes required in both clang and compiler-rt to allow building XRay-instrumented binaries in Darwin. For now we limit this to x86_64. We also start building the XRay runtime library in compiler-rt for osx. A caveat to this is that we don't have the tests set up and running yet, which we'll do in a set of follow-on changes. This patch uses the monorepo layout for the coordinated change across multiple projects. Reviewers: kubamracek Subscribers: mgorny, cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D39114 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317875 91177308-0d34-0410-b5e6-96231b3b80d8