David Blaikie [Wed, 19 Oct 2011 05:19:50 +0000 (05:19 +0000)]
Fix pr9789, assert-on-invalid while instantiating an (invalid) class template with a non-final parameter pack. Also improve the warning for non-final parameter packs in this scenario so it only fires once, rather than once for every template parameter after the non-final parameter pack.
Anna Zaks [Tue, 18 Oct 2011 23:06:44 +0000 (23:06 +0000)]
[analyzer] Make NodeBuilder and Pred node loosely coupled
NodeBuilder should not assume it's dealing with a single predecessor. Remove predecessor getters. Modify the BranchNodeBuilder to not be responsible for doing auto-transitions (which depend on a predecessor).
Anna Zaks [Tue, 18 Oct 2011 23:06:21 +0000 (23:06 +0000)]
[analyzer] Modularize builder use in processBranch.
Take advantage of the new builders for branch processing. As part of this change pass generic NodeBuilder (instead of BranchNodeBuilder) to the BranchCondition callback and remove the unused methods form BranchBuilder.
Anna Zaks [Tue, 18 Oct 2011 23:05:58 +0000 (23:05 +0000)]
[analyzer] Node Builder refactoring: Introduce a simple Node Builder responsible for generating the node frontier.
Currently we have a bunch of different node builders which provide some common
functionality but are difficult to refactor. Each builder generates nodes of
different kinds and calculates the frontier nodes, which should be propagated
to the next step (after the builder dies).
Introduce a new NodeBuilder which provides very basic node generation facilities
but takes care of the second problem. The idea is that all the other builders
will eventually use it. Use this builder in CheckerContext instead of
StmtNodeBuilder (the way the frontier is propagated to the StmtBuilder
is a hack and will be removed later on).
objc: more changes in use of IBOutletCollection attribute.
'Class' is disallowed as argument. If the argument is missing,
NSObject is assumed. // rdar://10296078
[libclang] Since an objc extension semantically continues the interface of the class
don't use unique USRs for them, otherwise we fail to associate @implementation methods
with the methods in extensions.
Hans Wennborg [Tue, 18 Oct 2011 08:58:16 +0000 (08:58 +0000)]
Disable the ssize_t test in format-strings-fixit.c.
Turns out this part of the test from r142342 wasn't portable.
The errors on the bots look like this:
E:\bb-win7\cmake-clang-i686-msys\build\tools\clang\test\Sema\Output\format-strings-fixit.c.tmp:58:13: error: conversion specifies type 'unsigned int' but the argument has type 'ssize_t' (aka 'long')
printf("%zd", (ssize_t) 42);
~~^ ~~~~~~~~~~~~
%zd
Obviously we can't typedef ssize_t to someting that doesn't have the same size as size_t and expect it to work.
But it's also weird that the format string "%zd" gets interpreted as "unsigned int" when it should clearly be signed.
Hans Wennborg [Tue, 18 Oct 2011 08:10:06 +0000 (08:10 +0000)]
Suggest %zu for size_t args to printf.
For PR11152. Make PrintSpecifier::fixType() suggest "%zu" for size_t, etc.
rather than looking at the underlying type and suggesting "%llu" or other
platform-specific length modifiers. Applies to C99 and C++11.
Douglas Gregor [Tue, 18 Oct 2011 04:23:19 +0000 (04:23 +0000)]
Don't format the code completion for parameters of block literal
arguments as block literal arguments; the block literal argument code
completion should only go one level deep. Fixes <rdar://problem/10291294>.
Douglas Gregor [Tue, 18 Oct 2011 02:43:19 +0000 (02:43 +0000)]
When transforming the arguments for a C++ "new" expression, make sure
to drop the implicitly-generated value initialization expression used
for initializing scalars. Fixes <rdar://problem/10283928>.
Richard Smith [Tue, 18 Oct 2011 02:28:33 +0000 (02:28 +0000)]
Refactor the checking for explicit template instantiations being performed in
the right namespace in C++11 mode. Teach the code to prefer the 'must be in
precisely this namespace' diagnostic whenever that's true, and fix a defect
which resulted in the -Wc++11-compat warning in C++98 mode sometimes being
omitted.
Richard Smith [Mon, 17 Oct 2011 23:06:20 +0000 (23:06 +0000)]
Add -Wc++98-compat warnings for uses of the new keywords 'alignof', 'char16_t',
'char32_t', 'constexpr', 'decltype', 'noexcept', 'nullptr' and 'static_assert'.
Nick Lewycky [Mon, 17 Oct 2011 23:05:52 +0000 (23:05 +0000)]
Wire up support for the controlling the extended dwarf .file directive. With
r142300 but not this patch, clang -S may emit .s files that assemblers other
than llvm-mc can't parse.
Eli Friedman [Mon, 17 Oct 2011 21:44:23 +0000 (21:44 +0000)]
Initial implementation of __atomic_is_lock_free. The input is the size of an atomic type rather than an atomic type itself just to save some implementation pain; I can change that if it seems worthwhile.
I think this is the last hook needed for <atomic> besides defines for ATOMIC_CHAR_LOCK_FREE and friends.
Richard Smith [Mon, 17 Oct 2011 21:20:17 +0000 (21:20 +0000)]
Refactor __attribute__ parsing, and add a diagnostic if the r_paren at the end
of an attrib is missing. gcc does not allow the closing parenthesis to be omitted.
Tanya Lattner [Mon, 17 Oct 2011 21:00:38 +0000 (21:00 +0000)]
The comparison of two vectors should return a signed result. hasIntegerRepresentation() used to always return false for vectors, but since it was changed, it also
changed the return type of a compare of two unsigned vectors to be unsigned. This patch removes the check for hasIntegerRepresentation since its not needed and returns the appropriate signed type.
I added a new test case and updated exisiting test cases that assumed an unsigned result.
[libclang] Introduce a new high level API for indexing clients that assumes
more of the work involved in indexing a translation unit and simplifies client
implementations.
Introduce ASTConsumer::HandleTopLevelDeclInObjCContainer which accepts
top-level declarations that occurred inside an ObjC container.
This is useful to keep track of such decls otherwise when e.g. a function
is declared inside an objc interface, it is not passed to HandleTopLevelDecl
and it is not inside the DeclContext of the interface that is returned.
Douglas Gregor [Mon, 17 Oct 2011 17:09:53 +0000 (17:09 +0000)]
When we end up having to parse the initializer of a C++ member early
in -fms-extensions mode, make sure we actually use that initializer
after having handled the declaration. Fixes PR11150.
Sebastian Redl [Mon, 17 Oct 2011 16:53:50 +0000 (16:53 +0000)]
Revert r142142: "Make a C-style cast a const-cast, to suppress a GCC warning."
Richard already fixed the underlying issue, so the cast was superfluous.
Douglas Gregor [Mon, 17 Oct 2011 15:32:29 +0000 (15:32 +0000)]
For modules, all macros that aren't include guards are implicitly
public. Add a __private_macro__ directive to hide a macro, similar to
the __module_private__ declaration specifier.
Douglas Gregor [Mon, 17 Oct 2011 14:55:37 +0000 (14:55 +0000)]
When building a module, use the macro definitions on the command line
as part of the hash rather than ignoring them. This means we'll end up
building more module variants (overall), but it allows configuration
macros such as NDEBUG to work so long as they're specified via command
line. More to come in this space.
Richard Smith [Sun, 16 Oct 2011 21:26:27 +0000 (21:26 +0000)]
Split apart the state accumulated during constant expression evaluation and the
end result. Use this split to propagate state information and diagnostics
through more of constant expression evaluation.