summaryrefslogtreecommitdiff
path: root/lib/Frontend/CompilerInvocation.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Silence a dubious GCC warning about a set but unused global. Indeed, theChandler Carruth2013-12-281-1/+1
| | | | | | purpose of this global is to be set and not used. =] git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198094 91177308-0d34-0410-b5e6-96231b3b80d8
* Bury leaked pointers in a global array to silence a leak detector in ↵Kostya Serebryany2013-12-271-0/+16
| | | | | | | | | | | | | | | | --disable-free mode Summary: This is an alternative to http://llvm-reviews.chandlerc.com/D2475 suggested by Chandler. Reviewers: chandlerc, rnk, dblaikie CC: cfe-commits, earthdok Differential Revision: http://llvm-reviews.chandlerc.com/D2478 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198073 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver] Rename '-objcmt-white-list-dir-path' option to ↵Argyrios Kyrtzidis2013-12-101-1/+1
| | | | | | '-objcmt-whitelist-dir-path' and add an alias for now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196944 91177308-0d34-0410-b5e6-96231b3b80d8
* [objcmt] Add a modernization option to infer and suggest designated ↵Argyrios Kyrtzidis2013-12-101-0/+2
| | | | | | | | initializers. rdar://15509284 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196943 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a tranche of comment, test and doc typosAlp Toker2013-12-051-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196510 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove a whole lot of unused variablesAlp Toker2013-11-271-1/+0
| | | | | | | There are about 30 removed in this patch, generated by a new FixIt I haven't got round to submitting yet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195814 91177308-0d34-0410-b5e6-96231b3b80d8
* Using an invalid -O falls back on -O3 instead of an errorSylvestre Ledru2013-11-181-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Currently with clang: $ clang -O20 foo.c error: invalid value '20' in '-O20' With the patch: $ clang -O20 foo.c warning: optimization level '-O20' is unsupported; using '-O3' instead. 1 warning generated. This matches the gcc behavior (with a warning added) Pass all tests: Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. Testing Time: 94.14s Expected Passes : 6721 Expected Failures : 20 Unsupported Tests : 17 (which was not the case of http://llvm-reviews.chandlerc.com/D2125) Differential Revision: http://llvm-reviews.chandlerc.com/D2212 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195009 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -freroll-loops to enable loop rerollingHal Finkel2013-11-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This adds -freroll-loops (and -fno-reroll-loops in the usual way) to enable loop rerolling as part of the optimization pass manager. This transformation can enable vectorization, reduce code size (or both). Briefly, loop rerolling can transform a loop like this: for (int i = 0; i < 3200; i += 5) { a[i] += alpha * b[i]; a[i + 1] += alpha * b[i + 1]; a[i + 2] += alpha * b[i + 2]; a[i + 3] += alpha * b[i + 3]; a[i + 4] += alpha * b[i + 4]; } into this: for (int i = 0; i < 3200; ++i) { a[i] += alpha * b[i]; } Loop rerolling is currently disabled by default at all optimization levels. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194967 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Using an invalid -O falls back on -O3 instead of an error"Alp Toker2013-11-151-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | Trying to fix test failures since earlier today. One of the tests added in this commit is outputting test/Driver/clang_f_opts.s which the builders that build in-tree (eg. clang-native-arm-cortex-a9) are trying to run as a test case, causing failures. clang_f_opts.c: If -### doesn't emit the warning then this test probably shouldn't be in here in the first place. Frontend maybe? invalid-o-level.c: Running %clang_cc1 in the Driver tests doesn't make sense because -cc1 bypasses the driver. (I'm not reverting the commit that introduced this but please fix instead of keeping it this way.) Reverting to fix the build failures and also so that the tests can be thought out more thoroughly. This reverts commit r194817. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194845 91177308-0d34-0410-b5e6-96231b3b80d8
* Using an invalid -O falls back on -O3 instead of an errorSylvestre Ledru2013-11-151-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Currently with clang: $ clang -O20 foo.c error: invalid value '20' in '-O20' With the patch: $ clang -O20 foo.c warning: optimization level '-O20' is unsupported; using '-O3' instead. 1 warning generated. This matches the gcc behavior (with a warning added) Pass all tests: Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. Testing Time: 94.14s Expected Passes : 6721 Expected Failures : 20 Unsupported Tests : 17 (which was not the case of http://llvm-reviews.chandlerc.com/D2125) Reviewers: chandlerc, rafael, rengolin, hfinkel Reviewed By: rengolin CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2152 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194817 91177308-0d34-0410-b5e6-96231b3b80d8
* [objcmt] Introduce "objcmt-white-list-dir-path=" option.Argyrios Kyrtzidis2013-11-141-0/+2
| | | | | | | This options accepts a path to a directory, collects the filenames of the files it contains, and the migrator will only modify files with the same filename. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194710 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -fprofile-sample-use to Clang's driver.Diego Novillo2013-11-131-0/+1
| | | | | | | | This adds a new option -fprofile-sample-use=filename to Clang. It tells the driver to schedule the SampleProfileLoader pass and passes on the name of the profile file to use. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194567 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjectiveC migrator. Place use of NS_NONATOMIC_IOSONLYFariborz Jahanian2013-11-131-0/+2
| | | | | | | | | on inferred property attribute under -objcmt-ns-nonatomic-iosonly option. // rdar://15442742 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194532 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Using an invalid -O falls back on -O3 instead of an error"Sylvestre Ledru2013-11-111-7/+7
| | | | | | | | | | This reverts commit r194403. Was breaking too many tests... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194420 91177308-0d34-0410-b5e6-96231b3b80d8
* Using an invalid -O falls back on -O3 instead of an errorSylvestre Ledru2013-11-111-7/+7
| | | | | | | | | | | | | | | | | | | | | Summary: Currently with clang: $ clang -O20 foo.c error: invalid value '20' in '-O20' With the patch: $ clang -O20 foo.c warning: invalid value '20' in '-O20'. Fall back on value '3' Reviewers: rengolin, hfinkel Reviewed By: rengolin CC: cfe-commits, hfinkel, rengolin Differential Revision: http://llvm-reviews.chandlerc.com/D2125 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194403 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate an unnecessary .c_str()Douglas Gregor2013-11-081-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194228 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a limit to the length of a sequence of 'operator->' functions we willRichard Smith2013-11-061-0/+2
| | | | | | | | follow when building a class member access expression. Based on a patch by Rahul Jain! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194161 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjectiveC migrator. Please annotation of properties with Fariborz Jahanian2013-11-051-0/+2
| | | | | | | | | NS_RETURNS_INNER_POINTER under -objcmt-returns-innerpointer-property flag (off by default), as older compilers do not support such annotations. // rdar://15396636 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194100 91177308-0d34-0410-b5e6-96231b3b80d8
* C++1y sized deallocation: if we have a use, but not a definition, of a sizedRichard Smith2013-11-051-1/+4
| | | | | | | | | | | | | | deallocation function (and the corresponding unsized deallocation function has been declared), emit a weak discardable definition of the function that forwards to the corresponding unsized deallocation. This allows a C++ standard library implementation to provide both a sized and an unsized deallocation function, where the unsized one does not just call the sized one, for instance by putting both in the same object file within an archive. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194055 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjectiveC. Define a new cc1 flag Fariborz Jahanian2013-11-011-0/+4
| | | | | | | | | | | | -fobjc-subscripting-legacy-runtime which is off by default and on only when using ObjectiveC legacy runtime. Use this flag to allow array and dictionary subscripting and disallow objectiveC pointer arithmatic in ObjectiveC legacy runtime. // rdar://15363492 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193889 91177308-0d34-0410-b5e6-96231b3b80d8
* I am about to change llvm::MemoryBuffer::getFile take take a Twine. ChangeRafael Espindola2013-10-251-1/+1
| | | | | | clang first so that the build still works. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193428 91177308-0d34-0410-b5e6-96231b3b80d8
* Turn struct-path aware TBAA on by default.Manman Ren2013-10-111-1/+1
| | | | | | | | | Use -no-struct-path-tbaa to turn it off. This is the same as r191695, which was reverted because it depends on a commit that has issues. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192497 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -fno-function-sections and -fno-data-sections. SinceNick Lewycky2013-10-111-2/+4
| | | | | | | | -f{function,data}-sections had no tests at all, add some, and verify that the -fno variants work as well. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192413 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjectiveC migrator. Introduce a new objcmt-atomic-property optionFariborz Jahanian2013-10-091-0/+2
| | | | | | | | and use it to infer all properties as 'atomic'. // rdar://14988132 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192317 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove -ast-dump-xml.Richard Smith2013-10-071-3/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192131 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjectiveC migrator: Add more options one for eachFariborz Jahanian2013-10-021-0/+8
| | | | | | | | kind of migration. // rdar://15003157 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191858 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjectiveC migrator. Starting distiguising differentFariborz Jahanian2013-10-021-0/+4
| | | | | | | | migrations under their own option. wip and // rdar://15003157 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191855 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r191586 and r191695. They cause crashes when building withRichard Smith2013-10-011-1/+1
| | | | | | | -relaxed-aliasing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191725 91177308-0d34-0410-b5e6-96231b3b80d8
* Turn struct-path aware TBAA on by default.Manman Ren2013-09-301-1/+1
| | | | | | | Use -no-struct-path-tbaa to turn it off. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191695 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement C++1y sized deallocation (n3778). This is not enabled by -std=c++1y;Richard Smith2013-09-291-0/+1
| | | | | | | | instead, it's enabled by the -cc1 flag -fsized-deallocation, until we sort out the backward-compatibility issues. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191629 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace -fobjc-default-synthesize-properties with ↵Rafael Espindola2013-09-271-1/+1
| | | | | | | | | disable-objc-default-synthesize-properties. We want the modern behavior most of the time, so inverting the option simplifies the driver and the tests. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191551 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -fmodule-map-file option.Daniel Jasper2013-09-241-0/+3
| | | | | | | | | | | | | | | | With this option, arbitrarily named module map files can be specified to be loaded as required for headers in the respective (sub)directories. This, together with the extern module declaration allows for specifying module maps in a modular fashion without the need for files called "module.map". Among other things, this allows a directory to contain two modules that are completely independent of one another. Review: http://llvm-reviews.chandlerc.com/D1697. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191284 91177308-0d34-0410-b5e6-96231b3b80d8
* Module use declarations (II)Daniel Jasper2013-09-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Review: http://llvm-reviews.chandlerc.com/D1546. I have picked up this patch form Lawrence (http://llvm-reviews.chandlerc.com/D1063) and did a few changes. From the original change description (updated as appropriate): This patch adds a check that ensures that modules only use modules they have so declared. To this end, it adds a statement on intended module use to the module.map grammar: use module-id A module can then only use headers from other modules if it 'uses' them. This enforcement is off by default, but may be turned on with the new option -fmodules-decluse. When enforcing the module semantics, we also need to consider a source file part of a module. This is achieved with a compiler option -fmodule-name=<module-id>. The compiler at present only applies restrictions to the module directly being built. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191283 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-cl: print diagnostics as "error(clang): foo" in /fallback modeHans Wennborg2013-09-241-1/+4
| | | | | | | | | | | | | | | This solves two problems: 1) MSBuild will not flag the build as unsuccessful just because we print an error in the output, since "error(clang):" doesn't seem to match the regex it's using. 2) It becomes more clear that the diagnostic is coming from clang as supposed to cl.exe. Differential Revision: http://llvm-reviews.chandlerc.com/D1735 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191250 91177308-0d34-0410-b5e6-96231b3b80d8
* Certain multi-platform languages, such as OpenCL, have the concept ofDavid Tweed2013-09-131-0/+22
| | | | | | | | | | | | | | | address spaces which is both (1) a "semantic" concept and (2) possibly a hardware level restriction. It is desirable to be able to discard/merge the LLVM-level address spaces on arguments for which there is no difference to the current backend while keeping track of the semantic address spaces in a funciton prototype. To do this enable addition of the address space into the name-mangling process. Add some tests to document this behaviour against inadvertent changes. Patch by Michele Scandale! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190684 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -fansi-escape-codes optionNico Rieck2013-09-111-0/+3
| | | | | | | | | | | | | Some build systems use pipes for stdin/stderr. On nix-ish platforms colored output can be forced by -fcolor-diagnostics. On Windows this option has no effect in these cases because LLVM uses the console API (which only operates on the console buffer) even if a console wrapper capable of interpreting ANSI escape codes is used. The -fansi-escape-codes option allows switching from the console API to ANSI escape codes. It has no effect on other platforms. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190464 91177308-0d34-0410-b5e6-96231b3b80d8
* The OpenCL standard specifies the sizes and alignments of various types than ↵David Tweed2013-09-091-2/+2
| | | | | | | | | | | | | other C-family languages, as well as specifying errno is not set by the math functions. Make the clang front-end set those appropriately when the OpenCL language option is set. Patch by Erik Schnetter! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190296 91177308-0d34-0410-b5e6-96231b3b80d8
* Attempt to migrate default dwarf version to 4 for linux.Eric Christopher2013-09-031-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189823 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjectiveC migrator. This patch infers readonly properties for no-parameter Fariborz Jahanian2013-08-281-0/+2
| | | | | | | | instance methods returning non-void. This will be quite noisy. So, it is placed under a new migrator flag -objcmt-migrate-readonly-property. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189537 91177308-0d34-0410-b5e6-96231b3b80d8
* Move -mfpmath handling to -cc1 and implement it for x86.Rafael Espindola2013-08-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | The original idea was to implement it all on the driver, but to do that the driver needs to know the sse level and to do that it has to know the default features of a cpu. Benjamin Kramer pointed out that if one day we decide to implement support for ' __attribute__ ((__target__ ("arch=core2")))', then the frontend needs to keep its knowledge of default features of a cpu. To avoid duplicating which part of clang handles default cpu features, it is probably better to handle -mfpmath in the frontend. For ARM this patch is just a small improvement. Instead of a cpu list, we check if neon is enabled, which allows us to reject things like -mcpu=cortex-a9 -mfpu=vfp -mfpmath=neon For X86, since LLVM doesn't support an independent ssefp feature, we just make sure the selected -mfpmath matches the sse level. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188939 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Merge TextPathDiagnostics and ClangDiagPathDiagConsumer.Jordan Rose2013-08-161-1/+1
| | | | | | | | | | | | | | | | | | | | This once again restores notes to following their associated warnings in -analyzer-output=text mode. (This is still only intended for use as a debugging aid.) One twist is that the warning locations in "regular" analysis output modes (plist, multi-file-plist, html, and plist-html) are reported at a different location on the command line than in the output file, since the command line has no path context. This commit makes -analyzer-output=text behave like a normal output format, which means that the *command line output will be different* in -analyzer-text mode. Again, since -analyzer-text is a debugging aid and lo-fi stand-in for a regular output mode, this change makes sense. Along the way, remove a few pieces of stale code related to the path diagnostic consumers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188514 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-cl: Support /showIncludesHans Wennborg2013-08-091-0/+1
| | | | | | | | | | This option prints information about #included files to stderr. Clang could already do it, this patch just teaches the existing code about the /showIncludes style and adds the flag. Differential Revision: http://llvm-reviews.chandlerc.com/D1333 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188037 91177308-0d34-0410-b5e6-96231b3b80d8
* The only useful loop unrolling flag to give realistically isChandler Carruth2013-08-081-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | '-fno-unroll-loops'. The option to the backend is even called 'DisableUnrollLoops'. This is precisely the form that Clang *didn't* support. We didn't recognize the flag, we didn't pass it to the CC1 layer, and even if we did we wouldn't use it. Clang only inspected the positive form of the flag, and only did so to enable loop unrolling when the optimization level wasn't high enough. This only occurs for an optimization level that even has a chance of running the loop unroller when optimizing for size. This commit wires up the 'no' variant, and switches the code to actually follow the standard flag pattern of using the last flag and allowing a flag in either direction to override the default. I think this is still wrong. I don't know why we disable the loop unroller entirely *from Clang* when optimizing for size, as the loop unrolling pass *already has special logic* for the case where the function is attributed as optimized for size! We should really be trusting that. Maybe in a follow-up patch, I don't really want to change behavior here. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187969 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-cl: Support the run-time selection options (/MD, /MT et al.)Hans Wennborg2013-08-081-0/+2
| | | | | | | | | | | | These flags set some preprocessor macros and injects a dependency on the runtime library into the object file, which later is picked up by the linker. This also adds a new CC1 flag for adding a dependent library. Differential Revision: http://llvm-reviews.chandlerc.com/D1315 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187945 91177308-0d34-0410-b5e6-96231b3b80d8
* Add option to disable module loading.Daniel Jasper2013-08-051-0/+2
| | | | | | | This patch was created by Lawrence Crowl and reviewed in: http://llvm-reviews.chandlerc.com/D963 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187738 91177308-0d34-0410-b5e6-96231b3b80d8
* CC1: Only parse command-line options that have the CC1Option flag.Hans Wennborg2013-08-021-12/+3
| | | | | | | | | | | | | We already reject flags that don't have the CC1Option flag, but we would previously do so after parsing the command-line arguments. Since the option parser now has a parameter for excluding options, we should just use that instead. Differential Revision: http://llvm-reviews.chandlerc.com/D1270 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187668 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a -fno-math-builtin option to the Clang -cc1Eli Bendersky2013-07-231-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186899 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjC migrator: Add -objcmt-migrate-property to do propertyFariborz Jahanian2013-07-091-0/+2
| | | | | | | | migration. Also, fixes an old bug where older migration flags were not being checked for properly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185948 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the multiple argument form of path::append.Benjamin Kramer2013-06-281-3/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185164 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove PathV1.h from CompilerInvocation.cpp.Rafael Espindola2013-06-261-8/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184918 91177308-0d34-0410-b5e6-96231b3b80d8