Francois Pichet [Mon, 18 Oct 2010 15:01:13 +0000 (15:01 +0000)]
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
Bill Wendling [Sun, 17 Oct 2010 07:38:01 +0000 (07:38 +0000)]
The "gcc.dg/compat/vector-1 -m32" test was broken after the MMX rewrite. The
function parameters weren't converted to use the correct type (x86_mmx). Add a
check, similar to the one in llvm-gcc, to see if we need the x86_mmx type for
that function parameter. If so, it coerces the type to be that.
John McCall [Sat, 16 Oct 2010 06:59:13 +0000 (06:59 +0000)]
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.
Daniel Dunbar [Sat, 16 Oct 2010 05:04:10 +0000 (05:04 +0000)]
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.
Douglas Gregor [Fri, 15 Oct 2010 23:53:28 +0000 (23:53 +0000)]
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>.
Ted Kremenek [Fri, 15 Oct 2010 22:50:23 +0000 (22:50 +0000)]
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>.
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.
Douglas Gregor [Fri, 15 Oct 2010 16:49:56 +0000 (16:49 +0000)]
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.
Douglas Gregor [Fri, 15 Oct 2010 13:35:25 +0000 (13:35 +0000)]
When we're in the context of an Objective-C message send's receiver,
typo correction prefers "super" over other, equivalent completions. I
believe this will fix the regression on the buildbot.
Recurse on a TypeLoc rather than a Type for TypedefDecl, now that the
typloc information is available (I don't think it was, originally).
Submitted as a 'trivial' change.
Devang Patel [Thu, 14 Oct 2010 22:59:23 +0000 (22:59 +0000)]
Use root non-virtual primary base class, not just immediate primary base class, for AT_containing_type.
This is tested by virtfunc.exp in gdb testsuite.
Douglas Gregor [Thu, 14 Oct 2010 22:11:03 +0000 (22:11 +0000)]
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.
Francois Pichet [Thu, 14 Oct 2010 20:49:46 +0000 (20:49 +0000)]
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.
Douglas Gregor [Thu, 14 Oct 2010 20:34:08 +0000 (20:34 +0000)]
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.
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.
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.
Introduce command line option -error-on-deserialized-decl that is accompanied by a name
and emits an error if a declaration with this name is deserialized from PCH.
This is for testing, to make sure that we don't deserialize stuff needlessly.
Don't add the injected class name to the redeclarations chain; the chain should contain actual redeclarations, not implicits.
As a bonus, now we don't deserialize it unless we need it.
Douglas Gregor [Wed, 13 Oct 2010 22:19:53 +0000 (22:19 +0000)]
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.
Douglas Gregor [Wed, 13 Oct 2010 20:41:14 +0000 (20:41 +0000)]
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.