Sebastian Redl [Fri, 13 Aug 2010 00:28:03 +0000 (00:28 +0000)]
Instead of modifying the ObjC AST to not modify existing declarations, teach chained PCH to overwrite declarations from earlier PCH files in dependent ones. Tell Sema to note when it changes AST nodes so that they have to be reserialized. Finally, the ObjCProtocolDecls created in forward decls, like the ObjCInterfaceDecls in @class forward decls, are not lexically part of the decl context; only the definition is.
John McCall [Thu, 12 Aug 2010 23:36:15 +0000 (23:36 +0000)]
Just disable the hidden-visibility optimization for now by hiding it behind
a -cc1 option. The Darwin linker complains about mixed visibility when linking
gcc-built objects with clang-built objects, and the optimization isn't really
that valuable. Platforms with less ornery linkers can feel free to enable this.
Tom Care [Thu, 12 Aug 2010 23:01:06 +0000 (23:01 +0000)]
Small changes to UnreachableCodeChecker
- Added detection of Empty CFGBlocks (artificial blocks)
- Relaxed an assertion based on an incorrect assumption until further investigation
Douglas Gregor [Thu, 12 Aug 2010 22:51:45 +0000 (22:51 +0000)]
Add a ParseAST overload that takes a Sema object, so that the caller
can create (and hold on to) the Sema object. Also, move Sema-related
initialization/finalization with its various consumers and external
sources into the Sema constructor and destructor, rather than placing
it in ParseAST.
Tom Care [Thu, 12 Aug 2010 22:45:47 +0000 (22:45 +0000)]
Improved IdempotentOperationChecker false positives and false negatives.
- Unfinished analysis may still report valid warnings if the path was completely analyzed
- New 'CanVary' heuristic to recursively determine if a subexpression has a varying element
- Updated test cases, including one known bug
- Exposed GRCoreEngine through GRExprEngine
John McCall [Thu, 12 Aug 2010 21:44:57 +0000 (21:44 +0000)]
Implement -Wcast-align. The initial design of this diagnostic diverges
from GCC's in that we warn on *any* increase in alignment requirements, not
just those that are enforced by hardware. Please let us know if this causes
major problems for you (which it shouldn't, since it's an optional warning).
Douglas Gregor [Thu, 12 Aug 2010 20:50:39 +0000 (20:50 +0000)]
Add a ParseAST overload that takes a Sema object, so that the caller
can create (and hold on to) the Sema object. Also, move Sema-related
initialization/finalization with its various consumers and external
sources into the Sema constructor and destructor, rather than placing
it in ParseAST.
Jordy Rose [Thu, 12 Aug 2010 08:54:03 +0000 (08:54 +0000)]
Remove OwnershipAttr::Kind, since it's essentially redundant with attr::Kind the way it's being used. Also fix isa<OwnershipAttr> support, break more-than-80-char lines, and other miscellaneous ownership attr cleanup.
Daniel Dunbar [Thu, 12 Aug 2010 00:05:12 +0000 (00:05 +0000)]
Driver: Use the compile time linker version as the default for -mlinker-version,
if detected.
- This is a hack, we really want the linker version at execution time, but we
don't have any infrastructure for getting that. Yet.
-Make TokenID of IdentifierInfo read-only, remove setTokenID().
-There are 2 instances that change the TokenID for GNU libstdc++ 4.2 compatibility.
To handler those cases introduce a RevertedTokenID bitfield, RevertTokenIDToIdentifier() and hasRevertedTokenIDToIdentifier() methods.
Store the bitfield in PCH.
Douglas Gregor [Wed, 11 Aug 2010 21:23:17 +0000 (21:23 +0000)]
Once code completion has completed, pass a "completion context" on to
the code-completion consumer. The consumer can use this information to
augument, filter, or display the code-completion results.
John McCall [Wed, 11 Aug 2010 20:59:53 +0000 (20:59 +0000)]
When re-raising an exception after a cleanup, we need to call _Unwind_Resume_or_Rethrow
instead of _Unwind_Resume. With SJLJ exceptions, this is spelled
"_Unwind_SjLj_Resume_or_Rethrow", not "_Unwind_SjLj_Resume", which has
significantly different semantics.
We should actually never be generating a call to _Unwind_SjLj_Resume directly;
even if we were generating true cleanups (which we aren't because of the
horrible hack), we should be calling __cxa_end_cleanup() on ARM. I
haven't implemented this because there's little point as long as the HH is
present.
Douglas Gregor [Wed, 11 Aug 2010 15:58:42 +0000 (15:58 +0000)]
Add a (currently unused) "options" parameter to
clang_reparseTranslationUnit(), along with a function to retrieve the
default recommended reparsing options for a translation unit.
Also, add the CXTranslationUnit_CacheCompletionResults flag, which is
also currently unused.
Douglas Gregor [Wed, 11 Aug 2010 14:45:53 +0000 (14:45 +0000)]
If name lookup finds different type declarations in different scopes
that actually refer to the same underlying type, it is not an
ambiguity; add uniquing support based on the canonical type of type
declarations. Fixes <rdar://problem/8296180>.
Douglas Gregor [Wed, 11 Aug 2010 12:19:30 +0000 (12:19 +0000)]
Speculatively revert r110610 " Make ObjCInterfaceDecl redeclarable,
and create separate decl nodes for forward declarations and the
definition," which appears to be causing significant Objective-C
breakage.
Daniel Dunbar [Wed, 11 Aug 2010 02:17:20 +0000 (02:17 +0000)]
ARM: Recognize single precision float register names.
- We don't recognize double or NEON register names yet -- we don't have the
infrastructure to generate the right clobbers for them.
Douglas Gregor [Wed, 11 Aug 2010 02:15:33 +0000 (02:15 +0000)]
Improve our handling of user-defined conversions when computing
implicit conversion sequences. In particular, model the "standard
conversion" from a class to its own type (or a base type) directly as
a standard conversion in the normal path *without* trying to determine
if there is a valid copy constructor. This appears to match the intent
of C++ [over.best.ics]p6 and more closely matches GCC and EDG.
As part of this, model non-lvalue reference initialization via
user-defined conversion in overloading the same way we handle it in
InitializationSequence, separating the "general user-defined
conversion" and "conversion to compatible class type" cases.
The churn in the overload-call-copycon.cpp test case is because the
test case was originally wrong; it assumed that we should do more
checking for copy constructors that we actually should, which affected
overload resolution.
John McCall [Wed, 11 Aug 2010 00:16:14 +0000 (00:16 +0000)]
Fix a bug in @finally emission in both the fragile and non-fragile EH schemes
where we weren't accounting for the possibility that a @finally block might
have internal cleanups and therefore might write to the cleanup destination slot.
Ted Kremenek [Wed, 11 Aug 2010 00:03:02 +0000 (00:03 +0000)]
Have GRCoreEngine record the blocks where analysis was aborted because we visited a block too many times along a given path. This is to support the unreachable code analysis.
Daniel Dunbar [Tue, 10 Aug 2010 17:39:05 +0000 (17:39 +0000)]
Driver/FreeBSD: Infer the right arch name in the presence of -m32,-m64, for the
cases we care about.
- This is eventually going to be unified outside the host specific code.
Douglas Gregor [Tue, 10 Aug 2010 15:02:34 +0000 (15:02 +0000)]
Teach the libclang cursor visitor to walk into the type information
provided by __builtin_types_compatible_p and __builtin_va_arg
expressions, now that Abramo has added proper type-source information
to those expressions.