Граф коммитов

6454 Коммитов

Автор SHA1 Сообщение Дата
Chandler Carruth 7bf3600f56 Fix the lookup of names used in a friend declaration to not attempt to
re-declare them. This fixes PR6317. Also add the beginnings of an interesting
test case for p1 of [class.friend] which also covers PR6317.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97499 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 21:17:36 +00:00
Chris Lattner e6794974b7 fix PR5933: don't warn about unused variables if a function has other errors in it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97498 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 21:06:03 +00:00
Chris Lattner 6d97e5e4b7 Implement jump checking for initialized c++ variables, implementing
a fixme and PR6451.

Only perform jump checking if the containing function has no errors,
and add the infrastructure needed to do this.

On the testcase in the PR, we produce:

t.cc:6:3: error: illegal goto into protected scope
  goto later;
  ^
t.cc:7:5: note: jump bypasses variable initialization
  X x;
    ^



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97497 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 20:59:53 +00:00
Chris Lattner 632c9d2692 avoid issues with the new scope protector. Previously we'd error
with "address taken of label in protected scope, jump to it would have unknown effect on scope"




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97495 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 20:56:44 +00:00
Ted Kremenek d49d87719b Allow a '0' precision in format strings (as the man page says it is okay).
Fixes <rdar://problem/7700339>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97482 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 19:22:33 +00:00
John McCall e1e342f4a9 The latest draft uses 'dt' to mangle member expressions, and now so do we.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97479 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 19:12:25 +00:00
Douglas Gregor 449d0a8290 When looking for a redeclaration of a static variable, only look for redeclarations. Fixes PR6449
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97478 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 19:11:54 +00:00
Douglas Gregor 96084f171f When instantiating a function-scoped enum, make sure that it and its
enumeration constants get placed into the local instantiation hash
table. Fixes PR6375.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97471 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 19:00:07 +00:00
Douglas Gregor 00225547b5 Robustify instantiation of templates when there are errors in the
template definition. Do this both by being more tolerant of errors in
our asserts and by not dropping a variable declaration completely when
its initializer is ill-formed. Fixes the crash-on-invalid in PR6375,
but not the original issue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97463 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 18:27:54 +00:00
John McCall 2e0a715595 Don't infinite-loop if TryAnnotateCXXScopeToken fails to annotate but doesn't
signal an error.  This can happen even when the current token is '::' if
this is a ::new or ::delete expression.

This was an oversight in my recent parser refactor;  fixes PR 5825.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97462 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 18:20:46 +00:00
Douglas Gregor 7c1e98f1cb When looking for the instantiated declaration that corresponds to a
given declaration in a template, make sure that the context we're
searching through is complete. Fixes PR6376.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97444 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 15:56:25 +00:00
Douglas Gregor f9f627dbbc Don't warn about case-value conversions from a negative value to a
larger unsigned value, since this is implementation-defined
behavior. (We previously suppressed this warning when converting from
a signed value to an unsigned value of the same size).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97430 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 01:04:55 +00:00
Douglas Gregor 4b2ccfc302 Improve name mangling for dependently-scoped declaration references.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97422 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 22:05:49 +00:00
Douglas Gregor 5ed1bc351f Add name mangling for DeclRefExprs that refer to external names
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97418 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 21:40:32 +00:00
Anders Carlsson dad0f9918a Handle unused functions in construction vtables correctly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97406 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 18:37:33 +00:00
Douglas Gregor a9bff30776 Warn about the deprecated string literal -> char* conversion. Fixes PR6428.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97404 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 18:30:25 +00:00
Chris Lattner b3a4e432c9 Implement PR6423 by using one token of lookahead to disambiguate
an *almost* always incorrect case.  This only does the lookahead
in the insanely unlikely case, so it shouldn't impact performance.

On this testcase:

struct foo {
}
typedef int x;

Before:

t.c:3:9: error: cannot combine with previous 'struct' declaration specifier
typedef int x;
        ^

After:

t.c:2:2: error: expected ';' after struct
}
 ^
 ;



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97403 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 18:18:36 +00:00
Anders Carlsson 0378bf0840 When laying out vtables for virtual bases in construction vtables, we need to check if the vtable is a primary base in the layout class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97402 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 18:08:38 +00:00
Anders Carlsson 293126becf Add another construction vtable test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97401 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 17:59:36 +00:00
John McCall db7b72a82a Support constant-evaluation of __builtin_nans* as well as the correct constant
evaluation of __builtin_nan*.  Most of the work to make this work is in LLVM.

Fixes <rdar://problem/7696712> and part of PR 5255.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97383 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 13:00:19 +00:00
Anders Carlsson 530c40c516 More improvements to construction vtables; we know handle vbase offsets correctly (I hope).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97361 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 01:43:58 +00:00
Anders Carlsson 0041a64933 Add a simple construction vtable test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97344 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27 21:09:00 +00:00
Anders Carlsson 6a8c5b2bc2 Use the real base offset when calculating vbase offsets.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97338 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27 19:21:58 +00:00
Anders Carlsson e54d1c12d7 Figured out why the test was failing, this will hopefully fix it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97336 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27 19:00:53 +00:00
Anders Carlsson 8bc68f7a29 Don't add this adjustments for pure virtual member functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97334 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27 18:16:50 +00:00
Anders Carlsson 64b6e80e86 XFAIL this for now. I have no idea why this test is failing on some machines. Looks like some sort of whitespace issue in FileCheck.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97332 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27 18:09:05 +00:00
Anders Carlsson 3504475548 Add another test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97329 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27 16:55:58 +00:00
Anders Carlsson 2ef9d6bbd3 Finish up the changes to this adjustments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97328 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27 16:52:49 +00:00
Ted Kremenek e3fc547902 Fix crasher caused by setting a bit in a possibly empty bitvector while
doing printf format string checking.  This is a recent regression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97318 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27 08:34:51 +00:00
Anders Carlsson c784ba21ba Fix another vtable layout bug; we weren't looking hard enough for overriden functions when determining if an overrider will ever be used.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97306 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27 06:38:03 +00:00
Anders Carlsson 5560969d73 Handle vcall offset sharing between destructors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97304 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27 04:12:52 +00:00
Anders Carlsson 08c26752ef Fix a bug where we were generating an unnecessary vtable for a virtual base that's already a primary virtual base.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97303 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27 04:05:52 +00:00
Zhongxing Xu 06079d1d1e Add test case for inlining call analysis.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97300 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27 02:44:37 +00:00
Douglas Gregor d1eabfb15c Robustify SourceManager::getLocation(), so that it returns an
end-of-line source location when given a column number beyond the
length of the line, or an end-of-file source location when given a
line number beyond the length of the file. Previously, we would return
an invalid location.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97299 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27 02:42:25 +00:00
Ted Kremenek efaff195ba For printf format string checking, add support for positional format strings.
Along the way, coelesce some of the diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97297 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27 01:41:03 +00:00
Douglas Gregor 5fe8c04009 Skip dependent virtual base classes; fixes PR6413.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97291 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-27 00:25:28 +00:00
John McCall 2a0d7574ac At sabre's request, drop the FP bounds diagnostics down to warnings and file
them under -Wbad-literal.  They're still on by default.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97284 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 23:35:57 +00:00
Fariborz Jahanian d64a4f4798 Prevent rewriter crash when variable type is missing.
Fixes radar 7692183.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97281 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 22:49:11 +00:00
Fariborz Jahanian f89c4270c9 Fix rewriting of byref variables in nested blocks.
Fixes radar 7692350.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97254 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 19:55:31 +00:00
Chris Lattner 19943151b8 fix rdar://7683173, rejecting an invalid conditional
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97253 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 19:42:53 +00:00
Ted Kremenek 7f70dc85d5 For printf format string checking, move the tracking of the data argument index out of
Sema and into analyze_printf::ParseFormatString().  Also use a bitvector to determine
what arguments have been covered (instead of just checking to see if the last argument consumed is the max argument).  This is prep. for support positional arguments (an IEEE extension).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97248 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 19:18:41 +00:00
Fariborz Jahanian e7c5c93e37 Rewriting of imported variable from outer
blocks's argument in the inner block requires special treatment.
Fixes radar 7692419.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97244 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 19:05:20 +00:00
John McCall 9ba6166f4a Fix an assertion-on-error during tentative constructor parsing by
propagating error conditions out of the various annotate-me-a-snowflake
routines.  Generally (but not universally) removes redundant diagnostics
as well as, you know, not crashing on bad code.  On the other hand,
I have just signed myself up to fix fiddly parser errors for the next
week.  Again.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97221 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 08:45:28 +00:00
Douglas Gregor dc0a11cf52 An explicit specialization is allowed following an explicit
instantiation so long as that explicit specialization was declared
previously. Fixes PR6160.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97210 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 06:03:23 +00:00
Douglas Gregor 6d90870fe8 Implement semantic analysis for C++ [expr.new]p18-20, which describe
how we find the operator delete that matches withe operator new we
found in a C++ new-expression.

This will also need CodeGen support. On a happy note, we're now a
"nans" away from building tramp3d-v4.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97209 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 05:06:18 +00:00
Fariborz Jahanian 7c63fddad6 Support rewriting of property synthesis with retain/copy
attributes. Fixes radar 7214439.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97203 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 01:42:20 +00:00
Douglas Gregor 692f85c1d2 Commit Eli's fix for implicit conversions to array type. Fixes PR6264.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97202 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 01:17:27 +00:00
Douglas Gregor 1af745143e Make sure to mark constructors, operator new, and operator delete as
used when we instantiate C++ new expressions, delete expressions, and
object-construction expressions. Fixes PR6424, although we can't test
all of it until we finish implementing lookup of "operator delete" for
new expressions (!).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97195 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 00:38:10 +00:00
Douglas Gregor c845aad6f7 When we decide to re-use an existing CXXConstructExpr node, make sure
to mark the constructor as referenced. Fixes the narrow issue reported
in PR6424, but there are a few other places that I'll fix before
closing out that PR.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97185 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-26 00:01:57 +00:00
Douglas Gregor b2cb1cbd72 When computing the composite pointer type for relational comparisons,
equality comparisons, and conditional operators, produce a composite
pointer type with the appropriate additional "const" qualifiers if the
pointer types would otherwise be incompatible. This is a small
extension (also present in GCC and EDG in a slightly different form)
that permits code like:

  void** i; void const** j; 
  i == j; 

with the following extwarn:

t.cpp:5:5: warning: comparison of distinct pointer types ('void **' and
      'void const **') uses non-standard composite pointer type
      'void const *const *' [-pedantic]
  i == j; 
  ~ ^  ~

Fixes PR6346, and I'll be filing a core issue about this with the C++
committee.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97177 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 22:29:57 +00:00
Anders Carlsson bf554f63bf Fux a bug where we were trying to add overriders for non-virtual bases of virtual bases more than once.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97173 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 22:18:35 +00:00
Douglas Gregor 9e23932aca Allow us to compare derived-to-base conversions between a reference
binding and a copy-construction. Fixes an overloading problem in the
Clang-on-Clang build.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97161 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 19:01:05 +00:00
Fariborz Jahanian b2f8121656 Forgot to include nested protocols in collection, resulting in
bogus warning. Fixes radar 7682116.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97157 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 18:24:33 +00:00
Douglas Gregor 333de066a0 Don't try to finalize an ill-formed variable or one whose class type is ill-formed. Fixes PR6421
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97152 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 18:11:54 +00:00
John McCall 3a81337276 When comparing two method overload candidates during overload diagnostics,
skip the object argument conversion if either of the candidates didn't
initialize it.

Fixes PR6421, which is such a very straightforward extension of PR6398 that I
should have worked it into the last test case (and therefore caught it then).
Ah well.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97135 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 10:46:05 +00:00
Chandler Carruth 78bd771b27 Fix a really trivial crasher and begin fleshing out one of the namespace test
cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97134 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 09:32:59 +00:00
Chandler Carruth 23a370f945 Add a new conversion rank to classify conversions between complex and scalar
types. Rank these conversions below other conversions. This allows overload
resolution when the only distinction is between a complex and scalar type. It
also brings the complex overload resolutin in line with GCC's.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97128 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 07:20:54 +00:00
Ted Kremenek e3972a902d Enhance the unused ivar checker to not consider an ivar to be accidentally unused
when it is explicitly marked as unused via __attribute__((unused)).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97104 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 03:26:55 +00:00
Ted Kremenek 2ec93a8ec8 Allow __attribute__((unused)) to be applied to ObjC ivars.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97103 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 03:26:51 +00:00
Douglas Gregor a2e7dd2f4a Use CXXPseudoDestructorExpr as the stored representation for dependent
expressions that look like pseudo-destructors, e.g.,

  p->T::~T()

where p has dependent type.

At template instantiate time, we determine whether we actually have a
pseudo-destructor or a member access, and funnel down to the
appropriate routine in Sema.

Fixes PR6380.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97092 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 01:56:36 +00:00
John McCall b1bdc6232d Catch more uses of uninitialized implicit conversion sequences.
When diagnosing bad conversions, skip the conversion for ignored object
arguments.  Fixes PR 6398.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97090 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 01:37:24 +00:00
Ted Kremenek fc89323210 Remove test case dependancy on platform headers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97088 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 01:16:07 +00:00
Ted Kremenek 381d1bf0ee Add UnixAPIChecker, a meta checker to include various precondition checks for calls
to various unix/posix functions, e.g. 'open()'.

As a first check, check that when 'open()' is passed 'O_CREAT' that it has
a third argument.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97086 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-25 00:20:35 +00:00
Fariborz Jahanian 2ce692aa82 Added test case for non-objective-c situation in
my last patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97075 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 22:53:58 +00:00
Fariborz Jahanian 5e49b2f3e0 Implement nasty rewriting of nested blocks when inner
blocks use variables not used in any of the outer blocks.
(Fixes radar 7682149).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97073 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 22:48:18 +00:00
Douglas Gregor eba9acec37 Add test case for PR6141, which was fixed a few days ago
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97063 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 21:54:27 +00:00
Douglas Gregor 5821249f8f Add test for AST importing of C++ namespaces, missing from a prior commit
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97062 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 21:53:36 +00:00
Douglas Gregor 81895a21a1 Add PCH test for C++ namespaces, missing from a previous commit
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97061 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 21:52:55 +00:00
Douglas Gregor 77549080fb ActOnPseudoDestructorExpr now performs all semantic analysis for
pseudo-destructor expressions, and builds the CXXPseudoDestructorExpr
node directly. Currently, this only affects pseudo-destructor
expressions when they are parsed, but not after template
instantiation. That's coming next...

Improve parsing of pseudo-destructor-names. When parsing the
nested-name-specifier and we hit the sequence of tokens X :: ~, query
the actual module to determine whether X is a type-name (in which case
the X :: is part of the pseudo-destructor-name but not the
nested-name-specifier) or not (in which case the X :: is part of the
nested-name-specifier). 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97058 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 21:29:12 +00:00
Anders Carlsson 5edcc37525 Generate correct vcall offsets when we have a primary virtual base that is not a primary base in the complete class hierarchy.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97039 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 16:43:12 +00:00
John McCall f604a5648d References to const int parameters with ICE default arguments are not ICEs.
Fixes PR6373.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97037 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 09:03:18 +00:00
John McCall 1a4bb5cc1b Make this test portable to ABIs that use sret.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97035 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 08:14:27 +00:00
John McCall b7d3589318 Fix test case and convert fully to FileCheck.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97032 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 07:33:39 +00:00
John McCall 0b0ef0a70b Canonicalize parameter and return types before computing ABI info. Eliminates
a common source of oddities and, in theory, removes some redundant ABI
computations.  Also fixes a miscompile I introduced yesterday by refactoring
some code and causing a slightly different code path to be taken that
didn't perform *parameter* type canonicalization, just normal type
canonicalization;  this in turn caused a bit of ABI code to misfire because
it was looking for 'double' or 'float' but received 'const float'.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97030 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 07:14:12 +00:00
Ted Kremenek 78c97fb0bb Disable one test case because of the inconsistent results it is giving on
Windows and Mac OS X.  Will investigate later.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97016 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 02:28:29 +00:00
Charles Davis 328ce34c7d When we encounter a function-specific attribute in a declaration specifier,
apply it only to the function itself, and never to the return type. Fixes part
of PR6408.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97015 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 02:27:18 +00:00
Zhongxing Xu 910716678e Always add CallExpr as block-level expression. Inline-based interprocedural
analysis needs this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97014 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 02:19:28 +00:00
Fariborz Jahanian 170ee0cb60 Correct radar no.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97009 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 01:37:04 +00:00
Fariborz Jahanian 86aa9fdbb5 Fix rewriting of a method when return type is
a block pointer type. Fixes radar 7682149.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97008 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 01:25:40 +00:00
Ted Kremenek 87260c7eab Add support for '%C' and '%S' printf conversion specifiers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97005 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-24 00:05:54 +00:00
Fariborz Jahanian f914b9782a More Sema check for ivars in class continuation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97002 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 23:41:11 +00:00
Devang Patel 70c23cdf12 Emit debug info for VectorType.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96999 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 22:59:39 +00:00
Blaine Garst 573e59de57 fix buildbot failure on windows by slightly trimming test output to ignore temporary name
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96998 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 22:59:01 +00:00
Rafael Espindola 11e8ce7380 Add support for the weakref attribute. We still produce "alias weak" as llvm-gcc does, but are more strict on what uses of weakref we accept.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96992 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 22:00:30 +00:00
Blaine Garst 2a7eb28397 Unconditionally support block introspection data in a new field at the end
of the block descriptor field.  This field is the ObjC style @encode
signature of the implementation function, and was to this point
conditionally provided in the block literal data structure.  That
provisional support is removed.

Additionally, eliminate unused enumerations for the block literal flags field.
The first shipping ABI unconditionally set (1<<29) but this bit is unused
by the runtime, so the second ABI will unconditionally have (1<<30) set so
that the runtime can in fact distinguish whether the additional data is
present or not.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96989 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 21:51:17 +00:00
Fariborz Jahanian 5f1c45f7c8 Fixes a rewriting of qualified-id type which exposed a bigger
rewriting problem. Fixes radar 7680953.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96987 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 21:34:38 +00:00
Ted Kremenek 891322002b Dead emit dead store warnings when assigning nil to an ObjC object
pointer (for defensive programming).  This matches the behavior with
assigning NULL to a regular pointer.  Fixes <rdar://problem/7631278>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96985 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 21:19:33 +00:00
Ted Kremenek 09b6897d96 Fix another crash on invalid code. In this case, handle ObjC categories (with no names)
that refer to an undefined class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96976 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 19:39:46 +00:00
John McCall c0cd21d2a3 Don't assert on compound assignment operators that operate in FP types when
the result is integral.  Fixes <rdar://problem/7676608>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96970 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 19:22:29 +00:00
Fariborz Jahanian 53395af128 A test case for property synthesis using ivar in class extensions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96968 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 18:50:01 +00:00
Eli Friedman b1162f178f PR6400: Handle an extreme edge case in mangling correctly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96961 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 18:20:18 +00:00
Eli Friedman 18da88a38b PR6386: Fix a recent regression in IRGen of cast-to-union constructs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96958 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 17:58:35 +00:00
Richard Pennington 33efe2f088 Retain attributes for K&R style parameter declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96941 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 12:22:13 +00:00
Ted Kremenek 786cc72eca Add test case for <rdar://problem/7242010>, which appears to have been fixed
in the recent changes to RegionStore::InvalidateRegions().  Note that we
are still not yet modeling 'memcpy()' explicitly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96902 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 07:17:57 +00:00
Charles Davis 064f7db69d When comparing two calling conventions after redeclaring a function, compare
the canonical calling conventions instead of comparing the raw calling
conventions directly. Fixes PR6361.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96895 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 06:13:55 +00:00
Charles Davis 05f62474dd When a reference to a field of a struct/union/class is passed to the
__alignof__ operator, make sure to take into account the packed alignment
of the struct/union/class itself. Matches GCC's behavior and fixes PR6362.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96884 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 04:52:00 +00:00
Anders Carlsson af280c03a5 More fixes. Don't try to emit a virtual base vtable if the virtual base in question is a primary virtual base of some other base.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96881 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 03:48:14 +00:00
Anders Carlsson 92f5432567 Always emit vcall offset for the primary base, not only if it's virtual. Remove a debug printf, and add the test case that now passes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96880 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 03:26:17 +00:00
Fariborz Jahanian 0e5ad25572 More support for ivars in class extension.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96850 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 01:26:30 +00:00
John McCall c0bf462cf3 Perform two more constructor/destructor code-size optimizations:
1) emit base destructors as aliases to their unique base class destructors
under some careful conditions.  This is enabled for the same targets that can
support complete-to-base aliases, i.e. not darwin.

2) Emit non-variadic complete constructors for classes with no virtual bases
as calls to the base constructor.  This is enabled on all targets and in
theory can trigger in situations that the alias optimization can't (mostly
involving virtual bases, mostly not yet supported).

These are bundled together because I didn't think it worthwhile to split them,
not because they really need to be.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96842 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 00:48:20 +00:00