summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver
Commit message (Collapse)AuthorAgeFilesLines
...
* IR: Represent -ggnu-pubnames with a flag on the DICompileUnit.Peter Collingbourne2017-09-121-4/+2
| | | | | | | | This allows the flag to be persisted through to LTO. Differential Revision: https://reviews.llvm.org/D37655 llvm-svn: 313078
* [Driver] Darwin: Link in the profile runtime archive firstVedant Kumar2017-09-122-20/+47
| | | | | | | | | | | | | | | | | | | | 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
* [ubsan] Extend default blacklist support to integer/nullability groupsVedant Kumar2017-09-121-1/+1
| | | | | | | The default blacklist should also apply when the integer or nullability checks are enabled. llvm-svn: 313062
* [ARM] Option for reading thread pointer from coprocessor registerStrahinja Petrovic2017-09-122-0/+31
| | | | | | | | | This patch enables option for reading thread pointer directly from coprocessor register (-mtp=soft/cp15). Differential Revision: https://reviews.llvm.org/D34878 llvm-svn: 313018
* [Driver] Fuchsia targets default to -fasynchronous-unwind-tablesPetr Hosek2017-09-121-0/+3
| | | | | | | | | | | | This regressed for x86-64 in r307856 because it's no longer inherited from Generic_GCC. We'd never noticed that it was missing other targets (i.e. aarch64), but Fuchsia is uniform across all machines. Patch by Roland McGrath Differential Revision: https://reviews.llvm.org/D37723 llvm-svn: 312989
* [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
* Driver: default to `-fno-use-cxatexit` on WindowsSaleem Abdulrasool2017-09-111-1/+1
| | | | | | | | | | This primarily impacts the Windows MSVC and Windows itanium environments. Windows MSVC does not use `__cxa_atexit` and Itanium follows suit. Simplify the logic for the default value calculation and blanket the Windows environments to default to off for use of `__cxa_atexit`. llvm-svn: 312941
* Fix validation of the -mthread-model flag in the Clang driverJonathan Roelofs2017-09-072-6/+5
| | | | | | | | | | | | | The ToolChain class validates the -mthread-model flag in the constructor which doesn't work correctly since the thread model methods are virtual methods. The check is moved into Clang::ConstructJob() when constructing the internal command line. https://reviews.llvm.org/D37496 Patch by: Ian Tessier! llvm-svn: 312748
* [CUDA] Added rudimentary support for CUDA-9 and sm_70.Artem Belevich2017-09-071-37/+51
| | | | | | | | | | | | | For now CUDA-9 is not included in the list of CUDA versions clang searches for, so the path to CUDA-9 must be explicitly passed via --cuda-path=. On LLVM side NVPTX added sm_70 GPU type which bumps required PTX version to 6.0, but otherwise is equivalent to sm_62 at the moment. Differential Revision: https://reviews.llvm.org/D37576 llvm-svn: 312734
* [mips] Replace Triple::Environment check by the isGNUEnvironment() call. NFCSimon Atanasyan2017-09-072-3/+3
| | | | llvm-svn: 312701
* Fix ARM bare metal driver to support atomicsJonathan Roelofs2017-09-062-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | The new bare metal support only supports the single thread model. This causes the builtin atomic functions (e.g.: __atomic_fetch_add) to not generate thread-safe assembly for these operations, which breaks our firmware. We target bare metal, and need to atomically modify variables in our interrupt routines, and task threads. Internally, the -mthread-model flag determines whether to lower or expand atomic operations (see D4984). This change removes the overridden thread model methods, and instead relies on the base ToolChain class to validate the thread model (which already includes logic to validate single thread model support). If the single thread model is required, the -mthread-model flag will have to be provided. As a workaround "-mthread-model posix" could be provided, but it only works due to a bug in the validation of the -mthread-model flag (separate patch coming to fix this). https://reviews.llvm.org/D37493 Patch by: Ian Tessier! llvm-svn: 312651
* Driver: delete some dead code (NFC)Saleem Abdulrasool2017-09-061-13/+0
| | | | | | | | | This code has been `#if 0`'ed out for a very long time. After speaking with Duncan, opt to remove it even if it is something which should be fixed. If the underlying issue is still valid, this can be restored with proper explanation and tests. llvm-svn: 312618
* Driver: remove unused variable (NFC)Saleem Abdulrasool2017-09-061-7/+4
| | | | | | | Remove `IsHosted` which is no longer needed in `RenderSSPOptions` after SVN r312595. The single use can now be inlined. NFC llvm-svn: 312616
* Fix indentation mistake from r312595Bruno Cardoso Lopes2017-09-061-1/+1
| | | | llvm-svn: 312599
* [Darwin] Enable -fstack-protector (back) by default with -ffreestandingBruno Cardoso Lopes2017-09-051-5/+0
| | | | | | | | Go back to behavior prior to r289005. rdar://problem/32987198 llvm-svn: 312595
* [Bash-autocomplete] Fix crash when invoking --autocomplete without value.Raphael Isemann2017-09-051-6/+4
| | | | | | | | | | | | | | | | Summary: Currently clang segfaults when invoked with `clang --autocomplete=`. This patch adds the necessary boundary checks and some tests for corner cases like this. Reviewers: yamaguchi Reviewed By: yamaguchi Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D37465 llvm-svn: 312533
* [AMDGPU] Implement infrastructure to set options in AMDGPUToolChainAndrey Kasaurov2017-09-052-3/+54
| | | | | | | | | | | | In current OpenCL implementation some options are set in OpenCL RT/Driver, which causes discrepancy between online and offline paths. Implement infrastructure to move options from OpenCL RT/Driver to AMDGPUToolChain using overloaded TranslateArgs() method. Create map for default options values, as Options.td doesn't support default values (in contrast with OPTIONS.def). Add two driver options: -On and -mNN (like -O3, -m64). Some minor formatting changes to follow the clang-format style. Differential Revision: https://reviews.llvm.org/D37386 llvm-svn: 312524
* Driver; extract target specific option application (NFC)Saleem Abdulrasool2017-09-032-76/+76
| | | | | | | | | Extract the target specific option application. This is a huge switch which was inlined into the `ConstructJob` option which adds a large amount of code to the already large function. Extract it to simply reduce the line count. NFC llvm-svn: 312436
* Driver: extract debugging related options (NFC)Saleem Abdulrasool2017-09-031-163/+182
| | | | | | | | | | Out-of-line the logic for selecting the debug information handling. This is still split across the new function and partially inline in the job construction. This is needed since the split portion attempts to record the "-cc1" arguments. This needs to be the very last item to ensure that all the flags are recorded. NFC. llvm-svn: 312435
* Driver: move `-mfpmath` into FP Options (NFC)Saleem Abdulrasool2017-09-031-5/+5
| | | | | | | Move the `-mfpmath` handling with the rest of the floating point optimization flags. llvm-svn: 312434
* Driver: extract `-fbuiltin` option handling (NFC)Saleem Abdulrasool2017-09-011-47/+51
| | | | | | | | | Extract the handling of the `-fbuiltin` family of flags to the driver. This centralises the handling of those options, keeping the long standing `#if 0`'ed block of code. This requires some additional code archaeology to determine if we need to enable this functionality. llvm-svn: 312392
* Driver: extract floating point optimization handling (NFC)Saleem Abdulrasool2017-09-011-154/+160
| | | | | | | | Extract the logic for the floating point handling into its own function. None of this information is needed for calculating the remainder of the arguments to the frontend. NFC llvm-svn: 312385
* Driver: extract diagnostics flag handling (NFC)Saleem Abdulrasool2017-09-011-107/+116
| | | | | | | | Extract a function to render the diagnostics options to the clang frontend. This continues the simplification of the clang cc1 command line invocation generation. NFC llvm-svn: 312351
* [libFuzzer] switch -fsanitize=fuzzer from trace-pc-guard to inline-8bit-countersKostya Serebryany2017-09-011-1/+1
| | | | llvm-svn: 312346
* Driver: extract ObjC option rendering (NFC)Saleem Abdulrasool2017-09-011-84/+87
| | | | | | | | | | | | | Extract the ObjC option rendering for the frontend. This localises the option translation. It augments the existing `AddRuntimeObjCOptions` which handles the runtime/ABI versioning flags only. This new function handles the non-runtime selecting flags. This logic was previously inlined into the `ConstructJob` function. Minor change to the flag ordering to group the blocks related flags together. llvm-svn: 312344
* Driver: extract modules flag handling (NFC)Saleem Abdulrasool2017-09-011-157/+162
| | | | | | | Extract a function to render the options related to modules. This reduces the cyclomatic complexity of the `ConstructJob` function. NFC. llvm-svn: 312330
* [clang-cl] Explicitly set object format to COFF in CL modeOleg Ranevskyy2017-08-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Currently object format is taken from the default target triple. For toolchains with a non-COFF default target this may result in an object format inappropriate for pc-windows and lead to compilation issues. For example, the default triple `aarch64-linux-elf` may produce something like `aarch64-pc-windows-msvc19.0.24215-elf` in CL mode. Clang creates `MicrosoftARM64TargetInfo` for such triple with data layout `e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128`. On the other hand, the AArch64 backend in `computeDataLayout` detects a non-COFF target and selects `e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128` as data layout for little endian. Different layouts used by clang and the backend cause an error: ``` error: backend data layout 'e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128' does not match expected target description 'e-m:w-p:64:64-i32:32-i64:64-i128:128-n32:64-S128' ``` This can be observed on the clang's Driver/cl-pch.c test with AArch64 as a default target. This patch enforces COFF in CL mode. Reviewers: hans Reviewed By: hans Subscribers: cfe-commits, aemerson, asl, kristof.beyls Differential Revision: https://reviews.llvm.org/D37336 llvm-svn: 312275
* Driver: extract ARCMT flag construction (NFC)Saleem Abdulrasool2017-08-311-69/+73
| | | | | | | | Extract the ARC migration tool flag handling into its own function. This simplifies the flow of the clang frontend command line construction function. NFC. llvm-svn: 312244
* [modules] Add ability to specify module name to module file mapping (reapply)Boris Kolpackov2017-08-311-2/+7
| | | | | | | | | | | | | | | | | | | | Extend the -fmodule-file option to support the [<name>=]<file> value format. If the name is omitted, then the old semantics is preserved (the module file is loaded whether needed or not). If the name is specified, then the mapping is treated as just another prebuilt module search mechanism, similar to -fprebuilt-module-path, and the module file is only loaded if actually used (e.g., via import). With one exception: this mapping also overrides module file references embedded in other modules (which can be useful if module files are moved/renamed as often happens during remote compilation). This override semantics requires some extra work: we now store the module name in addition to the file name in the serialized AST representation. Reviewed By: rsmith Differential Revision: https://reviews.llvm.org/D35020 llvm-svn: 312220
* [SanitizeCoverage] Enable stack-depth coverage for -fsanitize=fuzzerMatt Morehouse2017-08-301-1/+5
| | | | | | | | | | | | | | | | | | Summary: - Don't sanitize __sancov_lowest_stack. - Don't instrument leaf functions. - Add CoverageStackDepth to Fuzzer and FuzzerNoLink. - Only enable on Linux. Reviewers: vitalybuka, kcc, george.karpenkov Reviewed By: kcc Subscribers: kubamracek, cfe-commits, llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D37156 llvm-svn: 312185
* Driver: out-of-line static analyzer flag handling (NFC)Saleem Abdulrasool2017-08-301-72/+74
| | | | | | | | Extract the analyzer flag handling into its own function to reduce the overall complexity of the construction of the clang compiler arguments. NFC. llvm-svn: 312124
* Revert r312105 [modules] Add ability to specify module name to module file ↵Victor Leschuk2017-08-301-7/+2
| | | | | | | | mapping Looks like it breaks win10 builder. llvm-svn: 312112
* [modules] Add ability to specify module name to module file mappingBoris Kolpackov2017-08-301-2/+7
| | | | | | | | | | | | | | | | | | | | Extend the -fmodule-file option to support the [<name>=]<file> value format. If the name is omitted, then the old semantics is preserved (the module file is loaded whether needed or not). If the name is specified, then the mapping is treated as just another prebuilt module search mechanism, similar to -fprebuilt-module-path, and the module file is only loaded if actually used (e.g., via import). With one exception: this mapping also overrides module file references embedded in other modules (which can be useful if module files are moved/renamed as often happens during remote compilation). This override semantics requires some extra work: we now store the module name in addition to the file name in the serialized AST representation. Reviewed By: rsmith Differential Revision: https://reviews.llvm.org/D35020 llvm-svn: 312105
* Driver: refactor SSP argument handling (NFC)Saleem Abdulrasool2017-08-291-48/+59
| | | | | | | | Out-of-line the SSP argument handling for the sake of readability. Pass along some state information to avoid re-computing the command line flags. llvm-svn: 312084
* Driver: refactor OpenCL argument forwardingSaleem Abdulrasool2017-08-291-38/+26
| | | | | | | | | | | Extract the argument forwarding for OpenCL arguments. Make this more data driven as we are just repeating the argument name and spelling. This costs a slight bit more memory due to the string duplication, but makes it easier to follow. It should be possible to forward the internal string representation from the TableGen data to avoid this. But, this makes the code simpler to follow for now. llvm-svn: 312083
* Driver: reuse existing `D` variable (NFC)Saleem Abdulrasool2017-08-291-10/+9
| | | | | | | Change the rest of the function to use the `D` variable for the driver instance. NFC. llvm-svn: 312082
* Driver: hoist a local variable (NFC)Saleem Abdulrasool2017-08-291-32/+27
| | | | | | | Hoist the `getToolChain().getTriple()` to a variable rather than re-fetching it every time. NFC. llvm-svn: 312081
* Restore clang_rt library name on i686-android.Evgeniy Stepanov2017-08-291-0/+4
| | | | | | | | | | | | | | | | | Summary: Recent changes canonicalized clang_rt library names to refer to "i386" on all x86 targets. Android historically uses i686. This change adds a special case to keep i686 in all clang_rt libraries when targeting Android. Reviewers: hans, mgorny, beanz Subscribers: srhines, cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D37278 llvm-svn: 312048
* Revert "[SanitizeCoverage] Enable stack-depth coverage for -fsanitize=fuzzer"Matt Morehouse2017-08-291-5/+1
| | | | | | This reverts r312026 due to bot breakage. llvm-svn: 312047
* Re-enable stack depth instrumentation on Windows.Matt Morehouse2017-08-291-2/+2
| | | | | | | Specified tls_model attribute properly. Should compile on Windows now. llvm-svn: 312037
* Disable stack depth tracking on Windows.Matt Morehouse2017-08-291-2/+2
| | | | | | Windows doesn't support the tls_model attribute. llvm-svn: 312032
* Minimal runtime for UBSan.Evgeniy Stepanov2017-08-292-3/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: An implementation of ubsan runtime library suitable for use in production. Minimal attack surface. * No stack traces. * Definitely no C++ demangling. * No UBSAN_OPTIONS=log_file=/path (very suid-unfriendly). And no UBSAN_OPTIONS in general. * as simple as possible Minimal CPU and RAM overhead. * Source locations unnecessary in the presence of (split) debug info. * Values and types (as in A+B overflows T) can be reconstructed from register/stack dumps, once you know what type of error you are looking at. * above two items save 3% binary size. When UBSan is used with -ftrap-function=abort, sometimes it is hard to reason about failures. This library replaces abort with a slightly more informative message without much extra overhead. Since ubsan interface in not stable, this code must reside in compiler-rt. Reviewers: pcc, kcc Subscribers: srhines, mgorny, aprantl, krytarowski, llvm-commits Differential Revision: https://reviews.llvm.org/D36810 llvm-svn: 312029
* [SanitizeCoverage] Enable stack-depth coverage for -fsanitize=fuzzerMatt Morehouse2017-08-291-1/+5
| | | | | | | | | | | | | | | | | | Summary: - Don't sanitize __sancov_lowest_stack. - Don't instrument leaf functions. - Add CoverageStackDepth to Fuzzer and FuzzerNoLink. - Disable stack depth tracking on Mac. Reviewers: vitalybuka, kcc, george.karpenkov Reviewed By: kcc Subscribers: kubamracek, cfe-commits, llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D37156 llvm-svn: 312026
* [Bash-autocomplete] Refactor autocomplete code into own functionYuka Takahashi2017-08-291-43/+51
| | | | | | | | | | | | | | Summary: We wrote many codes in HandleImediateArgs, so I've refactored it into handleAutocompletions. Reviewers: v.g.vassilev, teemperor Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D37249 llvm-svn: 312018
* Use class to pass information about executable nameSerge Pavlov2017-08-292-22/+24
| | | | | | | | | | | | | Information about clang executable name components, such as target and driver mode, was passes in std::pair. With this change it is passed in a special structure. It improves readability and makes access to this information more convenient. NFC. Differential Revision: https://reviews.llvm.org/D36057 llvm-svn: 311981
* Revert "Revert r311552: [Bash-autocompletion] Add support for static ↵Yuka Takahashi2017-08-291-1/+10
| | | | | | | | | | | analyzer flags" This reverts commit 7c46b80c022e18d43c1fdafb117b0c409c5a6d1e. r311552 broke lld buildbot because I've changed OptionInfos type from ArrayRef to vector. However the bug is fixed, so I'll commit this again. llvm-svn: 311958
* Reland r311836 - [Driver] Use arch type to find compiler-rt libraries (on Linux)Michal Gorny2017-08-281-4/+1
| | | | | | | | | | | | | | | | | | | | Use llvm::Triple::getArchTypeName() when looking for compiler-rt libraries, rather than the exact arch string from the triple. This is more correct as it matches the values used when building compiler-rt (builtin-config-ix.cmake) which are the subset of the values allowed in triples. For example, this fixes an issue when the compiler set for i686-pc-linux-gnu triple would not find an i386 compiler-rt library, while this is the exact arch that is detected by compiler-rt. The same applies to any other i?86 variant allowed by LLVM. This also makes the special case for MSVC unnecessary, since now i386 will be used reliably for all 32-bit x86 variants. Differential Revision: https://reviews.llvm.org/D26796 llvm-svn: 311923
* Fix inaccurate comment about -fdelayed-template-parsing and MSVCReid Kleckner2017-08-281-2/+4
| | | | llvm-svn: 311899
* Revert r311836 - [Driver] Use arch type to find compiler-rt libraries (on Linux)Michal Gorny2017-08-271-1/+4
| | | | | | | This causes a breakage on the Android build bot. Let's revert it until we figure out the correct solution there. llvm-svn: 311861
* [Driver] Use arch type to find compiler-rt libraries (on Linux)Michal Gorny2017-08-261-4/+1
| | | | | | | | | | | | | | | | | | | | Use llvm::Triple::getArchTypeName() when looking for compiler-rt libraries, rather than the exact arch string from the triple. This is more correct as it matches the values used when building compiler-rt (builtin-config-ix.cmake) which are the subset of the values allowed in triples. For example, this fixes an issue when the compiler set for i686-pc-linux-gnu triple would not find an i386 compiler-rt library, while this is the exact arch that is detected by compiler-rt. The same applies to any other i?86 variant allowed by LLVM. This also makes the special case for MSVC unnecessary, since now i386 will be used reliably for all 32-bit x86 variants. Differential Revision: https://reviews.llvm.org/D26796 llvm-svn: 311836
OpenPOWER on IntegriCloud