summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/MSVCToolChain.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [Driver][OpenMP] Add logic for offloading-specific argument translation.Samuel Antao2016-10-271-1/+1
| | | | | | | | | | | | | | | Summary: This patch includes support for argument translation that is specific of a given offloading kind. Additionally, it implements the translation for OpenMP device kinds in the gcc tool chain. With this patch, it is possible to compile a functional OpenMP application with offloading capabilities with no separate compilation. Reviewers: echristo, tra, jlebar, rsmith, ABataev, hfinkel Subscribers: whchung, mehdi_amini, cfe-commits, Hahnfeld, andreybokhanko, arpith-jacob, carlo.bertolli, caomhin Differential Revision: https://reviews.llvm.org/D21848 llvm-svn: 285320
* Turn ArchName/BoundArch in Driver from raw pointer to StringRef (NFC)Mehdi Amini2016-10-071-1/+1
| | | | llvm-svn: 283605
* typo + indentation [NFC]Etienne Bergeron2016-08-301-1/+1
| | | | llvm-svn: 280127
* [Driver] Fix Windows SDK DetectionZachary Turner2016-07-281-4/+5
| | | | | | | | | | | | | | | | This fixes a couple of bugs in Windows SDK Detection. 1. `readFullStringValue` returns a bool, but was being compared with ERROR_SUCCESS. 2. `RegQueryValueExW` might return the null terminator in the queried value which will result in incorrect values being returned from `getSystemRegistryString`. Patch By: comicfans44@gmail.com Reviewed By: zturner Differential Revision: http://reviews.llvm.org/D21946 llvm-svn: 277005
* [MSVCToolChain] Guard hardcoded Windows paths with LLVM_ON_WIN32David Majnemer2016-07-251-0/+2
| | | | | | | Paths like C:/foo will never work on UNIX platforms, don't bother implicitly adding them to the search path. llvm-svn: 276606
* [Driver] Switch some getenv calls to llvm::sys::Process::GetEnvDavid Majnemer2016-07-241-25/+26
| | | | | | No functional change is intended. llvm-svn: 276573
* [NFC] Header cleanupMehdi Amini2016-07-181-0/+1
| | | | | | | | | | Summary: Removed unused headers, replaced some headers with forward class declarations Patch by: Eugene <claprix@yandex.ru> Differential Revision: https://reviews.llvm.org/D20100 llvm-svn: 275882
* Fixing a FIXME related to Unicode support on Windows. Converted the Win32 ↵Aaron Ballman2016-06-231-18/+27
| | | | | | | | APIs to explicitly use the W version when it involves strings that can hold non-ASCII characters (like file paths). Now explicitly using the A version for strings that will always be ASCII (like registry key paths). No extra tests required as this is currently covered by existing testing, and this is basically impossible to write Unicode-specific tests for. llvm-svn: 273563
* Add support for /Ob1 and -finline-hint-functions flagsHans Wennborg2016-06-221-1/+1
| | | | | | | | | | | | | | | | Add support for /Ob1 (and equivalent -finline-hint-functions), which enable inlining only for functions marked inline, either explicitly (via inline keyword, for example), or implicitly (function definition in class body, for example). This works by enabling inlining pass, and adding noinline attribute to every function not marked inline. Patch by Rudy Pons <rudy.pons@ilod.org>! Differential Revision: http://reviews.llvm.org/D20647 llvm-svn: 273440
* clang-cl: Fix unused argument warning when combining /O2 and /Ob2Hans Wennborg2016-05-251-1/+6
| | | | llvm-svn: 270642
* clang-cl: Bake /Ob0 and /Ob2 into the general /O option handlingHans Wennborg2016-05-241-1/+13
| | | | | | | This is a follow-up to r270609, wherein I forgot that /O options can be combined, and e.g. /Odb2 is a valid combination. llvm-svn: 270614
* Eliminate unnecessary file access checks in Clang driver on WindowsAdrian McCarthy2016-05-201-1/+4
| | | | | | Differential Revision: http://reviews.llvm.org/D20454 llvm-svn: 270226
* MSVCToolChain.cpp: Make version.dll generic for win32.NAKAMURA Takumi2016-05-141-2/+0
| | | | | | | We may consider msvc features may be capable on mingw host, if it can. Consider --host=mingw --target=msvc. llvm-svn: 269557
* MSVCToolChain.cpp: Use explicit constructor for SmallString from ↵NAKAMURA Takumi2016-05-141-1/+1
| | | | | | std::string, to appease mingw-g++. llvm-svn: 269556
* Get default -fms-compatibility-version from cl.exe's versionAdrian McCarthy2016-05-131-1/+43
| | | | | | | | | | | | | | -fms-compatibility-version was defaulting to 18 (VS 2013), which is a pain if your environment is pointing to version 19 (VS 2015) libraries. If cl.exe can be found, this patch uses its version number as the default instead. It re-uses the existing code to find the Visual Studio binaries folder and WinAPI methods to check its version. You can still explicitly specify a compatibility version on the command line. If you don't have cl.exe, this should be a no-op and you'll get the old default of 18. This affected the tests, which assumed that if you didn't specific a version, that it would default to 18, but this won't be true for all machines. So a couple test cases had to be eliminated and a couple others had to be tweaked to allow for various outputs. Addresses: https://llvm.org/bugs/show_bug.cgi?id=27215 Differential Revision: http://reviews.llvm.org/D20136 llvm-svn: 269515
* Do not add uwtable attribute by default for MachO targets.Akira Hatanaka2016-05-051-0/+5
| | | | | | | | | | r217178 changed clang to add function attribute uwtable by default on Win64, which caused the __eh_frame section to be emitted by default. This commit restores the previous behavior for MachO targets. rdar://problem/25282627 llvm-svn: 268589
* clang-cl: Remove -isystem, add -imsvc.Nico Weber2016-04-121-0/+4
| | | | | | | | | | | | | | | | | r260990 exposed -isystem in clang-cl. -isystem adds a directory to the front of the system include search path. The idea was to use this to point to a hermetic msvc install, but as it turns out this doesn't work: -isystem then adds the hermetic headers in front of clang's builtin headers, and clang's headers that are supposed to wrap msvc headers (say, stdarg.h) aren't picked up at all anymore. So revert that, and instead expose -imsvc which works as if the passed directory was part of %INCLUDE%: The header is treated as a system header, but it is searched after clang's lib/Header headers. Fixes half of PRPR26751. llvm-svn: 266108
* clang-cl: Don't warn about /Oy- being unused in 64-bit builds.Nico Weber2016-03-231-0/+6
| | | | | | http://reviews.llvm.org/D18392 llvm-svn: 264163
* Fix array index out of boundsDaniel Marjamaki2016-01-271-2/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D16582 llvm-svn: 258911
* [MSVC Compat] Don't omit frame pointers if /Oy- is specified before /O2David Majnemer2016-01-211-1/+2
| | | | | | | | | Microsoft's documentation states that specifying /Oy- after the /O[12x] options disables frame-pointer omission. What it does *not* state is that it also disables frame-pointer omission if /Oy- is specified before /O[12x]. llvm-svn: 258447
* clang-cl: Support /Dfoo#bar (PR25984)Hans Wennborg2016-01-121-72/+99
| | | | | | Such flags will now be translated to -Dfoo=bar. llvm-svn: 257537
* [Driver] Add support for Windows 10 SDKIgor Kudrin2015-09-241-66/+96
| | | | | | | | | | | | | | | | Summary: With Windows 10 SDK, Include and Lib directories now contain an additional subfolder with the name that corresponds to the full version of the SDK, for example: - C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\um - C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\um\x64 Reviewers: ruiu, rnk Subscribers: majnemer, cfe-commits Differential Revision: http://reviews.llvm.org/D12832 llvm-svn: 248463
* [Driver] Use UniversalCRT on Windows if availableReid Kleckner2015-09-111-13/+88
| | | | | | | | | | | | | | | | | | | | Summary: With Visual Studio 2015 release, a part of runtime library was extracted and now comes with Windows Kits. This patch enables clang to use Universal CRT library if %INCLUDE or %LIB environment varaibles are not specified. See also https://llvm.org/bugs/show_bug.cgi?id=24741 Patch by Igor Kudrin Reviewers: zturner, hans, rnk Subscribers: ruiu, cfe-commits Differential Revision: http://reviews.llvm.org/D12695 llvm-svn: 247362
* [clang-cl] Only respect /Oy- for x86_32David Majnemer2015-08-251-10/+21
| | | | | | | The /Oy- flag should have no effect for 64-bit X86, it has reliable unwind tables. llvm-svn: 245913
* [clang-cl] Handle -O correctlyDavid Majnemer2015-07-271-0/+98
| | | | | | | | | | | | | | | We had multiple bugs here: - We didn't support multiple optimization options in one argument. e.g. -O2y- - We didn't correctly expand -O[12dx] to their respective options. - We treated -O1 as clang -O1 instead of clang -Os. - We treated -Ox as clang -O3 instead of clang -O2. In fact, cl's -Ox option is *less* powerful than cl's -O2 option despite -Ox described as "Full Optimization". This fixes PR24003. llvm-svn: 243261
* Driver: enable support for -fsanitize=cfi on Windows.Peter Collingbourne2015-07-081-3/+0
| | | | | | | | | There are known issues, but the current implementation is good enough for the check-cfi test suite. Differential Revision: http://reviews.llvm.org/D11030 llvm-svn: 241728
* Pedantically rename all Tool subclasses to be nouns, not verbs. NFCDouglas Katzman2015-06-231-2/+2
| | | | | | | | | | | | | | | | | | Classes in Tools.h inherit ultimately from Tool, which is a noun, but subclasses of Tool were named for their operation, such as "Compile", wherein the constructor call "Compile(args...)" could be misconstrued as actually causing a compile to happen. Likewise various other methods were not harmonious with their effect, in that "BuildLinker()" returned a "new namespace::Link(...)" instead of a "new namespace::Linker(...)" which it now does. Exceptions: Clang and ClangAs are un-renamed. Those are their rightful names. And there is no particulary great way to name the "Lipo-er" and a few others. Differential Revision: http://reviews.llvm.org/D10595 llvm-svn: 240455
* [Sanitizers] Provide better diagnostic for sanitizers unsupported for target ↵Alexey Samsonov2015-06-191-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | triple. Introduce ToolChain::getSupportedSanitizers() that would return the set of sanitizers available on given toolchain. By default, these are sanitizers which don't necessarily require runtime support and are not toolchain- or architecture-dependent. Sanitizers (ASan, DFSan, TSan, MSan etc.) which cannot function without runtime library are marked as supported only on platforms for which we actually build these runtimes. This would allow more fine-grained checks in the future: for instance, we have to restrict availability of -fsanitize=vptr to Mac OS 10.9+ (PR23539). Update test cases accrodingly: add tests for certain unsupported configurations, remove test cases for -fsanitize=vptr + PS4 integration, as we don't build the runtime for PS4 at the moment. This change was first submitted as r239953 and reverted in r239958. The problem was and still is in Darwin toolchains, which get the knowledge about target platform too late after initializaition, while now we require this information when ToolChain::getSanitizerArgs() is called. r240170 works around this issue. llvm-svn: 240179
* Revert "[Sanitizers] Provide better diagnostic for sanitizers unsupported ↵Alexey Samsonov2015-06-171-9/+0
| | | | | | | | | for target triple." This reverts commit r239953, while I'm investigating assertion failure from http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_check/9994/ llvm-svn: 239958
* [Sanitizers] Provide better diagnostic for sanitizers unsupported for target ↵Alexey Samsonov2015-06-171-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | triple. Summary: Introduce ToolChain::getSupportedSanitizers() that would return the set of sanitizers available on given toolchain. By default, these are sanitizers which don't necessarily require runtime support (i.e. set from -fsanitize=undefined-trap). Sanitizers (ASan, DFSan, TSan, MSan etc.) which cannot function without runtime library are marked as supported only on platforms for which we actually build these runtimes. This would allow more fine-grained checks in the future: for instance, we have to restrict availability of -fsanitize=vptr to Mac OS 10.9+ (PR23539) Update test cases accrodingly: add tests for certain unsupported configurations, remove test cases for -fsanitize=vptr + PS4 integration, as we don't build the runtime for PS4 at the moment. Test Plan: regression test suite Reviewers: pcc Subscribers: cfe-commits, filcab, eugenis, thakis, kubabrecka, emaste, rsmith Differential Revision: http://reviews.llvm.org/D10467 llvm-svn: 239953
* [Driver] Preserve the object file format in ComputeEffectiveClangTripleDavid Majnemer2015-06-091-2/+8
| | | | | | | | The object file format is sometimes overridden for MSVC targets to use ELF instead of COFF. Make sure we preserve this choice when setting the msvc version number in the triple. llvm-svn: 239388
* [Driver] Inject the MSVC compatibility version into the tripleDavid Majnemer2015-06-081-0/+21
| | | | | | | Encoding the version into the triple will allow us to communicate to LLVM what functions it can expect to depend upon in the implementation. llvm-svn: 239273
* Remove many superfluous SmallString::str() calls.Yaron Keren2015-03-181-2/+2
| | | | | | | | | | | | | | | Now that SmallString is a first-class citizen, most SmallString::str() calls are not required. This patch removes a whole bunch of them, yet there are lots more. There are two use cases where str() is really needed: 1) To use one of StringRef member functions which is not available in SmallString. 2) To convert to std::string, as StringRef implicitly converts while SmallString do not. We may wish to change this, but it may introduce ambiguity. llvm-svn: 232622
* Remove a stray blank line that my sort_include.py script found.Chandler Carruth2015-02-131-1/+0
| | | | llvm-svn: 229093
* Attempt to fix ::sscanf Cygwin build break reported in PR22302Reid Kleckner2015-01-231-1/+3
| | | | llvm-svn: 226925
* Silence warning: "NOMINMAX" redefined.Yaron Keren2014-12-041-1/+3
| | | | llvm-svn: 223391
* Make -fuse-ld=lld work properly on Windows.Zachary Turner2014-12-011-0/+3
| | | | | | | | | | | | Using lld on Windows requires calling link-lld.exe instead of lld.exe. This patch puts this knowledge into clang so that when using the GCC style clang driver, it can properly delegate to lld. Differential Revision: http://reviews.llvm.org/D6428 Reviewed by: Reid Kleckner, Rui Ueyama llvm-svn: 223086
* Removing an unused variable; NFC.Aaron Ballman2014-11-141-1/+0
| | | | llvm-svn: 222048
* Fix C++ compliance issue. string literals must be const char *Zachary Turner2014-10-221-2/+2
| | | | llvm-svn: 220434
* Make a good guess about where MSVC and Windows SDK libraries are for linking.Zachary Turner2014-10-221-0/+65
| | | | | | | | | | | | | When a user has not configured a standard Visual Studio environment by running vcvarsall, clang tries its best to find Visual Studio include files and executables anyway. This patch makes clang also try to find system and Windows SDK libraries for linking against, as well. Reviewed by: Hans Wennborg Differential Revision: http://reviews.llvm.org/D5873 llvm-svn: 220425
* Resubmit "Improve Windows toolchain support for non-standard environments."Zachary Turner2014-10-221-90/+182
| | | | | | | | | | | | | | This resubmits change r220226. That change broke the chromium build bots because chromium it ships an hermetic MSVC toolchain that it expects clang to fallback to by finding it on the path. This patch fixes the issue by bumping up the prioritization of PATH when looking for MSVC binaries. Reviewed by: Hans Wennborg, Reid Kleckner Differential Revision: http://reviews.llvm.org/D5892 llvm-svn: 220424
* Driver: rename Windows to MSVCToolChainSaleem Abdulrasool2014-10-221-0/+335
This renames the Windows toolchain to MSVCToolChain. This is a preparatory step for adding a CrossWindowsToolChain which uses clang/libc++/(ld/lld) without the standard GCC toolchain lookup. NFC. llvm-svn: 220362
OpenPOWER on IntegriCloud