Ted Kremenek [Sat, 30 Oct 2010 00:43:15 +0000 (00:43 +0000)]
Add test case for <rdar://problem/8610363> (a bogus report of using an uninitialized field). This was
already fixed, but this serves for detecting regressions.
Douglas Gregor [Sat, 30 Oct 2010 00:23:06 +0000 (00:23 +0000)]
Make the deserialization of macro definitions lazy, so that we can
load identifiers without loading their corresponding macro
definitions. This is likely to improve PCH performance slightly, and
reduces deserialization stack depth considerably when using
preprocessor metaprogramming.
Dale Johannesen [Fri, 29 Oct 2010 23:12:32 +0000 (23:12 +0000)]
Generate bitcasts going in and out of MMX parameters
in asm's. PR 8501, 8602988.
I don't like including Type.h where it is; the idea was
to get references to X86_MMXTy out of the common code.
Maybe there's a better way?
John McCall [Fri, 29 Oct 2010 22:22:43 +0000 (22:22 +0000)]
Restore r117644, this time properly ignoring -fvisibility and type visibility
for namespace-scope variable declarations.
Apply visibility in IR gen to variables that are merely declared
and never defined. We were previously emitting these with default
visibility unless they were declared with private_extern.
Ignore global visibility settings when computing visibility for
a declaration's context, and key several conditions on whether a
visibility attribute exists anywhere in the hierarchy as opposed
to whether it exists at the current level.
Qualified 'id' should implement all of static class type's
protocols, including those added to class, super class
and categories; otherewise issue a warning. This fixes
pr8453.
John McCall [Fri, 29 Oct 2010 07:49:41 +0000 (07:49 +0000)]
Apply visibility in IR gen to variables that are merely declared
and never defined. We were previously emitting these with default
visibility unless they were declared with private_extern.
Ignore global visibility settings when computing visibility for
a declaration's context, and key several conditions on whether a
visibility attribute exists anywhere in the hierarchy as opposed
to whether it exists at the current level.
Charles Davis [Fri, 29 Oct 2010 03:25:11 +0000 (03:25 +0000)]
Add a hook to the CXXABI object to get the default method calling convention.
This isn't used yet, because someone more experienced than I needs to look
at the type system about gutting getCanonicalCallConv().
John McCall [Fri, 29 Oct 2010 00:29:13 +0000 (00:29 +0000)]
When computing the visibility of a class member, calculate the visibility
of its context without considering global settings like -fvisibility=hidden.
Fixes PR8492.
Douglas Gregor [Thu, 28 Oct 2010 15:44:59 +0000 (15:44 +0000)]
Simplify ASTUnit's internal timers, by not trying to keep a pile of
timers to be dumped whenever the ASTUnit is destroyed. Instead, just
print the time elapsed for each operation after we perform the
operation.
John McCall [Thu, 28 Oct 2010 08:53:48 +0000 (08:53 +0000)]
Implement an indirect-goto optimization for goto *&&lbl and respect this
in the scope checker. With that done, turn an indirect goto into a
protected scope into a hard error; otherwise IR generation has to start
worrying about declarations not dominating their scopes, as exemplified
in PR8473.
If this really affects anyone, I can probably adjust this to only hard-error
on possible indirect gotos into VLA scopes rather than arbitrary scopes.
But we'll see how people cope with the aggressive change on the marginal
feature.
Remove an assertion that hit on legitimate cases. A redeclaration may have location before the
first one if the redeclaration comes from a friend decl.
John McCall [Thu, 28 Oct 2010 02:34:38 +0000 (02:34 +0000)]
Implement the newest status quo for method override checking. The idea now
is that we need more information to decide the exact conditions for whether
one ObjCObjectPointer is an acceptable return/parameter override for another,
so we're going to disable that entire class of warning for now. The
"forward developement" warning category, -Wmethod-signatures, can receive
unrestricted feature work, and when we're happy with how it acts, we'll
turn it on by default.
This is a pretty conservative change, and nobody's totally content with it.
Douglas Gregor [Wed, 27 Oct 2010 22:21:36 +0000 (22:21 +0000)]
Make AST deserialization for class template specializations lazier, by
not loading the specializations of a class template until some AST
consumer needs them.
John McCall [Wed, 27 Oct 2010 20:58:56 +0000 (20:58 +0000)]
Restore r117403 (fixing IR gen for bool atomics), this time being less
aggressive about the form we expect bools to be in. I don't really have
time to fix all the sources right now.
Do the guarding of instantiated static data members
on if its linkage is weak. Currently this is the
case but may change in the future. (part of radar 8562966).
Chandler Carruth [Wed, 27 Oct 2010 06:55:41 +0000 (06:55 +0000)]
Add helper for extracting the CXXRecordDecl for the implicit argument to
a member call expression. This has proved to be a common pattern for users of
RecursiveASTVisitor.
Zhongxing Xu [Wed, 27 Oct 2010 03:23:10 +0000 (03:23 +0000)]
If visiting RHS causes us to finish 'Block', e.g. the RHS is a StmtExpr
containing a DoStmt, and the LHS doesn't create a new block, then we should
return RBlock. Otherwise we'll incorrectly return NULL.
Also relax an assertion in VisitWhileStmt(). Reset 'Block' when it is finished.
John McCall [Tue, 26 Oct 2010 22:09:15 +0000 (22:09 +0000)]
Extract procedures to do scalar-to-memory and memory-to-scalar conversions
in IR gen, and use those to fix a correctness issue with bool atomic
intrinsics. rdar://problem/8461234
Douglas Gregor [Tue, 26 Oct 2010 17:18:00 +0000 (17:18 +0000)]
Teach typo correction not to return the same keyword that matches a
typo. This can happen with context-sensitive keywords like "super",
when typo correction didn't know that "super" wasn't permitted in this
context.
John McCall [Tue, 26 Oct 2010 08:39:16 +0000 (08:39 +0000)]
Optimize field space usage in CompoundStmt, LabelStmt, Expr, and CastExpr.
There's probably still significant padding waste on x86-64 UNIXen, but
the difference in 32-bit compiles should be significant.
There are a lot of Expr nodes left that could lose a word this way.
Douglas Gregor [Tue, 26 Oct 2010 05:45:40 +0000 (05:45 +0000)]
Delay complete-type checking for arguments to no-prototype functions
until after we've checked/promoted the argument. Hopefully fixes the
Emacs regression due to my recent change that expanded type-checking
in the presence of K&R function definitions.
John McCall [Tue, 26 Oct 2010 04:59:26 +0000 (04:59 +0000)]
A couple of tweaks to the visibility rules:
- tags with C linkage should ignore visibility=hidden
- functions and variables with explicit visibility attributes should
ignore the linkage of their types
Either of these should be sufficient to fix PR8457.
John McCall [Tue, 26 Oct 2010 00:53:53 +0000 (00:53 +0000)]
Pending further discussion, re-enable warnings for Objective C
covariant/contravariant overrides and implementations, but do so under
control of a new flag (-Wno-objc-covariant-overrides, which yes does cover
contravariance too).
*At least* the covariance cases will probably be enabled by default shortly,
but that's not totally uncontroversial.
Douglas Gregor [Tue, 26 Oct 2010 00:51:02 +0000 (00:51 +0000)]
When de-serializing a type that is supposed to be canonical, call
getCanonicalType() to make sure that the type we got back is actually
canonical. This is the case for most types, which always build a
canonical type when given canonical components. However, some types that
involve expressions in their canonicalization (e.g., array types with
dependent sizes) don't always build canonical types from canonical
components, because there is no such thing as a "canonical"
expression. Therefore, we do this extra mapping to ensure that the
canonical types we store are actually canonical.