Commit Graph

59453 Commits

Author SHA1 Message Date
Chris Lattner b6e9eb6956 initial support for ObjC exceptions with the GNU runtime:
"This patch is a first pass at adding support for exceptions for the GNU runtime.  There are a few limitations at present:

- @synchronized() is not yet supported at all.  gcc currently emits calls to runtime library functions that don't exist for this directive.

- Only id @catch statements are currently working.  This is enough for NS_DURING and friends, but I need to spend more time reading the output from gcc -S to work out how it finds the class pointer to make arbitrary class type catch statements work.

- I've tested it with a few common cases[1] and the clang test suite (which doesn't test exceptions for the GNU runtime, but shows I haven't broken anything else), but there are probably a lot of cases I've missed."

Patch by David Chisnall!

llvm-svn: 71198
2009-05-08 00:11:50 +00:00
Bob Wilson e20be4183c Fix pr4100. Do not remove no-op copies when they are dead. The register
scavenger gets confused about register liveness if it doesn't see them.
I'm not thrilled with this solution, but it only comes up when there are dead
copies in the code, which is something that hopefully doesn't happen much.

Here is what happens in pr4100: As shown in the following excerpt from the
debug output of llc, the source of a move gets reloaded from the stack,
inserting a new load instruction before the move.  Since that source operand
is a kill, the physical register is free to be reused for the destination
of the move.  The move ends up being a no-op, copying R3 to R3, so it is
deleted.  But, it leaves behind the load to reload %reg1028 into R3, and
that load is not updated to show that it's destination operand (R3) is dead.
The scavenger gets confused by that load because it thinks that R3 is live.

Starting RegAlloc of: %reg1025<def,dead> = MOVr %reg1028<kill>, 14, %reg0, %reg0
  Regs have values: 
  Reloading %reg1028 into R3
  Last use of R3[%reg1028], removing it from live set
  Assigning R3 to %reg1025
  Register R3 [%reg1025] is never used, removing it from live set

Alternative solutions might be either marking the load as dead, or zapping
the load along with the no-op copy.  I couldn't see an easy way to do
either of those, though.

llvm-svn: 71196
2009-05-07 23:47:03 +00:00
Eli Friedman 7ce29a18e1 Fix crash with constant initialization of bit-fields in unions.
llvm-svn: 71194
2009-05-07 23:42:42 +00:00
Ted Kremenek 9157fbb6a6 Minor code cleanup in retain/release checker in preparation for some
other changes.  Instead of repeatedly checking for GC mode when
getting the return effect, just do this computation once.

llvm-svn: 71193
2009-05-07 23:40:42 +00:00
Daniel Dunbar 5bcbf1ccbd Add to the house of cards that is ABITestGen.
- Support generating structures with bit-fields.

llvm-svn: 71192
2009-05-07 23:19:55 +00:00
Mike Stump 5580bdcaa2 Add a warning for a missing copy attribute on a property that is a
block pointer.  Radar 6441502

llvm-svn: 71190
2009-05-07 23:06:50 +00:00
Daniel Dunbar 81ded69511 Remove -fobjc-tight-layout, seems to work!
llvm-svn: 71184
2009-05-07 21:58:26 +00:00
Mike Stump 5e16a0d9e7 Allow qualifiers on blocks. Radar 6441502
llvm-svn: 71183
2009-05-07 21:56:17 +00:00
Ted Kremenek ba53fe98e7 More attribute renaming:
- Rename 'ns_returns_owned' -> 'ns_returns_retained'.
- Rename 'cf_returns_owned' -> 'cf_returns_retained'.

llvm-svn: 71182
2009-05-07 21:49:45 +00:00
Fariborz Jahanian 0d451813f9 a forward class declaration matching a typedef name of a class
refers to the underlying class.
This is radar 6859726. Steve, please read the radar for my rational.

llvm-svn: 71181
2009-05-07 21:49:26 +00:00
Bob Wilson 5352454e6b Fix a comment (again).
llvm-svn: 71180
2009-05-07 21:20:42 +00:00
Bob Wilson 94c0a9fe8e Fix a comment.
llvm-svn: 71179
2009-05-07 21:19:45 +00:00
Dan Gohman 4bb6fa23cb Revert 71165. It did more than just revert 71158 and it introduced
several regressions. The problem due to 71158 is now fixed.

llvm-svn: 71176
2009-05-07 19:46:24 +00:00
Dan Gohman 140a6f24f0 Perform constant folding on operands of instructions with non-void
types, such as loads and calls.

llvm-svn: 71175
2009-05-07 19:43:39 +00:00
Anders Carlsson 6840b65ab7 add isFriendSpecified.
llvm-svn: 71174
2009-05-07 19:41:51 +00:00
Dan Gohman 64f756b48c SCEVComplexityCompare's new code was missing SCEVUDivExpr. Implement
the SCEVUDivExpr case.

llvm-svn: 71173
2009-05-07 19:23:21 +00:00
Ted Kremenek 094bc31000 Fix <rdar://problem/6848739>. When using -analyze, -Werror has no effect.
llvm-svn: 71172
2009-05-07 19:02:53 +00:00
Mike Stump f70bcf7d1a Tighten up relationals with blocks and ints. Radar 6441502
llvm-svn: 71171
2009-05-07 18:43:07 +00:00
Ted Kremenek a6e08327c0 analyzer: Add ProgramPoint 'PostLValue' just to distinguish (for
analysis introspection) when we computed an lvalue.  This shouldn't
effect the current analysis results in any way.

llvm-svn: 71169
2009-05-07 18:27:16 +00:00
Duncan Sands 7a8cfafd2e Revert r70876 and add a testcase (@c7) showing the problem:
bits captured, but the pointer marked nocapture.  In fact
I now recall that this problem is why only readnone functions
returning void were considered before!  However keep a small
fix that was also in r70876: a readnone function returning
void can result in bits being captured if it unwinds, so
test for this.

llvm-svn: 71168
2009-05-07 18:08:34 +00:00
Douglas Gregor 1bbffbceae Big update to the C++ status table to reflect "recent"
development. Still much more to write!

llvm-svn: 71167
2009-05-07 17:50:16 +00:00
Bill Wendling 17f0f65499 Temporarily revert r71158. It was causing a failure during a full bootstrap:
checking for bcopy... no
checking for getc_unlocked... Assertion failed: (0 && "Unknown SCEV kind!"), function operator(), file /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore.roots/llvmCore~obj/src/lib/Analysis/ScalarEvolution.cpp, line 511.
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~obj/src/libdecnumber/decUtility.c:360: internal compiler error: Abort trap
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.
make[4]: *** [decUtility.o] Error 1
make[4]: *** Waiting for unfinished jobs....
Assertion failed: (0 && "Unknown SCEV kind!"), function operator(), file /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore.roots/llvmCore~obj/src/lib/Analysis/ScalarEvolution.cpp, line 511.
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~obj/src/libdecnumber/decNumber.c:5591: internal compiler error: Abort trap
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.
make[4]: *** [decNumber.o] Error 1
make[3]: *** [all-stage2-libdecnumber] Error 2
make[3]: *** Waiting for unfinished jobs....

llvm-svn: 71165
2009-05-07 17:26:14 +00:00
Sebastian Redl fb23ddf661 Fix a FIXME in new expression checking.
llvm-svn: 71163
2009-05-07 16:14:23 +00:00
Douglas Gregor 938439b6fe Document the dependent type equivalence test case's purpose.
llvm-svn: 71162
2009-05-07 15:40:54 +00:00
Douglas Gregor 6d7a30c73e Test a few more variants of dependent type names
llvm-svn: 71161
2009-05-07 15:31:47 +00:00
Dan Gohman 9ba542c325 Make ScalarEvolution's GroupByComplexity more thorough. In addition
to sorting SCEVs by their kind, sort SCEVs of the same kind according
to their operands. This helps avoid things like (a+b) being a distinct
expression from (b+a).

llvm-svn: 71160
2009-05-07 14:39:04 +00:00
Dan Gohman 4f2e69c229 Trim unnecessary headers. Code in Analysis shouldn't use Transforms
headers due to library dependencies.

llvm-svn: 71159
2009-05-07 14:30:26 +00:00
Dan Gohman e5d2a04ace Constant-fold ptrtoint+add+inttoptr to gep when the pointer is an
array and the add is within range. This helps simplify expressions
expanded by ScalarEvolutionExpander.

llvm-svn: 71158
2009-05-07 14:24:56 +00:00
Dan Gohman c6bb55ba53 Factor out a common base class between SCEVCommutativeExpr and
SCEVAddRecExpr. This eliminates redundant code for visiting
all the operands of an expression.

llvm-svn: 71157
2009-05-07 14:00:19 +00:00
Argyrios Kyrtzidis 58f3811300 Move the tablegen-produced DebugLoc handling into a AsmWriter::processDebugLoc function.
No functionality change.

llvm-svn: 71156
2009-05-07 13:55:51 +00:00
Douglas Gregor ae1e53c87b Compute the canonical template name when building a template
specialization type for a dependent template name.

llvm-svn: 71153
2009-05-07 06:49:52 +00:00
Douglas Gregor 6bc50585e3 Start canonicalizing template names. This is not yet complete, but it
improves type identity with dependent types.

llvm-svn: 71152
2009-05-07 06:41:52 +00:00
Evan Cheng 143bae5dcd Code refactoring.
llvm-svn: 71151
2009-05-07 05:49:39 +00:00
Evan Cheng f356a89e92 Rename "loop aligner" pass to "code placement optimization" pass.
llvm-svn: 71150
2009-05-07 05:42:24 +00:00
Evan Cheng a55d46100e Eliminate compiler warnings.
llvm-svn: 71149
2009-05-07 05:31:56 +00:00
Chris Lattner ed58599a7e Add support for LLLi -> int128 in builtins.def
llvm-svn: 71148
2009-05-07 04:47:06 +00:00
Jakob Stoklund Olesen d1604fde53 Add const modifiers.
llvm-svn: 71147
2009-05-07 04:41:26 +00:00
Chris Lattner 5c633e38a8 Make this test portable to non-x86 hosts, patch by Mark Cianciosa!
llvm-svn: 71146
2009-05-07 04:21:16 +00:00
Mike Stump 1b821b4fc5 Improve semantic checking for blocks. Radar 6441502
llvm-svn: 71145
2009-05-07 03:14:14 +00:00
Bill Wendling 759de47964 THis doesn't fail.
llvm-svn: 71142
2009-05-07 01:41:42 +00:00
Bill Wendling 5a2fff718d Just turn aggressive stack coloring off at -O3.
llvm-svn: 71140
2009-05-07 01:33:38 +00:00
Bill Wendling 6144f63bd5 Temporarily revert r71010. It was causing massive failures during self-hosting.
llvm-svn: 71138
2009-05-07 01:27:25 +00:00
Ted Kremenek 9abe474852 Add preliminary support for enhancing null-pointer dereference diagnostics.
llvm-svn: 71135
2009-05-07 00:45:33 +00:00
Ted Kremenek 75edb2e8a0 Bug fix: Not all ConstraintManagers always return a null state when setting
isFeasible to false. This is something we may wish to do further validation on.

llvm-svn: 71134
2009-05-07 00:45:08 +00:00
Argyrios Kyrtzidis baf3fee885 Make DwarfWriter::RecordInlinedFnStart more like the other DwarfWriter's methods:
-Have it return a label ID
-Remove the unused Instruction parameter

No functionality change.

llvm-svn: 71132
2009-05-07 00:16:31 +00:00
Sebastian Redl f08aa62c80 Back out r70506 (exception spec in AST) again. We won't have exception specs until we've had a lot more discussion.
llvm-svn: 71125
2009-05-06 23:27:55 +00:00
Dan Gohman 39b480cea0 Use stable_sort instead of plain sort to avoid the risk of generating
trivially different code on different hosts (due to differing
std::sort implementations).

llvm-svn: 71124
2009-05-06 22:54:33 +00:00
Daniel Dunbar f9d90275f9 Handle -march for the LLVM recognized cpu names.
- x86 target feature handling should not be feature complete, even if
   the code quality is lacking.

llvm-svn: 71123
2009-05-06 21:56:32 +00:00
Ted Kremenek bb8d546208 Refactor BugReporter interface to have a new 'BugReporterContext' and
'BugReporterVisitor'. This simplifies callbacks from BugReporter to BugReports
(via VisitNode). It also lays the foundation for arbitrary visitor "call backs"
that can be registered to a BugReporterContext as a PathDiagnostic is
constructed. These call backs can help operate as separate "experts" that can
work on constructed pieces of a PathDiagnostic for which they possess special
knowledge.

llvm-svn: 71121
2009-05-06 21:39:49 +00:00
Daniel Dunbar 908a66dc9b If stderr isn't a terminal, don't try to guess the terminal width or
look at COLUMNS.

llvm-svn: 71120
2009-05-06 21:28:42 +00:00