summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGObjC.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Distinguish more carefully between free functions and C++ instance methodsJohn McCall2012-07-071-24/+27
| | | | | | | | in the ABI arrangement, and leave a hook behind so that we can easily tweak CCs on platforms that use different CCs by default for C++ instance methods. llvm-svn: 159894
* Documentation cleanup: Escape @objc* in Doxygen comments.James Dennett2012-06-221-24/+24
| | | | llvm-svn: 158974
* Restructure how the driver communicates information about theJohn McCall2012-06-201-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | target Objective-C runtime down to the frontend: break this down into a single target runtime kind and version, and compute all the relevant information from that. This makes it relatively painless to add support for new runtimes to the compiler. Make the new -cc1 flag, -fobjc-runtime=blah-x.y.z, available at the driver level as a better and more general alternative to -fgnu-runtime and -fnext-runtime. This new concept of an Objective-C runtime also encompasses what we were previously separating out as the "Objective-C ABI", so fragile vs. non-fragile runtimes are now really modelled as different kinds of runtime, paving the way for better overall differentiation. As a sort of special case, continue to accept the -cc1 flag -fobjc-runtime-has-weak, as a sop to PLCompatibilityWeak. I won't go so far as to say "no functionality change", even ignoring the new driver flag, but subtle changes in driver semantics are almost certainly not intended. llvm-svn: 158793
* Documentation cleanup:James Dennett2012-06-151-4/+6
| | | | | | | | * Escaped Objective-C @keywords in Doxygen comments; * Documented more accurate \params; * Exposed some more summaries using \brief. llvm-svn: 158559
* objective-c: fix a sema and IRGen crash when propertyFariborz Jahanian2012-05-291-6/+9
| | | | | | | | getter result type is safe but does not match with property type resulting in spurious warning followed by crash in IRGen. // rdar://11515196 llvm-svn: 157641
* objective-c IRGen. Fixes a getter synthesis bugFariborz Jahanian2012-04-261-1/+1
| | | | | | | where getter type is super class of its property type, resulting in an assert. // rdar://11323676 llvm-svn: 155663
* Implements boxed expressions for Objective-C. <rdar://problem/10194391>Patrick Beard2012-04-191-19/+19
| | | | llvm-svn: 155082
* These functions too have no prototypes. Audited the rest of Sema forEric Christopher2012-04-121-2/+2
| | | | | | | | FunctionDecl::Create calls as well. rdar://11079003 llvm-svn: 154578
* Change location information for synthesized properties to be at theEric Christopher2012-04-031-2/+2
| | | | | | | | | | | | | | | | | | property file/line rather than the @synthesize file/line. Avoids some nasty confusing-ness with conflating the file from the scope and the line from the original declaration. Use the current scope location as a separate parameter so that we can match it up better in the line table with the beginning of the scope. Update a couple of testcases accordingly since I had to change that we actually use the passed in location in EmitFunctionStart and for the new metadata parameter and add a new testcase to make sure we've got the right line numbers for synthesized properties. Part of rdar://11026482 llvm-svn: 153917
* Revert previous commit changing location information to see if thisEric Christopher2012-03-301-2/+2
| | | | | | is causing the gdb test failures on the bots. llvm-svn: 153727
* Change location information for synthesized properties to be at theEric Christopher2012-03-301-2/+2
| | | | | | | | | | | | | property file/line rather than the @synthesize file/line. Avoids some nasty confusing-ness with conflating the file from the scope and the line from the original declaration. Update a couple of testcases accordingly since I had to change that we actually use the passed in location in EmitFunctionStart. Fixes rdar://11026482 llvm-svn: 153714
* Revert r153613 as it's causing large compile-time regressions on the nightly ↵Chad Rosier2012-03-291-6/+3
| | | | | | testers. llvm-svn: 153660
* Tidy.Eric Christopher2012-03-291-13/+19
| | | | llvm-svn: 153658
* When we can't prove that the target of an aggregate copy isJohn McCall2012-03-281-3/+6
| | | | | | | a complete object, the memcpy needs to use the data size of the structure instead of its sizeof() value. Fixes PR12204. llvm-svn: 153613
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-111-17/+17
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* Simplify code. No functionality change.Benjamin Kramer2012-03-101-14/+5
| | | | llvm-svn: 152503
* Remove BlockDeclRefExpr and introduce a bit on DeclRefExpr toJohn McCall2012-03-101-33/+27
| | | | | | | | track whether the referenced declaration comes from an enclosing local context. I'm amenable to suggestions about the exact meaning of this bit. llvm-svn: 152491
* Add clang support for new Objective-C literal syntax for NSDictionary, NSArray,Ted Kremenek2012-03-061-18/+198
| | | | | | | | | | | | | NSNumber, and boolean literals. This includes both Sema and Codegen support. Included is also support for new Objective-C container subscripting. My apologies for the large patch. It was very difficult to break apart. The patch introduces changes to the driver as well to cause clang to link in additional runtime support when needed to support the new language features. Docs are forthcoming to document the implementation and behavior of these features. llvm-svn: 152137
* Make CodeGenFunction::EmitBlockCopyAndAutorelease actually do what its name ↵Eli Friedman2012-03-011-4/+4
| | | | | | says. llvm-svn: 151853
* Implement IRGen for the retain-autorelease in the lambda ↵Eli Friedman2012-02-281-0/+25
| | | | | | conversion-to-block-pointer outside of ARC. Testcases coming up soon. llvm-svn: 151603
* Whether an argument is required (in contrast with being anJohn McCall2012-02-171-20/+31
| | | | | | | | | | | | | | | | | | | | | optional argument passed through the variadic ellipsis) potentially affects how we need to lower it. Propagate this information down to the various getFunctionInfo(...) overloads on CodeGenTypes. Furthermore, rename those overloads to clarify their distinct purposes, and make sure we're calling the right one in the right place. This has a nice side-effect of making it easier to construct a function type, since the 'variadic' bit is no longer separable. This shouldn't really change anything for our existing platforms, with one minor exception --- we should now call variadic ObjC methods with the ... in the "right place" (see the test case), which I guess matters for anyone running GNUStep on MIPS. Mostly it's just a substantial clean-up. llvm-svn: 150788
* Represent C++ direct initializers as ParenListExprs before semantic analysisSebastian Redl2012-02-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instead of having a special-purpose function. - ActOnCXXDirectInitializer, which was mostly duplication of AddInitializerToDecl (leading e.g. to PR10620, which Eli fixed a few days ago), is dropped completely. - MultiInitializer, which was an ugly hack I added, is dropped again. - We now have the infrastructure in place to distinguish between int x = {1}; int x({1}); int x{1}; -- VarDecl now has getInitStyle(), which indicates which of the above was used. -- CXXConstructExpr now has a flag to indicate that it represents list- initialization, although this is not yet used. - InstantiateInitializer was renamed to SubstInitializer and simplified. - ActOnParenOrParenListExpr has been replaced by ActOnParenListExpr, which always produces a ParenListExpr. Placed that so far failed to convert that back to a ParenExpr containing comma operators have been fixed. I'm pretty sure I could have made a crashing test case before this. The end result is a (I hope) considerably cleaner design of initializers. More importantly, the fact that I can now distinguish between the various initialization kinds means that I can get the tricky generalized initializer test cases Johannes Schaub supplied to work. (This is not yet done.) This commit passed self-host, with the resulting compiler passing the tests. I hope it doesn't break more complicated code. It's a pretty big change, but one that I feel is necessary. llvm-svn: 150318
* simplify a bunch of code to use the well-known LLVM IR types computed by ↵Chris Lattner2012-02-071-2/+1
| | | | | | CodeGenModule. llvm-svn: 149943
* revert r149184Fariborz Jahanian2012-01-291-17/+3
| | | | llvm-svn: 149205
* objc-arc: Perform null check on receiver before sending methods whichFariborz Jahanian2012-01-281-3/+17
| | | | | | | | consume one or more of their arguments. If not done, this will cause a leak as method will not consume the argument when receiver is null. // rdar://10444474 llvm-svn: 149184
* Use function pointers, rather than references, to pass DestroyersPeter Collingbourne2012-01-261-4/+4
| | | | | | | around, in the process cleaning up the various gcc/msvc compiler workarounds. llvm-svn: 149036
* More dead code removal (using -Wunreachable-code)David Blaikie2012-01-201-1/+0
| | | | llvm-svn: 148577
* objc++: patch for IRgen for atomic properties ofFariborz Jahanian2012-01-101-34/+160
| | | | | | | c++ objects with non-trivial assignment/copy functions. Also, one additional sema check. // rdar://6137845 llvm-svn: 147817
* objc++: more atomic property api code forFariborz Jahanian2012-01-081-7/+15
| | | | | | c++ object properties. wip. llvm-svn: 147750
* objc++: More codegen stuff for atomic properties of c++ objectsFariborz Jahanian2012-01-071-7/+18
| | | | | | with non-trivial copies. // rdar://6137845 llvm-svn: 147735
* objc++: more code gen stuff for atomic property api,Fariborz Jahanian2012-01-061-13/+65
| | | | | | | | currently turned off. // rdar://6137845 Also, fixes a test case which should be nonatomic under new API. llvm-svn: 147691
* objc++: sythesize a helper function to be usedFariborz Jahanian2012-01-061-2/+89
| | | | | | | | for copying atomic properties of c++ objects with non-trivial copy assignment in setters/getters. Not yet used. // rdar://6137845 llvm-svn: 147636
* Fixes a code gen bug for setter code for a property ofFariborz Jahanian2012-01-051-1/+2
| | | | | | | | c++ object reference type with trivial copy constructor. This causes an assert crash and bad code gen. when assert is off. // rdar://6137845 llvm-svn: 147573
* Switch LValue so that it exposes alignment in CharUnits. (No functional ↵Eli Friedman2011-12-031-10/+5
| | | | | | change.) llvm-svn: 145753
* Enter the cleanups for a block outside the enclosingJohn McCall2011-11-101-2/+5
| | | | | | | | | | | | full-expression. Naturally they're inactive before we enter the block literal expression. This restores the intended behavior that blocks belong to their enclosing scope. There's a useful -O0 / compile-time optimization that we're missing here with activating cleanups following straight-line code from their inactive beginnings. llvm-svn: 144268
* Rip out CK_GetObjCProperty.John McCall2011-11-071-16/+0
| | | | llvm-svn: 143910
* Rip the ObjCPropertyRef l-value kind out of IR-generation.John McCall2011-11-071-101/+0
| | | | llvm-svn: 143908
* Change the AST representation of operations on Objective-CJohn McCall2011-11-061-0/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | property references to use a new PseudoObjectExpr expression which pairs a syntactic form of the expression with a set of semantic expressions implementing it. This should significantly reduce the complexity required elsewhere in the compiler to deal with these kinds of expressions (e.g. IR generation's special l-value kind, the static analyzer's Message abstraction), at the lower cost of specifically dealing with the odd AST structure of these expressions. It should also greatly simplify efforts to implement similar language features in the future, most notably Managed C++'s properties and indexed properties. Most of the effort here is in dealing with the various clients of the AST. I've gone ahead and simplified the ObjC rewriter's use of properties; other clients, like IR-gen and the static analyzer, have all the old complexity *and* all the new complexity, at least temporarily. Many thanks to Ted for writing and advising on the necessary changes to the static analyzer. I've xfailed a small diagnostics regression in the static analyzer at Ted's request. llvm-svn: 143867
* Replace vectors with arrays.Benjamin Kramer2011-10-151-3/+1
| | | | llvm-svn: 142072
* Recommit:Eric Christopher2011-10-131-16/+8
| | | | | | | | | | | | | | | Start handling debug line and scope information better: Migrate most of the location setting within the larger API in CGDebugInfo and update a lot of callers. Remove the existing file/scope change machinery in UpdateLineDirectiveRegion and replace it with DILexicalBlockFile usage. Finishes off the rest of rdar://10246360 after fixing a few bugs that were exposed in gdb testsuite testing. llvm-svn: 141893
* Revert file/scope handling patches. gdb testing revealed a couple of bugs.Eric Christopher2011-10-121-8/+16
| | | | llvm-svn: 141796
* Start handling debug line and scope information better:Eric Christopher2011-10-111-16/+8
| | | | | | | | | | | Migrate most of the location setting within the larger API in CGDebugInfo and update a lot of callers. Remove the existing file/scope change machinery in UpdateLineDirectiveRegion and replace it with DILexicalBlockFile usage. Finishes off the rest of rdar://10246360 llvm-svn: 141732
* Mark calls to objc_retainBlock that don't result from castsJohn McCall2011-10-041-8/+48
| | | | | | to id so that we can still optimize them appropriately. llvm-svn: 141064
* Allow getting all source locations of selector identifiers in a ObjCMethodDecl.Argyrios Kyrtzidis2011-10-031-1/+1
| | | | | | | | | | | | | Instead of always storing all source locations for the selector identifiers we check whether all the identifiers are in a "standard" position; "standard" position is -Immediately before the arguments: -(id)first:(int)x second:(int)y; -With a space between the arguments: -(id)first: (int)x second: (int)y; -For nullary selectors, immediately before ';': -(void)release; In such cases we infer the locations instead of storing them. llvm-svn: 140989
* When performing an @throw in ARC, retain + autoreleaseJohn McCall2011-10-011-0/+24
| | | | | | | the pointer, being sure to do so before running cleanups associated with that full-expression. rdar://10042689 llvm-svn: 140945
* Change "Regions" to be "LexicalBlocks" since that's what theyEric Christopher2011-09-291-4/+4
| | | | | | correspond to. llvm-svn: 140740
* de-tmpify clang.Benjamin Kramer2011-09-271-2/+1
| | | | llvm-svn: 140637
* Turn off the generation of unaligned atomic load/store; I'm going to ↵Eli Friedman2011-09-131-1/+3
| | | | | | explicitly error out on such cases in the backend, at least for the moment. llvm-svn: 139640
* Refactoring, mostly to give ObjCPropertyDecls stronger invariants forJohn McCall2011-09-131-9/+8
| | | | | | their semantic attributes and then to take advantage of that. llvm-svn: 139615
* Switch LangOptions over to a .def file that describes header of theDouglas Gregor2011-09-131-4/+4
| | | | | | | | | | language options. Use that .def file to declare the LangOptions class and initialize all of its members, eliminating a source of annoying initialization bugs. AST serialization changes are next up. llvm-svn: 139605
OpenPOWER on IntegriCloud