| #
cf142165 |
| 07-Aug-2010 |
John McCall <[email protected]> |
Store inheritance paths after CastExprs instead of inside them. This takes some trickery since CastExpr has subclasses (and indeed, is abstract).
Also, smoosh the CastKind into the bitfield from Exp
Store inheritance paths after CastExprs instead of inside them. This takes some trickery since CastExpr has subclasses (and indeed, is abstract).
Also, smoosh the CastKind into the bitfield from Expr.
Drops two words of storage from Expr in the common case of expressions which don't need inheritance paths. Avoids a separate allocation and another word of overhead in cases needing inheritance paths. Also has the advantage of not leaking memory, since destructors for AST nodes are never run.
llvm-svn: 110507
show more ...
|
| #
8680f87d |
| 21-Jul-2010 |
John McCall <[email protected]> |
Switch the destructor for a temporary arising from a reference binding over to using a lazy cleanup.
llvm-svn: 108994
|
| #
217af240 |
| 20-Jul-2010 |
Fariborz Jahanian <[email protected]> |
Adopt objc_assign_threadlocal() for __thread variables of GC types. Implements radar 8203301.
llvm-svn: 108917
|
| #
26008e07 |
| 20-Jul-2010 |
Chris Lattner <[email protected]> |
implement rdar://5739832 - operator new should check for overflow in multiply, causing clang to compile this code into something that correctly throws a length error, fixing a potential integer overf
implement rdar://5739832 - operator new should check for overflow in multiply, causing clang to compile this code into something that correctly throws a length error, fixing a potential integer overflow security attack:
void *test(long N) { return new int[N]; }
int main() { test(1L << 62); }
We do this even when exceptions are disabled, because it is better for the code to abort than for the attack to succeed.
This is heavily based on a patch that Fariborz wrote.
llvm-svn: 108915
show more ...
|
| #
cdb466e5 |
| 15-Jul-2010 |
Douglas Gregor <[email protected]> |
Reinstate the scalar-cast-to-const-reference improvements, this time with the proper spelling of "non-class prvalue". Silly me, I think class rvalues were xvalues rather than prvalues!
Hah hah hah.
Reinstate the scalar-cast-to-const-reference improvements, this time with the proper spelling of "non-class prvalue". Silly me, I think class rvalues were xvalues rather than prvalues!
Hah hah hah.
llvm-svn: 108443
show more ...
|
| #
31e225cc |
| 15-Jul-2010 |
Douglas Gregor <[email protected]> |
Revert r108431 and r108433 (the cast-to-const-reference fixes), which broke nightlytest.
llvm-svn: 108439
|
| #
6744cbda |
| 15-Jul-2010 |
Douglas Gregor <[email protected]> |
Spell isPRValue() properly.
llvm-svn: 108433
|
| #
1bae6a1b |
| 15-Jul-2010 |
Douglas Gregor <[email protected]> |
Teach CodeGenFunction::EmitCastLValue() to handle casts to an lvalue that involve binding a reference to a pure rvalue temporary (e.g., not a class temporary), by creating a new temporary and copying
Teach CodeGenFunction::EmitCastLValue() to handle casts to an lvalue that involve binding a reference to a pure rvalue temporary (e.g., not a class temporary), by creating a new temporary and copying the result there. Fixes PR6024.
llvm-svn: 108431
show more ...
|
| #
cee03909 |
| 15-Jul-2010 |
Douglas Gregor <[email protected]> |
CK_BitCast is not an lvalue bitcast any longer
llvm-svn: 108428
|
| #
51954276 |
| 13-Jul-2010 |
Douglas Gregor <[email protected]> |
Introduce a new cast kind for an "lvalue bitcast", which handles reinterpret_casts (possibly indirectly via C-style/functional casts) on values, e.g.,
int i; reinterpret_cast<short&>(i);
The I
Introduce a new cast kind for an "lvalue bitcast", which handles reinterpret_casts (possibly indirectly via C-style/functional casts) on values, e.g.,
int i; reinterpret_cast<short&>(i);
The IR generated for this is essentially the same as for
*reinterpret_cast<short*>(&i).
Fixes PR6437, PR7593, and PR7344.
llvm-svn: 108294
show more ...
|
| #
747eb784 |
| 08-Jul-2010 |
Douglas Gregor <[email protected]> |
Reinstate the fix for PR7556. A silly use of isTrivial() was suppressing copies of objects with trivial copy constructors.
llvm-svn: 107857
|
| #
e182370e |
| 07-Jul-2010 |
Douglas Gregor <[email protected]> |
Revert r107828 and r107827, the fix for PR7556, which seems to be breaking bootstrap on Linux.
llvm-svn: 107837
|
| #
6df2b8c3 |
| 07-Jul-2010 |
Douglas Gregor <[email protected]> |
Rename CXXZeroInitValueExpr to CXXScalarValueInitExpr, to reflect its newly-narrowed scope. No functionality change.
llvm-svn: 107828
|
| #
bd30929e |
| 06-Jul-2010 |
John McCall <[email protected]> |
Validated by nightly-test runs on x86 and x86-64 darwin, including after self-host. Hopefully these results hold up on different platforms.
I tried to keep the GNU ObjC runtime happy, but it's ha
Validated by nightly-test runs on x86 and x86-64 darwin, including after self-host. Hopefully these results hold up on different platforms.
I tried to keep the GNU ObjC runtime happy, but it's hard for me to test. Reimplement how clang generates IR for exceptions. Instead of creating new invoke destinations which sequentially chain to the previous destination, push a more semantic representation of *why* we need the cleanup/catch/filter behavior, then collect that information into a single landing pad upon request.
Also reorganizes how normal cleanups (i.e. cleanups triggered by non-exceptional control flow) are generated, since it's actually fairly closely tied in with the former. Remove the need to track which cleanup scope a block is associated with.
Document a lot of previously poorly-understood (by me, at least) behavior.
The new framework implements the Horrible Hack (tm), which requires every landing pad to have a catch-all so that inlining will work. Clang no longer requires the Horrible Hack just to make exceptions flow correctly within a function, however. The HH is an unfortunate requirement of LLVM's EH IR.
llvm-svn: 107631
show more ...
|
| #
c401de99 |
| 05-Jul-2010 |
Chris Lattner <[email protected]> |
in the "coerce" case, the ABI handling code ends up making the alloca for an argument. Make sure the argument gets the proper decl alignment, which may be different than the type alignment.
This fi
in the "coerce" case, the ABI handling code ends up making the alloca for an argument. Make sure the argument gets the proper decl alignment, which may be different than the type alignment.
This fixes PR7567
llvm-svn: 107627
show more ...
|
| #
bac7490f |
| 01-Jul-2010 |
Douglas Gregor <[email protected]> |
Remove unnecessary ASTContext parameter from CXXRecordDecl::getDestructor(); no functionality change.
llvm-svn: 107394
|
| #
3f48c603 |
| 27-Jun-2010 |
Anders Carlsson <[email protected]> |
Correctly destroy reference temporaries with global storage. Remove ErrorUnsupported call when binding a global reference to a non-lvalue. Fixes PR7326.
llvm-svn: 106983
|
| #
18c205ec |
| 27-Jun-2010 |
Anders Carlsson <[email protected]> |
Add a CreateReferenceTemporary that will do the right thing for variables with global storage.
llvm-svn: 106982
|
| #
2969c8c6 |
| 27-Jun-2010 |
Anders Carlsson <[email protected]> |
Simplify CodeGenFunction::EmitReferenceBindingToExpr as a first step towards fixing PR7326.
llvm-svn: 106981
|
| #
ca68d357 |
| 27-Jun-2010 |
Anders Carlsson <[email protected]> |
Reduce indentation.
llvm-svn: 106980
|
| #
5e016ae9 |
| 27-Jun-2010 |
Chris Lattner <[email protected]> |
finally get around to doing a significant cleanup to irgen: have CGF create and make accessible standard int32,int64 and intptr types. This fixes a ton of 80 column violations introduced by LLVMCo
finally get around to doing a significant cleanup to irgen: have CGF create and make accessible standard int32,int64 and intptr types. This fixes a ton of 80 column violations introduced by LLVMContextification and cleans up stuff a lot.
llvm-svn: 106977
show more ...
|
| #
6c5abe88 |
| 26-Jun-2010 |
Chris Lattner <[email protected]> |
Implement rdar://7530813 - collapse multiple GEP instructions in IRgen
This avoids generating two gep's for common array operations. Before we would generate something like:
%tmp = load i32* %X.
Implement rdar://7530813 - collapse multiple GEP instructions in IRgen
This avoids generating two gep's for common array operations. Before we would generate something like:
%tmp = load i32* %X.addr ; <i32> [#uses=1] %arraydecay = getelementptr inbounds [100 x i32]* %A, i32 0, i32 0 ; <i32*> [#uses=1] %arrayidx = getelementptr inbounds i32* %arraydecay, i32 %tmp ; <i32*> [#uses=1] %tmp1 = load i32* %arrayidx ; <i32> [#uses=1]
Now we generate:
%tmp = load i32* %X.addr ; <i32> [#uses=1] %arrayidx = getelementptr inbounds [100 x i32]* %A, i32 0, i32 %tmp ; <i32*> [#uses=1] %tmp1 = load i32* %arrayidx ; <i32> [#uses=1]
Less IR is better at -O0.
llvm-svn: 106966
show more ...
|
| #
57ce9715 |
| 26-Jun-2010 |
Chris Lattner <[email protected]> |
minor cleanup: don't emit the base of an array subscript until after we're done diddling around with the index stuff. Use a cheaper type comparison.
llvm-svn: 106963
|
| #
05dc78c0 |
| 26-Jun-2010 |
Chris Lattner <[email protected]> |
move scalar inc/dec codegen into ScalarExprEmitter instead of being in CGF. No functionality change.
llvm-svn: 106961
|
| #
fa20e950 |
| 26-Jun-2010 |
Chris Lattner <[email protected]> |
use more efficient type comparison predicates.
llvm-svn: 106958
|