Douglas Gregor [Wed, 4 Nov 2009 07:01:15 +0000 (07:01 +0000)]
When performing template instantiation (transformation) of
expressions, keep track of whether we are immediately taking the
address of the expression. Pass this flag when building a declaration
name expression so that we handle pointer-to-member constants
properly.
John McCall [Wed, 4 Nov 2009 02:18:39 +0000 (02:18 +0000)]
Change our basic strategy for avoiding deprecation warnings when the decl use
appears in a deprecated context. In the new strategy, we emit the warnings
as usual unless we're currently parsing a declaration, where "declaration" is
restricted to mean a decl group or a few special cases in Objective C. If
we *are* parsing a declaration, we queue up the deprecation warnings until
the declaration has been completely parsed, and then emit them only if the
decl is not deprecated.
We also standardize the bookkeeping for deprecation so as to avoid special cases.
Tanya Lattner [Wed, 4 Nov 2009 01:18:09 +0000 (01:18 +0000)]
Merge constant array and structures. This will create a global variables for arrays and structs that are constant and their initializer is constant. It is on by default but can be disable with the flag -fno-merge-all-constants.
Mike Stump [Wed, 4 Nov 2009 00:53:51 +0000 (00:53 +0000)]
Split out return adjustments in thunks from this adjustment in thunks
so the optimizer can tailcall into the return value adjustment thunk.
This improves codesize for complex hierarchies.
Ted Kremenek [Wed, 4 Nov 2009 00:09:15 +0000 (00:09 +0000)]
Refactor StoreManager::BindDecl() to take a VarRegion* instead of a VarDecl*, and modify GRExprEngine::EvalBind() to handle decl initialization as well. This paves the way for adding "checker" visitation in EvalBind().
Ted Kremenek [Tue, 3 Nov 2009 23:30:34 +0000 (23:30 +0000)]
Change GRTransferFuncs::RegisterChecks() to take a GRExprEngine& instead of a BugReporter&. This paves the way for pulling some of the retain/release checker into a "Checker" class.
Mike Stump [Tue, 3 Nov 2009 23:25:48 +0000 (23:25 +0000)]
Refine volatile handling, specifically, we must have the canonical
type to look at the volatile specifier. I found these all from just
hand auditing the code.
Douglas Gregor [Tue, 3 Nov 2009 23:16:33 +0000 (23:16 +0000)]
Parsing and semantic analysis for template-ids that name overloaded
operators, e.g.,
operator+<int>
which now works in declarators, id-expressions, and member access
expressions. This commit only implements the non-dependent case, where
we can resolve the template-id to an actual declaration.
Mike Stump [Tue, 3 Nov 2009 22:20:01 +0000 (22:20 +0000)]
We have to ensure we have the canonical type to do this. This is but
one instance of a large problem. assert for non-canoical types would
help track down these things.
John McCall [Tue, 3 Nov 2009 21:13:47 +0000 (21:13 +0000)]
CFieldCallback doesn't need to create an ExtensionRAIIObject: it's actually
automatically shadowed by the ExtensionRAIIObject created by
ParseStructDeclaration.
Douglas Gregor [Tue, 3 Nov 2009 19:44:04 +0000 (19:44 +0000)]
Replace the code that parses member access expressions after "." or
"->" with a use of ParseUnqualifiedId. Collapse
ActOnMemberReferenceExpr, ActOnDestructorReferenceExpr (both of them),
ActOnOverloadedOperatorReferenceExpr,
ActOnConversionOperatorReferenceExpr, and
ActOnMemberTemplateIdReferenceExpr into a single, new action
ActOnMemberAccessExpr that does the same thing more cleanly (and can
keep more source-location information).
John McCall [Tue, 3 Nov 2009 19:26:08 +0000 (19:26 +0000)]
Reorganize the parsing of decl groups / function definitions so that
declarators are parsed primarily within a single function (at least for
these cases). Remove some excess diagnostics arising during parse failures.
Douglas Gregor [Tue, 3 Nov 2009 16:56:39 +0000 (16:56 +0000)]
Use ParseUnqualifiedId when parsing id-expressions. This eliminates
yet another copy of the unqualified-id parsing code.
Also, use UnqualifiedId to simplify the Action interface for building
id-expressions. ActOnIdentifierExpr, ActOnCXXOperatorFunctionIdExpr,
ActOnCXXConversionFunctionExpr, and ActOnTemplateIdExpr have all been
removed in favor of the new ActOnIdExpression action.
Zhongxing Xu [Tue, 3 Nov 2009 12:13:38 +0000 (12:13 +0000)]
Pull VLA size checker into its own files.
Split it to two checkers, one for undefined size,
the other for zero size, so that we don't need to query the size
when emitting the bug report.
Ted Kremenek [Tue, 3 Nov 2009 08:00:42 +0000 (08:00 +0000)]
Move 'static inline' functions GetNullarySelector() and GetUnarySelector() from CFRefCount.cpp to ASTContext.h. These functions are likely to be generally useful.
Douglas Gregor [Tue, 3 Nov 2009 01:35:08 +0000 (01:35 +0000)]
Introduce a new class, UnqualifiedId, that provides a parsed
representation of a C++ unqualified-id, along with a single parsing
function (Parser::ParseUnqualifiedId) that will parse all of the
various forms of unqualified-id in C++.
Replace the representation of the declarator name in Declarator with
the new UnqualifiedId class, simplifying declarator-id parsing
considerably and providing more source-location information to
Sema. In the future, I hope to migrate all of the other
unqualified-id-parsing code over to this single representation, then
begin to merge actions that are currently only different because we
didn't have a unqualified notion of the name in the parser.
Assortment of property attributes declared in continuation
class must match those of same property declared
in its primary class. (Fixes radar 7352425)
Property declared in continuation class can only be used to
change a readonly property declared in the class (and its inherited protocols)
to writable property. (Fixes radar 7350645).
Douglas Gregor [Sun, 1 Nov 2009 20:32:48 +0000 (20:32 +0000)]
When determining whether a reference to a static data member is an
integral constant expression, make sure to find where the initializer
was provided---inside or outside the class definition---since that can
affect whether we have an integral constant expression (and, we need
to see the initializer itself).
Douglas Gregor [Sun, 1 Nov 2009 17:08:18 +0000 (17:08 +0000)]
Within a template, qualified name lookup can refer to a non-dependent type
that is not known to be a base class at template definition time due
to some dependent base class. Treat qualified name lookup that refers
to a non-static data member or function as implicit class member
access when the "this" type would be dependent.
Douglas Gregor [Sat, 31 Oct 2009 17:21:17 +0000 (17:21 +0000)]
Implement "incremental" template instantiation for non-type template
parameters and template type parameters, which occurs when
substituting into the declarations of member templates inside class
templates. This eliminates errors about our inability to "reduce
non-type template parameter depth", fixing PR5311.
Also fixes a bug when instantiating a template type parameter
declaration in a member template, where we weren't properly reducing
the template parameter's depth.