summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInvocation.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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... llvm-svn: 194420
* 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 llvm-svn: 194403
* Eliminate an unnecessary .c_str()Douglas Gregor2013-11-081-1/+1
| | | | llvm-svn: 194228
* 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! llvm-svn: 194161
* 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 llvm-svn: 194100
* 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. llvm-svn: 194055
* 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 llvm-svn: 193889
* 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. llvm-svn: 193428
* 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. llvm-svn: 192497
* 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. llvm-svn: 192413
* 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 llvm-svn: 192317
* Remove -ast-dump-xml.Richard Smith2013-10-071-3/+0
| | | | llvm-svn: 192131
* ObjectiveC migrator: Add more options one for eachFariborz Jahanian2013-10-021-0/+8
| | | | | | kind of migration. // rdar://15003157 llvm-svn: 191858
* ObjectiveC migrator. Starting distiguising differentFariborz Jahanian2013-10-021-0/+4
| | | | | | | migrations under their own option. wip and // rdar://15003157 llvm-svn: 191855
* Revert r191586 and r191695. They cause crashes when building withRichard Smith2013-10-011-1/+1
| | | | | | -relaxed-aliasing. llvm-svn: 191725
* Turn struct-path aware TBAA on by default.Manman Ren2013-09-301-1/+1
| | | | | | Use -no-struct-path-tbaa to turn it off. llvm-svn: 191695
* 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. llvm-svn: 191629
* 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. llvm-svn: 191551
* 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. llvm-svn: 191284
* 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. llvm-svn: 191283
* 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 llvm-svn: 191250
* 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! llvm-svn: 190684
* 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. llvm-svn: 190464
* 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! llvm-svn: 190296
* Attempt to migrate default dwarf version to 4 for linux.Eric Christopher2013-09-031-2/+2
| | | | llvm-svn: 189823
* 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. llvm-svn: 189537
* 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. llvm-svn: 188939
* [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. llvm-svn: 188514
* 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 llvm-svn: 188037
* 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. llvm-svn: 187969
* 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 llvm-svn: 187945
* 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 llvm-svn: 187738
* 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 llvm-svn: 187668
* Add a -fno-math-builtin option to the Clang -cc1Eli Bendersky2013-07-231-0/+1
| | | | llvm-svn: 186899
* 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. llvm-svn: 185948
* Use the multiple argument form of path::append.Benjamin Kramer2013-06-281-3/+1
| | | | llvm-svn: 185164
* Remove PathV1.h from CompilerInvocation.cpp.Rafael Espindola2013-06-261-8/+7
| | | | llvm-svn: 184918
* Use llvm::sys::fs::getMainExecutable.Rafael Espindola2013-06-261-1/+2
| | | | llvm-svn: 184915
* Make -vectorize-... proper cc1 flags instead of abusing -backend-option. FixesNick Lewycky2013-06-251-0/+4
| | | | | | usage of clang as a library. llvm-svn: 184812
* Add -ast-dump-lookups switch to -cc1 to dump DeclContext lookup maps. Test toRichard Smith2013-06-241-0/+1
| | | | | | follow. llvm-svn: 184678
* Fix a leak of TargetMachine in clang. We'll continue to leak it on purpose ifNick Lewycky2013-06-211-0/+1
| | | | | | given -disable-free. (Reviewed by John McCall over IRC.) llvm-svn: 184595
* Debug Info: support for gdwarf-2 gdwarf-3 gdwarf-4Manman Ren2013-06-191-1/+11
| | | | | | | | These options will add a module flag with name "Dwarf Version". The behavior flag is currently set to Warning, so when two values disagree, a warning will be emitted. llvm-svn: 184276
* Add support for -fpcc-struct-return. Patch by Arthur O'Dwyer!John McCall2013-06-181-0/+9
| | | | llvm-svn: 184166
* [Driver] Refactor clang driver to use LLVM's Option libraryReid Kleckner2013-06-141-42/+64
| | | | | | | | | | | | | | | | | | The big changes are: - Deleting Driver/(Arg|Opt)* - Rewriting includes to llvm/Option/ and re-sorting - 'using namespace llvm::opt' in clang::driver - Fixing the autoconf build by adding option everywhere As discussed in the review, this change includes using directives in header files. I'll make follow up changes to remove those in favor of name specifiers. Reviewers: espindola Differential Revision: http://llvm-reviews.chandlerc.com/D975 llvm-svn: 183989
* Include PathV1.h in files that use it.Rafael Espindola2013-06-111-0/+1
| | | | | | This is preparation for replacing Path.h with PathV2.h. llvm-svn: 183781
* Revert r182331, these checks should be based on the target not the host.Richard Smith2013-05-201-2/+0
| | | | llvm-svn: 182333
* Move two Darwin-specific hacks into #ifdef __APPLE__. These were stat'ingRichard Smith2013-05-201-0/+2
| | | | | | nonexistent Darwin-specific files on every module build. llvm-svn: 182331
* [Modules] Extend Darwin hack to include the modification time of ↵Douglas Gregor2013-05-101-1/+7
| | | | | | | | SystemVersion.plist. Fixes <rdar://problem/13856838>. llvm-svn: 181635
* C++1y: Add a step limit to constexpr evaluation, to catch runaway loops.Richard Smith2013-05-081-0/+2
| | | | llvm-svn: 181388
* Revert r177218.Argyrios Kyrtzidis2013-05-031-1/+0
| | | | | | Per discussion in cfe-commits, asserting may be a better way than introducing a special test flag. llvm-svn: 181073
OpenPOWER on IntegriCloud