summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* SubtargetFeature.h has been moved to MC.Evan Cheng2011-06-291-1/+1
| | | | llvm-svn: 134050
* Under a compiler flag, -freset-local-blocks,Fariborz Jahanian2011-06-281-0/+19
| | | | | | | wipe out stack blocks when they go out of scope. // rdar://9227352 llvm-svn: 134045
* Split out logic for valid clobbers and valid inline asm registers.Eric Christopher2011-06-281-0/+1
| | | | | | Fixes rdar://9281377 llvm-svn: 134016
* Eliminate most uses of ShallowCollectObjCIvars which requiresFariborz Jahanian2011-06-282-25/+24
| | | | | | | a vector for collection. Use iterators where needed instead. // rdar://6817577 llvm-svn: 134015
* Fix PR10204 in a better way.John McCall2011-06-271-3/+1
| | | | llvm-svn: 133943
* Revert parts of r133860 to fix a crash. Add a test.Nico Weber2011-06-271-1/+3
| | | | llvm-svn: 133931
* Cleanup cast IRGen a bit; no intended functionality change.Eli Friedman2011-06-252-34/+65
| | | | llvm-svn: 133864
* Do not apply the ARC move optimization to 'const'-qualified xvalues.John McCall2011-06-251-1/+1
| | | | llvm-svn: 133861
* LValue carries a type now, so simplify the main EmitLoad/Store APIsJohn McCall2011-06-259-104/+93
| | | | | | by removing the redundant type parameter. llvm-svn: 133860
* Mark the multiply which occurs as part of performing pointerJohn McCall2011-06-252-167/+164
| | | | | | | | arithmetic on a VLA as 'nsw', per discussion with djg, and implement pointer arithmetic (other than array accesses) and pointer subtraction for VLA types. llvm-svn: 133855
* Honor objc_precise_lifetime in GC mode by feeding the valueJohn McCall2011-06-243-0/+42
| | | | | | | in the variable to an inline asm which gets run when the variable goes out of scope. llvm-svn: 133840
* Revert "Shorten some ARM builtin names by removing unnecessary "neon" prefix."Bob Wilson2011-06-241-197/+197
| | | | | | | | Sorry, this was a bad idea. Within clang these builtins are in a separate "ARM" namespace, but the actual builtin names should clearly distinguish tha they are target specific. llvm-svn: 133833
* Fix struct member's scope. Patch by Xi Wang.Devang Patel2011-06-242-24/+29
| | | | llvm-svn: 133829
* Change the IR-generation of VLAs so that we capture bounds,John McCall2011-06-248-106/+187
| | | | | | | not sizes; so that we use well-typed allocas; and so that we properly recurse through the full set of variably-modified types. llvm-svn: 133827
* Shorten some ARM builtin names by removing unnecessary "neon" prefix.Bob Wilson2011-06-241-197/+197
| | | | llvm-svn: 133826
* Support for catching objc pointer objects in c++ catch-statementFariborz Jahanian2011-06-234-10/+17
| | | | | | in fragile abi mode and some other cleanups. // rdar://8940528 llvm-svn: 133747
* Alloa catching Objective-C id's being thrown with C++ throwFariborz Jahanian2011-06-224-12/+19
| | | | | | in Darwin's fragile abi mode. // rdar://8940528 llvm-svn: 133639
* Try to silence GCC warningDouglas Gregor2011-06-221-0/+2
| | | | llvm-svn: 133623
* Implement the C++0x move optimization for Automatic Reference CountingDouglas Gregor2011-06-221-0/+25
| | | | | | | | objects, so that we steal the retain count of a temporary __strong pointer (zeroing out that temporary), eliding a retain/release pair. Addresses <rdar://problem/9364932>. llvm-svn: 133621
* When binding a reference to an Automatic Reference Counting temporary,Douglas Gregor2011-06-223-38/+162
| | | | | | | | | retain/release the temporary object appropriately. Previously, we would only perform the retain/release operations when the reference would extend the lifetime of the temporary, but this does the wrong thing across calls. llvm-svn: 133620
* Replace the existing forms of ConstantArray::get() with a single formJay Foad2011-06-223-4/+3
| | | | | | that takes an ArrayRef. llvm-svn: 133615
* Emit @finally blocks completely lazily instead of forcing theirJohn McCall2011-06-223-71/+79
| | | | | | | | | | | | | existence by always threading an edge from the catchall. Not doing this was previously causing a crash in the very extreme case where neither the normal cleanup nor the EH catchall was actually reachable: we would delete the catchall entry block, which would cause us to delete the entry block of the finally cleanup as well because the cleanup logic would merge the blocks, which in turn triggered an assert because later blocks in the finally would still be using values from the entry. Laziness turns out to be the most elegant solution to the problem. llvm-svn: 133601
* IRgen: Add a -fuse-register-sized-bitfield-access option, for testing.Daniel Dunbar2011-06-211-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* IRgen: Add CGOptions to CGTypes.Daniel Dunbar2011-06-213-4/+8
| | | | llvm-svn: 133530
* A few tweaks to MaterializeTemporaryExpr suggested by John.Douglas Gregor2011-06-211-3/+1
| | | | llvm-svn: 133528
* Introduce a new AST node describing reference binding to temporaries.Douglas Gregor2011-06-214-2/+27
| | | | | | | | | | | | | | | | | | | | | | | | | MaterializeTemporaryExpr captures a reference binding to a temporary value, making explicit that the temporary value (a prvalue) needs to be materialized into memory so that its address can be used. The intended AST invariant here is that a reference will always bind to a glvalue, and MaterializeTemporaryExpr will be used to convert prvalues into glvalues for that binding to happen. For example, given const int& r = 1.0; The initializer of "r" will be a MaterializeTemporaryExpr whose subexpression is an implicit conversion from the double literal "1.0" to an integer value. IR generation benefits most from this new node, since it was previously guessing (badly) when to materialize temporaries for the purposes of reference binding. There are likely more refactoring and cleanups we could perform there, but the introduction of MaterializeTemporaryExpr fixes PR9565, a case where IR generation would effectively bind a const reference directly to a bitfield in a struct. Addresses <rdar://problem/9552231>. llvm-svn: 133521
* De-Unicode-ify in comments.NAKAMURA Takumi2011-06-211-1/+1
| | | | llvm-svn: 133501
* Add support for -Wa,--noexecstack when building from a non-assembly file. ForNick Lewycky2011-06-211-0/+2
| | | | | | | 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
* Canonicalize register names properly.Eric Christopher2011-06-211-0/+2
| | | | | | Fixes rdar://9425559 llvm-svn: 133486
* llvm-gcc treats a tentative definition with a previousFariborz Jahanian2011-06-201-1/+2
| | | | | | | | | (or follow up) extern declaration with weak_import as an actual definition. make clang follows this behavior. // rdar://9538608 llvm-gcc treats an extern declaration with weak_import llvm-svn: 133450
* Change how PHINodes store their operands.Jay Foad2011-06-201-3/+3
| | | | | | | | | | | | | | | | | | | Change PHINodes to store simple pointers to their incoming basic blocks, instead of full-blown Uses. Note that this loses an optimization in SplitCriticalEdge(), because we can no longer walk the use list of a BasicBlock to find phi nodes. See the comment I removed starting "However, the foreach loop is slow for blocks with lots of predecessors". Extend replaceAllUsesWith() on a BasicBlock to also update any phi nodes in the block's successors. This mimics what would have happened when PHINodes were proper Users of their incoming blocks. (Note that this only works if OldBB->replaceAllUsesWith(NewBB) is called when OldBB still has a terminator instruction, so it still has some successors.) llvm-svn: 133435
* Remove more unnecessary #include <llvm/ADT/SmallVector.h>Francois Pichet2011-06-201-1/+0
| | | | llvm-svn: 133418
* Update to match mainline ConstantStruct::get API change. Also, use Chris Lattner2011-06-207-59/+60
| | | | | | | | | | | ConvertType on InitListExprs as they are being converted. This is needed for a forthcoming patch, and improves the IR generated anyway (see additional type names in testcases). This patch also converts a bunch of std::vector's in CGObjCMac to use C arrays. There are a ton more that should be converted as well. llvm-svn: 133413
* update for api change.Chris Lattner2011-06-189-116/+66
| | | | llvm-svn: 133365
* Remove dead variables.Benjamin Kramer2011-06-183-6/+0
| | | | llvm-svn: 133346
* 80 cols.Benjamin Kramer2011-06-181-5/+5
| | | | llvm-svn: 133345
* When emitting a compound literal of POD type, continue to emit aDouglas Gregor2011-06-171-0/+10
| | | | | | | | | | | | | | | | | separate aggregate temporary and then memcpy it over to the destination. This fixes a regression I introduced with r133235, where the compound literal on the RHS of an assignment makes use of the structure on the LHS of the assignment. I'm deeply suspicious of AggExprEmitter::VisitBinAssign()'s optimization where it emits the RHS of an aggregate assignment directly into the LHS lvalue without checking whether there is any aliasing between the LHS/RHS. However, I'm not in a position to revisit this now. Big thanks to Eli for finding the regression! llvm-svn: 133261
* Perform an acquire memory barrier on the fast path of a thread-safeJohn McCall2011-06-171-11/+33
| | | | | | static initializer check, as required by the Itanium ABI. llvm-svn: 133250
* Objective-C fast enumeration loop variables are not retained in ARC, butJohn McCall2011-06-173-7/+47
| | | | | | | | | | | | they should still be officially __strong for the purposes of errors, block capture, etc. Make a new bit on variables, isARCPseudoStrong(), and set this for 'self' and these enumeration-loop variables. Change the code that was looking for the old patterns to look for this bit, and change IR generation to find this bit and treat the resulting variable as __unsafe_unretained for the purposes of init/destroy in the two places it can come up. llvm-svn: 133243
* Implement proper support for generating code for compound literals inDouglas Gregor2011-06-171-3/+8
| | | | | | | | | | | | | C++, which means: - binding the temporary as needed in Sema, so that we generate the appropriate call to the destructor, and - emitting the compound literal into the appropriate location for the aggregate, rather than trying to emit it as a temporary and memcpy() it. Fixes PR10138 / <rdar://problem/9615901>. llvm-svn: 133235
* Check the specific target to figure out if a constraint is a validEric Christopher2011-06-171-2/+5
| | | | | | | | | register constraint. Note that we're not checking if the register itself is valid for the constraint. Fixes rdar://9382985 llvm-svn: 133226
* Move computation of __private_extern__ visibilty toFariborz Jahanian2011-06-161-11/+2
| | | | | | getLVForNamespaceScopeDecl(). // rdar://9609649 llvm-svn: 133182
* Set the visibility to 'hidden' when previousFariborz Jahanian2011-06-161-2/+11
| | | | | | | declaration of global var is __private_extern__. // rdar://9609649 llvm-svn: 133157
* Restore correct use of GC barriers.John McCall2011-06-1610-133/+164
| | | | llvm-svn: 133144
* Suppress a warning in -Asserts builds.John McCall2011-06-151-0/+1
| | | | llvm-svn: 133110
* Automatic Reference Counting.John McCall2011-06-1527-238/+2899
| | | | | | | | | | 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
* Per Chris's suggestion, simplify code using llvm::getOrEnforceKnownAlignment.Eli Friedman2011-06-151-36/+15
| | | | llvm-svn: 133095
* Use isAnyComplexType here so we don't pass complex numbers into the ↵Eli Friedman2011-06-151-1/+1
| | | | | | aggregate handling code; found by inspection. llvm-svn: 133070
* Fix a regression from r132957 involving complex integers. (Fixes failures ↵Eli Friedman2011-06-151-2/+6
| | | | | | on gcc-testsuite bot.) llvm-svn: 133069
* Do not emit stoppoint before emitting debug info for parameters.Devang Patel2011-06-151-3/+1
| | | | | | | - llvm.dbg.declare already receives line number information from ParmDecl - Additional extra stoppoint messes up gdb's understanding of where function body starts. llvm-svn: 133065
OpenPOWER on IntegriCloud