summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/ToolChains/Darwin.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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 llvm-svn: 331834
* [driver][darwin] Do not infer -simulator environment for OS version env varsAlex Lorenz2018-04-251-3/+16
| | | | | | | | with non-simulator SDKs rdar://37955008 llvm-svn: 330878
* [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 llvm-svn: 330077
* [driver][darwin] Do not infer -simulator environment for non-simulator SDKsAlex Lorenz2018-04-031-5/+19
| | | | | | rdar://36369832 llvm-svn: 329110
* [Driver] Forward opt-remark hotness threshold to LTOAdam Nemet2018-02-261-1/+10
| | | | llvm-svn: 326108
* [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` llvm-svn: 321559
* 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. llvm-svn: 321526
* [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 llvm-svn: 321145
* [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 llvm-svn: 321102
* [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 llvm-svn: 321099
* Fix MSVC 'not all control paths return a value' warningSimon Pilgrim2017-12-101-0/+1
| | | | llvm-svn: 320297
* [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 llvm-svn: 320235
* [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 llvm-svn: 320073
* 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 llvm-svn: 319297
* 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 llvm-svn: 319295
* 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 llvm-svn: 319294
* Driver: remove `SupportsObjCGC` (NFC)Saleem Abdulrasool2017-11-191-2/+0
| | | | | | This option is not used in the frontend. Remove the method. llvm-svn: 318609
* Revert "[XRay][darwin] Initial XRay in Darwin Support"Dean Michael Berris2017-11-101-6/+0
| | | | | | This reverts r317875. llvm-svn: 317877
* [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 llvm-svn: 317875
* [Driver] Export symbols needed to use profile runtimeVedant Kumar2017-10-111-0/+29
| | | | | | | | | | | | | | | Apple's API verification tool (tapi) checks that the symbols exported from a program match a whitelist. When the program uses the profile runtime, some additional symbols which are typically not part of the regular whitelist must be exported. If we're using symbol export directives along with the profile runtime on Darwin, the driver needs to export the additional symbols to avoid verification failures. rdar://problem/30067753 llvm-svn: 315518
* [Driver] Fix -static-libsan / -shared-libsan on DarwinVedant Kumar2017-10-071-1/+2
| | | | | | | Don't ignore these flags on Darwin. The old behavior of using the dynamic runtime when neither flag is passed is preserved. llvm-svn: 315142
* [ubsan] Enable -fsanitize=function on DarwinVedant Kumar2017-09-131-0/+1
| | | | | | https://reviews.llvm.org/D37598 llvm-svn: 313099
* [Driver] Darwin: Link in the profile runtime archive firstVedant Kumar2017-09-121-18/+26
| | | | | | | | | | | | | | | | | | | | While building a project with code coverage enabled, we can link in dependencies which export a weak definition of __llvm_profile_filename. After r306710, linking in the profiling runtime could pull in a weak definition of this symbol from a dependency, instead of from within the runtime's archive. This inconsistency causes issues during API verification, and is also a practical problem (the symbol would go missing were the dependent dylib to be switched out). Introduce a LinkFirst runtime link option to make sure we always search the profiling runtime for this symbol first. rdar://problem/33271080 Differential Revision: https://reviews.llvm.org/D35385 llvm-svn: 313065
* [Driver] Support ubsan-minimal on DarwinVedant Kumar2017-09-111-1/+3
| | | | | | | | Make it possible to use the minimal ubsan runtime on Darwin. Differential Revision: https://reviews.llvm.org/D37649 llvm-svn: 312958
* Test fix: only add shared libraries to rpath.George Karpenkov2017-08-221-1/+1
| | | | llvm-svn: 311422
* Moving libFuzzer to compiler-rt: required updates to the Clang driver.George Karpenkov2017-08-211-16/+9
| | | | | | Differential Revision: https://reviews.llvm.org/D36909 llvm-svn: 311406
* [Driver][Darwin] Do not pass -munwind-table if -fno-excpetions isAkira Hatanaka2017-08-211-1/+6
| | | | | | | | | | | | supplied. With this change, -fno-exceptions disables unwind tables unless -funwind-tables is supplied too or the target is x86-64 (x86-64 requires emitting unwind tables). rdar://problem/33934446 llvm-svn: 311397
* Add -fsanitize=fuzzer-no-link flag to the driver.George Karpenkov2017-08-111-0/+1
| | | | | | | | | | | The flag will perform instrumentation necessary to the fuzzing, but will NOT link libLLVMFuzzer.a library. Necessary when modifying CFLAGS for projects which may produce executables as well as a fuzzable target. Differential Revision: https://reviews.llvm.org/D36600 llvm-svn: 310733
* [Driver][Darwin] Pass -munwind-table when !UseSjLjExceptions.Akira Hatanaka2017-08-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | This commit fixes a bug where clang/llvm doesn't emit an unwind table for a function when it is marked noexcept. Without this patch, the following code terminates with an uncaught exception on ARM64: int foo1() noexcept { try { throw 0; } catch (int i) { return 0; } return 1; } int main() { return foo1(); } rdar://problem/32411865 Differential Revision: https://reviews.llvm.org/D35693 llvm-svn: 310006
* [Driver] Make sure the deployment target is earlier than iOS 11 whenAkira Hatanaka2017-07-311-23/+23
| | | | | | | | | | it is inferred from -isysroot. This fixes a change that was inadvertently introduced in r309607. rdar://problem/32230613 llvm-svn: 309633
* [Driver] Allow users to silence the warning that is issued when theAkira Hatanaka2017-07-311-9/+11
| | | | | | | | | | deployment target is earlier than iOS 11 and the target is 32-bit. This is a follow-up to r306922. rdar://problem/32230613 llvm-svn: 309607
* Update to use enum classes for various ARM *Kind enumsFlorian Hahn2017-07-271-6/+6
| | | | | | | | | | | | | | Summary: This updates the relevant Clang parts for the LLVM change D35882. Reviewers: rengolin, chandlerc, javed.absar, rovka Reviewed By: rovka Subscribers: aemerson, cfe-commits, kristof.beyls Differential Revision: https://reviews.llvm.org/D35884 llvm-svn: 309289
* Introduce -nostdlib++ flag to disable linking the C++ standard library.Nico Weber2017-07-251-3/+2
| | | | | | | | | | | | | | | Projects that want to statically link their own C++ standard library currently need to pass -nostdlib or -nodefaultlibs, which also disables linking of the builtins library, -lm, and so on. Alternatively, they could use `clang` instead of `clang++`, but that already disables implicit addition of -lm on some toolchains. Add a dedicated flag -nostdlib++ that disables just linking of libc++ / libstdc++. This is analogous to -nostdinc++. https://reviews.llvm.org/D35780 llvm-svn: 308997
* [Sema] Improve diagnostic message for unavailable C++17 alignedAkira Hatanaka2017-07-191-4/+13
| | | | | | | | | | | | | | | | | | allocation functions. This changes the error message Sema prints when an unavailable C++17 aligned allocation function is selected. Original message: "... possibly unavailable on x86_64-apple-macos10.12" New message: "... only available on macOS 10.13 or newer" This is a follow-up to r306722. rdar://problem/32664169 Differential Revision: https://reviews.llvm.org/D35520 llvm-svn: 308496
* [Driver] Respect -target when determining target platform on AppleAkira Hatanaka2017-07-141-19/+49
| | | | | | | | | | | | | | platforms. Set the target OS based on -target if it is present on the command line and -arch is not. With this commit, "-target x86_64-apple-ios8.0" does the same thing as "-arch x86_64 -mios-version-min=8.0". rdar://problem/21012522 llvm-svn: 307982
* Recommit [driver][macOS] Pick the system version for theAlex Lorenz2017-07-071-1/+22
| | | | | | | | | | | | | | | | | | | | deployment target if the SDK is newer than the system This commit reverts the revert commit r305891. Now the change from r305678 should be correct because `llvm::sys::getProcessTriple` now returns the correct macOS version of the system after the LLVM change r307372. Original commit message: This commit improves the driver by making sure that it picks the system version for the deployment target when the version of the macOS SDK is newer than the system version. rdar://29449467 Differential Revision: https://reviews.llvm.org/D34175 llvm-svn: 307388
* [OpenMP] Extend CLANG target options with device offloading kind.Gheorghe-Teodor Bercea2017-07-061-1/+2
| | | | | | | | | | | | | | Summary: Pass the type of the device offloading when building the tool chain for a particular target architecture. This is required when supporting multiple tool chains that target a single device type. In our particular use case, the OpenMP and CUDA tool chains will use the same ```addClangTargetOptions ``` method. This enables the reuse of common options and ensures control over options only supported by a particular tool chain. Reviewers: arpith-jacob, caomhin, carlo.bertolli, ABataev, jlebar, hfinkel, tstellar, Hahnfeld Reviewed By: hfinkel Subscribers: jgravelle-google, aheejin, rengolin, jfb, dschuff, sbc100, cfe-commits Differential Revision: https://reviews.llvm.org/D29647 llvm-svn: 307272
* Fix indentation.Akira Hatanaka2017-07-011-7/+7
| | | | | | | | This is an attempt to fix a failing bot: http://lab.llvm.org:8011/builders/ubuntu-gcc7.1-werror llvm-svn: 306944
* [Driver] Check that the iOS deployment target is iOS 10 or earlier ifAkira Hatanaka2017-07-011-2/+26
| | | | | | | | | | | | | | | | | | | | | the target is 32-bit. The following changes are made to the driver since 32-bit apps do not run on iOS 11 or later: - If the deployment target is set explicitly, either with a command-line option or an environment variable, the driver should report an error if the version is greater than iOS 10. - In the case where the deployment target is not set explicitly and the default is inferred from the target triple or SDK version, it should use a maximum default of iOS 10.99.99. rdar://problem/32230613 Differential Revision: https://reviews.llvm.org/D34529 llvm-svn: 306922
* Insert llvm_unreachable at the end of a function to silence gcc'sAkira Hatanaka2017-06-291-0/+1
| | | | | | | | | | -Werror=return-type error. This is an attempt to fix the following failing bot: http://lab.llvm.org:8011/builders/ubuntu-gcc7.1-werror llvm-svn: 306739
* [libFuzzer] Do not link in libFuzzer with -fsanitize=fuzzer when producing a ↵George Karpenkov2017-06-291-1/+1
| | | | | | | | shared object https://reviews.llvm.org/D34791 llvm-svn: 306733
* [Sema] Issue diagnostics if a new/delete expression generates a call toAkira Hatanaka2017-06-291-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | a c++17 aligned allocation/deallocation function that is unavailable in the standard library on Apple platforms. The aligned functions are implemented only in the following versions or later versions of the OSes, so clang issues diagnostics if the deployment target being targeted is older than these: macosx: 10.13 ios: 11.0 tvos: 11.0 watchos: 4.0 The diagnostics are issued whenever the aligned functions are selected except when the selected function has a definition in the same file. If there is a user-defined function available somewhere else, option -Wno-aligned-allocation-unavailable can be used to silence the diagnostics. rdar://problem/32664169 Differential Revision: https://reviews.llvm.org/D34574 llvm-svn: 306722
* Revert r305678: [driver][macOS] Pick the system version for theAlex Lorenz2017-06-211-22/+1
| | | | | | | | | | | | | deployment target if the SDK is newer than the system This commit also reverts follow-up commits r305680 and r305685 that have buildbot fixes. The change in r305678 wasn't correct because it relied on `llvm::sys::getProcessTriple`, which uses a pre-configured OS version. We should lookup the actual macOS version of the system on which the compiler is running. llvm-svn: 305891
* Add missing OS check to r305678Alex Lorenz2017-06-191-2/+4
| | | | | | | That commit failed on non-macOS buildbots as I've forgotten to make sure that the system on which Clang is running on is actually macOS. llvm-svn: 305680
* [driver][macOS] Pick the system version for the deployment targetAlex Lorenz2017-06-191-1/+20
| | | | | | | | | | | | | | if the SDK is newer than the system This commit improves the driver by making sure that it picks the system version for the deployment target when the version of the macOS SDK is newer than the system version. rdar://29449467 Differential Revision: https://reviews.llvm.org/D34175 llvm-svn: 305678
* Flag -fsanitize=fuzzer to enable libfuzzerGeorge Karpenkov2017-04-241-0/+15
| | | | | | | | | | Previously, adding libfuzzer to a project was a multi-step procedure, involving libfuzzer compilation, linking the library, and specifying coverage flags. With this change,libfuzzer can be enabled by adding a single -fsanitize=fuzzer flag instead. llvm-svn: 301212
* Enable leak sanitizer builds for darwinFrancis Ricci2017-04-201-0/+3
| | | | | | | | | | | | | | Summary: Support for leak sanitizer on darwin has been added to compiler-rt, this patch adds compiler support. Reviewers: dexonsmith, compnerd Subscribers: alekseyshl, kubamracek, cfe-commits Differential Revision: https://reviews.llvm.org/D32192 llvm-svn: 300894
* Update to match LLVM r300135.Richard Smith2017-04-121-1/+2
| | | | | | Remove "REQUIRES: long_tests" from test/Driver/response-file.c since it is now about 10x faster. (We can add that back if it's still too slow for some buildbot.) llvm-svn: 300136
* [Driver] Define macro __APPLE_EMBEDDED_SIMULATOR__ when optionAkira Hatanaka2017-03-151-3/+16
| | | | | | | | | | | | | | | | | -m(i|tv|watch)os-simulator-version-min is on the command line. Previously the driver would treat -m(i|tv|watch)os-simulator-version-min as an alias of -m(i|tv|watch)os-version-min. This no longer works since we now need to distinguish between the two options (the latter is used for iOS running in a VM, for example). This commit stops making the simulator options the aliases of the OS options and defines a macro to differentiate between the two groups of options. rdar://problem/28872911 llvm-svn: 297866
* [Driver] Consolidate tools and toolchains by target platform. (NFC)David L. Jones2017-03-081-0/+1896
Summary: (This is a move-only refactoring patch. There are no functionality changes.) This patch splits apart the Clang driver's tool and toolchain implementation files. Each target platform toolchain is moved to its own file, along with the closest-related tools. Each target platform toolchain has separate headers and implementation files, so the hierarchy of classes is unchanged. There are some remaining shared free functions, mostly from Tools.cpp. Several of these move to their own architecture-specific files, similar to r296056. Some of them are only used by a single target platform; since the tools and toolchains are now together, some helpers now live in a platform-specific file. The balance are helpers related to manipulating argument lists, so they are now in a new file pair, CommonArgs.h and .cpp. I've tried to cluster the code logically, which is fairly straightforward for most of the target platforms and shared architectures. I think I've made reasonable choices for these, as well as the various shared helpers; but of course, I'm happy to hear feedback in the review. There are some particular things I don't like about this patch, but haven't been able to find a better overall solution. The first is the proliferation of files: there are several files that are tiny because the toolchain is not very different from its base (usually the Gnu tools/toolchain). I think this is mostly a reflection of the true complexity, though, so it may not be "fixable" in any reasonable sense. The second thing I don't like are the includes like "../Something.h". I've avoided this largely by clustering into the current file structure. However, a few of these includes remain, and in those cases it doesn't make sense to me to sink an existing file any deeper. Reviewers: rsmith, mehdi_amini, compnerd, rnk, javed.absar Subscribers: emaste, jfb, danalbert, srhines, dschuff, jyknight, nemanjai, nhaehnle, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D30372 llvm-svn: 297250
OpenPOWER on IntegriCloud