summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver
Commit message (Collapse)AuthorAgeFilesLines
...
* Link static PIE programs against rcrt0.o on OpenBSDBrad Smith2017-02-191-0/+4
| | | | | | Patch by Stefan Kempf. llvm-svn: 295610
* [CUDA] Don't pass -stack-protector to NVPTX compilations.Justin Lebar2017-02-191-19/+23
| | | | | | | | | We can't support stack-protector on NVPTX because NVPTX doesn't expose a stack to the compiler! Fixes PR32009. llvm-svn: 295609
* [AVR] Move definition of IsIntegratedAssemblerDefaultDylan McKay2017-02-182-1/+1
| | | | llvm-svn: 295536
* Cleanup: use range-based for rather than separate calls to begin and end.Richard Smith2017-02-181-9/+8
| | | | llvm-svn: 295524
* [XRAY][MIPS] Add -fxray-instrument for mips/mipsel/mips64/mips64elSagar Thakur2017-02-151-0/+4
| | | | | | | | | Summary: Adds xray instrument option for mips/mipsel/mips64/mips64el. Reviewed by sdardis, dberris Differential: D27698 llvm-svn: 295163
* Don't look for GCC versions in /usr/lib/<triple> except when <triple> is aRichard Smith2017-02-151-4/+5
| | | | | | | | | | freescale triple. On multiarch systems, this previously caused us to stat every file in /usr/lib/<triple> (typically several thousand files). This change halves the runtime of a clang invocation on an empty file on my system. llvm-svn: 295140
* Refactor GCC lib directory detection to make it easier to add lib directoriesRichard Smith2017-02-151-34/+45
| | | | | | that are only checked for some targets. llvm-svn: 295139
* [Driver] Use stem() and not filename().Davide Italiano2017-02-111-1/+1
| | | | | | | | | | On Windows the filename might have an extension, namely `.exe`, so the search will fail. Sorry, I don't have a good way to test this as it seems to fail only in some weird configurations. r284430 has the same modification for Fuchsia. llvm-svn: 294879
* [XRay] Implement powerpc64le xray.Tim Shen2017-02-101-0/+1
| | | | | | | | | | | | | | | | | | Summary: powerpc64 big-endian is not supported, but I believe that most logic can be shared, except for xray_powerpc64.cc. Also add a function InvalidateInstructionCache to xray_util.h, which is copied from llvm/Support/Memory.cpp. I'm not sure if I need to add a unittest, and I don't know how. Reviewers: dberris, echristo, iteratee, kbarton, hfinkel Subscribers: mehdi_amini, nemanjai, mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D29742 llvm-svn: 294781
* [DebugInfo] Added support to Clang FE for generating debug info for ↵Amjad Aboud2017-02-091-0/+5
| | | | | | | | | | | preprocessor macros. Added "-fdebug-macro" flag (and "-fno-debug-macro" flag) to enable (and to disable) emitting macro debug info. Added CC1 "-debug-info-macro" flag that enables emitting macro debug info. Differential Revision: https://reviews.llvm.org/D16135 llvm-svn: 294637
* [windows] [asan] Add wholearchive flag when including asan_cxx lib.Marcos Pividori2017-02-091-6/+7
| | | | | | | | | | | | | | We need -wholearchive for asan_cxx, the same than for asan. Clang Driver will add asan_cxx at the beginning of the arg list that we pass to the linker. To ensure that all the static libraries are linked to asan_cxx, we force the linker to include the object files in asan_cxx. This fixes some linker errors when compiling with address sanitizer for MT and passing the static library libFuzzer. Differential Revision: https://reviews.llvm.org/D29754 llvm-svn: 294604
* Driver: Do not link safestack with --whole-archive.Peter Collingbourne2017-02-071-3/+5
| | | | | | | | This allows it to be used with the other sanitizers. Differential Revision: https://reviews.llvm.org/D29545 llvm-svn: 294274
* Driver: Do not warn about unused -pthread when linking on darwinMatthias Braun2017-02-031-0/+4
| | | | | | | | While there is nothing to do at link time to get pthreads support on darwin, specifying the argument is fine and we should not warn about unused arguments. llvm-svn: 294065
* Revert "[Driver] Updated for Visual Studio 2017"Reid Kleckner2017-02-023-403/+256
| | | | | | | This reverts commit r293923. It causes test failures on Linux that need time to debug. llvm-svn: 293924
* [Driver] Updated for Visual Studio 2017Reid Kleckner2017-02-023-256/+403
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The patch updates the MSVC ToolChain for the changes made in Visual Studio 2017[1]. Other notable changes: - Path handling code has been centralised to make potential future changes less painful. - A compiler error is emitted if the driver is unable to locate a usable MSVC toolchain. (Previously it'd fail with a cryptic error such as "link.exe is not executable") - Support for the new Setup Config Server API[2] has been added, albeit block commented out with a preprocessor conditional. This can probably be re-evaluated when the API is officially released (it's currently at the RC stage), but it's left in to make it easy for anyone familiar with the API to give it a go with Clang. Patch by Hamza Sood. [1] https://blogs.msdn.microsoft.com/vcblog/2016/10/07/compiler-tools-layout-in-visual-studio-15/ [2] https://blogs.msdn.microsoft.com/heaths/2016/09/15/changes-to-visual-studio-15-setup/ Reviewers: ruiu, hans, rnk Reviewed By: rnk Subscribers: awson, RKSimon, amccarth, cfe-commits Differential Revision: https://reviews.llvm.org/D28365 llvm-svn: 293923
* [windows] [asan] Add wholearchive flag when including static lib asan.Marcos Pividori2017-01-311-0/+5
| | | | | | | | | | | | | | | | | In Windows, when the sanitizer is implemented as a static library, we use auxiliary static library dll_thunk that will be linked to the dlls that have instrumentation, so they can refer to the runtime in the main executable. It uses interception to get a pointer the function in the main executable and override its function with that pointer. Because of that, we need to ensure that the main executable exports all the sanitizers' interface, otherwise the initialization in dll_thunk will fail. In this commit we add the flag -wholearchive to clang driver to ensure that the linker does not omit any object files from asan library. Differential Revision: https://reviews.llvm.org/D29334 llvm-svn: 293668
* [X86] Teach Clang about -mfentry flagNirav Dave2017-01-311-0/+3
| | | | | | | | | | | | Replace mcount calls with calls to fentry. Reviewers: hfinkel, craig.topper Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D28001 llvm-svn: 293649
* [lsan] Enable LSan for x86 LinuxMaxim Ostapenko2017-01-311-1/+1
| | | | | | | | | This is a missed part of https://reviews.llvm.org/D28609. Enable LSan for x86 Linux in clang driver. Differential Revision: https://reviews.llvm.org/D29077 llvm-svn: 293609
* [windows] [asan] Add linker flag when including "asan_dynamic_runtime_thunk".Marcos Pividori2017-01-291-0/+4
| | | | | | | | | | | | | I modify clang driver for windows to include: "-wholearchive:asan_dynamic_runtime_thunk", so all object files in the static library: asan_dynamic_runtime_thunk are considered by the linker. This is necessary, because some object files only include linker pragmas, and doesn't resolve any symbol. If we don't include that flag, the linker will ignore them, and won't read the linker pragmas. Differential Revision: https://reviews.llvm.org/D29159 llvm-svn: 293420
* Fix typo introduced in r292960 that may affect -flto -save-temps (saving the ↵Mehdi Amini2017-01-281-1/+1
| | | | | | optimized bitcode) llvm-svn: 293370
* ARM-Darwin: re-enable -momit-leaf-frame-pointer.Tim Northover2017-01-272-8/+3
| | | | | | | | | | | | In r279546 I disabled all frame pointer elimination at the front-end on ARM-Darwin (and warned about it) because before that the backend had been silently ignoring these options. It turns out we didn't ignore -momit-leaf-frame-pointer though, just the more general -fomit-frame-pointer. So this re-enables passing that down to CodeGen so that everything really does continue working as before (with better diagnostics). llvm-svn: 293311
* clang-cl: Warn about /U flags that look like filenames (PR31662)Hans Wennborg2017-01-271-0/+8
| | | | | | | | | | | | Both on Mac and Windows, it's common to have a 'Users' directory in the root of the filesystem, so one might specify a filename as '/Users/me/myfile.c'. clang-cl (as well as MSVC's cl.exe) will interpret that as invoking the '/U' option, which is probably not what the user wanted. Add a warning about this. Differential Revision: https://reviews.llvm.org/D29198 llvm-svn: 293305
* [mips] Add support for static model on N64Simon Dardis2017-01-272-3/+60
| | | | | | | | | | | | | | | | | | | | | | | The patch teaches the Clang driver how to handle the N64 static relocation model properly. It enforces the correct target feature (+noabicalls) when -fno-pic is used. This is required as non-pic N64 code as the abi extension to call PIC code (CPIC) is unsupported. Make PIC the default for mips64 and mips64el, this affects both N32 & N64 ABIs, to better match GCC. As part of this effort, clean up the assembler invocation command builder, so the correct flags are used. This and r293279 in LLVM resolves PR/23485. Thanks to Brooks Davis for reporting the issue! Reviewers: slthakur, seanbruno Differential Revision: https://reviews.llvm.org/D29031 llvm-svn: 293285
* [docs] Add help text and refine grouping for various options.Richard Smith2017-01-271-2/+1
| | | | | | Also accept -G= (and -msmall-data-threshold=) as an alias for -G on MIPS as well as Hexagon. llvm-svn: 293254
* Driver: ignore -fno-objc-arc-exception when -fno-objc-arc setSaleem Abdulrasool2017-01-251-0/+6
| | | | | | | | | | | Sometime clang would be supplied -fobjc-arc -f(no)objc-arc-exceptions and then later disable ARC with -fno-objc-arc, which only negate first option, but not the latter, resulting usused argument warning. Silence this warning only when -fno-objc-arc option is present. Patch by Onha Choe! llvm-svn: 293014
* Forward -bitcode_process_mode to ld64 in marker-only modeMehdi Amini2017-01-241-2/+6
| | | | | | | | | | Reviewers: steven_wu Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D29066 llvm-svn: 292961
* Split isUsingLTO() outside of embedBitcodeInObject() and ↵Mehdi Amini2017-01-242-4/+6
| | | | | | | | | | | | | | embedBitcodeMarkerOnly(). Summary: These accessors maps directly to the command line option. Reviewers: steven_wu Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D29065 llvm-svn: 292960
* [Hexagon] Linux linker does not support .gnu-hashSumanth Gundapaneni2017-01-191-1/+3
| | | | | | | | | Hexagon Linux dynamic loader does not use (in fact does not support) .gnu-hash Differential Revision: https://reviews.llvm.org/D28865 llvm-svn: 292496
* Add -fdebug-info-for-profiling to emit more debug info for sample pgo ↵Dehao Chen2017-01-191-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | profile collection Summary: SamplePGO uses profile with debug info to collect profile. Unlike the traditional debugging purpose, sample pgo needs more accurate debug info to represent the profile. We add -femit-accurate-debug-info for this purpose. It can be combined with all debugging modes (-g, -gmlt, etc). It makes sure that the following pieces of info is always emitted: * start line of all subprograms * linkage name of all subprograms * standalone subprograms (functions that has neither inlined nor been inlined) The impact on speccpu2006 binary size (size increase comparing with -g0 binary, also includes data for -g binary, which does not change with this patch): -gmlt(orig) -gmlt(patched) -g 433.milc 4.68% 5.40% 19.73% 444.namd 8.45% 8.93% 45.99% 447.dealII 97.43% 115.21% 374.89% 450.soplex 27.75% 31.88% 126.04% 453.povray 21.81% 26.16% 92.03% 470.lbm 0.60% 0.67% 1.96% 482.sphinx3 5.77% 6.47% 26.17% 400.perlbench 17.81% 19.43% 73.08% 401.bzip2 3.73% 3.92% 12.18% 403.gcc 31.75% 34.48% 122.75% 429.mcf 0.78% 0.88% 3.89% 445.gobmk 6.08% 7.92% 42.27% 456.hmmer 10.36% 11.25% 35.23% 458.sjeng 5.08% 5.42% 14.36% 462.libquantum 1.71% 1.96% 6.36% 464.h264ref 15.61% 16.56% 43.92% 471.omnetpp 11.93% 15.84% 60.09% 473.astar 3.11% 3.69% 14.18% 483.xalancbmk 56.29% 81.63% 353.22% geomean 15.60% 18.30% 57.81% Debug info size change for -gmlt binary with this patch: 433.milc 13.46% 444.namd 5.35% 447.dealII 18.21% 450.soplex 14.68% 453.povray 19.65% 470.lbm 6.03% 482.sphinx3 11.21% 400.perlbench 8.91% 401.bzip2 4.41% 403.gcc 8.56% 429.mcf 8.24% 445.gobmk 29.47% 456.hmmer 8.19% 458.sjeng 6.05% 462.libquantum 11.23% 464.h264ref 5.93% 471.omnetpp 31.89% 473.astar 16.20% 483.xalancbmk 44.62% geomean 16.83% Reviewers: davidxl, andreadb, rob.lougher, dblaikie, echristo Reviewed By: dblaikie, echristo Subscribers: hfinkel, rob.lougher, andreadb, gbedwell, cfe-commits, probinson, llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D25435 llvm-svn: 292458
* Move vtable type metadata emission behind a cc1-level flag.Peter Collingbourne2017-01-181-1/+9
| | | | | | | | | | | | | In ThinLTO mode, type metadata will require the module to be written as a multi-module bitcode file, which is currently incompatible with the Darwin linker. It is also useful to be able to enable or disable multi-module bitcode for testing purposes. This introduces a cc1-level flag, -f{,no-}lto-unit, which is used by the driver to enable multi-module bitcode on all but Darwin+ThinLTO, and can also be used to enable/disable the feature manually. Differential Revision: https://reviews.llvm.org/D28877 llvm-svn: 292448
* Revert "[xray] try to fix thumb buildbot"Renato Golin2017-01-181-1/+0
| | | | | | This reverts commit r292268, as it didn't fix the buildbots. llvm-svn: 292355
* [xray] try to fix thumb buildbotRenato Golin2017-01-171-0/+1
| | | | llvm-svn: 292268
* Fix AArch64 global-merge backend option name.Frederic Riss2017-01-171-2/+2
| | | | | | | | -mglobal-merge is translated to the appropriate backend option in the driver. r277322 changed the AArch64 option name in the backend, but the driver was never updated. llvm-svn: 292192
* unique_ptrify Driver::ToolChainsDavid Blaikie2017-01-131-44/+45
| | | | llvm-svn: 291938
* unique_ptrify createDriverOptTableDavid Blaikie2017-01-132-11/+9
| | | | llvm-svn: 291919
* Address review comments on r290392:Chandler Carruth2017-01-121-4/+6
| | | | | | | | | | | | | - Don't break using '-mllvm -disable-llvm-optzns' (yet). - Don't add support for '-mllvm -disable-llvm-passes'. This is important for LLVM 4 as we haven't yet really told folks this is coming. I'll add release notes about this. I've also added some explicit testing of this so its more obvious what is happening here. llvm-svn: 291850
* [Driver] Add openSuse AArch64 TripleKostya Kortchinsky2017-01-101-1/+1
| | | | | | | | | | | | | | | | Summary: openSuse has AArch64 support, with images running on the Raspberry Pi 3. The libraries and headers live under the aarch64-suse-linux subdirectory, which is currently not in the AArch64 triples list. Address this by adding the corresponding string to AArch64Triples. Reviewers: chandlerc, bruno, bkramer, rengolin Subscribers: aemerson, rengolin, cfe-commits Differential Revision: https://reviews.llvm.org/D28238 llvm-svn: 291598
* Extend NetBSD/AArch64 to cover Big Endian as well.Joerg Sonnenberger2017-01-092-0/+2
| | | | llvm-svn: 291436
* [ToolChains] Use "static" instead of an anonymous namespace for a function. NFCJustin Lebar2017-01-051-4/+2
| | | | llvm-svn: 291133
* [Driver] Driver changes to support CUDA compilation on Windows.Justin Lebar2017-01-055-15/+77
| | | | | | | | | | | | | | | | | | | | | Summary: For the most part this is straightforward: Just add a CudaInstallation object to the MSVC and MinGW toolchains. CudaToolChain has to override computeMSVCVersion so that Clang::constructJob passes the right version flag to cc1. We have to modify IsWindowsMSVC and friends in Clang::constructJob to be true when compiling CUDA device code on Windows for the same reason. Depends on: D28319 Reviewers: tra Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D28320 llvm-svn: 291131
* [CUDA] Make CUDAInstallationDetector take the host triple in its constructor.Justin Lebar2017-01-052-4/+4
| | | | | | | | | | | | | | | Summary: Previously it was taking the true target triple, which is not really what it needs: The location of the CUDA installation depends on the host OS. Reviewers: tra Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D28319 llvm-svn: 291130
* Add AVR target and toolchain to ClangDylan McKay2017-01-055-0/+51
| | | | | | | | | | | | | | | | | Summary: Authored by Senthil Kumar Selvaraj This patch adds barebones support in Clang for the (experimental) AVR target. It uses the integrated assembler for assembly, and the GNU linker for linking, as lld doesn't know about the target yet. The DataLayout string is the same as the one in AVRTargetMachine.cpp. The alignment specs look wrong to me, as it's an 8 bit target and all types only need 8 bit alignment. Clang failed with a datalayout mismatch error when I tried to change it, so I left it that way for now. Reviewers: rsmith, dylanmckay, cfe-commits, rengolin Subscribers: rengolin, jroelofs, wdng Differential Revision: https://reviews.llvm.org/D27123 llvm-svn: 291082
* Accept and ignore -Wa,-mbig-obj on COFF targets for gas compatibilityReid Kleckner2017-01-041-0/+4
| | | | | | | | | LLVM's integrated assembler will automatically switch to big objects when there are more than 2**16 sections. Patch by Kyra! llvm-svn: 290979
* Add -f[no-]strict-return flag that can be used to avoid undefined behaviourAlex Lorenz2017-01-041-0/+3
| | | | | | | | | | | | | | | | | | | | | | | in non-void functions that fall off at the end without returning a value when compiling C++. Clang uses the new compiler flag to determine when it should treat control flow paths that fall off the end of a non-void function as unreachable. If -fno-strict-return is on, the code generator emits the ureachable and trap IR only when the function returns either a record type with a non-trivial destructor or another non-trivially copyable type. The primary goal of this flag is to avoid treating falling off the end of a non-void function as undefined behaviour. The burden of undefined behaviour is placed on the caller instead: if the caller ignores the returned value then the undefined behaviour is avoided. This kind of behaviour is useful in several cases, e.g. when compiling C code in C++ mode. rdar://13102603 Differential Revision: https://reviews.llvm.org/D27163 llvm-svn: 290960
* Add -plugin-opt=sample-profile for thinLTO build.Dehao Chen2017-01-041-0/+9
| | | | | | | | | | | | Summary: ThinLTO needs to pass down the sample profile file path to linker. Reviewers: tejohnson, davidxl, mehdi_amini Subscribers: bruno, cfe-commits Differential Revision: https://reviews.llvm.org/D27832 llvm-svn: 290919
* [c++17] Implement P0522R0 as written. This allows a template template argumentRichard Smith2016-12-311-0/+7
| | | | | | | | | | | | | | | | | | | to be specified for a template template parameter whenever the parameter is at least as specialized as the argument (when there's an obvious and correct mapping from uses of the parameter to uses of the argument). For example, a template with more parameters can be passed to a template template parameter with fewer, if those trailing parameters have default arguments. This is disabled by default, despite being a DR resolution, as it's fairly broken in its current state: there are no partial ordering rules to cope with template template parameters that have different parameter lists, meaning that code that attempts to decompose template-ids based on arity can hit unavoidable ambiguity issues. The diagnostics produced on a non-matching argument are also pretty bad right now, but I aim to improve them in a subsequent commit. llvm-svn: 290792
* Revert "Driver: switch Windows to static RelocModel"Reid Kleckner2016-12-283-6/+27
| | | | | | | This reverts commit r290569. It caused unforeseen codegen changes for switch jump tables described in PR31488. llvm-svn: 290672
* Driver: switch Windows to static RelocModelSaleem Abdulrasool2016-12-273-27/+6
| | | | | | | | | | | | Windows uses PE/COFF which is inherently position independent. The use of the PIC model is unnecessary. In fact, we would generate invalid code using the ELF PIC model when PIC was enabled previously. Now that we no longer accept -fPIC and -fpoc, this switches the internal representation to the static model to permit us to make PIC modules invalid when targeting Windows. This should not change the code generation, only the internal state management. llvm-svn: 290569
* Driver: warn on -fPIC/-fpic/-fPIE/-fpie on WindowsSaleem Abdulrasool2016-12-261-0/+11
| | | | | | | | | | | | Use of these flags would result in the use of ELF-style PIE/PIC code which is incorrect on Windows. Windows is inherently PIC by means of the DLL slide that occurs at load. This also mirrors the behaviour on GCC for MinGW. Currently, the Windows x86_64 forces the relocation model to PIC (Level 2). This is unchanged for now, though we should remove any assumptions on that and change it to a static relocation model. llvm-svn: 290533
* [PM] Introduce options to enable the (still experimental) new passChandler Carruth2016-12-231-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | manager, and a code path to use it. The option is actually a top-level option but does contain 'experimental' in the name. This is the compromise suggested by Richard in discussions. We expect this option will be around long enough and have enough users towards the end that it merits not being relegated to CC1, but it still needs to be clear that this option will go away at some point. The backend code is a fresh codepath dedicated to handling the flow with the new pass manager. This was also Richard's suggested code structuring to essentially leave a clean path for development rather than carrying complexity or idiosyncracies of how we do things just to share code with the parts of this in common with the legacy pass manager. And it turns out, not much is really in common even though we use the legacy pass manager for codegen at this point. I've switched a couple of tests to run with the new pass manager, and they appear to work. There are still plenty of bugs that need squashing (just with basic experiments I've found two already!) but they aren't in this code, and the whole point is to expose the necessary hooks to start experimenting with the pass manager in more realistic scenarios. That said, I want to *strongly caution* anyone itching to play with this: it is still *very shaky*. Several large components have not yet been shaken down. For example I have bugs in both the always inliner and inliner that I have already spotted and will be fixing independently. Still, this is a fun milestone. =D One thing not in this patch (but that might be very reasonable to add) is some level of support for raw textual pass pipelines such as what Sean had a patch for some time ago. I'm mostly interested in the more traditional flow of getting the IR out of Clang and then running it through opt, but I can see other use cases so someone may want to add it. And of course, *many* features are not yet supported! - O1 is currently more like O2 - None of the sanitizers are wired up - ObjC ARC optimizer isn't wired up - ... So plenty of stuff still lef to do! Differential Revision: https://reviews.llvm.org/D28077 llvm-svn: 290450
OpenPOWER on IntegriCloud