Commit Graph

81893 Commits

Author SHA1 Message Date
Eric Christopher 1f272f7fd8 Verify function prototypes before trying to optimize functions. We also
need TargetData, just return false if we don't have it.

Update testcases accordingly.

Fixes PR6807.

llvm-svn: 101011
2010-04-12 04:48:00 +00:00
Dan Gohman ecd40a34e2 Remove unnecessary parens.
llvm-svn: 101010
2010-04-12 02:24:01 +00:00
Dan Gohman f1e40e60d3 Minor code simplification.
llvm-svn: 101009
2010-04-12 02:22:30 +00:00
Dan Gohman fa5ad797e3 Re-apply r101000, with a fix: Don't eliminate an icmp which is part of
the loop exit test. This usually doesn't come up for a variety of
reasons, but it isn't impossible, so make IndVarSimplify handle it
conservatively.

llvm-svn: 101008
2010-04-12 02:21:50 +00:00
Chris Lattner 3d2a36277e whether we enable dylibs or not depends on the host, not the target.
llvm-svn: 101007
2010-04-12 02:21:38 +00:00
Chris Lattner a9396af5f2 other half of r101005
llvm-svn: 101006
2010-04-12 02:18:49 +00:00
Chris Lattner 37c75af0f8 fix PR6287 by accepting and ignoring the returns_twice attribute.
llvm-svn: 101005
2010-04-12 02:18:38 +00:00
Anders Carlsson 1c0f8bb4ce Have the CXXBaseOrMemberInitializer keep track of whether an initializer initializes a virtual base or not.
llvm-svn: 101004
2010-04-12 00:51:03 +00:00
Dan Gohman c0f1efaf8d Revert 101000, which is breaking self-host builds.
llvm-svn: 101002
2010-04-12 00:17:10 +00:00
Dan Gohman 068b793614 Fix indentation.
llvm-svn: 101001
2010-04-11 23:44:58 +00:00
Dan Gohman af4ab1b681 Teach IndVarSimplify how to eliminate comparisons involving induction
variables. For example, with code like this:

  for (i=0;i<n;++i)
    if (i<n)
      x[i] = 0;

IndVarSimplify will now recognize that i is always less than n inside
the loop, and eliminate the if.

llvm-svn: 101000
2010-04-11 23:10:12 +00:00
Ted Kremenek cb13408f12 Unbreak test on windows.
llvm-svn: 100999
2010-04-11 22:25:18 +00:00
Anders Carlsson 3383e2ad74 Fix another bug where we wouldn't generate secondary vtables for construction vtables in some cases.
llvm-svn: 100998
2010-04-11 22:20:36 +00:00
Ted Kremenek 2908a20d86 Add initial USR support for macro definitions.
llvm-svn: 100997
2010-04-11 22:20:34 +00:00
Ted Kremenek 74c4389ea6 Augment clang_getCursorUSR() to not always expect that clang_getCursorDecl() does the right
thing if the cursor is not a decl (such as in the case of macros).

llvm-svn: 100996
2010-04-11 22:20:26 +00:00
Dan Gohman 07591698ce Enhance ScalarEvolution::isKnownPredicate with support for
loop conditions which are invariants.

llvm-svn: 100995
2010-04-11 22:16:48 +00:00
Dan Gohman f7f28511a9 Minor code simplification.
llvm-svn: 100994
2010-04-11 22:13:11 +00:00
Dan Gohman ae4a4148ba When creating a ConstantRange for [n,UINT_MAX], special case n == 0, because
ConstantRange(0, 0) creates an empty range rather than a full one.

llvm-svn: 100993
2010-04-11 22:12:18 +00:00
Dan Gohman 2352dd7ee0 Fix a comment.
llvm-svn: 100992
2010-04-11 22:07:56 +00:00
Anders Carlsson d78b224e91 More renames.
llvm-svn: 100991
2010-04-11 22:07:06 +00:00
Anders Carlsson b41c633a34 Rename a function parameter.
llvm-svn: 100990
2010-04-11 22:03:57 +00:00
Ted Kremenek 33b9a42f41 Add CIndex support for blocks.
llvm-svn: 100989
2010-04-11 21:47:37 +00:00
Ted Kremenek 85421e9555 Update checker build.
llvm-svn: 100987
2010-04-11 21:02:52 +00:00
Anders Carlsson de0338abac Clarify an assertion.
llvm-svn: 100986
2010-04-11 20:23:06 +00:00
Anders Carlsson 343a26b56d Fix a bug where we were adding too many vcall offsets in some cases.
llvm-svn: 100985
2010-04-11 20:04:11 +00:00
Dan Gohman 008a38b1d6 Add a cast to void to show that the return value is being
intentionally ignored.

llvm-svn: 100984
2010-04-11 19:30:19 +00:00
Dan Gohman 7841a6ecd2 Delete a dead check.
llvm-svn: 100983
2010-04-11 19:29:41 +00:00
Chris Lattner b986aba6db add haiku support, patch by Paul Davey!
llvm-svn: 100982
2010-04-11 19:29:39 +00:00
Dan Gohman 2532856704 Delete dead code.
llvm-svn: 100981
2010-04-11 19:28:47 +00:00
Dan Gohman 93cd0f1278 Fix a #include.
llvm-svn: 100980
2010-04-11 19:27:52 +00:00
Dan Gohman b50349a979 Rename isLoopGuardedByCond to isLoopEntryGuardedByCond, to emphasise
that it's only testing for the entry condition, not full loop-invariant
conditions.

llvm-svn: 100979
2010-04-11 19:27:13 +00:00
Benjamin Kramer fedd987f4b utostr isn't going away too soon, try to make it slightly smaller.
llvm-svn: 100977
2010-04-11 19:00:03 +00:00
Chris Lattner 6033be79b3 avoid double negatives
llvm-svn: 100976
2010-04-11 18:53:08 +00:00
Ted Kremenek 5868ec6e3d Fix CFG bug where bases of member expressions were not always evaluated in a lvalue context. Fixes <rdar://problem/7813989>.
llvm-svn: 100966
2010-04-11 17:02:10 +00:00
Ted Kremenek 66de60376c Fix bug in AddStmtChoice:asLValue() where 'AsLValueNotAlwaysAdd' would not be treated as indicating an lvalue.
llvm-svn: 100965
2010-04-11 17:02:04 +00:00
Ted Kremenek d2ba1f9ff0 Sort visitor methods. No functionality change.
llvm-svn: 100964
2010-04-11 17:01:59 +00:00
Benjamin Kramer 249f50ca04 Fix run line so this test actually tests something.
llvm-svn: 100962
2010-04-11 09:39:39 +00:00
Chris Lattner a36ec4243b fix PR6811 by not parsing 'super' as a magic expression in
LookupInObjCMethod.  Doing so allows all sorts of invalid code
to slip through to codegen.  This patch does not change the 
AST representation of super, though that would now be a natural
thing to do since it can only be in the receiver position and
in the base of a ObjCPropertyRefExpr.

There are still several ugly areas handling super in the parser,
but this is definitely a step in the right direction.

llvm-svn: 100959
2010-04-11 08:28:14 +00:00
Chris Lattner 90c58faea6 actually the interface grossness in the previous patch was due to
typo correction.  However, now that the code has been factored out
of LookupMemberExpr, it can recurse to itself instead of to 
LookupMemberExpr!  Remove grossness.

llvm-svn: 100958
2010-04-11 07:51:10 +00:00
Chris Lattner 2b1ca5fb8a factor the code that handles "expr.field" when expr is a
pointer to an objc interface out to a method in SemaExprObjC.
This is *much* uglier than it should be due to grossness in
LookupMemberExpr :(

llvm-svn: 100957
2010-04-11 07:45:24 +00:00
Chris Lattner 00dcffded1 fix a problem causing us to lose the ''s around objc interface names
in a diagnostic.

llvm-svn: 100956
2010-04-11 07:04:01 +00:00
Daniel Dunbar 2131f9ba8c Simplify test, in the hopes of making linux happy.
llvm-svn: 100955
2010-04-11 01:10:44 +00:00
Nick Lewycky 3e24f7e632 Remove dead argument and clean whitespace. No functionality change.
llvm-svn: 100954
2010-04-10 23:18:13 +00:00
Anders Carlsson 0b5522114e Enable an assert and remove a now unnecessary assert.
llvm-svn: 100953
2010-04-10 21:50:08 +00:00
Anders Carlsson 7a148f7141 Fix another vbase layout bug.
llvm-svn: 100952
2010-04-10 21:35:33 +00:00
Anders Carlsson 5b441d73b7 Add a simple debug-only verification pass to the record layout builder.
llvm-svn: 100951
2010-04-10 21:24:48 +00:00
Anders Carlsson 88cf34f2b4 Fix a bug where we would add the same function twice in a vtable.
llvm-svn: 100949
2010-04-10 20:39:29 +00:00
Chris Lattner bd7b0a8d55 revert 100942, pending discussion.
llvm-svn: 100946
2010-04-10 19:33:39 +00:00
Anders Carlsson be1b9cbc63 Rename VtableComponent and VtableBuilder.
llvm-svn: 100945
2010-04-10 19:13:06 +00:00
Chris Lattner 4568ed7893 Implement support for varargs functions without any fixed
parameters in the CBE by implicitly adding a fixed argument.
This allows eliminating a work-around from DAE.  Patch by
Sylvere Teissier!

llvm-svn: 100944
2010-04-10 19:12:44 +00:00