summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInvocation.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Introduce the "-index-header-map" option, to give special semanticsDouglas Gregor2011-07-281-10/+37
| | | | | | | for quoted header lookup when dealing with not-yet-installed frameworks. Fixes <rdar://problem/9824020>. llvm-svn: 136331
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-17/+17
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* [arcmt] Add some additional driver flags to optionally emit or save the ↵Argyrios Kyrtzidis2011-07-191-0/+10
| | | | | | | | | | | pre-migration ARC errors. -arcmt-migrate-emit-errors : Emits the pre-migration ARC errors but it doesn't affect anything else -arcmt-migrate-report-output : Writes out the pre-migration ARC errors to the provided plist file rdar://9791454 llvm-svn: 135491
* In debugger mode, make ObjC message sends to unknown selectors returnJohn McCall2011-07-131-0/+3
| | | | | | | | | | __unknown_anytype, and rewrite such message sends correctly. I had to bite the bullet and actually add a debugger support mode for this one, which is a bit unfortunate, but there really isn't anything else I could imagine doing; this is clearly just debugger-specific behavior. llvm-svn: 135051
* Implement -MG. Fixes PR9613Peter Collingbourne2011-07-121-0/+1
| | | | llvm-svn: 134996
* [arcmt] Introduce new '-ccc-arcmt-migrate <path>' ARC migration driver option.Argyrios Kyrtzidis2011-07-091-1/+13
| | | | | | | | | | | | | | | | | | | | This is a new mode of migration, where we avoid modifying the original files but we emit temporary files instead. <path> will be used to keep migration process metadata. Currently the temporary files that are produced are put in the system's temp directory but we can put them in the <path> if is necessary. Also introduce new ARC migration functions in libclang whose only purpose, currently, is to accept <path> and provide pairs of original file/transformed file to map from the originals to the files after transformations are applied. Finally introduce the c-arcmt-test utility that exercises the new libclang functions, update arcmt-test, and add tests for the whole process. rdar://9735086. llvm-svn: 134844
* Remove BoostCon-specific code from Clang. FWIW, I'm a fan of things like ↵Jonathan D. Turner2011-07-071-3/+0
| | | | | | this living in a separate branch. llvm-svn: 134649
* Call objc_terminate() instead of abort() when a cleanup throws anJohn McCall2011-07-061-0/+3
| | | | | | | exception in Objective-C; in Objective-C++ we still use std::terminate(). This is only available in very recent runtimes. llvm-svn: 134456
* Change the driver's logic about Objective-C runtimes: abstract out aJohn McCall2011-07-061-4/+8
| | | | | | | | | | | | structure to hold inferred information, then propagate each invididual bit down to -cc1. Separate the bits of "supports weak" and "has a native ARC runtime"; make the latter a CodeGenOption. The tool chain is still driving this decision, because it's the place that has the required deployment target information on Darwin, but at least it's better-factored now. llvm-svn: 134453
* Use existing -fcatch-undefined-behavior option,Fariborz Jahanian2011-06-291-3/+0
| | | | | | replacing -freset-local-blocks. // rdar://9227352 llvm-svn: 134082
* Under a compiler flag, -freset-local-blocks,Fariborz Jahanian2011-06-281-0/+3
| | | | | | | wipe out stack blocks when they go out of scope. // rdar://9227352 llvm-svn: 134045
* Make InitHeaderSearch::AddPath and HeaderSearchOptions::AddPath consistentBob Wilson2011-06-211-6/+6
| | | | | | | | use an "IgnoreSysRoot" argument. HeaderSearchOptions had been using the opposite form with "IsSysRootRelative", which made for much confusion when looking at true/false values in calls in AddPath. No functional change. llvm-svn: 133550
* Fix the default libc++ header search path to be sysrooted. Radar 9639692.Bob Wilson2011-06-211-0/+4
| | | | | | | | | The -cxx-isystem path is not prefixed with the sysroot directory, so it's not a good way for the driver to set the system default C++ search path. Instead, add -stdlib as a cc1 option and teach the frontend how to find the headers. The driver can then just pass -stdlib through to "cc1". llvm-svn: 133547
* IRgen: Add a -fuse-register-sized-bitfield-access option, for testing.Daniel Dunbar2011-06-211-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Changes bit-field access policy to try to use (aligned) register sized accesses. The idea here is that by using larger accesses we expose more coalescing potential to the backend when we have situations like adjacent bit-fields in the same structure (which is common), and that the backend should be smart enough to narrow the accesses down when no coalescing is done or when it is shown not to be profitable. -- $ clang -m32 -O3 -S -o - t.c _f0: ## @f0 pushl %ebp movl %esp, %ebp movl 8(%ebp), %eax movb (%eax), %cl andb $-128, %cl orb $1, %cl movb %cl, (%eax) movb 1(%eax), %cl andb $-128, %cl orb $1, %cl movb %cl, 1(%eax) movb 2(%eax), %cl andb $-128, %cl orb $1, %cl movb %cl, 2(%eax) movb 3(%eax), %cl andb $-128, %cl orb $1, %cl movb %cl, 3(%eax) popl %ebp ret $ clang -m32 -O3 -S -o - t.c -Xclang -fuse-register-sized-bitfield-access _f0: ## @f0 pushl %ebp movl %esp, %ebp movl 8(%ebp), %eax movl $-2139062144, %ecx ## imm = 0xFFFFFFFF80808080 andl (%eax), %ecx orl $16843009, %ecx ## imm = 0x1010101 movl %ecx, (%eax) popl %ebp ret -- llvm-svn: 133532
* Add support for -Wa,--noexecstack when building from a non-assembly file. ForNick Lewycky2011-06-211-0/+3
| | | | | | | an assembly file it worked correctly, while for a .c file it would given an error about how --noexecstack is not a supported argument to -Wa. llvm-svn: 133489
* [arcmt] Remove '-arcmt-modify-in-memory', it turned out less useful than we ↵Argyrios Kyrtzidis2011-06-171-8/+1
| | | | | | hoped it would be. llvm-svn: 133315
* The ARC Migration Tool. All the credit goes to Argyrios and FariborzJohn McCall2011-06-151-0/+32
| | | | | | for this. llvm-svn: 133104
* Automatic Reference Counting.John McCall2011-06-151-8/+37
| | | | | | | | | | Language-design credit goes to a lot of people, but I particularly want to single out Blaine Garst and Patrick Beard for their contributions. Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself, in no particular order. llvm-svn: 133103
* Introduce a -cc1-level option to turn off related result typeDouglas Gregor2011-06-141-0/+6
| | | | | | inference, to be used (only) by the Objective-C rewriter. llvm-svn: 133025
* Eliminate the -f[no]objc-infer-related-result-type flags; there's noDouglas Gregor2011-06-131-6/+0
| | | | | | reason to allow the user to control these semantics through a flag. llvm-svn: 132919
* Implement Objective-C Related Result Type semantics.Douglas Gregor2011-06-111-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Related result types apply Cocoa conventions to the type of message sends and property accesses to Objective-C methods that are known to always return objects whose type is the same as the type of the receiving class (or a subclass thereof), such as +alloc and -init. This tightens up static type safety for Objective-C, so that we now diagnose mistakes like this: t.m:4:10: warning: incompatible pointer types initializing 'NSSet *' with an expression of type 'NSArray *' [-Wincompatible-pointer-types] NSSet *array = [[NSArray alloc] init]; ^ ~~~~~~~~~~~~~~~~~~~~~~ /System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:72:1: note: instance method 'init' is assumed to return an instance of its receiver type ('NSArray *') - (id)init; ^ It also means that we get decent type inference when writing code in Objective-C++0x: auto array = [[NSMutableArray alloc] initWithObjects:@"one", @"two",nil]; // ^ now infers NSMutableArray* rather than id llvm-svn: 132868
* Implement -fgnu89-inline. Fixes PR10041.Rafael Espindola2011-06-021-0/+3
| | | | llvm-svn: 132460
* Introduce the -fdiagnostics-format=xxx option to control how ClangDouglas Gregor2011-05-211-1/+24
| | | | | | | | | | | | prints the file, line, and column of a diagnostic. We currently support Clang's normal format, MSVC, and Vi formats. Note that we no longer change the diagnostic format based on -fms-extensions. Patch by Andrew Fish! llvm-svn: 131794
* Preserve the full name of the file, so that '-c -o foo.pic.o' producesNick Lewycky2011-05-051-1/+1
| | | | | | foo.pic.gcno instead of foo.gcno. llvm-svn: 130899
* Change cycle detection to be based off of a warning flag.Alexis Hunt2011-05-051-5/+0
| | | | llvm-svn: 130898
* Record where the GCOV data files should be placed.Nick Lewycky2011-05-041-0/+1
| | | | llvm-svn: 130866
* Implement a better version of delegating constructor cycle detection.Alexis Hunt2011-05-041-0/+5
| | | | | | | | | | | | | This is more efficient as it's all done at once at the end of the TU. This could still get expensive, so a flag is provided to disable it. As an added bonus, the diagnostics will now print out a cycle. The PCH test is XFAILed because we currently can't deal with a note emitted in the header and I, being tired, see no other way to verify the serialization of delegating constructors. We should probably address this problem /somehow/ but no good solution comes to mind. llvm-svn: 130836
* When using -std= flag added check to make sure language and standard are ↵Chad Rosier2011-05-021-0/+34
| | | | | | compatable llvm-svn: 130710
* Implement -fno-dwarf2-cfi-asm.Rafael Espindola2011-04-301-0/+3
| | | | llvm-svn: 130616
* Removed redundant case statementsChad Rosier2011-04-301-2/+0
| | | | llvm-svn: 130564
* Add -Oz option and use it to set the inline threshold to 25.Bob Wilson2011-04-291-3/+4
| | | | | | Radar 9333566. Patch by Chad Rosier! llvm-svn: 130554
* Move all of the logic for __DEPRECATED to the driver based on commentsChandler Carruth2011-04-231-2/+2
| | | | | | from dgregor. llvm-svn: 130066
* Fix Clang's __DEPRECATED define to be controled by -Wdeprecated. ThisChandler Carruth2011-04-231-0/+7
| | | | | | | | | | | | | | | | | | matches GCC behavior which libstdc++ uses to limit #warning-based messages about deprecation. The machinery involves threading this through a new '-fdeprecated-macro' flag for CC1. The flag defaults to "on", similarly to -Wdeprecated. We turn the flag off in the driver when the warning is turned off (modulo matching some GCC bugs). We record this as a language option, and key the preprocessor on the option when introducing the define. A separate flag rather than a '-D' flag allows us to properly represent the difference between C and C++ builds (only C++ receives the define), and it allows the specific behavior of following -Wdeprecated without potentially impacting the set of user-provided macro flags. llvm-svn: 130055
* There were some frustrating problems with the implementation ofChandler Carruth2011-04-231-2/+3
| | | | | | | | | | | | | | | | | | | | -Wwrite-strings. First and foremost, once the positive form of the flag was passed, it could never be disabled by passing -Wno-write-strings. Also, the diagnostic engine couldn't in turn use -Wwrite-strings to control diagnostics (as GCC does) because it was essentially hijacked to drive the language semantics. Fix this by giving CC1 a clean '-fconst-strings' flag to enable const-qualified strings in C and ObjC compilations. Corresponding '-fno-const-strings' is also added. Then the driver is taught to introduce '-fconst-strings' in the CC1 command when '-Wwrite-strings' dominates. This entire flag is basically GCC-bug-compatibility driven, so we also match GCC's bug where '-w' doesn't actually disable -Wwrite-strings. I'm open to changing this though as it seems insane. llvm-svn: 130051
* Add -fdelayed-template-parsing option. Using this option all templated ↵Francois Pichet2011-04-221-0/+6
| | | | | | | | | function definitions are parsed at the end of the translation unit only if it is required by an actual instantiation. As such all the symbols of the TU are available during name lookup. Using this flag is necessary for compatibility with Microsoft template code. This also provides some parsing speed improvement. llvm-svn: 130022
* Wire up the -ftest-coverage and -fprofile-arcs flags to .gcno file emission (atNick Lewycky2011-04-211-0/+6
| | | | | | | | | compile time) and .gcda emission (at runtime). --coverage enables both. This does not yet add the profile_rt library to the link step if -fprofile-arcs is enabled when linking. llvm-svn: 129956
* Initial work to improve documentation for Clang's diagnostics, from Matthieu ↵Douglas Gregor2011-04-151-0/+3
| | | | | | Monrocq llvm-svn: 129614
* fix a bunch of comment typos found by codespell. Patch byChris Lattner2011-04-151-1/+1
| | | | | | Luis Felipe Strano Moraes! llvm-svn: 129559
* C1X: add a language standardPeter Collingbourne2011-04-151-0/+1
| | | | llvm-svn: 129553
* Fix a bunch of major problems with __unknown_anytype and properly testJohn McCall2011-04-091-0/+3
| | | | | | for them. The only major missing feature is references. llvm-svn: 129234
* accept -x objc-cpp-output as an alias for -x objective-c-cpp-output,Chris Lattner2011-04-091-0/+1
| | | | | | per PR9577 llvm-svn: 129201
* Frontend: Sketch support for -diagnostic-log-file, which still doesn't do ↵Daniel Dunbar2011-04-071-0/+5
| | | | | | anything. llvm-svn: 129086
* Integrated-As: Support -Wa,-L when using the integrated assembler.Daniel Dunbar2011-03-281-0/+3
| | | | llvm-svn: 128433
* Flip the default for showing include stacks on notes to false. ThisChandler Carruth2011-03-271-4/+4
| | | | | | | | | | | | | required modifying a few tests that specifically use note include stacks to check the source manager's view of include stacks. I've simply added the flag to these tests for now, they may have to be more substantially changed if we decide to remove support for note include stacks altogether. Also, add a test for include stacks on notes that was supposed to go in with the previous commit. llvm-svn: 128390
* Add an option to suppress include stack printing on note diagnostics.Chandler Carruth2011-03-271-0/+7
| | | | | | | | | | | | | | | | | | These stacks are often less important than those on primary diagnostics. As the number of notes grows, this becomes increasingly important. The include stack printing is clever and doesn't print stacks for adjacent diagnostics from the same file, but when a note is in between a sequence of errors in a header file, and the notes all refer to some other file, we end up getting a worst-case ping-pong of include stacks that take up a great deal of vertical space. Still, for now, the default behavior isn't changed. We can evaluate user feedback with the flag. Patch by Richard Trieu, a couple of style tweaks from me. llvm-svn: 128371
* Frontend: Add a more explicit -backend-option flag for passing backend commandDaniel Dunbar2011-03-221-0/+5
| | | | | | | | line options, instead of leveraging the blanket -mllvm option. - This allows using the frontend itself without requiring the backend have those options available (i.e., if the target wasn't built). llvm-svn: 128087
* Add support for language-specific address spaces. On top of that,Peter Collingbourne2011-03-181-0/+3
| | | | | | | | | add support for the OpenCL __private, __local, __constant and __global address spaces, as well as the __read_only, _read_write and __write_only image access specifiers. Patch originally by ARM; language-specific address space support by myself. llvm-svn: 127915
* Lexer: Add extremely limited support for -traditional-cpp, ignoring BCPLDaniel Dunbar2011-03-181-0/+3
| | | | | | comments. llvm-svn: 127910
* The Darwin kernel does not provide useful guard variable support.John McCall2011-03-181-0/+3
| | | | | | | | Issue this as an IR-gen error; it's not really worthwhile doing this "right", i.e. in Sema, because IR gen knows a lot of tricks beyond what the constant evaluator knows. llvm-svn: 127854
* Fix duplicate argument processingSandeep Patel2011-03-161-1/+1
| | | | llvm-svn: 127746
OpenPOWER on IntegriCloud