Commit Graph

8944 Commits

Author SHA1 Message Date
Daniel Dunbar cb79c22678 tests: Force triple to avoid limited precision warning on win32.
llvm-svn: 116770
2010-10-18 23:37:08 +00:00
Ted Kremenek da8a79ac8d "Fix" bogus idempotent operations warning due to loop unrolling not unrolling enough loops to show that an invariant
doesn't hold.  This fix is to increase the loop unrolling count to 4, which experiments show doesn't typically impact
analysis time.  The real fix is to modify the IdempotentOperationsChecker to suppress warnings where an analysis point
could be preceded by a point where we gave up due to loop unrolling.

llvm-svn: 116769
2010-10-18 23:36:05 +00:00
Douglas Gregor c769d6e007 Fix the translation of the PCC_ForInit code-completion context for
C++/C99/Objective-C, so that we properly include types. This fix
affects global caching of code-completion results; without caching,
the behavior was already correct.

llvm-svn: 116757
2010-10-18 22:01:46 +00:00
Douglas Gregor 643c330b91 Provide code completion for types after the '^' that starts a block
literal. 

llvm-svn: 116754
2010-10-18 21:34:55 +00:00
John McCall 18e4edae82 Fix some bugs in local class mangling brought up in PR8355.
Patch by Richard Smith!

llvm-svn: 116752
2010-10-18 21:28:44 +00:00
Douglas Gregor 8e3e8743fb Introduce code completion results for Objective-C methods, both when
declaring methods and when sending messages to them, by bringing all
of the selector into TypedCheck chunks in the completion result. This
way, we can improve the sorting of these results to account for the
full selector name rather than just the first chunk.

llvm-svn: 116746
2010-10-18 21:05:04 +00:00
Argyrios Kyrtzidis 9beef8e53d Read/write declaration attributes from/to PCH properly. Embed them in the declaration block instead of trying to create another block.
The new block was messing with the assumption that after decls block comes the stmts block.
Fixes http://llvm.org/PR8406

llvm-svn: 116737
2010-10-18 19:20:11 +00:00
Argyrios Kyrtzidis 754fb5ffb3 Merge header & cpp for test/PCH/attrs.c - more convenient to keep the tests in one source file.
llvm-svn: 116736
2010-10-18 19:20:05 +00:00
Douglas Gregor 1b035bbe3a When providing code completions of Objective-C method declarations
(after - or +), always traverse superclasses and all categories. The
programmer may want to complete a method from *anywhere*.

llvm-svn: 116723
2010-10-18 18:21:28 +00:00
Fariborz Jahanian f34011e4ca patch fixes class names missing from method names in debug information for
synthesized property. // rdar: //8498026

llvm-svn: 116717
2010-10-18 17:51:06 +00:00
Anders Carlsson 778ca32c88 Implement the first half of [dcl.attr.override]p6.
llvm-svn: 116709
2010-10-18 16:24:27 +00:00
Francois Pichet a310806ae5 Microsoft enum extensions. 2 things will change on -fms-extensions:
1. enum underlying type is int by default.
2. Error "enumerator value is not representable in the underlying type"is a ExtWarning

llvm-svn: 116704
2010-10-18 15:01:13 +00:00
Bill Wendling 5cd41c4b13 Reapply r116684 with fixes. The test cases needed to be updated.
llvm-svn: 116696
2010-10-18 03:41:31 +00:00
Anders Carlsson 0ea1047d51 Implement [dcl.attr.override]p2 and add tests for p1 and p2.
llvm-svn: 116692
2010-10-17 23:36:12 +00:00
Anders Carlsson fa9de26518 Add test for [dcl.attr.final]p4.
llvm-svn: 116691
2010-10-17 22:47:44 +00:00
John McCall d509182336 Coding by inspection has its problems.
llvm-svn: 116672
2010-10-16 16:34:08 +00:00
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