Sebastian Redl [Thu, 5 Feb 2009 15:12:41 +0000 (15:12 +0000)]
Fix the symptom of the regression, by having the CXXConditionDeclExpr not destroy its Decl.
However, the cause still remains: the Decl is linked into the chain of its DeclContext and remains there despite being deleted.
Sebastian Redl [Thu, 5 Feb 2009 15:02:23 +0000 (15:02 +0000)]
Put the invalid flag of OwningResult into the Action pointer.
This shrinks OwningResult by one pointer. Since it is no longer larger than OwningPtr, merge the two.
This leads to simpler client code and speeds up my benchmark by 2.7%.
For some reason, this exposes a previously hidden bug, causing a regression in SemaCXX/condition.cpp.
Daniel Dunbar [Thu, 5 Feb 2009 11:21:33 +0000 (11:21 +0000)]
Add bare bones test that parameter passing is consistent for
scalar/complex/aggregate cases.
- Currently disabled for x86_64, triggering a misoptimization
(PR3489).
Daniel Dunbar [Thu, 5 Feb 2009 11:13:54 +0000 (11:13 +0000)]
Implement Direct ABIInfo semantics.
- No intended functionality change, this is essentially enabling
direct passing of complex and aggregate values, which no ABI is
using.
Daniel Dunbar [Thu, 5 Feb 2009 09:16:39 +0000 (09:16 +0000)]
Implement ABI Indirect sematics for arguments.
- No intended functionality change, all current ABI implementations
were only using indirect for complex/aggregate types, which were
being passed indirectly with the Direct ABIInfo kind.
Zhongxing Xu [Thu, 5 Feb 2009 06:57:29 +0000 (06:57 +0000)]
Make SymbolicRegion subclass TypedRegion, for symbols usually have types, so
do the symblic regions associated with them and we need them to be typed.
Current SymbolicRegion::getRValueType() method is very restricting. It may be
modified when we are more clear about what could be the types of symblic
regions.
BasicConstraintManager::Assume() is changed due to that now SymblicRegion is a
subclass of SubRegion.
Ted Kremenek [Thu, 5 Feb 2009 06:50:21 +0000 (06:50 +0000)]
Remove a bunch of obscene double-buffering of BugReports in the retain/release
checker. This was previously needed because BugReport objects were previously
allocated on the stack and not owned by BugReporter. Now we can just issue them
on the fly. This change was motivated because we were seeing some weird cases
where some really long paths would get issued for bugs (particularly leaks)
because of some double-caching.
Ted Kremenek [Wed, 4 Feb 2009 23:49:09 +0000 (23:49 +0000)]
Overhaul BugReporter interface and implementation. The new interface cleans up
the ownership of BugTypes and BugReports. Now BugReports are owned by BugTypes,
and BugTypes are owned by the BugReporter object.
The major functionality change in this patch is that reports are not immediately
emitted by a call to BugReporter::EmitWarning (now called EmitReport), but
instead of queued up in report "equivalence classes". When
BugReporter::FlushReports() is called, it emits one diagnostic per report
equivalence class. This provides a nice cleanup with the caching of reports as
well as enables the BugReporter engine to select the "best" path for reporting a
path-sensitive bug based on all the locations in the ExplodedGraph that the same
bug could occur.
Along with this patch, Leaks are now coalesced into a common equivalence class
by their allocation site, and the "summary" diagnostic for leaks now reports the
allocation site as the location of the bug (this may later be augmented to also
provide an example location where the leak occurs).
Douglas Gregor [Wed, 4 Feb 2009 22:46:25 +0000 (22:46 +0000)]
Implement semantic analysis for the GNU flexible array initialization
extension. The interaction with designated initializers is a
bit... interesting... but we follow GNU's lead and don't permit too
much crazy code in this area.
Also, make the "excess initializers" error message a bit more
informative.
Daniel Dunbar [Wed, 4 Feb 2009 21:19:06 +0000 (21:19 +0000)]
Add -femit-all-decls codegen option.
- Emits all declarations, even unused (static) ones.
- Useful when doing minimization of codegen problems (otherwise
problems localized to a static function aren't minimized well).
Douglas Gregor [Wed, 4 Feb 2009 17:27:36 +0000 (17:27 +0000)]
Some name-lookup-related fixes, from Piotr Rak!
- Changes Lookup*Name functions to return NamedDecls, instead of
Decls. Unfortunately my recent statement that it will simplify lot of
code, was not quite right, but it simplifies some...
- Makes MergeLookupResult SmallPtrSet instead of vector, following
Douglas suggestions.
- Adds %qN format for printing qualified names to Diagnostic.
- Avoids searching for using-directives in Scopes, which are not
DeclScope, during unqualified name lookup.
Steve Naroff [Wed, 4 Feb 2009 17:14:05 +0000 (17:14 +0000)]
Fix <rdar://problem/6552648> error: redefinition of 'XCElementAnchorDelegate' as different kind of symbol.
At first glance, this looked like a recent regression (possibly created by http://llvm.org/viewvc/llvm-project?view=rev&revision=63354, which was the only recent change to this section of Sema::ActOnStartClassInterface()). After more investigation, it looks like an edge case bug that we didn't cover in our tests.
Douglas Gregor [Wed, 4 Feb 2009 16:44:47 +0000 (16:44 +0000)]
Bring operator name lookup (as required for C++ operator overloading)
into the general name-lookup fold. This cleans up some ugly,
not-quite-working code in the handling of operator overloading.
Douglas Gregor [Wed, 4 Feb 2009 15:01:18 +0000 (15:01 +0000)]
Fix our semantic analysis of
unqualified-id '('
in C++. The unqualified-id might not refer to any declaration in our
current scope, but declarations by that name might be found via
argument-dependent lookup. We now do so properly.
As part of this change, CXXDependentNameExpr, which was previously
designed to express the unqualified-id in the above constructor within
templates, has become UnresolvedFunctionNameExpr, which does
effectively the same thing but will work for both templates and
non-templates.
Additionally, we cope with all unqualified-ids, since ADL also applies
in cases like
Chris Lattner [Wed, 4 Feb 2009 01:06:56 +0000 (01:06 +0000)]
lower the interface to getLineNumber like we did for
getColumnNumber. This fixes a FIXME in
SourceManager::getPresumedLoc because we now just decompose
the sloc once.
Chris Lattner [Wed, 4 Feb 2009 00:55:58 +0000 (00:55 +0000)]
make SM::getColumnNumber take a predecomposed FileID/offset, which
makes it clear to clients that they have to pick an instantiation
or spelling location before calling it and allows optimization based
on that.
Daniel Dunbar [Wed, 4 Feb 2009 00:44:42 +0000 (00:44 +0000)]
Change construction of common ObjC functions to use CGCall
infrastructure to construct function type.
- For consistencty, we should probably always use this to construct
function types, but these are absolutely necessary to ensure that
we can emit calls to these functions.
Douglas Gregor [Wed, 4 Feb 2009 00:32:51 +0000 (00:32 +0000)]
Initial implementation of argument dependent lookup (a.k.a. ADL,
a.k.a. Koenig lookup) in C++. Most of the pieces are in place, but for
two:
- In an unqualified call g(x), even if the name does not refer to
anything in the current scope, we can still find functions named
"g" based on ADL. We don't yet have this ability.
- ADL will need updating for friend functions and templates.