| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
constant variable.
llvm-svn: 110660
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
<rdar://problem/8278732>
llvm-svn: 110420
|
|
|
|
| |
llvm-svn: 110239
|
|
|
|
|
|
| |
for objective-c/c++ blocks (NeXt runtime).
llvm-svn: 110213
|
|
|
|
|
|
|
|
|
| |
enclosing normal cleanup, not the top of the EH stack. I'm *really*
surprised this hasn't been causing more problems.
Fixes rdar://problem/8231514.
llvm-svn: 109569
|
|
|
|
|
|
|
| |
as well as some significant asymptotic inefficiencies with threading
multiple jumps through deep cleanups.
llvm-svn: 109274
|
|
|
|
|
|
| |
commits.
llvm-svn: 109000
|
|
|
|
| |
llvm-svn: 108999
|
|
|
|
| |
llvm-svn: 108998
|
|
|
|
|
|
| |
using a lazy cleanup.
llvm-svn: 108994
|
|
|
|
|
|
|
| |
from the laziness features here except better block ordering, but it removes yet
another CleanupBlock use.
llvm-svn: 108990
|
|
|
|
| |
llvm-svn: 108989
|
|
|
|
|
|
|
|
|
| |
initializer of (). Make sure to use a simple memset() when we can, or
fall back to generating a loop when a simple memset will not
suffice. Fixes <rdar://problem/8212208>, a regression due to my work
in r107857.
llvm-svn: 108977
|
|
|
|
| |
llvm-svn: 108972
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
which generates more efficient and more obviously conformant
code. We now test for overflow of the multiply then force
the result to -1 if so. On X86, this generates nice code
like this:
__Z4testl: ## @_Z4testl
## BB#0: ## %entry
subl $12, %esp
movl $4, %eax
mull 16(%esp)
testl %edx, %edx
movl $-1, %ecx
cmovel %eax, %ecx
movl %ecx, (%esp)
call __Znam
addl $12, %esp
ret
llvm-svn: 108927
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
asm operand twice.
llvm-svn: 108489
|
|
|
|
|
|
| |
harmless way.
llvm-svn: 108295
|
|
|
|
|
|
|
| |
or a catch of a record type by value or reference. Also convert this to a
lazy cleanup.
llvm-svn: 108287
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
mostly in avoiding unnecessary work at compile time but also in producing more
sensible block orderings.
Move the destructor cleanups for local variables over to use lazy cleanups.
Eventually all cleanups will do this; for now we have some awkward code
duplication.
Tell IR generation just to never produce landing pads in -fno-exceptions.
This is a much more comprehensive solution to a problem which previously was
half-solved by checks in most cleanup-generation spots.
llvm-svn: 108270
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
rethrow. Fixes rdar://problem/7696603
llvm-svn: 107757
|
|
|
|
|
|
|
|
|
|
|
|
| |
emit metadata associating allocas and global values with a Decl*. This feature
is controlled by an option that (intentionally) cannot be enabled on the command
line.
To use this feature, simply set
CodeGenOptions.EmitDeclMetadata = true;
and then interpret the completely underspecified metadata. :)
llvm-svn: 107739
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
load/store nonsense in the epilog. For example, for:
int foo(int X) {
int A[100];
return A[X];
}
we used to generate:
%arrayidx = getelementptr inbounds [100 x i32]* %A, i32 0, i64 %idxprom ; <i32*> [#uses=1]
%tmp1 = load i32* %arrayidx ; <i32> [#uses=1]
store i32 %tmp1, i32* %retval
%0 = load i32* %retval ; <i32> [#uses=1]
ret i32 %0
}
which codegen'd to this code:
_foo: ## @foo
## BB#0: ## %entry
subq $408, %rsp ## imm = 0x198
movl %edi, 400(%rsp)
movl 400(%rsp), %edi
movslq %edi, %rax
movl (%rsp,%rax,4), %edi
movl %edi, 404(%rsp)
movl 404(%rsp), %eax
addq $408, %rsp ## imm = 0x198
ret
Now we generate:
%arrayidx = getelementptr inbounds [100 x i32]* %A, i32 0, i64 %idxprom ; <i32*> [#uses=1]
%tmp1 = load i32* %arrayidx ; <i32> [#uses=1]
ret i32 %tmp1
}
and:
_foo: ## @foo
## BB#0: ## %entry
subq $408, %rsp ## imm = 0x198
movl %edi, 404(%rsp)
movl 404(%rsp), %edi
movslq %edi, %rax
movl (%rsp,%rax,4), %eax
addq $408, %rsp ## imm = 0x198
ret
This actually does matter, cutting out 2000 lines of IR from CGStmt.ll
for example.
Another interesting effect is that altivec.h functions which are dead
now get dce'd by the inliner. Hence all the changes to
builtins-ppc-altivec.c to ensure the calls aren't dead.
llvm-svn: 106970
|
|
|
|
| |
llvm-svn: 106949
|
|
|
|
|
|
| |
array of other done c++ objects. Fixes PR7490.
llvm-svn: 106869
|
|
|
|
|
|
|
| |
when block literal is declared inside a ctor/dtor.
Fixes radr 8096995.
llvm-svn: 106700
|
|
|
|
|
|
| |
Elhage!
llvm-svn: 106507
|
|
|
|
|
|
| |
-mconstructor-aliases by using a WeakVH instead of a raw pointer.
llvm-svn: 106384
|
|
|
|
|
|
| |
an lvalue. Fixes PR7390.
llvm-svn: 106235
|
|
|
|
|
|
|
|
| |
Fix multiplies by scalar
Add SemaChecking code for all immediates
Add SemaChecking-gen support to arm_neon.td
llvm-svn: 105930
|
|
|
|
| |
llvm-svn: 105848
|
|
|
|
| |
llvm-svn: 105770
|
|
|
|
|
|
| |
UniqueAggreDestructorCount from CodeGenFunction and let LLVM handle uniquing the internal functions instead.
llvm-svn: 105648
|
|
|
|
| |
llvm-svn: 105646
|
|
|
|
|
|
| |
make it through codegen to the .s file
llvm-svn: 105599
|
|
|
|
| |
llvm-svn: 104778
|
|
|
|
| |
llvm-svn: 104446
|
|
|
|
|
|
|
| |
critical for ObjC++ correctness; hard to test independently of various
required Sema changes, though.
llvm-svn: 104422
|
|
|
|
| |
llvm-svn: 104390
|
|
|
|
|
|
| |
setting null data member pointers correctly. Fixes PR7139.
llvm-svn: 104387
|
|
|
|
|
|
|
|
|
|
| |
'self' variable arising from uses of the 'super' keyword. Also reorganize
some code so that BlockInfo (now CGBlockInfo) can be opaque outside of
CGBlocks.cpp.
Fixes rdar://problem/8010633.
llvm-svn: 104312
|
|
|
|
|
|
|
| |
class initialization, drill down through an arbitrary number of anonymous
records.
llvm-svn: 104310
|
|
|
|
|
|
| |
(the codegen works here, too, but that's annoying to test without execution)
llvm-svn: 104202
|