summaryrefslogtreecommitdiff
path: root/test/Driver
Commit message (Collapse)AuthorAgeFilesLines
* Fix -fuse-init-array decision logic on NetBSDJoerg Sonnenberger2019-10-211-0/+15
| | | | | | | | For NetBSD 9 and later, it is the default. On older versions, only ARM and AArch64 use it by default. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@375468 91177308-0d34-0410-b5e6-96231b3b80d8
* [test] Merge Driver/as-w-warnings.c into as-no-warnings.cFangrui Song2019-10-212-9/+7
| | | | | | For -integrated-as RUN lines we can remove -target. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@375439 91177308-0d34-0410-b5e6-96231b3b80d8
* [profile] Do not cache __llvm_profile_get_filename resultVedant Kumar2019-10-181-1/+1
| | | | | | | | | | | | | | | | | When the %m filename pattern is used, the filename is unique to each image, so the cached value is wrong. It struck me that the full filename isn't something that's recomputed often, so perhaps it doesn't need to be cached at all. David Li pointed out we can go further and just hide lprofCurFilename. This may regress workflows that depend on using the set-filename API to change filenames across all loaded DSOs, but this is expected to be very rare. rdar://55137071 Differential Revision: https://reviews.llvm.org/D69137 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@375301 91177308-0d34-0410-b5e6-96231b3b80d8
* [ThinLTOCodeGenerator] Add support for index-based WPDEugene Leviant2019-10-181-3/+2
| | | | | | | | | | This is clang part of the patch. It adds -flto-unit flag for thin LTO builds on Mac and PS4 Differential revision: https://reviews.llvm.org/D68950 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@375224 91177308-0d34-0410-b5e6-96231b3b80d8
* [WebAssembly] -pthread implies -target-feature +sign-extThomas Lively2019-10-181-2/+8
| | | | | | | | | | | | | | | | | Summary: The sign extension proposal was motivated by a desire to not have separate sign-extending atomic operations, so it is meant to be enabled when threads are used. Reviewers: aheejin, dschuff Subscribers: sbc100, jgravelle-google, sunfish, jfb, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69075 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@375199 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang-offload-wrapper][NFC] Use captured name of the entry type in LIT testSergey Dmitriev2019-10-171-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D69140 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@375177 91177308-0d34-0410-b5e6-96231b3b80d8
* Reland: Dead Virtual Function EliminationOliver Stannard2019-10-171-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove dead virtual functions from vtables with replaceNonMetadataUsesWith, so that CGProfile metadata gets cleaned up correctly. Original commit message: Currently, it is hard for the compiler to remove unused C++ virtual functions, because they are all referenced from vtables, which are referenced by constructors. This means that if the constructor is called from any live code, then we keep every virtual function in the final link, even if there are no call sites which can use it. This patch allows unused virtual functions to be removed during LTO (and regular compilation in limited circumstances) by using type metadata to match virtual function call sites to the vtable slots they might load from. This information can then be used in the global dead code elimination pass instead of the references from vtables to virtual functions, to more accurately determine which functions are reachable. To make this transformation safe, I have changed clang's code-generation to always load virtual function pointers using the llvm.type.checked.load intrinsic, instead of regular load instructions. I originally tried writing this using clang's existing code-generation, which uses the llvm.type.test and llvm.assume intrinsics after doing a normal load. However, it is possible for optimisations to obscure the relationship between the GEP, load and llvm.type.test, causing GlobalDCE to fail to find virtual function call sites. The existing linkage and visibility types don't accurately describe the scope in which a virtual call could be made which uses a given vtable. This is wider than the visibility of the type itself, because a virtual function call could be made using a more-visible base class. I've added a new !vcall_visibility metadata type to represent this, described in TypeMetadata.rst. The internalization pass and libLTO have been updated to change this metadata when linking is performed. This doesn't currently work with ThinLTO, because it needs to see every call to llvm.type.checked.load in the linkage unit. It might be possible to extend this optimisation to be able to use the ThinLTO summary, as was done for devirtualization, but until then that combination is rejected in the clang driver. To test this, I've written a fuzzer which generates random C++ programs with complex class inheritance graphs, and virtual functions called through object and function pointers of different types. The programs are spread across multiple translation units and DSOs to test the different visibility restrictions. I've also tried doing bootstrap builds of LLVM to test this. This isn't ideal, because only classes in anonymous namespaces can be optimised with -fvisibility=default, and some parts of LLVM (plugins and bugpoint) do not work correctly with -fvisibility=hidden. However, there are only 12 test failures when building with -fvisibility=hidden (and an unmodified compiler), and this change does not cause any new failures for either value of -fvisibility. On the 7 C++ sub-benchmarks of SPEC2006, this gives a geomean code-size reduction of ~6%, over a baseline compiled with "-O2 -flto -fvisibility=hidden -fwhole-program-vtables". The best cases are reductions of ~14% in 450.soplex and 483.xalancbmk, and there are no code size increases. I've also run this on a set of 8 mbed-os examples compiled for Armv7M, which show a geomean size reduction of ~3%, again with no size increases. I had hoped that this would have no effect on performance, which would allow it to awlays be enabled (when using -fwhole-program-vtables). However, the changes in clang to use the llvm.type.checked.load intrinsic are causing ~1% performance regression in the C++ parts of SPEC2006. It should be possible to recover some of this perf loss by teaching optimisations about the llvm.type.checked.load intrinsic, which would make it worth turning this on by default (though it's still dependent on -fwhole-program-vtables). Differential revision: https://reviews.llvm.org/D63932 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@375094 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix darwin-ld-lto test for some speical pathSteven Wu2019-10-161-2/+4
| | | | | | | | | Fix the test by not assuming the prefix path of the temp directory can be matched by a regex. rdar://problem/56259195 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@375027 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver,ARM] Make -mfloat-abi=soft turn off MVE.Simon Tatham2019-10-161-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since `-mfloat-abi=soft` is taken to mean turning off all uses of the FP registers, it should turn off the MVE vector instructions as well as NEON and scalar FP. But it wasn't doing so. So the options `-march=armv8.1-m.main+mve.fp+fp.dp -mfloat-abi=soft` would cause the underlying LLVM to //not// support MVE (because it knows the real target feature relationships and turned off MVE when the `fpregs` feature was removed), but the clang layer still thought it //was// supported, and would misleadingly define the feature macro `__ARM_FEATURE_MVE`. The ARM driver code already has a long list of feature names to turn off when `-mfloat-abi=soft` is selected. The fix is to add the missing entries `mve` and `mve.fp` to that list. Reviewers: dmgreen Subscribers: kristof.beyls, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69025 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@375001 91177308-0d34-0410-b5e6-96231b3b80d8
* [Clang][OpenMP Offload] Move offload registration code to the wrapperSergey Dmitriev2019-10-151-5/+31
| | | | | | | | | | The final list of OpenMP offload targets becomes known only at the link time and since offload registration code depends on the targets list it makes sense to delay offload registration code generation to the link time instead of adding it to the host part of every fat object. This patch moves offload registration code generation from clang to the offload wrapper tool. This is the last part of the OpenMP linker script elimination patch https://reviews.llvm.org/D64943 Differential Revision: https://reviews.llvm.org/D68746 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374937 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix as-w-option.c on Windows where no assembler existsReid Kleckner2019-10-151-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374936 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang] refactor -Wa,-W test cases.Jian Cai2019-10-151-10/+0
| | | | | | | | Remove REQUIRES and only keep the clang driver tests, since the assembler are already tested with -Wa,--no-warn. This way we could run the test on non-linux platforms and catch breaks on them. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374932 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Driver/working-directory.c testJan Korous2019-10-151-1/+0
| | | | | | Accidentally committed debug print. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374929 91177308-0d34-0410-b5e6-96231b3b80d8
* Reland [Driver] Fix -working-directory issuesJan Korous2019-10-152-2/+19
| | | | | | | | Don't change the default VFS in Driver, update tests & reland. This reverts commit 999f8a7416f8edc54ef92e715fd23c532bcc74d4. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374926 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Dead Virtual Function Elimination"Jorge Gorbe Moya2019-10-141-11/+0
| | | | | | This reverts commit 9f6a873268e1ad9855873d9d8007086c0d01cf4f. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374844 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang] add requirements to -Wa,-W test cases.Jian Cai2019-10-141-0/+3
| | | | | | Include linux as a test requirement. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374837 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support to -Wa,-W in clangJian Cai2019-10-141-0/+14
| | | | | | | | | | | | | | | | | | | | Summary: Currently clang does not support -Wa,-W, which suppresses warning messages in GNU assembler. Add this option for gcc compatibility. https://bugs.llvm.org/show_bug.cgi?id=43651. Reland with differential information. Reviewers: bcain Reviewed By: bcain Subscribers: george.burgess.iv, gbiv, llozano, manojgupta, nickdesaulniers, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68884 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374834 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Add support to -Wa,-W in clang"Jian Cai2019-10-141-14/+0
| | | | | | This reverts commit e72eeca43b9577be2aae55f7603febbf223a6ab3. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374833 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support to -Wa,-W in clangJian Cai2019-10-141-0/+14
| | | | | | | | Currently clang does not support -Wa,-W, which suppresses warning messages in GNU assembler. Add this option for gcc compatibility. https://bugs.llvm.org/show_bug.cgi?id=43651 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374822 91177308-0d34-0410-b5e6-96231b3b80d8
* [ARM] Preserve fpu behaviour for '-crypto'Diogo N. Sampaio2019-10-141-0/+15
| | | | | | | | | | | | | | | | | | | | | Summary: This patch restores the behaviour that -fpu overwrites the architecture obtained from -march or -mcpu flags, not enforcing to disable 'crypto' if march=armv7 and mfpu=neon-fp-armv8. However, it does warn that 'crypto' is ignored when passing mfpu=crypto-neon-fp-armv8. Reviewers: peter.smith, labrinea Reviewed By: peter.smith Subscribers: nickdesaulniers, kristof.beyls, dmgreen, cfe-commits, krisb Tags: #clang Differential Revision: https://reviews.llvm.org/D67608 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374785 91177308-0d34-0410-b5e6-96231b3b80d8
* [RISCV] enable LTO support, pass some options to linker.Sam Elliott2019-10-141-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | Summary: 1. enable LTO need to pass target feature and abi to LTO code generation RISCV backend need the target feature to decide which extension used in code generation. 2. move getTargetFeatures to CommonArgs.h and add ForLTOPlugin flag 3. add general tools::getTargetABI in CommonArgs.h because different target uses different way to get the target ABI. Patch by Kuan Hsu Chen (khchen) Reviewers: lenary, lewis-revill, asb, MaskRay Reviewed By: lenary Subscribers: hiraditya, dschuff, aheejin, fedor.sergeev, mehdi_amini, inglorion, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, MaskRay, zzheng, edward-jones, steven_wu, rogfer01, MartinMosbeck, brucehoult, the_o, dexonsmith, rkruppe, PkmX, jocewei, psnobl, benna, Jim, lenary, s.egerton, pzheng, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67409 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374774 91177308-0d34-0410-b5e6-96231b3b80d8
* Prefer 'env not' over 'not env' in tests.Nico Weber2019-10-142-5/+5
| | | | | | | | | That way, lit's builtin 'env' command can be used for the 'env' bit. Also it's clearer that way that the 'not' shouldn't cover 'env' failures. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374749 91177308-0d34-0410-b5e6-96231b3b80d8
* Slightly relax restriction on exact order arguments must appear.Douglas Yung2019-10-121-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374627 91177308-0d34-0410-b5e6-96231b3b80d8
* Dead Virtual Function EliminationOliver Stannard2019-10-111-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, it is hard for the compiler to remove unused C++ virtual functions, because they are all referenced from vtables, which are referenced by constructors. This means that if the constructor is called from any live code, then we keep every virtual function in the final link, even if there are no call sites which can use it. This patch allows unused virtual functions to be removed during LTO (and regular compilation in limited circumstances) by using type metadata to match virtual function call sites to the vtable slots they might load from. This information can then be used in the global dead code elimination pass instead of the references from vtables to virtual functions, to more accurately determine which functions are reachable. To make this transformation safe, I have changed clang's code-generation to always load virtual function pointers using the llvm.type.checked.load intrinsic, instead of regular load instructions. I originally tried writing this using clang's existing code-generation, which uses the llvm.type.test and llvm.assume intrinsics after doing a normal load. However, it is possible for optimisations to obscure the relationship between the GEP, load and llvm.type.test, causing GlobalDCE to fail to find virtual function call sites. The existing linkage and visibility types don't accurately describe the scope in which a virtual call could be made which uses a given vtable. This is wider than the visibility of the type itself, because a virtual function call could be made using a more-visible base class. I've added a new !vcall_visibility metadata type to represent this, described in TypeMetadata.rst. The internalization pass and libLTO have been updated to change this metadata when linking is performed. This doesn't currently work with ThinLTO, because it needs to see every call to llvm.type.checked.load in the linkage unit. It might be possible to extend this optimisation to be able to use the ThinLTO summary, as was done for devirtualization, but until then that combination is rejected in the clang driver. To test this, I've written a fuzzer which generates random C++ programs with complex class inheritance graphs, and virtual functions called through object and function pointers of different types. The programs are spread across multiple translation units and DSOs to test the different visibility restrictions. I've also tried doing bootstrap builds of LLVM to test this. This isn't ideal, because only classes in anonymous namespaces can be optimised with -fvisibility=default, and some parts of LLVM (plugins and bugpoint) do not work correctly with -fvisibility=hidden. However, there are only 12 test failures when building with -fvisibility=hidden (and an unmodified compiler), and this change does not cause any new failures for either value of -fvisibility. On the 7 C++ sub-benchmarks of SPEC2006, this gives a geomean code-size reduction of ~6%, over a baseline compiled with "-O2 -flto -fvisibility=hidden -fwhole-program-vtables". The best cases are reductions of ~14% in 450.soplex and 483.xalancbmk, and there are no code size increases. I've also run this on a set of 8 mbed-os examples compiled for Armv7M, which show a geomean size reduction of ~3%, again with no size increases. I had hoped that this would have no effect on performance, which would allow it to awlays be enabled (when using -fwhole-program-vtables). However, the changes in clang to use the llvm.type.checked.load intrinsic are causing ~1% performance regression in the C++ parts of SPEC2006. It should be possible to recover some of this perf loss by teaching optimisations about the llvm.type.checked.load intrinsic, which would make it worth turning this on by default (though it's still dependent on -fwhole-program-vtables). Differential revision: https://reviews.llvm.org/D63932 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374539 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -fgnuc-version= to control __GNUC__ and other GCC macrosReid Kleckner2019-10-103-4/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I noticed that compiling on Windows with -fno-ms-compatibility had the side effect of defining __GNUC__, along with __GNUG__, __GXX_RTTI__, and a number of other macros for GCC compatibility. This is undesirable and causes Chromium to do things like mix __attribute__ and __declspec, which doesn't work. We should have a positive language option to enable GCC compatibility features so that we can experiment with -fno-ms-compatibility on Windows. This change adds -fgnuc-version= to be that option. My issue aside, users have, for a long time, reported that __GNUC__ doesn't match their expectations in one way or another. We have encouraged users to migrate code away from this macro, but new code continues to be written assuming a GCC-only environment. There's really nothing we can do to stop that. By adding this flag, we can allow them to choose their own adventure with __GNUC__. This overlaps a bit with the "GNUMode" language option from -std=gnu*. The gnu language mode tends to enable non-conforming behaviors that we'd rather not enable by default, but the we want to set things like __GXX_RTTI__ by default, so I've kept these separate. Helps address PR42817 Reviewed By: hans, nickdesaulniers, MaskRay Differential Revision: https://reviews.llvm.org/D68055 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374449 91177308-0d34-0410-b5e6-96231b3b80d8
* Update clang tests for new LLVM IR backslash printing in r374415Reid Kleckner2019-10-101-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374416 91177308-0d34-0410-b5e6-96231b3b80d8
* [Clang][OpenMP Offload] Add new tool for wrapping offload device binariesSergey Dmitriev2019-10-093-120/+155
| | | | | | | | | | This patch removes the remaining part of the OpenMP offload linker scripts which was used for inserting device binaries into the output linked binary. Device binaries are now inserted into the host binary with a help of the wrapper bit-code file which contains device binaries as data. Wrapper bit-code file is dynamically created by the clang driver with a help of new tool clang-offload-wrapper which takes device binaries as input and produces bit-code file with required contents. Wrapper bit-code is then compiled to an object and resulting object is appended to the host linking by the clang driver. This is the second part of the patch for eliminating OpenMP linker script (please see https://reviews.llvm.org/D64943). Differential Revision: https://reviews.llvm.org/D68166 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374219 91177308-0d34-0410-b5e6-96231b3b80d8
* [HIP] Fix -save-tempsYaxun Liu2019-10-091-0/+41
| | | | | | | | | | | Currently clang does not save some of the intermediate file generated during device compilation for HIP when -save-temps is specified. This patch fixes that. Differential Revision: https://reviews.llvm.org/D68665 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374198 91177308-0d34-0410-b5e6-96231b3b80d8
* [mips] Set default float ABI to "soft" on FreeBSDSimon Atanasyan2019-10-091-0/+8
| | | | | | | | Initial patch by Kyle Evans. Fix PR43596 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374154 91177308-0d34-0410-b5e6-96231b3b80d8
* [driver][hip] Skip bundler if host action is nothing.Michael Liao2019-10-081-0/+11
| | | | | | | | | | | | Reviewers: sfantao, tra, yaxunl Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68652 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374097 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang] Accept -ftrivial-auto-var-init in clang-clVitaly Buka2019-10-071-0/+2
| | | | | | | | | | | | Reviewers: eugenis, rnk Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68608 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373992 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-cl: Ignore the new /ZH optionsHans Wennborg2019-10-071-0/+3
| | | | | | | | | These were added to the MS docs in https://github.com/MicrosoftDocs/cpp-docs/commit/85b9b6967e58e485251450f7451673f6fc873e88 and are supposedly available in VS 2019 16.4 (though my 2019 Preview, version 16.4.0-pre.1.0 don't seem to have them.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373887 91177308-0d34-0410-b5e6-96231b3b80d8
* [HIP] Use option -nogpulib to disable linking device libYaxun Liu2019-10-031-0/+11
| | | | | | | Differential Revision: https://reviews.llvm.org/D68300 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373649 91177308-0d34-0410-b5e6-96231b3b80d8
* [HIP] Enable specifying different default gpu arch for HIP/CUDA.Michael Liao2019-10-031-0/+7
| | | | | | | | | | | | Reviewers: tra, yaxunl Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68394 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373634 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix driver tests when `LLVM_ENABLE_PER_TARGET_RUNTIME_DIR` is `ON`Serge Pavlov2019-10-032-7/+35
| | | | | | | | | | | | | | | | Some Driver tests relied on the default resource direcory having per-os per-arch subdirectory layout, and when clang is built with `-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON`, those test fail, because clang by default assumes per-target subdirectories. Explicitly set `-resource-dir` flag to point to a tree with per-os per-arch layout. See also: D45604, D62469 Differential Revision: https://reviews.llvm.org/D66981 Patch by Sergej Jaskiewicz <jaskiewiczs@icloud.com>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373565 91177308-0d34-0410-b5e6-96231b3b80d8
* [HIP] Support -emit-llvm for device compilationYaxun Liu2019-10-031-0/+72
| | | | | | | | | | | | Sometimes it is useful to compile HIP device code to LLVM BC. It is not convenient to use clang -cc1 since there are lots of options needed. This patch allows clang driver to compile HIP device code to LLVM BC with -emit-llvm -c. Differential Revision: https://reviews.llvm.org/D68284 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373561 91177308-0d34-0410-b5e6-96231b3b80d8
* [ThinLTO] Enable index-only WPD from clangTeresa Johnson2019-10-011-1/+1
| | | | | | | | | | | | | | | | | | Summary: To trigger the index-only Whole Program Devirt support added to LLVM, we need to be able to specify -fno-split-lto-unit in conjunction with -fwhole-program-vtables. Keep the default for -fwhole-program-vtables as -fsplit-lto-unit, but don't error on that option combination. Reviewers: pcc Subscribers: mehdi_amini, inglorion, steven_wu, dexonsmith, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68029 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373370 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Driver/modules.cpp test to work when build directory name contains '.s'Tom Stellard2019-09-301-1/+1
| | | | | | | | | | | | Reviewers: dyung, rsmith, hansw Subscribers: mati865, mgorny, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66176 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373275 91177308-0d34-0410-b5e6-96231b3b80d8
* Driver tests: set `--sysroot=""` to support clang with `DEFAULT_SYSROOT`Serge Pavlov2019-09-284-20/+38
| | | | | | | | | | | | When testing clang that has been compiled with `-DDEFAULT_SYSROOT` set to some path, some tests would fail. Override sysroot to be empty string for the tests to succeed when clang is configured with `DEFAULT_SYSROOT`. Differential Revision: https://reviews.llvm.org/D66834 Patch by Sergej Jaskiewicz <jaskiewiczs@icloud.com>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373147 91177308-0d34-0410-b5e6-96231b3b80d8
* [Clang][OpenMP Offload] Create start/end symbols for the offloading entry ↵Sergey Dmitriev2019-09-271-8/+0
| | | | | | | | | | | | table with a help of a linker Linker automatically provides __start_<section name> and __stop_<section name> symbols to satisfy unresolved references if <section name> is representable as a C identifier (see https://sourceware.org/binutils/docs/ld/Input-Section-Example.html for details). These symbols indicate the start address and end address of the output section respectively. Therefore, renaming OpenMP offload entries section name from ".omp.offloading_entries" to "omp_offloading_entries" to use this feature. This is the first part of the patch for eliminating OpenMP linker script (please see https://reviews.llvm.org/D64943). Differential Revision: https://reviews.llvm.org/D68070 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373118 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the 'directory' field in DumpCompilationDatabase and add testHans Wennborg2019-09-271-2/+2
| | | | | | | This broke in r371027 due to a missing negation (llvm::sys::fs::current_path returns false on success). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373049 91177308-0d34-0410-b5e6-96231b3b80d8
* Only pass -coverage-notes-file when emitting coverageReid Kleckner2019-09-261-0/+6
| | | | | | | | | | | | | | | | The only functional change here is that -coverage-notes-file is not passed to -cc1 in some situations. This code appears to be trying to put the gcno and gcda output next to the final object file, but it's doing that in a really convoluted way that needs to be re-examined. It looks for -c or -S in the original command, and then looks at the -o argument if present in order to handle the -fno-integrated-as case. However, this doesn't work if this is a link command with multiple inputs. I looked into fixing this, but the check-profile test suite has a lot of dependencies on this behavior, so I left it all alone. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373004 91177308-0d34-0410-b5e6-96231b3b80d8
* Un-XFAIL coverage_no_integrated_as.c test on WindowsReid Kleckner2019-09-261-7/+6
| | | | | | | | | | | You can't use -fno-integrated-as for *-msvc triples because no usable standalone assembler exists. Perhaps we could teach clang to emit a .s and then reinvoke itself, but that's a bit silly. Anyway, fix the test by using an Itanium ABI triple, which will become mingw, which will assume gnu as is a usable assembler. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372994 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver] Always use -z separate-loadable-segments with lld on FuchsiaFangrui Song2019-09-251-1/+1
| | | | | | | | | | The option was added to lld in D67481/372807. Reviewed By: phosek Differential Revision: https://reviews.llvm.org/D68009 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372814 91177308-0d34-0410-b5e6-96231b3b80d8
* [SystemZ] Support z15 processor nameUlrich Weigand2019-09-201-0/+2
| | | | | | | | | | | | The recently announced IBM z15 processor implements the architecture already supported as "arch13" in LLVM. This patch adds support for "z15" as an alternate architecture name for arch13. Corrsponding LLVM support was committed as rev. 372435. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372436 91177308-0d34-0410-b5e6-96231b3b80d8
* [mips] Pass "xgot" flag as a subtarget featureSimon Atanasyan2019-09-182-2/+12
| | | | | | | | | We need "xgot" flag in the MipsAsmParser to implement correct expansion of some pseudo instructions in case of using 32-bit GOT (XGOT). MipsAsmParser does not have reference to MipsSubtarget but has a reference to "feature bit set". git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372220 91177308-0d34-0410-b5e6-96231b3b80d8
* [ARM] Update clang for removal of vfp2d16 and vfp2d16spEli Friedman2019-09-171-9/+9
| | | | | | | | | | Matching fix for https://reviews.llvm.org/D67375 (r372186). Differential Revision: https://reviews.llvm.org/D67467 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372187 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver] Fix multiple bugs related to dependency file options: -M -MM -MD ↵Fangrui Song2019-09-141-4/+22
| | | | | | | | | | | -MMD -MT -MQ -M -o test.i => dependency file is test.d, not test.i -MM -o test.i => dependency file is test.d, not test.i -M -MMD => bogus warning -Wunused-command-line-argument -M MT dummy => -w not rendered git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371918 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver] Improve Clang::getDependencyFileName and its tests after rC371853Fangrui Song2019-09-143-26/+17
| | | | | | | The test file name metadata-with-dots.c is confusing because -MD and -MMD have nothing to do with metadata. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371917 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix test to use %t for newly created files.Tim Shen2019-09-131-5/+5
| | | | | | | | This is both for consistency with other `mkdir`s in tests, and fixing permission issues with the non-temporary cwd during testing (they are not always writable). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371897 91177308-0d34-0410-b5e6-96231b3b80d8