Chris Lattner
5ff40fc7ab
tighten the check for cast of super to avoid rejecting valid code,
...
rdar://7853261
llvm-svn: 101048
2010-04-12 17:09:27 +00:00
Douglas Gregor
b93b606759
When creating the implicitly-declared special member functions, be
...
sure to introduce them into the current Scope (when we have one) in
addition to the DeclContext for the class, so that they can be found
by name lookup for inline members of the class. Fixes PR6570.
llvm-svn: 101047
2010-04-12 17:09:20 +00:00
Chris Lattner
08e774b7ef
fix rdar://7852959 - Use of super within a block is actually ok.
...
(aka, Fariborz was right ;-)
llvm-svn: 101046
2010-04-12 17:03:29 +00:00
Fariborz Jahanian
5ea6bdd0ea
Issue warning when 'weak_import' attribute is applied on a class only
...
when it is not supported in versions of MacOs.
llvm-svn: 101044
2010-04-12 16:57:31 +00:00
Dan Gohman
e4148978b8
Remove a #include.
...
llvm-svn: 101043
2010-04-12 16:26:03 +00:00
Douglas Gregor
61c1ac2e5c
Remove the blanket statement about Clang not supporting access control. It does now
...
llvm-svn: 101041
2010-04-12 16:01:38 +00:00
Douglas Gregor
ce40e2ef8a
Fix a crash-on-invalid involving name lookup of tag names, where we
...
ended up finding a function template that we didn't expect. Recover
more gracefully, and fix a similar issue for class templates.
llvm-svn: 101040
2010-04-12 16:00:01 +00:00
Tobias Grosser
4885db6f52
Remove unneeded debug in PostDominator runOnFunction()
...
The information is already available with "opt -analyze". The DominatorTree
does also not have this in its runOnFunction. So they behave now
more consistent.
llvm-svn: 101038
2010-04-12 15:32:55 +00:00
Tobias Grosser
6a5eef4067
Remove dead code in the dotty dominance tree printer.
...
This template is not needed anymore as it was replaced by the
DOTGraphTraitsViewer.
llvm-svn: 101036
2010-04-12 15:02:19 +00:00
Benjamin Kramer
1f336da54f
Boolify.
...
llvm-svn: 101035
2010-04-12 12:22:19 +00:00
Benjamin Kramer
d0b5c6cbed
Plug trivial leak.
...
llvm-svn: 101034
2010-04-12 11:38:35 +00:00
Dan Gohman
27c8e79839
Delete this code, which is no longer needed.
...
llvm-svn: 101033
2010-04-12 08:00:22 +00:00
Dan Gohman
07f6563e81
Move the EliminateIVUsers call back out to its original location. Now that
...
a ScalarEvolution bug with overflow handling is fixed, the normal analysis
code will automatically decline to operate on the icmp instructions which
are responsible for the loop exit.
llvm-svn: 101032
2010-04-12 07:56:56 +00:00
Douglas Gregor
7531ca96f7
Add another test case for r101029, which verifies that we now
...
correctly diagnose instantiation of a function parameter with Objective-C
class type (since Objective-C classes can't be passed by value).
llvm-svn: 101031
2010-04-12 07:51:13 +00:00
Dan Gohman
6635bb26a6
Generalize ScalarEvolution's PHI analysis to handle loops that don't
...
have preheaders or dedicated exit blocks, as clients may not otherwise
need to run LoopSimplify.
llvm-svn: 101030
2010-04-12 07:49:36 +00:00
Douglas Gregor
940bca7b93
Be sure to instantiate the parameters of a function, even when the
...
function's type is (strictly speaking) non-dependent. This ensures
that, e.g., default function arguments get instantiated properly.
And, since I couldn't resist, collapse the two implementations of
function-parameter instantiation into calls to a single, new function
(Sema::SubstParmVarDecl), since the two had nearly identical code (and
each had bugs the other didn't!). More importantly, factored out the
semantic analysis of a parameter declaration into
Sema::CheckParameter, which is called both by
Sema::ActOnParamDeclarator (when parameters are parsed) and when a
parameter is instantiated. Previously, we were missing some
Objective-C and address-space checks on instantiated function
parameters.
Fixes PR6733.
llvm-svn: 101029
2010-04-12 07:48:19 +00:00
Dan Gohman
f76210ead8
Rewrite the overflow checking in the get{Signed,Unsigned}Range code for
...
AddRecs so that it checks for overflow in the computation that it is
performing, rather than just checking hasNo{Signed,Unsigned}Wrap, since
those flags are for a different computation. This fixes a bug that
impacts an upcoming change.
llvm-svn: 101028
2010-04-12 07:39:33 +00:00
Dan Gohman
15f90c294c
Use RecursivelyDeleteTriviallyDeadInstructions in EliminateIVComparisons,
...
instead of deleting just the user. This makes it more consistent with
other code in IndVarSimplify, and theoretically can eliminate more users
earlier.
llvm-svn: 101027
2010-04-12 07:29:15 +00:00
Chris Lattner
3adb17d44f
fix a bug I noticed by inspection, correcting two reject-valid bugs.
...
llvm-svn: 101026
2010-04-12 06:36:00 +00:00
Chris Lattner
3ab8ca2894
fix a rejects-valid bug that I introduced, pointed out
...
by David Chisnall
llvm-svn: 101024
2010-04-12 06:27:57 +00:00
Evan Cheng
250283916d
Enable post regalloc machine licm by default.
...
llvm-svn: 101023
2010-04-12 06:25:28 +00:00
Chris Lattner
1447136553
use pointer comparison instead of isStr
...
llvm-svn: 101022
2010-04-12 06:22:50 +00:00
Chris Lattner
cd963185f0
fix a rejects-valid testcase involving super that I dreamt up.
...
This also fixes cases where super is used in a block in a
method which isn't valid.
llvm-svn: 101021
2010-04-12 06:20:33 +00:00
Chris Lattner
df74264787
change Scope::WithinElse to be a normal scope flag, widen the
...
fields to two 16-bit values instead of using bitfields.
llvm-svn: 101020
2010-04-12 06:12:50 +00:00
Chris Lattner
7974fb130f
fix this test.
...
llvm-svn: 101019
2010-04-12 05:47:20 +00:00
Chris Lattner
c263f43ffd
xfail this test for now.
...
llvm-svn: 101018
2010-04-12 05:44:13 +00:00
Chris Lattner
4806f7eb1f
fix an invalid use of super, you can't use super like this in a block!
...
llvm-svn: 101017
2010-04-12 05:43:31 +00:00
Chris Lattner
c2ebb03297
Have the parser decide whether a message to super is a variable or
...
type, instead of having sema do it.
llvm-svn: 101016
2010-04-12 05:38:43 +00:00
Nick Lewycky
7ff88f8b00
Typo.
...
llvm-svn: 101015
2010-04-12 05:32:01 +00:00
Chris Lattner
8731366c8b
fix a fixme, stop evaluating getCurMethodDecl() repeatedly
...
in "LookupInObjCMethod".
llvm-svn: 101014
2010-04-12 05:10:17 +00:00
Nick Lewycky
6ba630b077
Remove use of exceptions from bugpoint. No deliberate functionality change!
...
llvm-svn: 101013
2010-04-12 05:08:25 +00:00
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