Commit Graph

55475 Commits

Author SHA1 Message Date
Chris Lattner 5c204c92a4 Fix PR3720 by properly propagating alignment information from memcpy/memmove
onto element accesses.

llvm-svn: 66053
2009-03-04 19:20:50 +00:00
Daniel Dunbar 03f32e7638 ccc: Fix passing of -nozero-initialized-in-bss.
- PR3722.

llvm-svn: 66052
2009-03-04 19:17:10 +00:00
Nate Begeman 920438ef1d Fix a thinko in the JIT where the address of a GV was only recorded in the map
on failure to resolve it.
Do not abort on failure to resolve an external symbol when using dlsym stubs,
  since the symbol may not be in the JIT's address space.  Just use 0.
Allow dlsym stubs to differentiate between GlobalVars and Functions.

llvm-svn: 66050
2009-03-04 19:10:38 +00:00
Mike Stump 8473a12bfe Move more blocks CodeGenFunction code up and out.
llvm-svn: 66049
2009-03-04 19:03:44 +00:00
Mike Stump 06acea8a69 Move some of the CodeGenFunction blocks code up and out. No
functionality change.

llvm-svn: 66048
2009-03-04 18:57:26 +00:00
Mike Stump 6c39666a77 Move more of the blocks code up and out.
llvm-svn: 66046
2009-03-04 18:47:42 +00:00
Steve Naroff d1b64be776 Partial fix for <rdar://problem/6645157> [clang on Xcode; regression]: error: instance variable 'someField' is private.
A recent regression caused by http://llvm.org/viewvc/llvm-project?rev=65912&view=rev.

This commit isn't fully baked. Nevertheless, it should cause Xcode to compile again. Will speak with Fariborz offline.

llvm-svn: 66045
2009-03-04 18:34:24 +00:00
Chris Lattner 2b19a65864 fixes suggested by Sebastian!
llvm-svn: 66044
2009-03-04 18:24:58 +00:00
Devang Patel 4b6e4bb25d Refactor code.
llvm-svn: 66043
2009-03-04 18:21:39 +00:00
Mike Stump 95435674f9 Move more of blocks codegen out of CodeGenModule and into the
BlockModule.  No functionality change.  This should help people that
don't want to know anything about blocks not be confused by the
overloaded use of the term block or nor want to see all the blocks
goop.

llvm-svn: 66042
2009-03-04 18:17:45 +00:00
Fariborz Jahanian 4f4de6c27f Some refactoring of recent code. No functionality change.
llvm-svn: 66041
2009-03-04 18:15:57 +00:00
Fariborz Jahanian c2371eadd6 Fix a corner case of message lookup looking for class methods.
If all else failed, find the message in class's root's
list of instacne methods!

llvm-svn: 66040
2009-03-04 17:50:39 +00:00
Bob Wilson 5b15d01ff3 Fix BuildVectorSDNode::isConstantSplat to handle one-element vectors.
It is an error to call APInt::zext with a size that is equal to the value's
current size, so use zextOrTrunc instead.

llvm-svn: 66039
2009-03-04 17:47:01 +00:00
Daniel Dunbar 5b9e9682f1 Support "asm" renaming of external symbols.
- PR3698.

llvm-svn: 66038
2009-03-04 17:31:19 +00:00
Daniel Dunbar 3e2cbc3161 Driver: Add ArgList implementation.
llvm-svn: 66037
2009-03-04 17:10:42 +00:00
Ted Kremenek 79fa6a24b7 GRExprEngine::VisitCast: Just pass through function and block pointers.
llvm-svn: 66036
2009-03-04 16:52:57 +00:00
Mike Stump 376e3c0347 Start the migration of more of the blocks code out of sight for most
people.  De-duplicates BLOCK_NEEDS_FREE and friends.

llvm-svn: 66035
2009-03-04 15:35:22 +00:00
Mike Stump edb252aeba Start the migration of more of the blocks code out of sight for most
people.  De-duplicates BLOCK_NEEDS_FREE and friends.

llvm-svn: 66034
2009-03-04 15:32:52 +00:00
Steve Naroff 3f49feeed5 Finish up some fixes related to <rdar://problem/6497631> Message lookup is sometimes different than gcc's.
- Disallow casting 'super'. GCC allows this, however it doesn't make sense (super isn't an expression and the cast won't alter lookup/dispatch).
- Tighten up lookup when messaging 'self'.

llvm-svn: 66033
2009-03-04 15:11:40 +00:00
Mike Stump 436f0ef9ff .emacs file bits for automatically setting the llvm.org coding style. Thanks Anton.
llvm-svn: 66032
2009-03-04 14:14:37 +00:00
Mike Stump 0874160bd5 Add __block codegen testcase. We introduce a temporary flag to enable
codegen, until such time as codegen is complete enough to turn on with
-fblocks.

llvm-svn: 66031
2009-03-04 13:17:22 +00:00
Owen Anderson 0dedc114de Add a restore folder, which shaves a dozen or so machineinstrs off oggenc. Update a testcase to check this.
llvm-svn: 66029
2009-03-04 08:52:31 +00:00
Daniel Dunbar 5637208a88 Driver: More Option implementation.
- Add Options.def file, collects option information.

 - Actual option instantiation is handled lazily by OptTable to allow
   the driver to not need to instantiate all options.

 - cast<> support for Option, other minor tweaks.

llvm-svn: 66028
2009-03-04 08:33:23 +00:00
Eli Friedman 9ad7244f5b Check that the return type for function definitions is complete.
llvm-svn: 66027
2009-03-04 07:30:59 +00:00
Gabor Greif a954a99c40 "Ghostify" embedded sentinels. This is a real win in all cases
because less bytes are allocated and subobject construction is gone.
For reference how it works, see BasicBlock.h.
Btw. it is very assuring to see that somebody has invented
this ilist-embedded sentinel technique before me :-)

llvm-svn: 66026
2009-03-04 06:57:48 +00:00
Chris Lattner 8322dc809e make the token lexer allocate its temporary token buffers for
preexpanded macro arguments from the preprocessor's bump pointer.
This reduces # mallocs from 12444 to 11792.

llvm-svn: 66025
2009-03-04 06:50:57 +00:00
Evan Cheng 9edd616b59 Fix PR3666: isel calls to constant addresses.
llvm-svn: 66024
2009-03-04 06:48:53 +00:00
Chris Lattner 9631e1871e Switch attributes to be allocated from the declcontext bump pointer just like
decls.  This reduces the number of calls to malloc on cocoa.h with pth and
-disable-free from 15958 to 12444 times (down ~3500).

llvm-svn: 66023
2009-03-04 06:34:08 +00:00
Zhongxing Xu 7d41c616f1 Adjust indentation.
llvm-svn: 66022
2009-03-04 06:33:38 +00:00
Eli Friedman 7604d37723 PR3686: make the legalizer handle bitcast from i80 to x86 long double.
llvm-svn: 66021
2009-03-04 06:23:34 +00:00
Chris Lattner 9a2d50e7fd add an a Attr::Destroy method and force clients to go through it. As part of
this, make DeclBase::Destroy destroy attributes instead of the DeclBase dtor.

llvm-svn: 66020
2009-03-04 06:05:19 +00:00
Eli Friedman f22fa28522 Make this test a bit more specific about the target so that it passes on
Linux.

llvm-svn: 66019
2009-03-04 06:00:10 +00:00
Eli Friedman e0a5b8b11f Minor cleanup for choose expressions: add a helper that returns the
chosen sub-expression, rather than just evaluating the condition.

llvm-svn: 66018
2009-03-04 05:52:32 +00:00
Chris Lattner 1a84994c46 allocate MultiKeywordSelector's out of a bump pointer allocator instead of malloc.
This has two advantages 1) no more leaking them, 2) fewer calls to malloc.

This changes us from calling malloc 3685/1390/883/2974/1185 times respectively on
16/20/24/28/32 byte objects when parsing cocoa.h with pth and -disable-free to
calling it 2816/1020/702/2903/1168 times each respectively.

llvm-svn: 66017
2009-03-04 05:35:38 +00:00
Chris Lattner 7b26b29351 simplify Sema::AddInstanceMethodToGlobalPool, no functionality change.
llvm-svn: 66016
2009-03-04 05:16:45 +00:00
Chris Lattner 4192bce91b add a special case for codegen that improves the case where we have
multiple sequential cases to a) not create tons of fall-through basic blocks
and b) not recurse deeply.  This fixes codegen on 100K deep cases, and improves
codegen on moderate cases from this:

        switch i32 %tmp, label %sw.epilog [
                i32 1000, label %sw.bb
                i32 1001, label %sw.bb1
                i32 1002, label %sw.bb2
                i32 1003, label %sw.bb3
                i32 1004, label %sw.bb4
...
sw.bb:          ; preds = %entry
        br label %sw.bb1

sw.bb1:         ; preds = %entry, %sw.bb
        br label %sw.bb2

sw.bb2:         ; preds = %entry, %sw.bb1
        br label %sw.bb3

sw.bb3:         ; preds = %entry, %sw.bb2
        br label %sw.bb4

to:

        switch i32 %tmp, label %sw.epilog [
                i32 1000, label %sw.bb
                i32 1001, label %sw.bb
                i32 1002, label %sw.bb
                i32 1003, label %sw.bb
                i32 1004, label %sw.bb
sw.bb:  ;; many preds

llvm-svn: 66015
2009-03-04 04:46:18 +00:00
Chris Lattner 9bbf1ba1e6 fix infinite recursion
llvm-svn: 66014
2009-03-04 04:30:02 +00:00
Chris Lattner e46f6e7d9c make CaseStmt::getSourceRange() iterative for deeply
nested cases instead of recursive.

llvm-svn: 66013
2009-03-04 04:26:45 +00:00
Eli Friedman 3efa41a478 Continuation of PR3687: fix more places to use the right type for
booleans.

llvm-svn: 66012
2009-03-04 04:25:14 +00:00
Chris Lattner 34a2209177 Change Parser::ParseCaseStatement to use an iterative approach to parsing
multiple sequential case statements instead of doing it with recursion.  This
fixes a problem where we run out of stack space parsing 100K directly nested
cases.

There are a couple other problems that prevent this from being useful in 
practice (right now the example only parses correctly with -disable-free and
doesn't work with -emit-llvm), but this is a start.

I'm not including a testcase because it is large and uninteresting for 
regtesting.

Sebastian, I would appreciate it if you could scrutinize the smart pointer 
gymnastics I do.

llvm-svn: 66011
2009-03-04 04:23:07 +00:00
Eli Friedman a1493b3b4d Comment fix: change a question to an answer.
llvm-svn: 66010
2009-03-04 04:22:58 +00:00
Eli Friedman 42d2a3add6 Attempt to fix PR3709: when converting from an integer to a pointer,
first extend the integer to the correct width.

llvm-svn: 66009
2009-03-04 04:02:35 +00:00
Dan Gohman 6728f892be Revert r66004 for now; it's causing a variety of test failures.
llvm-svn: 66008
2009-03-04 03:54:19 +00:00
Mike Stump 97d01d50d9 Improved ABI compliance for __block variables. No testcases yet as we
still give an unsupported error for them due to the fact this is a
work in progress.

llvm-svn: 66007
2009-03-04 03:23:46 +00:00
Evan Cheng e08f4cb9a1 Rename test.
llvm-svn: 66006
2009-03-04 02:47:25 +00:00
Ted Kremenek d275bf3c54 Added the notion of a "boundable region", which is a region that can have a direct binding in the StoreManager.
llvm-svn: 66005
2009-03-04 02:43:08 +00:00
Dan Gohman fe8d71f42a Teach the x86 backend to eliminate "test" instructions by using the EFLAGS
result from add, sub, inc, and dec instructions in simple cases.

llvm-svn: 66004
2009-03-04 02:33:24 +00:00
Daniel Dunbar 14a41c5e98 Add some more FIXME's about bits we could pack better.
llvm-svn: 66003
2009-03-04 02:27:50 +00:00
Daniel Dunbar 47076e7155 Woot, save 8 bytes in Decl on 64-bit by reordering fields. This
reduces allocated Decl size by ~8% on Cocoa.h (~700k).

llvm-svn: 66002
2009-03-04 02:26:41 +00:00
Dale Johannesen 845e582cbe Revert unintended commmit.
llvm-svn: 66001
2009-03-04 02:09:48 +00:00