summaryrefslogtreecommitdiffstats
path: root/clang/test/Driver/cl-options.c
Commit message (Collapse)AuthorAgeFilesLines
...
* [driver] [cl] Add/fix c++17/c++latestMartell Malone2017-10-151-1/+4
| | | | | | | | Patch by: daxpedda Differential Revision: https://reviews.llvm.org/D38123 llvm-svn: 315864
* [clang-cl] Claim ignored /O[12xd] argumentsReid Kleckner2017-10-031-0/+3
| | | | | | Fixes PR34809 llvm-svn: 314743
* clang-cl: Alias /d1reportAllClassLayout to -fdump-record-layouts (PR32826)Hans Wennborg2017-04-271-0/+3
| | | | llvm-svn: 301567
* clang-cl: Support the /Zc:twoPhase[-] command-line option (PR32680)Hans Wennborg2017-04-171-0/+3
| | | | | | | | | It sounds like MSVC is adding support for two-phase name lookup in a future version, enabled by this flag (see bug). Differential Revision: https://reviews.llvm.org/D32138 llvm-svn: 300501
* enable -flto=thin in clang-clBob Haarman2017-02-271-0/+9
| | | | | | | | | | | | | | Summary: This enables LTO to be used with the clang-cl frontend. Reviewers: rnk, hans Reviewed By: hans Subscribers: pcc, cfe-commits, mehdi_amini, Prazek Differential Revision: https://reviews.llvm.org/D30239 llvm-svn: 296373
* clang-cl: Warn about /U flags that look like filenames (PR31662)Hans Wennborg2017-01-271-0/+6
| | | | | | | | | | | | 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
* Address review comments on r290392:Chandler Carruth2017-01-121-1/+1
| | | | | | | | | | | | | - 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
* Support -fno-delayed-template-parsing in clang-cl.exeReid Kleckner2017-01-041-0/+8
| | | | | | | | | | | | | | | | | | | | Summary: This change adds support for the -fno-delayed-template-parsing option in clang-cl.exe. This allows developers using clang-cl.exe to opt out of emulation of MSVC's non-conformant template instantiation implementation while continuing to use clang-cl.exe for its emulation of cl.exe command-line options. The default behavior of clang-cl.exe (-fdelayed-template-parsing) is unchanged. The MSVC Standard Library implementation uses clang-cl.exe with this switch in its tests to ensure that the library headers work on compilers with the conformant two-phase-lookup behavior. Reviewers: majnemer, cfe-commits, DaveBartolomeo Differential Revision: https://reviews.llvm.org/D22275 llvm-svn: 290990
* Make '-disable-llvm-optzns' an alias for '-disable-llvm-passes'.Chandler Carruth2016-12-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Much to my surprise, '-disable-llvm-optzns' which I thought was the magical flag I wanted to get at the raw LLVM IR coming out of Clang deosn't do that. It still runs some passes over the IR. I don't want that, I really want the *raw* IR coming out of Clang and I strongly suspect everyone else using it is in the same camp. There is actually a flag that does what I want that I didn't know about called '-disable-llvm-passes'. I suspect many others don't know about it either. It both does what I want and is much simpler. This removes the confusing version and makes that spelling of the flag an alias for '-disable-llvm-passes'. I've also moved everything in Clang to use the 'passes' spelling as it seems both more accurate (*all* LLVM passes are disabled, not just optimizations) and much easier to remember and spell correctly. This is part of simplifying how Clang drives LLVM to make it cleaner to wire up to the new pass manager. Differential Revision: https://reviews.llvm.org/D28047 llvm-svn: 290392
* make -fprofile-instr-generate and -fprofile-instr-use work with clang-clBob Haarman2016-11-301-0/+13
| | | | | | | | | Summary: Makes -fprofile-instr-generate and -fprofile-instr-use work with clang-cl so that profile-guided optimization can be used. Differential Revision: https://reviews.llvm.org/D27086 llvm-svn: 288230
* clang-cl: Expose the -flto optionHans Wennborg2016-10-041-0/+1
| | | | | | | | | | | We could hook up /GL as an alias for -flto, but that might be confusing, as clang-cl in that mode would not be drop-in compatible with cl.exe /GL, as it requires the linker to be lld. Exposing -flto seems like a less confusing way to expose this functionality. llvm-svn: 283255
* [clang-cl] Accept the joined equals version of -resource-dir=Reid Kleckner2016-09-141-1/+2
| | | | | | | lib/Tooling injects this argument without regard for what driver syntax is in use. llvm-svn: 281550
* Make -fstandalone-debug and -flimit-debug-info available in clang-clReid Kleckner2016-09-091-0/+2
| | | | | | | | | | Our limited debug info optimizations are breaking down at DLL boundaries, so we're going to evaluate the size impact of these settings, and possibly change the default. Users should be able to override our settings, though. llvm-svn: 281056
* [clang-cl] Check that we are in clang cl mode before enabling support for ↵Pierre Gousseau2016-09-061-0/+2
| | | | | | | | | | the CL environment variable. Checking for the type of the command line tokenizer should not be the criteria to enable support for the CL environment variable, this change checks that we are in clang-cl mode instead. Differential Revision: https://reviews.llvm.org/D23503 llvm-svn: 280702
* clang-cl: Support MSVC2015's /validate-charset flag.Nico Weber2016-08-261-0/+6
| | | | | | | | | | | | | | | | | | | Clang always assumes that files are utf-8. If an invalidly encoded character is used in an identifier, clang always errors. If it's used in a character literal, clang warns Winvalid-source-encoding (on by default). Clang never checks the encoding of things in comments (adding this seems like a nice feature if it doesn't impact performance). For cl.exe /utf-8 (which enables /validate-charset), if a bad character is used in an identifier, it emits both an error and a warning. If it's used in a literal or a comment, it emits a warning. So mapping /validate-charset to -Winvalid-source-encoding seems like a fairly decent fit. https://reviews.llvm.org/D23945 llvm-svn: 279872
* clang-cl: Accept MSVC2015's '/utf-8' flag.Nico Weber2016-08-261-0/+1
| | | | | | Clang always behaves as if that's passed, so just ignore the flag. llvm-svn: 279869
* clang-cl: Accept MSVC 2015's `/execution-charset:utf-8` flag.Nico Weber2016-08-261-0/+5
| | | | | | | | | | Also makes -fexec-charset accept utf-8 case-insensitively. Like https://reviews.llvm.org/D23807, but for execution-charset. Also replace a few .lower() comparisons with equals_lower(). https://reviews.llvm.org/D23938 llvm-svn: 279866
* Add support for -fdiagnostics-absolute-paths: printing absolute paths in ↵Hans Wennborg2016-08-261-1/+1
| | | | | | | | diagnostics Differential Revision: https://reviews.llvm.org/D23816 llvm-svn: 279827
* Omit column info for CodeView by defaultAdrian McCarthy2016-08-251-0/+9
| | | | | | | | | | | | Clang tracks only start columns, not start-end ranges. CodeView allows for that, but the VS debugger doesn't handle anything less than a complete range well--it either highlights the wrong part of a statement or truncates source lines in the assembly view. It's better to have no column information at all. So by default, we'll omit the column information for CodeView targeting Windows. Since the column info is still useful for sanitizers, I've promoted -gcolumn-info (and -gno-column-info) to a CoreOption and added a couple tests to make sure that works for clang-cl. Differential Revision: https://reviews.llvm.org/D23720 llvm-svn: 279765
* clang-cl: Make /Brepro actually work.Nico Weber2016-08-231-2/+2
| | | | | | | | | /Brepro means we want reproducible builds, i.e. we _don't_ want the timestamp that's needed to be compatible with the incremental linker. https://reviews.llvm.org/D23805 llvm-svn: 279555
* clang-cl: Accept MSVC 2015's `/source-charset:utf-8` flag.Nico Weber2016-08-231-0/+5
| | | | | | | | | | | | | clang already treats all inputs as utf-8. Warn if anything but utf-8 is passed. Do this by mapping source-charset to finput-charset, which already behaves like this. Slightly tweak finput-charset to accept "utf-8" case-insensitively. This matches gcc's and cl.exe's behavior, and IANA says that character set names are case-insensitive. https://reviews.llvm.org/D23807 llvm-svn: 279531
* [clang-cl] Make -gline-tables-only imply -gcodeviewReid Kleckner2016-08-091-0/+4
| | | | | | | | | It's surprising that you have to pass /Z7 in addition to -gcodeview to get debug info. The sanitizer runtime, for example, expects that if the compiler supports the -gline-tables-only flag, then it will emit debug info. llvm-svn: 278139
* [clang-cl] Add support for /ZdDavid Majnemer2016-07-091-1/+1
| | | | | | | | | | MASM (ML.exe and ML64.exe) and older versions of MSVC (CL.exe) support a flag called /Zd which is more-or-less -gline-tables-only. It seems nicer to support this flag instead of exposing -gline-tables-only. llvm-svn: 274991
* [clang-cl] Implement support for /stdDavid Majnemer2016-06-271-0/+6
| | | | | | | /std: supports two arguments, c++14 and c++latest. Currently, c++latest maps to c++1z but this might change down the road. llvm-svn: 273841
* Add support for /Ob1 and -finline-hint-functions flagsHans Wennborg2016-06-221-1/+4
| | | | | | | | | | | | | | | | 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
* Add support to clang-cl driver for /GS switchEtienne Bergeron2016-06-151-0/+10
| | | | | | | | | | | | | | | | | | | Summary: This patch is adding command-line support for the MSVC buffer security check. The buffer security check is turned on with the '/GS' compiler switch. https://msdn.microsoft.com/en-us/library/8dbf701c.aspx The MSVC buffer security check in implemented here: http://reviews.llvm.org/D20346 Reviewers: hans, rnk Subscribers: chrisha, cfe-commits, rnk, hans, thakis Differential Revision: http://reviews.llvm.org/D20347 llvm-svn: 272832
* clang-cl: Support -resource-dir option (PR28074)Hans Wennborg2016-06-131-0/+1
| | | | | | It's useful e.g. for distributed build systems. llvm-svn: 272583
* clang-cl: Fix unused argument warning when combining /O2 and /Ob2Hans Wennborg2016-05-251-0/+2
| | | | llvm-svn: 270642
* clang-cl: Bake /Ob0 and /Ob2 into the general /O option handlingHans Wennborg2016-05-241-0/+1
| | | | | | | 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
* [Driver] Add support for -finline-functions and /Ob2 flagsHans Wennborg2016-05-241-1/+3
| | | | | | | | | | | | | | | | | | -finline-functions and /Ob2 are currently ignored by Clang. The only way to enable inlining is to use the global O flags, which also enable other options, or to emit LLVM bitcode using Clang, then running opt by hand with the inline pass. This patch allows to simply use the -finline-functions flag (same as GCC) or /Ob2 in clang-cl mode to enable inlining without other optimizations. This is the first patch of a serie to improve support for the /Ob flags. Patch by Rudy Pons <rudy.pons@ilod.org>! Differential Revision: http://reviews.llvm.org/D20576 llvm-svn: 270609
* Get default -fms-compatibility-version from cl.exe's versionAdrian McCarthy2016-05-131-1/+1
| | | | | | | | | | | | | | -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
* Fix testcase for the LLVM_LIBDIR_SUFFIX=64 case. Fallout from r266108.Ismail Donmez2016-04-141-1/+1
| | | | llvm-svn: 266324
* clang/test/Driver/cl-options.c: Fix an expression to recognize dos r'\\'.NAKAMURA Takumi2016-04-131-1/+1
| | | | llvm-svn: 266154
* clang-cl: Remove -isystem, add -imsvc.Nico Weber2016-04-121-1/+6
| | | | | | | | | | | | | | | | | 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
* Revert 266090, needs more testing first.Nico Weber2016-04-121-1/+0
| | | | llvm-svn: 266091
* clang-cl: Expose -nostdlibinc.Nico Weber2016-04-121-0/+1
| | | | llvm-svn: 266090
* clang-cl: Silently ignore /d2FastFail flag.Nico Weber2016-03-291-0/+1
| | | | | | It's some debugging flag for cl.exe related to how it writes crash dumps. llvm-svn: 264774
* clang-cl: Don't warn about /Oy- being unused in 64-bit builds.Nico Weber2016-03-231-3/+3
| | | | | | http://reviews.llvm.org/D18392 llvm-svn: 264163
* clang-cl: Move /FC from "Unsupported" to "Ignored" list.Nico Weber2016-03-211-0/+1
| | | | | | | /FC affects if diagnostics print with full paths and if __FILE__ expands with a full path. clang-cl does both of these two by default. llvm-svn: 263953
* [clang-cl] Allow use of -gline-tables-onlyReid Kleckner2016-03-181-0/+4
| | | | llvm-svn: 263816
* [clang-cl] /EHc should not effect functions with explicit exception ↵David Majnemer2016-02-291-3/+3
| | | | | | | | | | specifications Functions with an explicit exception specification have their behavior dictated by the specification. The additional /EHc behavior only comes into play if no exception specification is given. llvm-svn: 262198
* Don't enable /GX by defaultDavid Majnemer2016-02-221-0/+3
| | | | | | | The /GX flag is disabled unless explicitly specified on the command line. This partially addresses PR26698. llvm-svn: 261537
* [MSVC Compat] Add support for /GX, /GX-David Majnemer2016-02-201-0/+6
| | | | | | These are legacy flags which map to /EHsc and /EHs-c- respectively. llvm-svn: 261424
* clang-cl: Expose -isystem.Nico Weber2016-02-161-0/+1
| | | | | | | | | | | | | Like cl.exe, clang-cl allows adding system include directories via the INCLUDE env var. Having a driver flag for this functionality is useful, so add this too. (In the future, we probably also want to have a flag alternative to VCINSTALLDIR as used in MSVCToolChain::getVisualStudioBinaries(), and a way to override the registry accesses in MSVCToolChain::getWindowsSDKDir() -- maybe -ivcroot= and -iwinsdkroot=?). llvm-svn: 260990
* [clang-cl] /Z7 now generates normal debug info, not just line infoReid Kleckner2016-02-101-2/+2
| | | | | | | | | Previously LLVM could not process any debug info we produced, so it didn't make sense to spend time generating it. Now that it has primitive support for local variable info, it does make sense to generate normal debug info. llvm-svn: 260435
* [MSVC Compat] Don't omit frame pointers if /Oy- is specified before /O2David Majnemer2016-01-211-0/+4
| | | | | | | | | 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
* Follow-up to r257537: add test that majnemer asked aboutHans Wennborg2016-01-121-1/+2
| | | | llvm-svn: 257541
* clang-cl: Support /Dfoo#bar (PR25984)Hans Wennborg2016-01-121-2/+6
| | | | | | Such flags will now be translated to -Dfoo=bar. llvm-svn: 257537
* [clang-cl] Add support for /BreproDavid Majnemer2015-12-211-0/+9
| | | | | | | | | | | | The /Brepro flag controls whether or not the compiler should embed timestamps into the object file. Object files which do not embed timestamps are not suitable for incremental linking but are suitable for hermetic build systems and staged self-hosts of clang. A normal clang spelling of this flag has been added, -mincremental-linker-compatible. llvm-svn: 256204
* clang-cl: Add an alias for /wd4100Nico Weber2015-12-151-2/+3
| | | | llvm-svn: 255655
OpenPOWER on IntegriCloud