| Age | Commit message (Collapse) | Author |
|
class; they should just be completely opaque throughout IR gen now,
although I haven't really audited that.
Fix a bug apparently inherited from gcc-4.2 where we failed to null-check
member data pointers when performing derived-to-base or base-to-derived
conversions on them.
llvm-svn: 111789
|
|
pointers. I find the resulting code to be substantially cleaner, and it
makes it very easy to use the same APIs for data member pointers (which I have
conscientiously avoided here), and it avoids a plethora of potential
inefficiencies due to excessive memory copying, but we'll have to see if it
actually works.
llvm-svn: 111776
|
|
the ABI code. Implement correct semantics for these on ARM.
I believe this completes the implementation of member function pointers
on ARM.
I think I'm going to switch member function pointers over to be
non-aggregates while I have all this in mind.
llvm-svn: 111774
|
|
- Fixes PR5598.
- Review appreciated.
llvm-svn: 111726
|
|
methods.
llvm-svn: 111722
|
|
llvm-svn: 111721
|
|
field (I think).
- Doug, please check.
llvm-svn: 111720
|
|
with isNonGC().
llvm-svn: 111718
|
|
which were previously not computing the qualifier list. In most cases, I don't think it matters, but I believe this is conservatively more correct / consistent.
llvm-svn: 111717
|
|
llvm-svn: 111716
|
|
factored out.
llvm-svn: 111715
|
|
generating lvalue load/stores.
llvm-svn: 111710
|
|
update callers as best I can.
- This is a work in progress, our alignment handling is very horrible / sketchy -- I am just aiming for monotonic improvement.
- Serious review appreciated.
llvm-svn: 111707
|
|
llvm-svn: 111334
|
|
reason that this should be limited to simple lvalues.
llvm-svn: 111331
|
|
llvm-svn: 111330
|
|
an lvalue of another, compatible Objective-C object type (e.g., a
subclass). Introduce a new initialization sequence step kind to
describe this binding, along with a new cast kind. Fixes PR7741.
llvm-svn: 110513
|
|
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
|
|
using a lazy cleanup.
llvm-svn: 108994
|
|
Implements radar 8203301.
llvm-svn: 108917
|
|
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
|
|
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
|
|
broke nightlytest.
llvm-svn: 108439
|
|
llvm-svn: 108433
|
|
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
|
|
llvm-svn: 108428
|
|
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
|
|
suppressing copies of objects with trivial copy constructors.
llvm-svn: 107857
|
|
breaking bootstrap on Linux.
llvm-svn: 107837
|
|
newly-narrowed scope. No functionality change.
llvm-svn: 107828
|
|
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
|
|
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
|
|
CXXRecordDecl::getDestructor(); no functionality change.
llvm-svn: 107394
|
|
ErrorUnsupported call when binding a global reference to a non-lvalue. Fixes PR7326.
llvm-svn: 106983
|
|
with global storage.
llvm-svn: 106982
|
|
fixing PR7326.
llvm-svn: 106981
|
|
llvm-svn: 106980
|
|
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
|
|
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
|
|
we're done diddling around with the index stuff. Use a cheaper type
comparison.
llvm-svn: 106963
|
|
of being in CGF. No functionality change.
llvm-svn: 106961
|
|
llvm-svn: 106958
|
|
llvm-svn: 106949
|
|
reference.
llvm-svn: 106477
|
|
lvalue when performing a derived-to-base conversion.
Fixes radar 7501812. Added an executable test to
llvm-test suite.
llvm-svn: 106247
|
|
an lvalue. Fixes PR7390.
llvm-svn: 106235
|
|
dependency edge was reversed such that CodeGen depends on Frontend.
llvm-svn: 106065
|
|
llvm-svn: 104446
|
|
temporaries. There are actually several interrelated fixes here:
- When converting an object to a base class, it's only an lvalue
cast when the original object was an lvalue and we aren't casting
pointer-to-derived to pointer-to-base. Previously, we were
misclassifying derived-to-base casts of class rvalues as lvalues,
causing various oddities (including problems with reference binding
not extending the lifetimes of some temporaries).
- Teach the code for emitting a reference binding how to look
through no-op casts and parentheses directly, since
Expr::IgnoreParenNoOpCasts is just plain wrong for this. Also, make
sure that we properly look through multiple levels of indirection
from the temporary object, but destroy the actual temporary object;
this fixes the reference-binding issue mentioned above.
- Teach Objective-C message sends to bind the result as a temporary
when needed. This is actually John's change, but it triggered the
reference-binding problem above, so it's included here. Now John
can actually test his return-slot improvements.
llvm-svn: 104434
|
|
llvm-svn: 104390
|