summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Clean up the analysis of the collection operand to ObjCJohn McCall2011-07-271-2/+20
| | | | | | | | | | | for-in statements; specifically, make sure to close over any temporaries or cleanups it might require. In ARC, this has implications for the lifetime of the collection, so emit it with a retain and release it upon exit from the loop. rdar://problem/9817306 llvm-svn: 136204
* Disable the optimization that skips emission of complete, non-virtualDouglas Gregor2011-07-261-5/+1
| | | | | | | | | destructors of abstract classes. It's undefined behavior to actually call the destructor (e.g., via delete), but the presence of code that calls this destructor doesn't make the program ill-formed. Fixes <rdar://problem/9819242>. llvm-svn: 136180
* Rename getInstantiationLineNumber to getExpansionLineNumber in bothChandler Carruth2011-07-252-4/+3
| | | | | | SourceManager and FullSourceLoc. llvm-svn: 135969
* Mechanically rename SourceManager::getInstantiationLoc andChandler Carruth2011-07-251-2/+2
| | | | | | | | FullSourceLoc::getInstantiationLoc to ...::getExpansionLoc. This is part of the API and documentation update from 'instantiation' as the term for macros to 'expansion'. llvm-svn: 135914
* Shorten some expressions by using ArrayRef::slice().Frits van Bommel2011-07-251-6/+3
| | | | llvm-svn: 135910
* fix PR10415, tidying up IR representation of module level inline asmChris Lattner2011-07-231-0/+2
| | | | | | to avoid extraneous \n's. llvm-svn: 135862
* Move ArrayRef to LLVM.h and eliminate now-redundant qualifiers, patch by Jon ↵Chris Lattner2011-07-234-6/+6
| | | | | | Mulder! llvm-svn: 135855
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-2333-339/+338
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* clean up forward declarations of raw_ostream to use the new LLVM.hChris Lattner2011-07-232-5/+6
| | | | | | patch by Jon Mulder! llvm-svn: 135851
* Document the existing objc_precise_lifetime attribute.John McCall2011-07-221-18/+68
| | | | | | | | | Introduce and document a new objc_returns_inner_pointer attribute, and consume it by performing a retain+autorelease on message receivers when they're not immediately loaded from an object with precise lifetime. llvm-svn: 135764
* Convert IRBuilder::CreateGEP and IRBuilder::CreateInBoundsGEP to useJay Foad2011-07-226-11/+8
| | | | | | ArrayRef. llvm-svn: 135761
* fix PR10384: C++ allows external arrays of incomplete type as well.Chris Lattner2011-07-221-0/+8
| | | | | | Many thanks to Eli for reducing this great testcase. llvm-svn: 135752
* In ARC, non-atomic getters do not need to retain and autoreleaseJohn McCall2011-07-221-17/+20
| | | | | | | their loaded values, although it still worth doing this for __weak properties to get the autoreleased-return-value optimization. llvm-svn: 135747
* Add a const overload for ObjCInterfaceDecl::all_declared_ivar_begin.Jordy Rose2011-07-225-43/+33
| | | | | | | | | This was previously not-const only because it has to lazily construct a chain of ivars the first time it is called (and after the chain is invalidated). In practice, all the clients were just const_casting their const Decls; all those now-unnecessary const_casts have been removed. llvm-svn: 135741
* Convert ConstantExpr::getGetElementPtr andJay Foad2011-07-216-14/+14
| | | | | | ConstantExpr::getInBoundsGetElementPtr to use ArrayRef. llvm-svn: 135673
* Unbreak build after API change.Benjamin Kramer2011-07-201-6/+7
| | | | llvm-svn: 135585
* add raw_ostream and Twine to LLVM.h, eliminating a ton of llvm:: qualifications.Chris Lattner2011-07-202-8/+8
| | | | llvm-svn: 135577
* now that we have a centralized place to do so, add some using declarations forChris Lattner2011-07-2011-58/+59
| | | | | | | some common llvm types: stringref and smallvector. This cleans up the codebase quite a bit. llvm-svn: 135576
* fix rdar://9780211 - Clang crashes with an assertion failure building ↵Chris Lattner2011-07-201-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | WKView.mm from WebKit This is something of a hack, the problem is as follows: 1. we instantiate both copied of RetainPtr with the two different argument types (an id and protocol-qualified id). 2. We refer to the ctor of one of the instantiations when introducing global "x", this causes us to emit an llvm::Function for a prototype whose "this" has type "RetainPtr<id<bork> >*". 3. We refer to the ctor of the other instantiation when introducing global "y", however, because it *mangles to the same name as the other ctor* we just use a bitcasted version of the llvm::Function we previously emitted. 4. We emit deferred declarations, causing us to emit the body of the ctor, however the body we emit is for RetainPtr<id>, which expects its 'this' to have an IR type of "RetainPtr<id>*". Because of the mangling collision, we don't have this case, and explode. This is really some sort of weird AST invariant violation or something, but hey a bitcast makes the pain go away. llvm-svn: 135572
* fix a case where we're using ConvertType for a memory object.Chris Lattner2011-07-201-1/+1
| | | | | | It doesn't matter in practice, but it is good to be tidy. llvm-svn: 135571
* as eli points out, we're not doing memory stuff here. While ConvertType Chris Lattner2011-07-202-3/+2
| | | | | | | and ConvertTypeForMem are the same for pointers, it is best to just use ConvertType. Thanks Eli! llvm-svn: 135567
* fix PR10395 - array decay can produce an interesting type whenChris Lattner2011-07-201-1/+4
| | | | | | | decaying an array of incomplete type (which has type [0 x i8]*) to a normal pointer (which has incompletetype*). llvm-svn: 135565
* Match createTargetMachine API change.Evan Cheng2011-07-191-11/+13
| | | | llvm-svn: 135469
* Simplify.Devang Patel2011-07-191-6/+2
| | | | llvm-svn: 135456
* Check column number also.Devang Patel2011-07-181-3/+5
| | | | llvm-svn: 135437
* Migrate LLVM and Clang to use the new makeArrayRef(...) functions where ↵Frits van Bommel2011-07-182-9/+6
| | | | | | | | previously explicit non-default constructors were used. Mostly mechanical with some manual reformatting. llvm-svn: 135390
* In C99, emit an inline function when encountering an extern redeclaration.Nick Lewycky2011-07-181-2/+15
| | | | | | Fixes PR10233! llvm-svn: 135377
* de-constify llvm::Type, patch by David Blaikie!Chris Lattner2011-07-1835-452/+452
| | | | llvm-svn: 135370
* Fix typoJoerg Sonnenberger2011-07-151-1/+1
| | | | llvm-svn: 135285
* Convert CallInst and InvokeInst APIs to use ArrayRef.Jay Foad2011-07-1511-66/+69
| | | | llvm-svn: 135265
* Fix the definition of AsTypeExpr. I'm still not sure thisJohn McCall2011-07-151-1/+1
| | | | | | | | | | is right --- shouldn't there be a TypeLoc in here somewhere? --- but at least it doesn't have a redundant QualType and a broken children() method. Noticed this while doing things in serialization. llvm-svn: 135257
* protect some calls to ConvertType when a function info is under constructionChris Lattner2011-07-151-3/+3
| | | | | | | to prevent recursive compilation problems. This fixes a failure of CodeGen/decl.c on x86-32 targets that don't fill in the coerce-to type. llvm-svn: 135256
* Enhance the IR type lowering code to be much smarter about recursively loweringChris Lattner2011-07-153-68/+172
| | | | | | | | | | | | | | | | | | | | | | | | | types. Fore xample, we used to lower: struct bar { int a; }; struct foo { void (*FP)(struct bar); } G; to: %struct.foo = type { {}* } since the function pointer would cause recursive translation of bar and we didn't know if that would get us into trouble. We are now smart enough to know that it is fine, so we get this type instead: %struct.foo = type { void (i32)* } Codegen still needs to be prepared for uncooperative types at any place, which is why I let the maximally uncooperative code sit around for awhile to help shake out the bugs. llvm-svn: 135244
* Create a new expression node, SubstNonTypeTemplateParmExpr,John McCall2011-07-155-0/+17
| | | | | | | | to represent a fully-substituted non-type template parameter. This should improve source fidelity, as well as being generically useful for diagnostics and such. llvm-svn: 135243
* Change intrinsic getter to take an ArrayRef, now that the underlying ↵Benjamin Kramer2011-07-147-113/+105
| | | | | | function in LLVM does. llvm-svn: 135155
* Reapply r134946 with fixes. Tested on Benjamin testcase and other test-suite ↵Bruno Cardoso Lopes2011-07-131-2/+10
| | | | | | failures. llvm-svn: 135091
* Emit debug info for extended vectors.Devang Patel2011-07-131-3/+0
| | | | llvm-svn: 135083
* Don't crash if defining -dealloc in a category.John McCall2011-07-131-3/+5
| | | | llvm-svn: 135054
* Okay, that rule about zero-length arrays applies to destroyingJohn McCall2011-07-133-53/+38
| | | | | | them, too. llvm-svn: 135038
* Arrays are permitted to be zero-length in some situations.John McCall2011-07-132-27/+27
| | | | llvm-svn: 135036
* Convert the standard default-construction loops to use phis andJohn McCall2011-07-132-84/+103
| | | | | | partial destruction. llvm-svn: 135033
* per john's advice, speculatively lower uses of forward-declared enums toChris Lattner2011-07-131-5/+12
| | | | | | | i32. They almost always end up this way in the end anyway, and if we get lucky, this avoids generating some bitcasts. llvm-svn: 135032
* PR10337 reminds me that calls return values, lets handle them justChris Lattner2011-07-131-3/+9
| | | | | | like arguments. Thanks PR10337! :) llvm-svn: 135030
* Aggressive dead code elimination.John McCall2011-07-132-80/+0
| | | | llvm-svn: 135029
* Generalize the routine for destroying an object with staticJohn McCall2011-07-132-49/+55
| | | | | | | storage duration, then explicitly exempt ownership-qualified types from it. llvm-svn: 135028
* Switch delete[] IR-generation over to the destroy framework,John McCall2011-07-131-78/+38
| | | | | | which implicitly makes it EH-safe as well. llvm-svn: 135025
* When compiling ::delete for a class with a virtual destructor, callDouglas Gregor2011-07-131-4/+19
| | | | | | | | the complete destructor and then invoke the global delete operator. Previously, we would invoke the deleting destructor, which calls the wrong delete operator. Fixes PR10341. llvm-svn: 135021
* Revert r134946Bruno Cardoso Lopes2011-07-121-8/+1
| | | | llvm-svn: 135004
* Generalize Cleanup::Emit's "isForEH" parameter into a setJohn McCall2011-07-1212-54/+89
| | | | | | of flags. No functionality change. llvm-svn: 134997
* Add more compiler workarounds. Should fix the build with old GCCs and MSVC.Benjamin Kramer2011-07-121-6/+10
| | | | llvm-svn: 134995
OpenPOWER on IntegriCloud