Commit Graph

8928 Commits

Author SHA1 Message Date
John McCall 17afe45a87 objc_exception_rethrow does not take an exception argument.
rdar://problem/8535238

llvm-svn: 116663
2010-10-16 08:21:07 +00:00
John McCall 2c2eb12d9c White-listing templated-scope friend decls is a good idea, but doing it
by marking the decl invalid isn't.  Make some steps towards supporting these
and then hastily shut them down at the last second by marking them as
unsupported.

llvm-svn: 116661
2010-10-16 06:59:13 +00:00
Daniel Dunbar 622581b73b Revert r116656, "IRgen/Obj-C/NeXT: Fix the IR signature for
objc_exception_rethrow, so we don't...", since something is actually trying to
call this with the wrong signature (!). Unfortunately I don't understand the new
EH infrastructure well enough to fix it immediately.

llvm-svn: 116660
2010-10-16 05:04:10 +00:00
Daniel Dunbar 90bb5c2315 IRgen/Obj-C/NeXT: Fix the IR signature for objc_exception_rethrow, so we don't
generate unnecessary %al clear on x86_64.

llvm-svn: 116656
2010-10-16 04:08:16 +00:00
Fariborz Jahanian 1cee0adea3 Fix a rewriting bug of rewriting properties declared in
protocols. // rdar: //8558702

llvm-svn: 116652
2010-10-16 00:29:27 +00:00
Chandler Carruth dc689c4156 Not really sure how this worked, but it seems like a clear typo. =]
llvm-svn: 116650
2010-10-16 00:24:52 +00:00
Douglas Gregor 1f81ced14c Allow list-initialization of a local variable of class type with a
flexible array member, so long as the flexibility array member is
either not initialized or is initialized with an empty initializer
list. Fixes <rdar://problem/8540437>.

llvm-svn: 116647
2010-10-15 23:53:28 +00:00
Douglas Gregor bafff22b91 Disable this test again, which naturally fails on every platform except the one I'm building with
llvm-svn: 116642
2010-10-15 23:23:05 +00:00
Ted Kremenek 4f63ac7057 Tweak retain/release checker diagnostics to specify a leak occurs because an object is not referenced later in the path,
not that it isn't referenced later in the code.  Fixes <rdar://problem/8527839>.

llvm-svn: 116636
2010-10-15 22:50:23 +00:00
Fariborz Jahanian dddf158c19 Check for ivar being a C++ object before attempting to
find a copy constructor/assignment operator used
in getter/setter synthesis. This removes an unintended
diagnostics and makes objc++ consistant with objective-c.
// rdar: //8550657.

llvm-svn: 116631
2010-10-15 22:42:59 +00:00
Nick Lewycky c60d6e7af0 Report the location of the syntax error inside a macro. Fixes PR7944.
llvm-svn: 116624
2010-10-15 21:43:24 +00:00
Argyrios Kyrtzidis dfe47dba37 Revert r116605, a lot more were committed by mistake.
llvm-svn: 116606
2010-10-15 18:51:34 +00:00
Argyrios Kyrtzidis ffbba26285 Add '-include-pch' option to the driver, so it can get passed to the cc1 driver.
llvm-svn: 116605
2010-10-15 18:49:01 +00:00
Argyrios Kyrtzidis 434383d703 Read/write to/from PCH DeclarationNameLocs, DeclarationNameInfos and QualifierInfos (rdar://8513756).
llvm-svn: 116598
2010-10-15 18:21:24 +00:00
Douglas Gregor 26c5578d84 When performing typo correction, keep track of whether the last lookup
we did was an acceptable lookup. If it is, then we can re-use that
lookup result. If it isn't, we have to perform the lookup again. This
is almost surely the cause behind the mysterious typo.m failures on
some builders; we were getting the wrong lookup results returned.

llvm-svn: 116586
2010-10-15 16:49:56 +00:00
Daniel Dunbar 2a40abae4d Disable type.m while failures are investigated.
llvm-svn: 116577
2010-10-15 15:28:09 +00:00
Daniel Dunbar 1837dbd4e3 Make test more consistent.
llvm-svn: 116576
2010-10-15 15:13:02 +00:00
Douglas Gregor 36c22a2335 Diagnose C++ [class.mem]p13-14, where a class member has the same name
as the class itself. Fixes PR7082.

llvm-svn: 116573
2010-10-15 13:21:21 +00:00
Gabor Greif de1f58919a zap trailing whitespace
llvm-svn: 116572
2010-10-15 08:48:51 +00:00
Gabor Greif 7e1dd672fb testcase for http://llvm.org/PR8371 of my last commit, r116570
llvm-svn: 116571
2010-10-15 08:44:44 +00:00
Abramo Bagnara 932e393fda Treat __extension__ like ParenExpr.
llvm-svn: 116569
2010-10-15 07:51:18 +00:00
Douglas Gregor d4e1fb562e Don't complain about a variable within a linkage-specification that is
initialized. Fixes PR7076.

llvm-svn: 116553
2010-10-15 01:21:46 +00:00
Douglas Gregor b048402073 When we are missing the ',' or '>' to terminate a template parameter
list, complain about it! Fixes PR7053.

llvm-svn: 116551
2010-10-15 01:15:58 +00:00
Douglas Gregor 8a8e0313bf Add builtin conditional operator candidates for scoped enumeration
types, from Alp Toker! Fixes PR8344.

llvm-svn: 116549
2010-10-15 00:50:56 +00:00
Fariborz Jahanian 9c07e1767d Rewrite bug fix rewriting a property assignment when
its RHS is an ivar. Fixes //rdar: //8541517.

llvm-svn: 116539
2010-10-14 23:31:39 +00:00
John McCall f477659040 template-ids are looked up differently in friend declarations.
llvm-svn: 116529
2010-10-14 22:22:28 +00:00
Douglas Gregor 57756eabc9 When performing typo correction, look through the set of known
identifiers to determine good typo-correction candidates. Once we've
identified those candidates, we perform name lookup on each of them
and the consider the results. 

This optimization makes typo correction > 2x faster on a benchmark
example using a single typo (NSstring) in a tiny file that includes
Cocoa.h from a precompiled header, since we are deserializing far less
information now during typo correction.

There is a semantic change here, which is interesting. The presence of
a similarly-named entity that is not visible can now affect typo
correction. This is both good (you won't get weird corrections if the
thing you wanted isn't in scope) and bad (you won't get good
corrections if there is a similarly-named-but-completely-unrelated
thing). Time will tell whether it was a good choice or not.

llvm-svn: 116528
2010-10-14 22:11:03 +00:00
Douglas Gregor c3bbf48f47 Make sure that we diagnose invalid qualifiers on friend functions.
llvm-svn: 116527
2010-10-14 22:03:51 +00:00
Andrew Trick 6c8ce5c8b5 Reverting r116493: removes a test that failed on clang selfhost and msvc
llvm-svn: 116522
2010-10-14 21:41:16 +00:00
Fariborz Jahanian a895c38928 Put line number on the diagnostic. //rdar: //8550657.
llvm-svn: 116519
2010-10-14 21:30:10 +00:00
Francois Pichet 41232a9872 r116509 fixed the Win32 XFAIL.
The failing was due to this:
1. preamble.c contains CR+LF new lines
2. write() is called with a buffer containing the original (CR+LF) to output the result on the console.
3. In text mode(the default), write() convert LF to CR+LF even if LF is preceded by CR, hence we have CR+CR+LF which filecheck interprets as 2 lines.

llvm-svn: 116513
2010-10-14 20:49:46 +00:00
Douglas Gregor 0afa7f66cd Tweak the typo-correction implementation to determine corrections
solely based on the names it sees, rather than actual declarations it
gets. In essence, we determine the set of names that are "close
enough" to the typo'd name. Then, we perform name lookup for each of
those names, filtering out those that aren't actually visible, and
typo-correct from the remaining results.

Overall, there isn't much of a change in the behavior of typo
correction here. The only test-suite change comes from the fact that
we make good on our promise to require that the user type 3 characters
for each 1 character corrected. 

The real intent behind this change is to set the stage for an
optimization to typo correction (so that we don't need to deserialize
all declarations in a translation unit) and future work in finding
missing qualification ("'vector' isn't in scope; did you mean
'std::vector'?). Plus, the code is cleaner this way.

llvm-svn: 116511
2010-10-14 20:34:08 +00:00
Argyrios Kyrtzidis 6843141d39 Store in PCH the key function of C++ class to avoid deserializing the complete declaration context in order to compute it.
Progress for rdar://7260160.

llvm-svn: 116508
2010-10-14 20:14:38 +00:00
Argyrios Kyrtzidis 0e88a565c0 Allow deserialization of just the fields of a record, when we want to iterate over them,
instead of deserializing the complete declaration context of the record.

Iterating over the fields of a record is very common (e.g to determine the layout), unfortunately we needlessly deserialize every declaration
that the declaration context of the record contains; this can be bad for large C++ classes that contain a lot of methods.
Fix this by allow deserialization of just the fields when we want to iterate over them.
Progress for rdar://7260160.

llvm-svn: 116507
2010-10-14 20:14:34 +00:00
David Chisnall a9d40ee0ab Test case for r116439
llvm-svn: 116493
2010-10-14 18:15:20 +00:00
Anton Yartsev 73d4023114 support for AltiVec extensions from the Cell architecture
llvm-svn: 116478
2010-10-14 14:37:46 +00:00
Chris Lattner 26f6c227dc allow I128 suffixes in msextensions mode just like i128 suffixes, patch
by Martin Vejnar!

llvm-svn: 116460
2010-10-14 00:24:10 +00:00
Douglas Gregor 5a2bb5ba98 Diagnose when a 'static' member function overrides a virtual function
in a base class. Fixes PR8168.

llvm-svn: 116448
2010-10-13 22:55:32 +00:00
Douglas Gregor a007d36c1b Generalize the checking for qualification of (non-friend) class
members. Provide a hard error when the qualification doesn't match the
current class type, or a warning + Fix-it if it does match the current
class type. Fixes PR8159.

llvm-svn: 116445
2010-10-13 22:19:53 +00:00
Douglas Gregor d07ba34a44 There is no reason for dereferencing a pointer-to-member to require
that the class type into which the pointer points be complete, even
though the standard requires it. GCC/EDG do not require a complete
type here, so we're calling this a problem with the standard. Fixes
PR8328.

llvm-svn: 116429
2010-10-13 20:41:14 +00:00
Douglas Gregor f10c97f36e _Bool is not a keyword in C++. Fixes PR7388 and PR8349.
llvm-svn: 116422
2010-10-13 20:00:38 +00:00
Douglas Gregor dc13b04a98 Place conversion warnings for non-type template arguments under the
control of -Wconversion, and ignore them by default.

llvm-svn: 116415
2010-10-13 18:27:55 +00:00
Douglas Gregor b39215942e Fix a silly bug in the suppression of non-error diagnostics in a
SFINAE context, where we weren't getting the right diagnostic argument
count. I blame DiagnosticBuilder's weirdness. Fixes PR8372.

llvm-svn: 116411
2010-10-13 17:22:14 +00:00
John McCall f7cfb2212c Support friend function declarations in local classes correctly.
Fixes a crash and diagnoses the error condition of an unqualified
friend which doesn't resolve to something.  I'm still not certain how
this is useful.

llvm-svn: 116393
2010-10-13 05:45:15 +00:00
Argyrios Kyrtzidis 8c64bbe032 Embrace C++ ABI 5.2.6 and consider that template instantiations don't have key functions (same as GCC).
llvm-svn: 116391
2010-10-13 02:39:41 +00:00
Douglas Gregor 7731d3fafc Teach the warning about unnamed/local types in template arguments to
actually walk the template argument type to find any unnamed/local
types within it. Fixes PR6784.

llvm-svn: 116382
2010-10-13 00:27:52 +00:00
Douglas Gregor 5bb5e4ad9d Introduce support for emitting diagnostics (warnings + their notes)
that are suppressed during template argument deduction. This change
queues diagnostics computed during template argument deduction. Then,
if the resulting function template specialization or partial
specialization is chosen by overload resolution or partial ordering
(respectively), we will emit the queued diagnostics at that point. 

This addresses most of PR6784. However, the check for unnamed/local
template arguments (which existed before this change) is still only
skin-deep, and needs to be extended to look deeper into types. It must
be improved to finish PR6784.

llvm-svn: 116373
2010-10-12 23:32:35 +00:00
John McCall de3fd2264c Handle dependent friends more explicitly and deal with the possibility
of templated-scope friends by marking them invalid and white-listing all
accesses until such time as we implement them.  Fixes a crash, this time
without a broken test case.

llvm-svn: 116364
2010-10-12 23:13:28 +00:00
Eli Friedman 36ebbec121 PR8325: don't do destructor checking when a pointer is thrown.
llvm-svn: 116336
2010-10-12 20:32:36 +00:00
John McCall 036855a0ed Enter the context of the declared function template when performing
deduction and the final substitution, but not while substituting the
explicit template arguments.  Fixes rdar://problem/8537391

llvm-svn: 116332
2010-10-12 19:40:14 +00:00