Daniel Dunbar [Thu, 5 Nov 2009 02:42:12 +0000 (02:42 +0000)]
Replace DiagnosticClient::setLangOptions with {Begin,End}SourceFile, and clarify
invariants (diagnostics with source informations must occur between
{Begin,End}SourceFile).
Daniel Dunbar [Thu, 5 Nov 2009 02:11:37 +0000 (02:11 +0000)]
Remove clang-cc -html-diags option, this doesn't fit in well and we get plenty
of coverage of this from the analyzer.
If this bothers you, I can add it back in a mode where non-source diagnostics go
to stderr and only source diagnostics use -html-diags, but I don't think anyone
uses this.
Ted Kremenek [Thu, 5 Nov 2009 02:09:23 +0000 (02:09 +0000)]
Acting on Daniel's nagging, remove PathDiagnosticClientFactory() and
migrate work in the destructors of PathDiagnosticClients from their
destructors to FlushReports(). The destructors now currently call
FlushReports(); this will be fixed in a subsequent patch.
Douglas Gregor [Thu, 5 Nov 2009 00:51:44 +0000 (00:51 +0000)]
When instantiating a UnaryOperator, allow the resulting expression to
still be dependent or invoke an overloaded operator. Previously, we
only supported builtin operators.
BinaryOperator/CompoundAssignOperator didn't have this issue because
we always built a CXXOperatorCallExpr node, even when name lookup
didn't find any functions to save until instantiation time. Now, that
code builds a BinaryOperator or CompoundAssignOperator rather than a
CXXOperatorCallExpr, to save some space.
Ted Kremenek [Thu, 5 Nov 2009 00:42:23 +0000 (00:42 +0000)]
Modify GRExprEngine::EvalBind() to take both a "store expression" and
an "assign expression", representing the expressions where the value
binding occurs and the assignment takes place respectively. These are
largely syntactic clues for better error reporting.
Douglas Gregor [Wed, 4 Nov 2009 22:49:18 +0000 (22:49 +0000)]
When starting a C++ member access expression, make sure to compute the
type of the object even when it is dependent. Specifically, this makes
sure that we get the right type for "this->", which is important when
performing name lookup into this scope to determine whether an
identifier or operator-function-id is a template name.
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.