• Home
  • History
  • Annotate
  • only in /external/clang/test/Sema/
History log of /external/clang/test/Sema/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ef8225444452a1486bd721f3285301fe84643b00 21-Jul-2014 Stephen Hines <srhines@google.com> Update Clang for rebase to r212749.

This also fixes a small issue with arm_neon.h not being generated always.

Includes a cherry-pick of:
r213450 - fixes mac-specific header issue
r213126 - removes a default -Bsymbolic on Android

Change-Id: I2a790a0f5d3b2aab11de596fc3a74e7cbc99081d
_try.c
lign-x86.c
rm-neon-types.c
rm64-neon-args.c
rm_acle.c
sm.c
ttr-alias-cycle.c
ttr-alias-elf.c
ig-endian-neon-initializers.c
uiltins-arm-exclusive.c
uiltins-arm.c
uiltins-arm64-exclusive.c
uiltins.c
89.c
onstant-builtins-2.c
ecl-in-prototype.c
llimport.c
ormat-strings-enum-fixed-type.cpp
ormat-strings-enum.c
s-inline-asm.c
rivate-extern.c
entative-decls.c
hread-specifier.c
ar-redecl.c
arn-main-return-type.c
6bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89 29-May-2014 Stephen Hines <srhines@google.com> Update Clang for 3.5 rebase (r209713).

Change-Id: I8c9133b0f8f776dc915f270b60f94962e771bc83
arch64-neon-ranges.c
arch64-neon-vector-types.c
rm64-inline-asm.c
rm64-neon-args.c
rray-init.c
sm.c
tomic-ops.c
ttr-alias-cycle.c
ttr-alias-elf.c
ttr-aligned.c
ttr-capabilities.c
ool-compare.c
uiltin-clear_cache.c
uiltins-aarch64.c
uiltins-gnu-mode.c
onversion.c
ecl-invalid.c
llexport.c
llimport.c
xt_vector_casts.c
ormat-strings-scanf.c
ormat-strings.c
nline-asm-validate.c
nvalid-decl.c
s_bitfield_layout.c
ragma-section.c
eturn-noreturn.c
tatements.c
truct-decl.c
hread-specifier.c
ls.c
ransparent-union.c
ypedef-retain.c
ypes.c
ector-assign.c
ector-cast.c
ector-init.c
ector-ops.c
arn-bitwise-compare.c
arn-documentation.cpp
arn-overlap.c
arn-unreachable.c
651f13cea278ec967336033dd032faef0e9fc2ec 24-Apr-2014 Stephen Hines <srhines@google.com> Updated to Clang 3.5a.

Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
007-10-01-BuildArrayRef.c
009-03-09-WeakDeclarations-1.c
009-04-22-UnknownSize.c
009-07-17-VoidParameter.c
nputs/ms-keyword-system-header.h
nputs/warn-unreachable.h
icrosoftCompatibility.c
icrosoftExtensions.c
arch64-neon-ranges.c
arch64-neon-vector-types.c
lloc_size.c
rm-interrupt-attr.c
rm64-inline-asm.c
rm64-neon-args.c
sm.c
tomic-ops.c
ttr-alias-elf.c
ttr-aligned.c
ttr-availability-ios.c
ttr-availability-macosx.c
ttr-availability.c
ttr-capabilities.c
ttr-cleanup.c
ttr-coldhot.c
ttr-deprecated-message.c
ttr-deprecated.c
ttr-malloc.c
ttr-msp430.c
ttr-noduplicate.c
ttr-ownership.c
ttr-section.c
ttr-unavailable-message.c
ttr-used.c
itfield-layout.c
lock-misc.c
uiltins-arm64-exclusive.c
uiltins-arm64.c
allingconv.c
arbon.c
onst-eval.c
onstructor-attribute.c
rash-invalid-array.c
ecl-in-prototype.c
llexport.c
llimport-dllexport.c
llimport.c
mpty1.c
nable_if.c
xt_vector_casts.c
n-ptr-as-fn-prototype.c
ormat-strings-fixit.c
ormat-strings-scanf.c
ormat-strings.c
-c-e.c
mplicit-builtin-decl.c
mplicit-cast-dump.c
nline-asm-validate.c
it.local.cfg
oop-control.c
s-inline-asm.c
s-wchar.c
s_bitfield_layout.c
s_class_layout.cpp
eon-vector-types.c
onnull.c
verloadable.c
ragma-ms_struct.c
ragma-pack-apple.c
eturn.c
entinel-attribute.c
hift.c
tatements.c
tatic-init.c
witch.c
hread-specifier.c
ransparent-union.c
ypeof-use-deprecated.c
ypes.c
nused-expr.c
ariadic-promotion.c
ector-cast.c
la.c
arn-absolute-value-header.c
arn-absolute-value.c
arn-documentation.cpp
arn-missing-variable-declarations.c
arn-null.c
arn-outof-range-assign-enum.c
arn-thread-safety-analysis.c
arn-type-safety.c
arn-unreachable.c
char.c
03e463e293f5ecf62cb8c807d00edb9fbb1f99d7 16-Dec-2013 Bill Wendling <isanbard@gmail.com> Merging r196212:
------------------------------------------------------------------------
r196212 | alp | 2013-12-02 22:13:01 -0800 (Mon, 02 Dec 2013) | 22 lines

Emit an extension warning when changing system header tokens

clang converts keywords to identifiers for compatibility with various system
headers such as GNU libc.

Implement a -Wkeyword-compat extension warning to diagnose those cases. The
warning is on by default but will generally be ignored in system headers. It
can however be enabled globally to aid standards conformance testing.

This also changes the __uptr keyword avoidance from r195710 to no longer
special-case system headers, bringing it in line with other similar workarounds
in clang.

Implementation returns bool for symmetry with token annotation functions.

Some examples:

warning: keyword '__is_pod' will be treated as an identifier for the remainder of the translation unit [-Wkeyword-compat]
struct __is_pod

warning: keyword '__uptr' will be treated as an identifier here [-Wkeyword-compat]
union w *__uptr;
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@197359 91177308-0d34-0410-b5e6-96231b3b80d8
nputs/ms-keyword-system-header.h
s-keyword-system-header.c
dd6669dbb872a69a42a0d8fd77cd48a971cabcc9 09-Dec-2013 Bill Wendling <isanbard@gmail.com> Merging r196724:
------------------------------------------------------------------------
r196724 | tnorthover | 2013-12-08 07:24:55 -0800 (Sun, 08 Dec 2013) | 5 lines

ARM: teach Sema that "r" can match 64-bit values

We already support using "r" on 64-bit values (a GPRPair is
allocated), but Sema doesn't know this yet so issues a warning. This
should fix it.
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@196746 91177308-0d34-0410-b5e6-96231b3b80d8
rm-asm.c
307c92ecb82e59a8fa82912906e1b168a157cb82 05-Dec-2013 Bill Wendling <isanbard@gmail.com> Merging r196387:
------------------------------------------------------------------------
r196387 | aaronballman | 2013-12-04 07:32:26 -0800 (Wed, 04 Dec 2013) | 1 line

When parsing ignored attribute arguments, presuming the first argument is an unresolved identifier the same way that we do for unknown arguments. This resolves PR18075, where we regressed the handling of OpenBSD's bounded attribute.
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@196522 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-bounded.c
edb95d3f9eb354b30baddd58fee5d2e7b3da2c92 02-Dec-2013 Bill Wendling <isanbard@gmail.com> Merging r196048:
------------------------------------------------------------------------
r196048 | d0k | 2013-12-01 07:09:32 -0800 (Sun, 01 Dec 2013) | 3 lines

CommentLexer: When proceeding with a typo corrected name don't clobber the token.

This would crash if the token is used in another diagnostic. PR18051.
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@196075 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation-fixits.cpp
db60e42e35d980119c12b1a2e8b627817c8449f4 02-Dec-2013 Bill Wendling <isanbard@gmail.com> Merging r196045:
------------------------------------------------------------------------
r196045 | d0k | 2013-12-01 03:48:10 -0800 (Sun, 01 Dec 2013) | 3 lines

Reenable ms inline asm test.

LLVM r196044 should make it pass.
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@196072 91177308-0d34-0410-b5e6-96231b3b80d8
s-inline-asm.c
45c2eed19c012d8b5e686aedb28cdbb36347fee5 27-Nov-2013 Bill Wendling <isanbard@gmail.com> Merging r195303:
------------------------------------------------------------------------
r195303 | rsmith | 2013-11-20 17:53:02 -0800 (Wed, 20 Nov 2013) | 4 lines

PR10837: Warn if a null pointer constant is formed by a zero integer constant
expression that is not a zero literal, in C. This is a different, and more
targeted, approach than that in r194540.

------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@195815 91177308-0d34-0410-b5e6-96231b3b80d8
arn-null.c
7f3ec66c405045ae67abf54f728845f36e91baa9 26-Nov-2013 Bill Wendling <isanbard@gmail.com> Merging r195710:
------------------------------------------------------------------------
r195710 | alp | 2013-11-25 17:30:10 -0800 (Mon, 25 Nov 2013) | 10 lines

Unbreak -fms-extensions with GNU libc headers

GNU libc uses '__uptr' as a member name in C mode, conflicting with the
eponymous MSVC pointer modifier keyword.

Detect and mark the token as an identifier when these specific conditions are
met. __uptr will continue to work as a keyword for the remainder of the
translation unit.

Fixes PR17824.
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@195721 91177308-0d34-0410-b5e6-96231b3b80d8
nputs/ms-keyword-system-header.h
s-keyword-system-header.c
f41e20ae7a36806d148f0e50fa8e9339b5d759a4 19-Nov-2013 Bill Wendling <isanbard@gmail.com> Merging r195126:
------------------------------------------------------------------------
r195126 | joerg | 2013-11-19 05:38:38 -0800 (Tue, 19 Nov 2013) | 2 lines

Revert r194540, it breaks various C++ programs.

------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@195139 91177308-0d34-0410-b5e6-96231b3b80d8
arn-null.c
93982a7557fae3c72d84a3fc4c8d2b9852ccc5db 15-Nov-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR8455: Handle an attribute between a goto label and a variable declaration per
the GNU documentation: the attribute only appertains to the label if it is
followed by a semicolon. Based on a patch by Aaron Ballman!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194869 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unused-label.c
f2941ec5bfcce36feffac514582d168b4e0ef811 13-Nov-2013 Reid Kleckner <reid@kleckner.net> Only provide MS builtins when -fms-extensions is on

We already have builtins that are only available in GNU mode, so this
mirrors that.

Reviewers: rsmith

Differential Revision: http://llvm-reviews.chandlerc.com/D2128

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194615 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.c
d1fa81ccbce1ba2d8f467e7c2800250b81ea2e35 13-Nov-2013 Serge Pavlov <sepavloff@gmail.com> Warn on duplicate function specifier

This patch fixes PR8264. Duplicate qualifiers already are diagnozed,
now the same diagnostics is issued for duplicate function specifiers.

Differential Revision: http://llvm-reviews.chandlerc.com/D2025


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194559 91177308-0d34-0410-b5e6-96231b3b80d8
eclspec.c
f2febe6b5e9213fb4d97e1d4f9b47166be89afad 13-Nov-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR10837: Warn if a null pointer constant is formed by a zero integer constant
expression that is not a zero literal, in C. Patch by Ivan A. Kosarev!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194540 91177308-0d34-0410-b5e6-96231b3b80d8
arn-null.c
54de9bb0e67a3c06f6daad27af74e87f84944fa3 07-Nov-2013 Enea Zaffanella <zaffanella@cs.unipr.it> Fixed bug in return type of __builtin_va_start().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194197 91177308-0d34-0410-b5e6-96231b3b80d8
arargs.c
633c0c2fbc1d9272b3f25220ffb8fe4b04ece3db 02-Nov-2013 David Majnemer <david.majnemer@gmail.com> Sema: Cleanup and simplify anonymous union diagnostics

The determination of which diagnostics would be issued for certain
anonymous unions started to get a little ridiculous. Clean this up by
inverting the condition-tree's logic from dialect -> issue to
issue -> diagnostic.

As part of this cleanup, move ext_c99_flexible_array_member from
DiagnosticParseKinds.td to DiagnosticSemaKinds.td because it's driven by
Sema, not Parse.

Also, the liberty was taken to edit ext_c99_flexible_array_member to
match other, similar, diagnostics.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193919 91177308-0d34-0410-b5e6-96231b3b80d8
89.c
6f6dc158ee2fbe5b9b8685dad45be02cba0873f5 02-Nov-2013 David Majnemer <david.majnemer@gmail.com> Sema: Flexible array members were introduced in C99, diagnose their use in C++

The declaration of a flexible array member was correctly diagnosed as an
extension in C89 mode but not in C++.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193918 91177308-0d34-0410-b5e6-96231b3b80d8
89.c
cd9d305fa4f613b89d101246bf58f6cb13247d12 31-Oct-2013 Kaelyn Uhrain <rikka@google.com> Fix a C struct diagnostic regression introduced by r187504 (PR17762).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193799 91177308-0d34-0410-b5e6-96231b3b80d8
ember-reference.c
a6306fc4b03672f7ecc0ae43d2620a0fc36764e9 29-Oct-2013 Tim Northover <tnorthover@apple.com> ARM: fix AST for __builtin_arm_strex call

The AST was constructed so that this builtin returned the default BoolTy and
since I'd opted for custom SemaChecking, I should have set it properly at that
point.

This caused an assertion failure when the types didn't match up with what we
generated. This makes it return an IntTy, which is as good as anything.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193606 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins-arm-strex-rettype.c
0e42127584009cbedf924f86cd494745fdeb3c90 26-Oct-2013 Alp Toker <alp@nuanti.com> Remove REQUIRES aarch64-registered-target from test

Registered targets don't matter for Sema tests, this passes fine.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193485 91177308-0d34-0410-b5e6-96231b3b80d8
arch64-neon-vector-types.c
02debf605cd904edac8dceb196e5f142ce3d14eb 25-Oct-2013 Jordan Rose <jordan_rose@apple.com> Add -Wstring-plus-char, which warns when adding char literals to C strings.

Specifically, this warns when a character literal is added (using '+') to a
variable with type 'char *' (or any other pointer to character type). Like
-Wstring-plus-int, there is a fix-it to change "foo + 'a'" to "&foo['a']"
iff the character literal is on the right side of the string.

Patch by Anders Rönnholm!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193418 91177308-0d34-0410-b5e6-96231b3b80d8
tring-plus-char.c
d92aa2d2880d1c30baff996cb4c4f0836dbc355e 24-Oct-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR17666: Instead of allowing an initial identifier argument in any attribute
which we don't think can't have one, only allow it in the tiny number of
attributes which opts into this weird parse rule.

I've manually checked that the handlers for all these attributes can in fact
cope with an identifier as the argument. This is still somewhat terrible; we
should move more fully towards picking the parsing rules based on the
attribute, and make the Parse -> Sema interface more type-safe.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193295 91177308-0d34-0410-b5e6-96231b3b80d8
ips16_attr_allowed.c
7967c95891c5f65f6312fbbcb999ac257d776914 24-Oct-2013 Warren Hunt <whunt@google.com> Implements 64 bit microsoft record layout and adds lit tests to cover
it. Also removes all of the microsoft C++ ABI related code from the
itanium layout builder.

Differential Revision: http://llvm-reviews.chandlerc.com/D2003



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193290 91177308-0d34-0410-b5e6-96231b3b80d8
s_bitfield_layout.c
65f958dca64ef64d43bf85e871ec64e638ff2602 22-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> Consider hidden decls for isUsed checks.

This fixes pr17624.

A FIXME from Richard Smith:

It seems to me that the root cause is that a per-Decl 'used' flag doesn't
really make much sense in the way we use it now. I think we should either track
whether that particular declaration is used (with isUsed scanning the entire
redecl chain), or we should only have one flag for the entire redeclaration
chain (perhaps by always looking at the flag on either the most recent decl or
the canonical decl). Modeling it as "is this declaration or any previous
declaration used" is weird, and requires contortions like the loop at the end
of Sema::MarkFunctionReferenced.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193202 91177308-0d34-0410-b5e6-96231b3b80d8
arn-variable-not-needed.c
b1c0e204046b72828e513bad369ab03252b2c42e 22-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> Treat aliases as definitions.

This fixes pr17639.

Before this patch clang would consider

void foo(void) __attribute((alias("__foo")));

a declaration. It now correctly handles it as a definition.

Initial patch by Alp Toker. I added support for variables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193200 91177308-0d34-0410-b5e6-96231b3b80d8
lias-redefinition.c
ragma-weak.c
d205498c83c1bba1004ae41299ad7138881b9480 22-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> New fix for pr17535.

This is a fixed version of r193161. In order to handle

void foo() __attribute__((alias("bar")));
void bar() {}
void zed() __attribute__((alias("foo")));

it is not enough to delay aliases to the end of the TU, we have to do two
passes over them to find if they are defined or not.

This can be implemented by producing alias as we go and just doing the second
pass at the end. This has the advantage that other parts of clang that were
expecting alias to be processed in order don't have to be changed.

This patch also handles cyclic aliases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193188 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-alias-elf.c
d661d50118716e9695af5a893a2df45e87a6b3c8 22-Oct-2013 Chandler Carruth <chandlerc@gmail.com> Revert r193073 and the attempt to fix it in r193170.

This patch wasn't reviewed, and isn't correctly preserving the behaviors
relied upon by QT. I don't have a direct example of fallout, but it
should go through the standard code review process. For example, it
should never have removed the QT test case that was added when fixing
those users.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193174 91177308-0d34-0410-b5e6-96231b3b80d8
tatements.c
87017a781f9e2d70a0478abaae26ba486f6e717e 22-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> Revert "This patch causes clang to reject alias attributes that point to undefined names. For example, with this patch we now reject"

This reverts commit r193161.

It broke

void foo() __attribute__((alias("bar")));
void bar() {}
void zed() __attribute__((alias("foo")));

Looks like we have to fix pr17639 first :-(

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193162 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-alias-elf.c
e37bf44c8012f36f900955d8513e03791803045e 22-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> This patch causes clang to reject alias attributes that point to undefined
names. For example, with this patch we now reject

void f1(void) __attribute__((alias("g1")));

This patch is implemented in CodeGen. It is quiet a bit simpler and more
compatible with gcc than implementing it in Sema. The downside is that the
errors only fire during -emit-llvm.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193161 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-alias-elf.c
fb90266d8bb5a977de45d07e702277f4cb54d74e 21-Oct-2013 Serge Pavlov <sepavloff@gmail.com> Fix to PR8880 (clang dies processing a for loop).

Due to statement expressions supported as GCC extension, it is possible
to put 'break' or 'continue' into a loop/switch statement but outside its
body, for example:

for ( ; ({ if (first) { first = 0; continue; } 0; }); )

Such usage must be diagnosed as an error, GCC rejects it. To recognize
this and similar patterns the flags BreakScope and ContinueScope are
temporarily turned off while parsing condition expression.

Differential Revision: http://llvm-reviews.chandlerc.com/D1762


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193073 91177308-0d34-0410-b5e6-96231b3b80d8
tatements.c
a3bfa54f2ad8600fc1bb3d39b37e3cd5469ccbb6 20-Oct-2013 Alp Toker <alp@nuanti.com> Switch attribute test line endings from CRLF

The convention is LF unless specifically testing line endings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193056 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-ownership.c
251b18d74231763a1d3f52236aeee9cc5c98f397 17-Oct-2013 Bill Wendling <isanbard@gmail.com> This is now passing. Uncomment and close out PR6281.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192869 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unused-function.c
f186c9203278c0804b051e2b10ee2631a4d17274 15-Oct-2013 Richard Smith <richard-llvm@metafoo.co.uk> Add constant evaluation support for __builtin_isinf, __builtin_isfinite,
__builtin_isnan, and __builtin_isnormal. Patch by Karthik Bhat! Tests by me.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192729 91177308-0d34-0410-b5e6-96231b3b80d8
onstant-builtins-2.c
dc58180432868cfa9c060d5c41114634e4b841c7 14-Oct-2013 Warren Hunt <whunt@google.com> Lit tests for Microsoft C++ record layout.
They weren't added with the rest of the microsoft record layout patch due me not
doing svn add.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192612 91177308-0d34-0410-b5e6-96231b3b80d8
s_bitfield_layout.c
b2969b1e50580344891a98f5b241f8351fe371cf 11-Oct-2013 Warren Hunt <whunt@google.com> Adds Microsoft compatiable C++ record layout code to clang.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192494 91177308-0d34-0410-b5e6-96231b3b80d8
s_class_layout.cpp
77b9f65d652d29608f44cc347d40f0c4dbc0ba4d 10-Oct-2013 Ted Kremenek <kremenek@apple.com> Make test portable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192338 91177308-0d34-0410-b5e6-96231b3b80d8
xt_vector_casts.c
af3b980ef367e031051afd67ca3475bb7aa32db8 10-Oct-2013 Ted Kremenek <kremenek@apple.com> Fix getIntegerTypeOrder() to properly handle enums by first unwrapping their underlying integer type. This is a precondition for calling getIntegerRank().

Fixes an assertion failure in a test case involving vectors.

Fixes <rdar://problem/15091442>

Please somebody check this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192334 91177308-0d34-0410-b5e6-96231b3b80d8
xt_vector_casts.c
45d3950e373412f395413c81a0310e8090508608 09-Oct-2013 Hans Wennborg <hans@hanshq.net> Tighten diagnostics for calling conventions on variadic functions

Follow-up from r192240.

This makes it an error to use callee-cleanup conventions on variadic
functions, except for __fastcall and __stdcall, which we ignore with
a warning for GCC and MSVC compatibility.

Differential Revision: http://llvm-reviews.chandlerc.com/D1870

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192308 91177308-0d34-0410-b5e6-96231b3b80d8
allingconv.c
rtd.c
3636fb126ffa22704c5eacb52fc5673247d8ad57 08-Oct-2013 Hans Wennborg <hans@hanshq.net> Turn error about fastcall variadic function into warning in MS mode (PR12535)

MSVC allows this and silently falls back to __cdecl for variadic functions.
This patch turns Clang's error into a warning in MS mode and adds a test
to make sure we generate correct code.

Differential Revision: http://llvm-reviews.chandlerc.com/D1861

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192240 91177308-0d34-0410-b5e6-96231b3b80d8
allingconv.c
aeb87e7ef327905ba1abba879076e9577a2090c4 08-Oct-2013 Ted Kremenek <kremenek@apple.com> Split test to test -Wshadow with emmintrin.h more portable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192144 91177308-0d34-0410-b5e6-96231b3b80d8
arn-shadow-intrinsics.c
arn-shadow.c
185f156e41b38c2452dba7bb0ee44067f8d92538 08-Oct-2013 Ted Kremenek <kremenek@apple.com> Suppress useless -Wshadow warning when using _mm* macros from emmintrin.h

Fixes <rdar://problem/10679282>.

I'm not completely satisfied with this patch. Sprinkling "diagnostic ignored"
_Pragmas throughout this file is gross, but I couldn't suppress
it for the entire file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192143 91177308-0d34-0410-b5e6-96231b3b80d8
arn-shadow.c
4e49952712ff9b1b1696cb07580b2b24a3ca99e1 03-Oct-2013 Matthew Curtis <mcurtis@codeaurora.org> Gracefully (and correctly) handle init of multiple union members

We now emit warnings when doing so and code generation is consistent
with GCC. Note that the C99 spec is unclear as to the precise
behavior.

See also ...
Bug:
http://llvm.org/bugs/show_bug.cgi?id=16644 and

cfe-dev discussion:
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-September/031918.html



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191890 91177308-0d34-0410-b5e6-96231b3b80d8
esignated-initializers.c
64eac850a04e33f5b37a4b17ed7e3a18f6edad82 01-Oct-2013 Tim Northover <tnorthover@apple.com> Implement ARM GNU-style interrupt attribute

This attribute allows users to use a modified C or C++ function as an ARM
exception-handling function and, with care, to successfully return control to
user-space after the issue has been dealt with.

rdar://problem/14207019

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191769 91177308-0d34-0410-b5e6-96231b3b80d8
rm-interrupt-attr.c
85c80f23177deb63bf75fff52adf32d870a149da 25-Sep-2013 Rafael Espindola <rafael.espindola@gmail.com> Don't pass -print-stats to the driver, it is a -cc1 option only.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191376 91177308-0d34-0410-b5e6-96231b3b80d8
arbon.c
a41c97a5d1912ffd184381d269fd8e5a25ee5e59 20-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> Switch the semantic DeclContext for a block-scope declaration of a function or
variable from being the function to being the enclosing namespace scope (in
C++) or the TU (in C). This allows us to fix a selection of related issues
where we would build incorrect redeclaration chains for such declarations, and
fail to notice type mismatches.

Such declarations are put into a new IdentifierNamespace, IDNS_LocalExtern,
which is only found when searching scopes, and not found when searching
DeclContexts. Such a declaration is only made visible in its DeclContext if
there are no non-LocalExtern declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191064 91177308-0d34-0410-b5e6-96231b3b80d8
truct-decl.c
5f33c37f8fe476602d9a1cc968060f6113ec8aaa 19-Sep-2013 Eli Friedman <eli.friedman@gmail.com> Add specific warning flags for GNU ext in Sema.

This patch adds the following, more specific warning flags:

gnu-anonymous-struct
gnu-compound-literal-initializer
gnu-empty-struct
gnu-flexible-array-initializer
gnu-flexible-array-union-member
gnu-folding-constant
redeclared-class-member
gnu-redeclared-enum
gnu-union-cast
gnu-variable-sized-type-not-at-end

Patch by Peter Lewis.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190972 91177308-0d34-0410-b5e6-96231b3b80d8
nu-flags.c
d56929515691f707754721f18911f0282cfeb43c 18-Sep-2013 Stepan Dyatkovskiy <stpworld@narod.ru> Recommited:
Fix for PR16752. Second commit.

PR16752: 'mode' attribute for unusual targets doesn't work properly
Description:
Troubles could be happened due to some assumptions in handleModeAttr function (see SemaDeclAttr.cpp).
For example, it assumes that 32 bit integer is 'int', while it could be 16 bit only.
Instead of asking target: 'which type do you want to use for int32_t ?' it just hardcodes general opinion. That doesn't looks pretty correct.
Please consider the next solution:
1. In Basic/TargetInfo add getIntTypeByWidth and getRealTypeByWidth methods. Methods asks target for proper type for given bit width.
2. Fix handleModeAttr according to new methods in TargetInfo.

Fixes:
1st Commit (Done): Add new methods for TargetInfo:
getRealTypeByWidth and getIntTypeByWidth
for ASTContext names are almost same(invokes new methods from TargetInfo):
getIntTypeForBitwidth and getRealTypeForBitwidth

2nd Commit (Current): Fix SemaDeclAttr, handleModeAttr function.

Also test/Sema/attr-mode.c was fixed. 'XC' mode test was disabled for PPC64 machines.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190926 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-mode.c
414a1bdbdaf250e0488589f12865c8961831b65d 18-Sep-2013 Hal Finkel <hfinkel@anl.gov> Add the intrinsic __builtin_convertvector

LLVM supports applying conversion instructions to vectors of the same number of
elements (fptrunc, fptosi, etc.) but there had been no way for a Clang user to
cause such instructions to be generated when using builtin vector types.

C-style casting on vectors is already defined in terms of bitcasts, and so
cannot be used for these conversions as well (without leading to a very
confusing set of semantics). As a result, this adds a __builtin_convertvector
intrinsic (patterned after the OpenCL __builtin_astype intrinsic). This is
intended to aid the creation of vector intrinsic headers that create generic IR
instead of target-dependent intrinsics (in other words, this is a generic
_mm_cvtepi32_ps). As noted in the documentation, the action of
__builtin_convertvector is defined in terms of the action of a C-style cast on
each vector element.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190915 91177308-0d34-0410-b5e6-96231b3b80d8
onvertvector.c
31bc1d2da58677b95346d1c34ba289e6a178bec3 17-Sep-2013 David Majnemer <david.majnemer@gmail.com> ffreestanding shouldn't effect main() on win32


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190824 91177308-0d34-0410-b5e6-96231b3b80d8
reemain.c
e1668a3a07a048eb5520410119b8b06787bfcc10 16-Sep-2013 Aaron Ballman <aaron@aaronballman.com> Updated the way the ownership attributes are semantically diagnosed. Added test cases for the semantics checks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190802 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-ownership.c
2440fb1f91557912f8c43cb72201170254ae09f4 16-Sep-2013 Amara Emerson <amara.emerson@arm.com> Add error checking to reject neon_vector_type attribute on targets without NEON.

Patch by Artyom Skrobov.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190801 91177308-0d34-0410-b5e6-96231b3b80d8
arch64-neon-vector-types.c
eon-vector-types-support.c
eon-vector-types.c
fbf6f5c8ac0a3feb9a5add5f9221a21f68ca487a 13-Sep-2013 Aaron Ballman <aaron@aaronballman.com> Updated the PCS calling convention to use the new checkStringLiteralArgument helper function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190710 91177308-0d34-0410-b5e6-96231b3b80d8
allingconv.c
c561714647f16b028f2c098ae810bd553138d17b 13-Sep-2013 Benjamin Kramer <benny.kra@googlemail.com> As Aaron pointed out it's simpler to reject wide string availability attr messages in the parser.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190706 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-availability.c
f37e4f24c39d0fd3c7f954d2321c4590421907af 13-Sep-2013 Benjamin Kramer <benny.kra@googlemail.com> Guard availability and thread safety attributes against wide strings.

Found by inspection.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190701 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-availability.c
ebaee6b74e56f28c088225b11a512e6e7d1fb9d8 11-Sep-2013 Aaron Ballman <aaron@aaronballman.com> The cleanup attribute no longer uses an unresolved, simple identifier as its argument. Instead, it takes an expression that is fully resolved.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190476 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-cleanup.c
812d6bcbd13190e6e5c2c915bf1499038d56b44b 10-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR5683: Issue a warning when subtracting pointers to types of zero size, and
treat such subtractions as being non-constant. Patch by Serge Pavlov! With a
few tweaks by me.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190439 91177308-0d34-0410-b5e6-96231b3b80d8
mpty1.c
bbb3b3237df2284f6f3c34798944fcfa4b43fd34 10-Sep-2013 Aaron Ballman <aaron@aaronballman.com> Attribute tablegen now understands that attribute arguments can be optional. This allows for automated checking of the number of arguments expected vs number of arguments given for attributes. Greatly reduces the amount of manual checking required.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190368 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-mode.c
ae3a83f578e48745f12b213c222217d91187a248 09-Sep-2013 Benjamin Kramer <benny.kra@googlemail.com> Sema: Don't crash on visibility attributes with an identifier argument.

PR17105.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190312 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-visibility.c
e5934897fb4eb0ddc272e81b3aae0994cdee49e9 09-Sep-2013 Aaron Ballman <aaron@aaronballman.com> Removing the endian attribute and updating associated test cases. This functionality was never completely implemented, and this is an improvement over silently eating the attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190303 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-endian.c
624421f98d8fcb8ed8ebc406da41217682159aa8 31-Aug-2013 Aaron Ballman <aaron@aaronballman.com> Consolidating the notion of a GNU attribute parameter with the attribute argument list.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189711 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-endian.c
allingconv.c
arn-type-safety.c
e8519c31a6ef853b627d557702ac1890f18ce2c9 30-Aug-2013 Charles Davis <cdavis5x@gmail.com> Add ms_abi and sysv_abi attribute handling.

Based on a patch by Benno Rice!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189644 91177308-0d34-0410-b5e6-96231b3b80d8
allingconv-ms_abi.c
allingconv-sysv_abi.c
s_abi-sysv_abi.c
ef072033876e295ec5d3402f8730a3ae358ad815 28-Aug-2013 Reid Kleckner <reid@kleckner.net> Delete CC_Default and use the target default CC everywhere

Summary:
Makes functions with implicit calling convention compatible with
function types with a matching explicit calling convention. This fixes
things like calls to qsort(), which has an explicit __cdecl attribute on
the comparator in Windows headers.

Clang will now infer the calling convention from the declarator. There
are two cases when the CC must be adjusted during redeclaration:
1. When defining a non-inline static method.
2. When redeclaring a function with an implicit or mismatched
convention.

Fixes PR13457, and allows clang to compile CommandLine.cpp for the
Microsoft C++ ABI.

Excellent test cases provided by Alexander Zinenko!

Reviewers: rsmith

Differential Revision: http://llvm-reviews.chandlerc.com/D1231

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189412 91177308-0d34-0410-b5e6-96231b3b80d8
allingconv.c
rtd.c
6a5526046b945032c69c9ead1cd341226cdf1c16 22-Aug-2013 David Majnemer <david.majnemer@gmail.com> Typo.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188996 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-ms.c
8d061b8ee7f5a56c494708b1ad00fffbb01dc4e9 22-Aug-2013 Dmitri Gribenko <gribozavr@gmail.com> gnu-flags.c test: relax the check a bit

This tests warning flags, so no need to test for specific alignment which is
platform-dependent.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188993 91177308-0d34-0410-b5e6-96231b3b80d8
nu-flags.c
df72071db0ddfd7264485105c19230c315e8ce2c 22-Aug-2013 David Majnemer <david.majnemer@gmail.com> Analysis: Make %I in printf more reasonable, add more tests


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188992 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-ms.c
24146975f1af8c1b4b14e8545f218129d0e7dfeb 22-Aug-2013 Eli Friedman <eli.friedman@gmail.com> Split isFromMainFile into two functions.

Basically, isInMainFile considers line markers, and isWrittenInMainFile
doesn't. Distinguishing between the two is useful when dealing with
files which are preprocessed files or rewritten with -frewrite-includes
(so we don't, for example, print useless warnings).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188968 91177308-0d34-0410-b5e6-96231b3b80d8
nline.c
47ad6ce1afad6b70927347dfa15e0f1dc76bf5bb 21-Aug-2013 David Majnemer <david.majnemer@gmail.com> Analysis: Add support for MS specific printf format specifiers

Summary: Adds support for %I, %I32 and %I64.

Reviewers: hans, jordan_rose, rnk, majnemer

Reviewed By: majnemer

CC: cfe-commits, cdavis5x

Differential Revision: http://llvm-reviews.chandlerc.com/D1456

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188937 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-ms.c
e85baa92c8b6d68c254e33934397d4883fc12aef 21-Aug-2013 Richard Sandiford <rsandifo@linux.vnet.ibm.com> Tweak gnu-flags.c test for z, where globals have 2-byte alignment by default


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188905 91177308-0d34-0410-b5e6-96231b3b80d8
nu-flags.c
e0f720eaa958fa3eb539851779c51b8371e09e7b 21-Aug-2013 Eli Friedman <eli.friedman@gmail.com> Remove Extension warning for GNU local labels.

We generally don't warn about extensions involving keywords reserved
for the implementation, so we shouldn't warn here either: the
standard doesn't require it, and it doesn't provide useful information
to the user.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188840 91177308-0d34-0410-b5e6-96231b3b80d8
nu-flags.c
24515d9819fcea76743d8ffca077620b679bf318 21-Aug-2013 Eli Friedman <eli.friedman@gmail.com> Add more specific flags for misc GNU extensions.

This adds the following as subgroups of -Wgnu: -Wgnu-alignof-expression,
-Wgnu-case-range, -Wgnu-complex-integer, -Wgnu-conditional-omitted-operand,
-Wgnu-empty-initializer, -Wgnu-label-as-value, -Wgnu-local-label,
and -Wgnu-statement-expression,

Patch by Peter Lewis.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188839 91177308-0d34-0410-b5e6-96231b3b80d8
nu-flags.c
48a2a3a6ec7a168abdb1e0116bceeac578c132ea 20-Aug-2013 Eli Friedman <eli.friedman@gmail.com> Handle init lists and _Atomic fields.

Fixes PR16931.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188718 91177308-0d34-0410-b5e6-96231b3b80d8
tomic-ops.c
2d67097ad41f4c2fe82ebce3f587e06498f1bd71 17-Aug-2013 Richard Smith <richard-llvm@metafoo.co.uk> Refactor all diagnosing of TypoCorrections through a common function, in
preparation for teaching this function how to diagnose a correction that
includes importing a module.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188602 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.c
dd9459f8869f66409f7ea429053b453e33f6499c 13-Aug-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix implementation of C11 6.2.7/4 and C++11 [dcl.array]p3:

When a local extern declaration redeclares some other entity, the type of that
entity is merged with the prior type if the prior declaration is visible (in C)
or is declared in the same scope (in C++).

- Make LookupRedeclarationWithLinkage actually work in C++, use it in the right
set of cases, and make it track whether it found a shadowed declaration.
- Track whether we found a declaration in the same scope (for C++) including
across serialization and template instantiation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188307 91177308-0d34-0410-b5e6-96231b3b80d8
xtern-redecl.c
1c56c9d9c2eed9ade88afe93541cc6fd25932355 08-Aug-2013 Rafael Espindola <rafael.espindola@gmail.com> Fix alignof computation of large arrays on x86_64.

We were exposing the extra alignment given to large arrays. The new behavior
matches gcc, which is a good thing since this is a gcc extension.

Thanks to Joerg Sonnenberger for noticing it.

While at it, centralize the method description in the .h file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187999 91177308-0d34-0410-b5e6-96231b3b80d8
lign-x86-64.c
fbbdc5daee4dc772d4d137080890fd79492592d6 08-Aug-2013 Richard Trieu <rtrieu@google.com> Emit an error for enum increments and decrements in C++ mode.
Fixes PR16394.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187955 91177308-0d34-0410-b5e6-96231b3b80d8
num-increment.c
b793f0d3448a15277cd6b6cc4ba558ded39a8084 01-Aug-2013 Tim Northover <tnorthover@apple.com> AArch64: initial NEON support

Patch by Ana Pazos

- Completed implementation of instruction formats:
AdvSIMD three same
AdvSIMD modified immediate
AdvSIMD scalar pairwise

- Completed implementation of instruction classes
(some of the instructions in these classes
belong to yet unfinished instruction formats):
Vector Arithmetic
Vector Immediate
Vector Pairwise Arithmetic

- Initial implementation of instruction formats:
AdvSIMD scalar two-reg misc
AdvSIMD scalar three same

- Intial implementation of instruction class:
Scalar Arithmetic

- Initial clang changes to support arm v8 intrinsics.
Note: no clang changes for scalar intrinsics function name mangling yet.

- Comprehensive test cases for added instructions
To verify auto codegen, encoding, decoding, diagnosis, intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187568 91177308-0d34-0410-b5e6-96231b3b80d8
arch64-neon-vector-types.c
750f73aadcfb9810a5825fd57325e310042e5617 30-Jul-2013 Aaron Ballman <aaron@aaronballman.com> err_attribute_missing_parameter_name has been replaced by err_attribute_argument_type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187420 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-mode.c
9f939f75c64770c746d78579f75a49f9c657e426 30-Jul-2013 Aaron Ballman <aaron@aaronballman.com> Replacing err_attribute_argument_not_int with err_attribute_not_type_attr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187419 91177308-0d34-0410-b5e6-96231b3b80d8
ddress_spaces.c
lloc_size.c
ttr-regparm.c
eon-vector-types.c
3cd6feb87a62fb52c31cbc83655d76ace020513f 30-Jul-2013 Aaron Ballman <aaron@aaronballman.com> err_attribute_not_string has been subsumed by err_attribute_argument_type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187400 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
nnotate.c
ttr-section.c
ttr-tls_model.c
ttr-unavailable-message.c
allingconv.c
b3d7efe0f95bc44f0e93602f4617a53ca3b66e3a 30-Jul-2013 Aaron Ballman <aaron@aaronballman.com> Refactor some attributes to use checkFunctionOrMethodArgumentIndex instead of using custom logic. No functional changes intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187398 91177308-0d34-0410-b5e6-96231b3b80d8
lloc_size.c
ttr-format.c
onnull.c
13a29a2408d7b0246375215b59b75ad5eeec1053 30-Jul-2013 David Blaikie <dblaikie@gmail.com> Remove assert header dependency in test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187387 91177308-0d34-0410-b5e6-96231b3b80d8
arn-thread-safety-analysis.c
88c4b5efc604b982ca9083548d568b02b1abd2ab 29-Jul-2013 David Blaikie <dblaikie@gmail.com> Support for Thread Safety Analysis in C

Patch by Ethan Jackson.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187365 91177308-0d34-0410-b5e6-96231b3b80d8
arn-thread-safety-analysis.c
1652ed1cd2cb63e0d0cb74c67a40d9dc5cab6b89 26-Jul-2013 Eli Friedman <eli.friedman@gmail.com> Tighten type-checking for vector attributes.

Based on patch by Yunzhong Gao.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187176 91177308-0d34-0410-b5e6-96231b3b80d8
ypes.c
de99be1929b16ec524ce3312b31191ff05716597 23-Jul-2013 Aaron Ballman <aaron@aaronballman.com> Removing a number of individual run lines and replacing them with single line test cases. This reduces the number of test runs, provides the same coverage, and allows us to test that the attribute names are included in the diagnostic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186982 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-args.c
baec77865b3ce64bb942dddc5dc2fada84ce5099 23-Jul-2013 Aaron Ballman <aaron@aaronballman.com> Added the attribute name to the err_attribute_wrong_number_arguments diagnostic for clarity; updated almost all of the affected test cases.

Thanks to Fariborz Jahanian for the suggestion!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186980 91177308-0d34-0410-b5e6-96231b3b80d8
nnotate.c
ttr-cleanup.c
ttr-naked.c
ttr-nodebug.c
ttr-noinline.c
ttr-noreturn.c
ttr-regparm.c
ttr-returns-twice.c
ttr-tls_model.c
ttr-unused.c
allingconv.c
ips16_attr_allowed.c
eon-vector-types.c
verloadable.c
73883c3d9bf1a03e5c0240e5a8755d5bea07c386 23-Jul-2013 Aaron Ballman <aaron@aaronballman.com> Removed a redundant diagnostic and replaced it with a more standard one. Added a test case for the diagnostic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186942 91177308-0d34-0410-b5e6-96231b3b80d8
ddress_spaces.c
081c883c3f28d0031e2c8c465c9d18b6fd10e6e4 23-Jul-2013 Aaron Ballman <aaron@aaronballman.com> Correcting the NSObject and Overloadable attribute diagnostics so that the count reported matches reality.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186936 91177308-0d34-0410-b5e6-96231b3b80d8
verloadable.c
b3da613977f6b77dee2b382eeff5713168a4ca18 23-Jul-2013 Eli Friedman <eli.friedman@gmail.com> Integers which are too large should be an error.

Switch some warnings over to errors which should never have been warnings
in the first place. (Also, a minor fix to the preprocessor rules for
integer literals while I'm here.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186903 91177308-0d34-0410-b5e6-96231b3b80d8
28bitint.c
lloc_size.c
8202630a58e5aa7f5630b44266e4460fa7021ac1 22-Jul-2013 Enea Zaffanella <zaffanella@cs.unipr.it> Fixed implementation of C89 6.5.7 p3.
Warning should be emitted only for InitListExpr nodes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186859 91177308-0d34-0410-b5e6-96231b3b80d8
89.c
6bc8f9a21cdbf3f043455ff78f9ece66f9f2c3d9 22-Jul-2013 Aaron Ballman <aaron@aaronballman.com> This test was missing its -verify argument.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186847 91177308-0d34-0410-b5e6-96231b3b80d8
onnull.c
b9a5935c58a3bc78c4a511ee77ad2f0c4ca29dc1 22-Jul-2013 Enea Zaffanella <zaffanella@cs.unipr.it> Implement the part of C89 6.5.7 p3 requiring a constant initializer list
when initializing aggregate/union types, no matter if static or not.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186817 91177308-0d34-0410-b5e6-96231b3b80d8
89.c
bb145e80d9c0f6a18d02508c30f922f38ccede5e 18-Jul-2013 Aaron Ballman <aaron@aaronballman.com> Test contents were somehow duplicated, resulting in any testcase that fails automatically failing twice. Removing the duplicates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186590 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-args.c
2dbdef237491cbe81b8597a6519c6c5f938877cd 18-Jul-2013 Aaron Ballman <aaron@aaronballman.com> Removed a parameter from handleAttrWithMessage to make it more consistent with other attribute handlers, as well as other attribute error messages. Added missing test cases for the unavailable attribute, and updated the deprecated test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186578 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
ttr-unavailable-message.c
21cde050b64eefbb5094af67985752eee42d00e2 17-Jul-2013 Eli Friedman <eli.friedman@gmail.com> Make Expr::isConstantInitializer match IRGen.

Sema needs to be able to accurately determine what will be
emitted as a constant initializer and what will not, so
we get accurate errors in C and accurate -Wglobal-constructors
warnings in C++. This makes Expr::isConstantInitializer match
CGExprConstant as closely as possible.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186464 91177308-0d34-0410-b5e6-96231b3b80d8
nit.c
09df2b066221d869f17f4b5762405f111a65f983 16-Jul-2013 Tim Northover <tnorthover@apple.com> ARM: implement low-level intrinsics for the atomic exclusive operations.

This adds three overloaded intrinsics to Clang:
T __builtin_arm_ldrex(const volatile T *addr)
int __builtin_arm_strex(T val, volatile T *addr)
void __builtin_arm_clrex()

The intent is that these do what users would expect when given most sensible
types. Currently, "sensible" translates to ints, floats and pointers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186394 91177308-0d34-0410-b5e6-96231b3b80d8
tomic-ops.c
uiltins-arm-exclusive.c
e8caa30d6124b915fb6bfb3fb2d0eb4857381d08 16-Jul-2013 Serge Pavlov <sepavloff@gmail.com> Limit number of bits in size representation so that bit size fit 64 bits.
This fixes PR8256 and some others.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186385 91177308-0d34-0410-b5e6-96231b3b80d8
rray-size-64.c
ffsetof-64.c
9ec4099a0946a46108a8e22a4b30d45d5443decd 16-Jul-2013 Eli Friedman <eli.friedman@gmail.com> Merge attributes on typedef decls.

Not completely sure this is right, but it's clearly better than what
we did before this commit (effectively dropping the attribute).

<rdar://problem/14413117>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186373 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-deprecated.c
09bddcf8c0ce4cc2f2a18e050e971539e8a396f8 08-Jul-2013 Eli Friedman <eli.friedman@gmail.com> Fix Sema for compares with _Atomic vars.

Use UsualArithmeticConversions unconditionally in analysis of
comparisons and conditional operators: the method performs
the usual arithmetic conversions if both sides are arithmetic, and
usual unary conversions if they are not. This is just a cleanup
for conditional operators; for comparisons, it fixes the issue that
we would try to check isArithmetic() on an atomic type.

Also, fix GetExprRange() in SemaChecking.cpp so it deals with variables
of atomic type correctly.

Fixes PR15537.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185857 91177308-0d34-0410-b5e6-96231b3b80d8
tomic-expr.c
bcd0650c1e50a2e73b11717731e074a1ac2ac5ba 08-Jul-2013 David Majnemer <david.majnemer@gmail.com> Sema: Do not merge new decls with invalid, old decls

Sema::MergeFunctionDecl attempts merging two decls even if the old decl
is invalid. This can lead to interesting circumstances where we
successfully merge the decls but the result makes no sense.

Take the following for example:

template <typename T>
int main(void);

int main(void);

Sema will not consider these to be overloads of the same name because
main can't be overloaded, which means that this must be a redeclaration.

In this case the templated decl is compatible with the non-templated
decl allowing the Sema::CheckFunctionDeclaration machinery to move on
and do bizarre things like setting the previous decl of a non-templated
decl to a templated decl!

The way I see it, we should just bail from MergeFunctionDecl if the old
decl is invalid.

This fixes PR16531.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185779 91177308-0d34-0410-b5e6-96231b3b80d8
arn-main.c
a535daff4bd1390bb80b42a2a34d2c00f8a714d7 04-Jul-2013 Roman Divacky <rdivacky@freebsd.org> Add test for r185584.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185668 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-mode.c
96e7813f08c6adf1d8657b0da86741b54e850fd7 04-Jul-2013 Rafael Espindola <rafael.espindola@gmail.com> Add 'not' to commands that are expected to fail.

This is at least good documentation, but also opens the possibility of
using pipefail.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185652 91177308-0d34-0410-b5e6-96231b3b80d8
arentheses.c
arn-main-return-type.c
arn-main.c
arn-unused-parameters.c
d29e24f24e9a130431eafefa42c36be8e7a597de 04-Jul-2013 Richard Smith <richard-llvm@metafoo.co.uk> Add test for PR4997. This has been fixed for a while.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185614 91177308-0d34-0410-b5e6-96231b3b80d8
ddress_spaces.c
f0d14cb8c8f95c9039e4ea1f5966f233a76ba1d8 03-Jul-2013 Roman Divacky <rdivacky@freebsd.org> Add support for TF/TC modes available on eg. PowerPC64.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185578 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-mode.c
0c0b3909d11de7440d77556089516918b9c04cef 30-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Teach -Wunsequenced that the side-effects of a function evaluation are sequenced
before the value computation of the result. In C, this is implied by there being
a sequence point after their evaluation, and in C++, it's implied by the
side-effects being sequenced before the expressions and statements in the
function body.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185282 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unsequenced.c
aa4bc18240c03b5ed7952aa5e013c081f8733ed3 30-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Reinstate r185229, reverted in r185256, with a tweak: further ignore the
standard's rule that an extern "C" declaration conflicts with any entity in the
global scope with the same name. Now we only care if the global scope entity is
a variable declaration (and so might have the same mangled name as the extern
"C" declaration). This has been reported as a standard defect.

Original commit message:

PR7927, PR16247: Reimplement handling of matching extern "C" declarations
across scopes.

When we declare an extern "C" name that is not a redeclaration of an entity in
the same scope, check whether it redeclares some extern "C" entity from another
scope, and if not, check whether it conflicts with a (non-extern-"C") entity in
the translation unit.

When we declare a name in the translation unit that is not a redeclaration,
check whether it conflicts with any extern "C" entities (possibly from other
scopes).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185281 91177308-0d34-0410-b5e6-96231b3b80d8
verloadable.c
6e428a446ed7cc170346430afa7be54e83b2d28c 29-Jun-2013 Timur Iskhodzhanov <timurrrr@google.com> Revert r185229 as it breaks compilation of <windows.h>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185256 91177308-0d34-0410-b5e6-96231b3b80d8
verloadable.c
5eab8d733ce7867fda4e6d5f5afa6dfe8a105c79 29-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR7927, PR16247: Reimplement handling of matching extern "C" declarations
across scopes.

When we declare an extern "C" name that is not a redeclaration of an entity in
the same scope, check whether it redeclares some extern "C" entity from another
scope, and if not, check whether it conflicts with a (non-extern-"C") entity in
the translation unit.

When we declare a name in the translation unit that is not a redeclaration,
check whether it conflicts with any extern "C" entities (possibly from other
scopes).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185229 91177308-0d34-0410-b5e6-96231b3b80d8
verloadable.c
418dd3eb3e813235af089b5c88182941f8a03d20 27-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR16467: Teach -Wunsequenced that in C11 (unlike C++11), an assignment's
side-effect is not sequenced before its value computation. Also fix a
mishandling of ?: expressions where the condition is constant that was
exposed by the tests for this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185035 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unsequenced.c
5e37eec0e1cd6246b62a3cc33380253b3b3fd2cf 26-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Make this test properly test both things it's trying to test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184887 91177308-0d34-0410-b5e6-96231b3b80d8
fprintf-valid-redecl.c
ac83a3cdbfa3dad298ab3d87fb608b9b08176e57 25-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix null pointer dereference if we redeclare an unprototyped function. Patch by
WenHan Gu!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184875 91177308-0d34-0410-b5e6-96231b3b80d8
fprintf-valid-redecl.c
12df246d6dea2ee1f92c186f922f1afcf499647a 24-Jun-2013 Reid Kleckner <reid@kleckner.net> [AST] Introduce a new DecayedType sugar node

The goal of this sugar node is to be able to look at an arbitrary
FunctionType and tell if any of the parameters were decayed from an
array or function type. Ultimately this is necessary to implement
Microsoft's C++ name mangling scheme, which mangles decayed arrays
differently from normal pointers.

Reviewers: rsmith

Differential Revision: http://llvm-reviews.chandlerc.com/D1014

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184763 91177308-0d34-0410-b5e6-96231b3b80d8
unction.c
c5b0054693b3b3cafe6a13549358c22e07fcd4ff 24-Jun-2013 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: allow "\param ..." to describe variadic arguments

Original patch by Fariborz Jahanian; extended by me.

Fixes rdar://14124644


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184688 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
arn-documentation.m
6969e43b14a91124b98e4b0bd4d34a736123fe0b 24-Jun-2013 Dmitri Gribenko <gribozavr@gmail.com> Documentation parsing: recognize \relates, \related, \relatesonly, \relatedonly
so that -Wdocumentation-unknown-command does not warn on these commands.
Fixes PR16092.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184676 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
97e5bc2643dd1478ca10d1b9a6581f332801c958 23-Jun-2013 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: followup to r184610: allow multiple \returns

Remove unneeded member in CommentSema, add a test for the XML schema (the
schema already allowed multiple paragraphs in <ResultDiscussion>, but there
were no tests for that), fix HTML generation (it is not allowed to have <p>
inside <dl>).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184652 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
d52b20c706326cc2c5c3707a902e7ca4474719b6 22-Jun-2013 Fariborz Jahanian <fjahanian@apple.com> [document parsing]: Allow multiple adjacent \return and the like
commands. Render them properly in XML output.
// rdar://14207725


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184610 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
9b9bdba90cb7a61ed0e5bbadf9155b9d6848ce98 21-Jun-2013 Nico Weber <nicolasweber@gmx.de> Fix a crash with __flaot128 noticed by Eli.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184498 91177308-0d34-0410-b5e6-96231b3b80d8
28bitfloat.cc
cac18add73d095eaab600aefe27ea7174aec4922 20-Jun-2013 Nico Weber <nicolasweber@gmx.de> Lazily provide a __float128 dummy type in -std=gnu++11 mode.

This is needed to parse libstdc++ 4.7's type_traits, see PR13530.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184476 91177308-0d34-0410-b5e6-96231b3b80d8
28bitfloat.cc
2d588b4bc7127adf1a1c621002dfe452a99fef6f 19-Jun-2013 Fariborz Jahanian <fjahanian@apple.com> documentation parsing: patch to make @class work for
class templates; and similarly, @function works for
function templates. // rdar://14124702


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184329 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
b0f9314bbe29d09c3ea3f76a257125d1568665c7 19-Jun-2013 NAKAMURA Takumi <geek4civic@gmail.com> Revert r184249, "doc. parsing: Allow parameter name "..." for variadic functions/methods."

It crashes in the case;

/// Without any "param"s in the description.
int printf(const char *format, ...);

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184283 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.m
7e5e2d0c53b1b7253621d955089c0d14fe2a8078 19-Jun-2013 Fariborz Jahanian <fjahanian@apple.com> doc. parsing: Allow parameter name "..." for variadic functions/methods.
// rdar://14124644


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184249 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.m
2243e78a6580ead4d17b76c924cd4b630b50d6ae 18-Jun-2013 Eli Friedman <eli.friedman@gmail.com> Correctly compute the index of the first string format argument when deciding
whether to emit a -Wformat-security warning. <rdar://problem/14178260>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184214 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
e4bce7a4250e3d646ceab372ebed71ca7e79cf28 18-Jun-2013 Bob Wilson <bob.wilson@apple.com> size_t on Darwin AAPCS targets is "unsigned long". <rdar://problem/14136459>

Some embedded targets use ARM's AAPCS with iOS header files that define size_t
as unsigned long, which conflicts with the usual AAPCS definition of size_t
as unsigned int.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184171 91177308-0d34-0410-b5e6-96231b3b80d8
rm-darwin-aapcs.cpp
0dcea35c21b001c9c2c9b4d4a8cfd4c82dc5f00c 17-Jun-2013 Serge Pavlov <sepavloff@gmail.com> Clean up empty struct/union recognition.
Make use of getTypeSizeInChars to detect structs/unions of zero size. It allows
more accurate detection of types of zero size. It however has a side effect -
sequence of used types may change, that is why the test 'override-layout' was
modified.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184088 91177308-0d34-0410-b5e6-96231b3b80d8
mpty1.c
ad24ad4c741cad0fe79d6e4a74edc58d592a0f90 13-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Allow clang to build __clear_cache on ARM.

__clear_cache is special. It needs no signature, but is a real function in
compiler_rt or libgcc.

Patch by Andrew Turner.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183926 91177308-0d34-0410-b5e6-96231b3b80d8
uiltin-clear_cache.c
5350ded82a4e93a79c99a322e11360e096e2f852 13-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> More for PR12457: fix handling of __builtin_isinf_sign and test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183890 91177308-0d34-0410-b5e6-96231b3b80d8
onstant-builtins-2.c
acaf72adaed7b320fdec8c09f70ec9ac46df3563 13-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Towards PR12457: constant expression evaluation support for __builtin_parity{,l,ll}, __builtin_ffs{,l,ll}, and __builtin_fpclassify.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183889 91177308-0d34-0410-b5e6-96231b3b80d8
onstant-builtins-2.c
4dbf408ee91a35f7c703ab279e7eaa1803215936 13-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix part of PR12457. Patch by Justin Bogner!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183886 91177308-0d34-0410-b5e6-96231b3b80d8
onstant-builtins-2.c
79f4bb7aad1b7c53f8a3bc43d89de0efdef8286d 13-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Add -Wdeprecated warnings and fixits for things deprecated in C++11:
- 'register' storage class
- dynamic exception specifications

Only the former check is enabled by default for now (the latter might be quite noisy).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183881 91177308-0d34-0410-b5e6-96231b3b80d8
hread-specifier.c
81359b0a88510087a873de771f9a2f5ee7ed97d9 12-Jun-2013 Eli Friedman <eli.friedman@gmail.com> Tweak r183791 so we don't print a note without a source location.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183803 91177308-0d34-0410-b5e6-96231b3b80d8
esignated-initializers.c
9808b711aa2153e4fe9a627a2721fa5c3bbbdc97 08-Jun-2013 Reid Kleckner <reid@kleckner.net> Add a test case for blocks taking an array typedef

r183614 was failing because va_list on some platforms is defined in a
similar manner. This test fails on Windows with r183614 applied.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183617 91177308-0d34-0410-b5e6-96231b3b80d8
lock-args.c
c910d4cfa5042f2c9da1eb4e0b6ed59240c0eeee 08-Jun-2013 Reid Kleckner <reid@kleckner.net> Revert "[Sema] Make FunctionType's TSI use unadjusted argument types"

This reverts commit r183614.

It broke test/Sema/block-printf-attribute-1.c on non-Windows platforms,
and the fix is not trivial.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183616 91177308-0d34-0410-b5e6-96231b3b80d8
unction-redecl.c
63c9a92a805394c1ca9e4a5fd8afb3acbb918d03 08-Jun-2013 Reid Kleckner <reid@kleckner.net> [Sema] Make FunctionType's TSI use unadjusted argument types

This helps preserve the type-as-written in the AST, which we need for
MSVC mangling. In particular, we need to preserve the types of array
parameters in function pointer types.

The essence of this change is:
- QualType ArgTy = Param->getType();
+ QualType ArgTy = Param->getTypeSourceInfo()->getType();

... followed by the adjustment in ActOnFunctionDeclarator().

Differential Revision: http://llvm-reviews.chandlerc.com/D883

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183614 91177308-0d34-0410-b5e6-96231b3b80d8
unction-redecl.c
122e601886ae527d6e7100c589339c05190a168a 08-Jun-2013 Serge Pavlov <sepavloff@gmail.com> Recognition of empty structures and unions is moved to semantic stage

Differential Revision: http://llvm-reviews.chandlerc.com/D586


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183609 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
mpty1.c
mpty2.c
f9eaf98bf524f7e2dcb9875a9f4afd9e25fc615d 08-Jun-2013 David Majnemer <david.majnemer@gmail.com> Revert "Properly consider the range of enum for range comparisons in C mode"

The approach r183084 took was wrong, back it out.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183575 91177308-0d34-0410-b5e6-96231b3b80d8
utof-range-constant-compare.c
48a1e81715bf9c37a4168d83f4218e6517e29541 06-Jun-2013 Joey Gouly <joey.gouly@arm.com> Fix a crash with -Wassign-enum, where we didn't adjust the APInt type of the
constant. Also fix some spelling mistakes and formatting issues.

Reviewed by Richard Smith over IRC.

Fixes PR15069.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183409 91177308-0d34-0410-b5e6-96231b3b80d8
arn-outof-range-assign-enum.c
649c6c50fd3dd13577071b26fec4495f7538d923 06-Jun-2013 Hans Wennborg <hans@hanshq.net> Disallow reinterpret_cast from pointer to bool on Windows

This became allowed by accident in r131201, but triggers an assert.
That patch added an exception to allow conversion from pointers to
narrow integral types for MSVC compatibility. However, a pointer can
already be converted to bool in a civilized manner; allowing conversion
via reinterpret_cast is a bad idea.

Fixes PR16222.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183394 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
ad69e0cc6590f2d208fa863c48697563960e4a61 02-Jun-2013 David Majnemer <david.majnemer@gmail.com> Properly consider the range of enum for range comparisons in C mode

In some cases, clang applies the C++ rules for computing the range of a
value when said value is an enum.

Instead, apply C semantics when in C mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183084 91177308-0d34-0410-b5e6-96231b3b80d8
utof-range-constant-compare.c
708eb71b3d677ffb8fb899b386062d92ecdcc675 31-May-2013 Benjamin Kramer <benny.kra@googlemail.com> Testcase for r183015.

I hate svn add.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183019 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins-gnu-mode.c
df08c4b371522025d1d3aec4992fb0f27d7c4571 30-May-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix potential infinite loop when iterating over redeclarations of an ObjMethodDecl, resulting from invalid code.

Check for invalid decls in ObjCMethodDecl::getNextRedeclaration(); otherwise if we start from an invalid redeclaration
of an @implementation we would move to the @interface and not reach the original declaration again.

Fixes rdar://14024851

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182951 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.m
2628b44e100da28972a14854f98d0aa6f7b888e0 29-May-2013 Ted Kremenek <kremenek@apple.com> Split off casts to void* for -Wint-to-pointer-cast to subgroup -Wint-to-void-pointer-cast.

This change is motivated from user feedback that some APIs use
void* as an opaque "context" object that may not really be a pointer.
Such users want an ability to turn off the warning for casts
to void* while preserving the warning for other cases.

Implements <rdar://problem/14016721>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182884 91177308-0d34-0410-b5e6-96231b3b80d8
ast.c
538bbe597b935a74d95c668ad209536753f13481 28-May-2013 Fariborz Jahanian <fjahanian@apple.com> Patch to issue error when target of MacOS and iOS
does not support large load/store of atomic objects.
// rdar://13973577


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182781 91177308-0d34-0410-b5e6-96231b3b80d8
tomic-requires-library-error.c
b07d448a625d7399d871079d55491c6b10316e6f 25-May-2013 Nico Weber <nicolasweber@gmx.de> Warn on va_start() when called with a reference parameter.

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1905.pdf 18.7p3
explicitly calls this (and some other things) out as undefined.

Also move 2 other existing warnings behind the new -Wvarargs flag.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182694 91177308-0d34-0410-b5e6-96231b3b80d8
arargs.cpp
aa9df09729fb8aee3e645549e95fcb413306a7aa 23-May-2013 Aaron Ballman <aaron@aaronballman.com> Adding in parsing and the start of semantic support for __sptr and __uptr pointer type qualifiers. This patch also fixes the correlated __ptr32 and __ptr64 pointer qualifiers so that they are truly type attributes instead of declaration attributes.

For more information about __sptr and __uptr, see MSDN: http://msdn.microsoft.com/en-us/library/aa983399.aspx

Patch reviewed by Richard Smith.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182535 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftCompatibility.cpp
icrosoftExtensions.c
ttr-print.c
dbed7cceb8b453cc0ef78cc83f5466d5268037ba 21-May-2013 Fariborz Jahanian <fjahanian@apple.com> doc. parsing. HeaderDoc documentaton allows use of
@class command on an @interface declaration. Turn off
the warning for this case. // rdar://13927330


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182334 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.m
beba3e80378f38f3d1e1ef030dacdd438373d3d5 20-May-2013 Reid Kleckner <reid@kleckner.net> Warn on and drop dllimport attrs from variable definitions

AsmPrinter::EmitLinkage() does not handle dllimport linkage. The LLVM
verifier should also be fixed to reject this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182320 91177308-0d34-0410-b5e6-96231b3b80d8
llimport-dllexport.c
ee2f8f2f7c4eacfa305a29fcd916d63c650ca847 16-May-2013 Richard Trieu <rtrieu@google.com> Return QualType() when a too large array is attempting to be created. This
prevents further errors and some overflows in size calculations.
One overflow was previously triggering an assert.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181970 91177308-0d34-0410-b5e6-96231b3b80d8
ffsetof-64.c
0ff5074f37a66bca244a9d5d0da050ff68693ce2 15-May-2013 Hans Wennborg <hans@hanshq.net> Better diagnostics for string initialization.

This commit improves Clang's diagnostics for string initialization.
Where it would previously say:

/tmp/a.c:3:9: error: array initializer must be an initializer list
wchar_t s[] = "Hi";
^
/tmp/a.c:4:6: error: array initializer must be an initializer list or string literal
char t[] = L"Hi";
^

It will now say

/tmp/a.c:3:9: error: initializing wide char array with non-wide string literal
wchar_t s[] = "Hi";
^
/tmp/a.c:4:6: error: initializing char array with wide string literal
char t[] = L"Hi";
^

As a bonus, it also fixes the fact that Clang would previously reject
this valid C11 code:

char16_t s[] = u"hi";
char32_t t[] = U"hi";

because it would only recognize the built-in types for char16_t and
char32_t, which do not exist in C.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181880 91177308-0d34-0410-b5e6-96231b3b80d8
s-wchar.c
tring-init.c
char.c
1bb8cb5558f46502b84e3b2935b7f5b4c1759d21 15-May-2013 Richard Trieu <rtrieu@google.com> Move a test that requires 64-bit mode to a separate test with a triple in
the run line.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181854 91177308-0d34-0410-b5e6-96231b3b80d8
ffsetof-64.c
ffsetof.c
910f17e331221cd0833d0b5b49013cbbc7ef122a 14-May-2013 Richard Trieu <rtrieu@google.com> When computing the size of large arrays, use char units instead of bits.
This prevents an overflow and assertion when the number of bits cannot be
stored in 64-bits.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181839 91177308-0d34-0410-b5e6-96231b3b80d8
ffsetof.c
173a4cc51a416a938885358b9592e629728e7407 14-May-2013 Rafael Espindola <rafael.espindola@gmail.com> Really fix the declaration of __clear_cache.

When I tested gcc's behaviour before, I forgot the extern "C", so it
would warn when the types *did* match.

So in the end
* __clear_cache takes two void pointers.
* aarch64 was correct before.
* libgcc's manual is wrong.
* this patch fixes arm.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181810 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins-aarch64.c
uiltins-arm.c
4537d6e0f9baf2e011a4260e0d7872789b01c3f2 14-May-2013 Rafael Espindola <rafael.espindola@gmail.com> Fix __clear_cache on ARM.

Current gcc's produce an error if __clear_cache is anything but

__clear_cache(char *a, char *b);

It looks like we had just implemented a gcc bug that is now fixed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181784 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins-arm.c
a9d7b46c2fb3eb9020b60375e0cb722bd26b108d 14-May-2013 Tim Northover <t.p.northover@gmail.com> AArch64: add test for updated __clear_cache definition

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181765 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins-aarch64.c
fbff0c4510c7f0e0f30a005960e434b973f5bd21 13-May-2013 Fariborz Jahanian <fjahanian@apple.com> Objective-C error recovery. This patch makes a quick
recovery form duplicate method definition error thus
preventing doc parsing to loop trying to find comment
for the invalid redefinition in a previous declaration.
// rdar://13836387


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181710 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.m
15f92bad58c8650b1306729744b1a1230197497a 10-May-2013 Hans Wennborg <hans@hanshq.net> Add support for __wchar_t in -fms-extensions mode.

MSVC provides __wchar_t. This is the same as the built-in wchar_t type
from C++, but it is also available with -fno-wchar and in C.

The commit changes ASTContext to have two different types for this:

- WCharTy is the built-in type used for wchar_t in C++ and __wchar_t.

- WideCharTy is the type of a wide character literal. In C++ this is
the same as WCharTy, and in C it is an integer type compatible with
the type in <stddef.h>.

This fixes PR15815.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181587 91177308-0d34-0410-b5e6-96231b3b80d8
s-wchar.c
524387ae3dfc0c4cf2b095f83f9e47aa549b7e55 09-May-2013 Ben Langmuir <ben.langmuir@intel.com> CodeGen for CapturedStmts

EmitCapturedStmt creates a captured struct containing all of the captured
variables, and then emits a call to the outlined function. This is similar in
principle to EmitBlockLiteral.

GenerateCapturedFunction actually produces the outlined function. It is based
on GenerateBlockFunction, but is much simpler. The function type is determined
by the parameters that are in the CapturedDecl.

Some changes have been added to this patch that were reviewed as part of the
serialization patch and moving the parameters to the captured decl.

Differential Revision: http://llvm-reviews.chandlerc.com/D640


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181536 91177308-0d34-0410-b5e6-96231b3b80d8
aptured-statements.c
f4030ae4638d1831a2a031f1e33b86de8c5fef28 09-May-2013 Fariborz Jahanian <fjahanian@apple.com> [doc parsing]: make single character command impostures
warn in pedantic mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181523 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.m
9d6b1cb173998c82783c1751b8ce88d3d7243dc3 09-May-2013 Fariborz Jahanian <fjahanian@apple.com> [doc parsing]: don't attempt to fix single character
commands (\t \n are common). \\ rdar://12381408


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181517 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation-fixits.cpp
ad91e5431f2f2d0a32ccdff8c55e7fa921af42bd 09-May-2013 Fariborz Jahanian <fjahanian@apple.com> [doc parsing]: Also do typo correction for
dynamically registered commands.
// rdar://12381408


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181477 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation-fixits.cpp
0089bc4ddee6bb309ad25f4c7ad4b7ffe5df4512 08-May-2013 Fariborz Jahanian <fjahanian@apple.com> documentation parsing. Patch to do typo correction for
documentation commands. Patch was reviewed, along with
great suggestions for improvement, by Doug.
// rdar://12381408


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181458 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation-fixits.cpp
993f43f24d7a45a5cd4678a3316b0852261fc5d4 06-May-2013 John McCall <rjmccall@apple.com> Grab-bag of bit-field fixes:

- References to ObjC bit-field ivars are bit-field lvalues;
fixes rdar://13794269, which got me started down this.
- Introduce Expr::refersToBitField, switch a couple users to
it where semantically important, and comment the difference
between this and the existing API.
- Discourage Expr::getBitField by making it a bit longer and
less general-sounding.
- Lock down on const_casts of bit-field gl-values until we
hear back from the committee as to whether they're allowed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181252 91177308-0d34-0410-b5e6-96231b3b80d8
itfield.c
27f9cf3a5a92f70f043b6cfbc5f3f2ac3a38f182 06-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix assert if __extension__ or _Generic is used when initializing a char array from a string literal.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181174 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
ff920eec4d449bee560d8d99636ad0eb50cd9d8d 04-May-2013 Tim Northover <Tim.Northover@arm.com> AArch64: teach Clang about __clear_cache intrinsic

libgcc provides a __clear_cache intrinsic on AArch64, much like it
does on 32-bit ARM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181111 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins-aarch64.c
ad6fd9f93ce0d328397e8d57ef7117ced24fc8e2 04-May-2013 Fariborz Jahanian <fjahanian@apple.com> [Doc parsing] Provide diagnostics for unknown documentation
commands. // rdar://12381408


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181071 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
arn-documentation.m
58eb37036b47bbe7433f72d92a2cb60848507707 01-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix PR15845: apparently MSVC does not support implicit int in C++ mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180822 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftCompatibility.cpp
d237d2e6b85a74f31c986dc585fa6c39733b74a2 30-Apr-2013 Fariborz Jahanian <fjahanian@apple.com> c language: diagnose use of "[*]" on any array dimension
in the parameter of a function definition. Currently,
it crashes in irgen if it is on other than the 1st dimension.
// rdar://13705391


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180732 91177308-0d34-0410-b5e6-96231b3b80d8
rash-invalid-array.c
5ddf70f1e736d4919c147cf938c8f20b0d17dd00 18-Apr-2013 Benjamin Kramer <benny.kra@googlemail.com> Reject asm output constraints that consist of modifiers only.

Fixes PR15759.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179756 91177308-0d34-0410-b5e6-96231b3b80d8
sm.c
1a7df995d4a62cd579c390b2d0cfb34a61878434 18-Apr-2013 Richard Trieu <rtrieu@google.com> Switch the note order for -Woverloaded-shift-op-parentheses so that the note
with the silence fix-it comes first. This is more consistent with the rest
of the warnings in -Wparentheses.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179742 91177308-0d34-0410-b5e6-96231b3b80d8
arentheses.cpp
aea5201b76bcc29b07aef689fc82601df75f3128 18-Apr-2013 Richard Trieu <rtrieu@google.com> Update the -Wparentheses tests to check that fix-its are in the correct place.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179740 91177308-0d34-0410-b5e6-96231b3b80d8
arentheses.c
arentheses.cpp
099ecfb0ed137665a3394187030d8fd7183fd9d4 17-Apr-2013 Fariborz Jahanian <fjahanian@apple.com> [document parsing]: When tag declaration (but not definition!)
is part of the decl-specifier-seq of some other declaration,
it doesn't get comment. // rdar://12390371


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179722 91177308-0d34-0410-b5e6-96231b3b80d8
o-documentation-warn-tagdecl-specifier.c
b42f200777a66b98989160bf3987ce431540a584 17-Apr-2013 Andy Gibbs <andyg1001@hotmail.co.uk> Extended VerifyDiagnosticConsumer to also verify source file for diagnostic.

VerifyDiagnosticConsumer previously would not check that the diagnostic and
its matching directive referenced the same source file. Common practice was
to create directives that referenced other files but only by line number,
and this led to problems such as when the file containing the directive
didn't have enough lines to match the location of the diagnostic in the
other file, leading to bizarre file formatting and other oddities.

This patch causes VerifyDiagnosticConsumer to match source files as well as
line numbers. Therefore, a new syntax is made available for directives, for
example:

// expected-error@file:line {{diagnostic message}}

This extends the @line feature where "file" is the file where the diagnostic
is generated. The @line syntax is still available and uses the current file
for the diagnostic. "file" can be specified either as a relative or absolute
path - although the latter has less usefulness, I think! The #include search
paths will be used to locate the file and if it is not found an error will be
generated.

The new check is not optional: if the directive is in a different file to the
diagnostic, the file must be specified. Therefore, a number of test-cases
have been updated with regard to this.

This closes out PR15613.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179677 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-arc-cf-code-audited.c
2a6e528cbd687e22744d5d7eba428afea99da300 17-Apr-2013 Richard Trieu <rtrieu@google.com> Add warning group -Woverloaded-shift-op-parentheses to -Wparentheses. This
will fire on code such as:

cout << x == 0;

which the compiler will intrepret as

(cout << x) == 0;

This warning comes with two fixits attached to notes, one for parentheses to
silence the warning, and another to evaluate the comparison first.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179662 91177308-0d34-0410-b5e6-96231b3b80d8
arentheses.cpp
6afcf8875d4e447645cd7bf3733dd8e2eb8455dc 16-Apr-2013 Tareq A. Siraj <tareq.a.sriaj@intel.com> Sema for Captured Statements

Add CapturedDecl to be the DeclContext for CapturedStmt, and perform semantic
analysis. Currently captures all variables by reference.

TODO: templates

Author: Ben Langmuir <ben.langmuir@intel.com>

Differential Revision: http://llvm-reviews.chandlerc.com/D433


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179618 91177308-0d34-0410-b5e6-96231b3b80d8
aptured-statements.c
7a92c8957df49250fbc6e02e76b18aac8ae1ecf1 16-Apr-2013 Jyotsna Verma <jverma@codeaurora.org> Remove setjmp.h header file from Sema/return.c test and include necessary
declarations explicitly in the test.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179604 91177308-0d34-0410-b5e6-96231b3b80d8
eturn.c
b004a8e5aa700108de2acc8f81b0dd2ec7518899 16-Apr-2013 Douglas Gregor <dgregor@apple.com> Fix PR4296: Add parser detection/error recovery for nested functions, from Serve Pavlov!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179603 91177308-0d34-0410-b5e6-96231b3b80d8
unction.c
236d9d16c9b42001085611a82d37b9d5a4f39c1f 16-Apr-2013 Douglas Gregor <dgregor@apple.com> Fix handling of atomic shift operations, from Serge Pavlov.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179600 91177308-0d34-0410-b5e6-96231b3b80d8
tomic-expr.c
df4cc0a0c75ff9d92ca501ecd40c5413b97506d6 15-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> Local thread_local variables are implicitly 'static'. (This doesn't apply to _Thread_local nor __thread.)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179517 91177308-0d34-0410-b5e6-96231b3b80d8
hread-specifier.c
b6b127f279f89d992e0713866f17fed267147a79 15-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> Properly check for a constant initializer for a thread-local variable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179516 91177308-0d34-0410-b5e6-96231b3b80d8
hread-specifier.c
6a570f610c101054e79af2fcdb73a10f8e3f337d 14-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> Diagnose if a __thread or _Thread_local variable has a non-constant initializer
or non-trivial destructor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179491 91177308-0d34-0410-b5e6-96231b3b80d8
hread-specifier.c
088831d0b9185b806ead7dc47865b0d1b1a1d164 14-Apr-2013 John McCall <rjmccall@apple.com> Handle incompatible redeclarations of library builtins better.
Invalid redeclarations of valid explicit declarations shouldn't
take the same path as redeclarations of implicit declarations,
and invalid local extern declarations shouldn't foul things up
for everybody else.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179482 91177308-0d34-0410-b5e6-96231b3b80d8
xtern-redecl.c
38afbc7361d861968232defaeaf8e302af75b5ee 13-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> Annotate flavor of TLS variable (statically or dynamically initialized) onto the AST.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179447 91177308-0d34-0410-b5e6-96231b3b80d8
hread-specifier.c
927b0af2f0834bad37e3d2a1953804b0845d8711 13-Apr-2013 John McCall <rjmccall@apple.com> Don't replace an existing decl in the scope chains with its
local-extern redeclaration; type refinements, default arguments,
etc. must all be locally scoped.

rdar://13535367

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179430 91177308-0d34-0410-b5e6-96231b3b80d8
xtern-redecl.c
unction-redecl.c
ar-redecl.c
ec64244f5939fa81596fbeddad966cca4b4a4c51 13-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> Parsing support for thread_local and _Thread_local. We give them the same
semantics as __thread for now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179424 91177308-0d34-0410-b5e6-96231b3b80d8
hread-specifier.c
1e8058f8d90fab1b9011adf62caa52e19e61382c 12-Apr-2013 Bob Wilson <bob.wilson@apple.com> Define Neon intrinsics as "static inline" to avoid warning. rdar://13108414

We had been defining Neon intrinsics as "static" with always_inline attributes.
If you use them from an extern inline function, you get a warning, e.g.:

static function 'vadd_u8' is used in an inline function with external linkage

This change simply adds the inline keyword to avoid that warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179406 91177308-0d34-0410-b5e6-96231b3b80d8
rm-neon-types.c
9adcf1c96cb18c99ff62aedb1aa41da3966d17b9 11-Apr-2013 Jyotsna Verma <jverma@codeaurora.org> Exclude test30 of Sema/return.c for Hexagon since setjmp.h include file
is unavailable for Hexagon.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179310 91177308-0d34-0410-b5e6-96231b3b80d8
eturn.c
8da488dc0bf10d0b6b8861653e8014f0d06fe322 10-Apr-2013 Richard Trieu <rtrieu@google.com> Remove outdated run lines from tests.

These run lines originally tested that the fix-its were properly applied.
Originally, the fixits were attached to warnings and were applied by -fixit.
Now, the fixits are attached to notes, so nothing happens. These run lines
still manage to pass since Clang will produce an empty output which gets piped
back to Clang. Then Clang produces no error on an empty input.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179131 91177308-0d34-0410-b5e6-96231b3b80d8
arentheses.c
arentheses.cpp
efac8da4cfa49799d5fdbc9d10b0e9f9a53ff6c8 07-Apr-2013 Benjamin Kramer <benny.kra@googlemail.com> Sema: Don't crash when trying to emit a warning for a duplicate value in an invalid enum.

Fixes PR15693. A null check on a pointer returned from cast<> is a very dubious
construct, do we have a checker for this somewhere?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178975 91177308-0d34-0410-b5e6-96231b3b80d8
arn-duplicate-enum.c
d613ac9c57936d219d9eecba1d061a45ff7a3ae8 04-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix 41 of the 61 tests which fail with modules enabled: we were computing and
caching the linkage for a declaration before we set up its redeclaration chain,
when determining whether a declaration could be a redeclaration of something
from an unimported submodule. We actually want to look at the declaration as if
it were not a redeclaration here, so compute the linkage but don't cache it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178733 91177308-0d34-0410-b5e6-96231b3b80d8
rivate-extern.c
74b9fa16e5d1e1a5f3adb065043db46ad20a4575 03-Apr-2013 Andy Gibbs <andyg1001@hotmail.co.uk> Enable use of _Static_assert inside structs and unions in C11 mode (as per C11 6.7.2.1p1).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178632 91177308-0d34-0410-b5e6-96231b3b80d8
tatic-assert.c
b421d926cdc632489915d39556f04c14f59d2392 02-Apr-2013 John McCall <rjmccall@apple.com> Add -Wstatic-local-in-inline, which warns about using a static local
variable in a C99 inline (but not static-inline or extern-inline)
function definition.

The standard doesn't actually say that this doesn't apply to
"extern inline" definitions, but that seems like a useful extension,
and it at least doesn't have the obvious flaw that a static
mutable variable in an externally-available definition does.

rdar://13535367

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178520 91177308-0d34-0410-b5e6-96231b3b80d8
nline.c
5b8740f840238b3616691e5b300df57a758f32a6 01-Apr-2013 John McCall <rjmccall@apple.com> Only merge down a variable type if the previous declaration was
visible. There's a lot of potential badness in how we're modelling
these things, but getting this much correct is reasonably easy.

rdar://13535367

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178488 91177308-0d34-0410-b5e6-96231b3b80d8
xtern-redecl.c
6d11877a226ce09dc0f7e767098f37255e2d3712 01-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> Add test for PR12527 (bug has apparently already been fixed).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178476 91177308-0d34-0410-b5e6-96231b3b80d8
tomic-ops.c
66dca6eaaa2e9c24023fc919ab72b8ae2df1e288 30-Mar-2013 Benjamin Kramer <benny.kra@googlemail.com> Sema: Don't crash when trying to emit a precedence warning on postinc/decrement.

Post-Inc can occur as a binary call (the infamous dummy int argument), but it's
not really a binary operator.

Fixes PR15628.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178412 91177308-0d34-0410-b5e6-96231b3b80d8
arentheses.cpp
52b2e7085f09bf7834b41f6e807aff5ac97bd3a5 29-Mar-2013 Benjamin Kramer <benny.kra@googlemail.com> Sema: Warn on sizeof on binary ops on decayed arrays.

The array will decay into a pointer, creating an unexpected result.
sizeof(array + int) is an easy to make typo for sizeof(array) + int.

This was motivated by a NetBSD security bug, used sizeof(key - r) instead of
sizeof(key) - r, reducing entropy in a random number generator.
http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/kern/subr_cprng.c.diff?r1=1.14&r2=1.15&only_with_tag=MAIN&f=h

Differential Revision: http://llvm-reviews.chandlerc.com/D571

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178371 91177308-0d34-0410-b5e6-96231b3b80d8
xpr-comma-c99.c
xpr-comma.c
arn-sizeof-array-decay.c
dff2be8ba441f5c61af8444479f7133b22dcfcf4 29-Mar-2013 Timur Iskhodzhanov <timurrrr@google.com> Revert r178273 as it broke the Linux bootstrap due to false positives

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178320 91177308-0d34-0410-b5e6-96231b3b80d8
onstant-conversion.c
59d8ccb45eeb33d255fd39933e75b45770a7a009 28-Mar-2013 Matt Beaumont-Gay <matthewbg@google.com> Warn about more than the first unused variable when -Werror is set.

To do this, thread DiagnosticErrorTrap's hasUnrecoverableErrorOccurred through
to Scope.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178294 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unused-variables-werror.c
25ffbef84450f0c666957a2d00cdf928c61b44d7 28-Mar-2013 Sam Panzer <espanz@gmail.com> Implemented a warning when an input several bitwise operations are
likely be implicitly truncated:

* All forms of Bitwise-and, bitwise-or, and integer multiplication.
* The assignment form of integer addition, subtraction, and exclusive-or
* The RHS of the comma operator
* The LHS of left shifts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178273 91177308-0d34-0410-b5e6-96231b3b80d8
onstant-conversion.c
eb82a53aaa7880b7d3fd733aeee38b9aeee919ba 28-Mar-2013 Richard Smith <richard-llvm@metafoo.co.uk> For -Wignored-qualifiers, don't warn on qualifiers which we acquire via a
typedef. Also don't warn on the _Atomic type specifier, just on the _Atomic
type qualifier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178218 91177308-0d34-0410-b5e6-96231b3b80d8
eturn.c
cbd739410be5ecd8161cab1caba54df8cf15b02d 28-Mar-2013 Bill Wendling <isanbard@gmail.com> Simplify test to use a count for the number of notes expected.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178196 91177308-0d34-0410-b5e6-96231b3b80d8
sm.c
3d91ddb9a97caf3e8950d4be6920ce8a4d308e76 27-Mar-2013 Tim Northover <Tim.Northover@arm.com> Add another expected note. Two errors => two notes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178143 91177308-0d34-0410-b5e6-96231b3b80d8
sm.c
f2ff5bdef011a060994afe84131b3134c5ffd8bc 27-Mar-2013 Bill Wendling <isanbard@gmail.com> Fix testcase to add expected note.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178122 91177308-0d34-0410-b5e6-96231b3b80d8
sm.c
14df23bd114919abc374b2bcd2b2e16b79936584 25-Mar-2013 Bill Wendling <isanbard@gmail.com> Emit an error message instead of crashing when dereferencing an incomplete pointer type.

If the ASM statement is dereferencing an incomplete pointer type, issue an error
instead of crashing.
<rdar://problem/12700799>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177915 91177308-0d34-0410-b5e6-96231b3b80d8
sm.c
b9da713efb4277753211590953f433723908aade 21-Mar-2013 John McCall <rjmccall@apple.com> Further weaken block conversion rules to permit blocks with
enum return type to be converted to blocks with any integer type
of the same size.

rdar://13463504

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177613 91177308-0d34-0410-b5e6-96231b3b80d8
lock-return.c
2aa5cf412c9a56aba1e3a7b04ca18499a2b83b20 19-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> documentation comment parsing. Added couple of
top-level HeaderDoc tags @functiongroup and
@methodgroup to doc. tags recognized.
// rdar://12379114


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177358 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.m
7132be1ef46248746990590b91e693dfc3cce251 19-Mar-2013 Richard Smith <richard-llvm@metafoo.co.uk> Diagnose uses of 'alignof' on functions in -pedantic mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177354 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
c7f811638f8603fa373d2be724e8b1c8ba51ad75 18-Mar-2013 Richard Smith <richard-llvm@metafoo.co.uk> Add missing diagnostic for a nested-name-specifier on a free-standing type definition. Bump some related diagnostics from warning to extension in C++, since they're errors there. Add some missing checks for function specifiers on non-function declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177335 91177308-0d34-0410-b5e6-96231b3b80d8
nonymous-struct-union.c
ecl-invalid.c
eclspec.c
truct-decl.c
7adf3a9f84688f334a1cd977317bb42f9e06c9f4 15-Mar-2013 Ted Kremenek <kremenek@apple.com> Enhance -Wtautological-constant-out-of-range-compare to include the name of the enum constant.

This is QoI. Fixes <rdar://problem/13076064>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177190 91177308-0d34-0410-b5e6-96231b3b80d8
ompare.c
a30bab4b5d421fb148a732da31621cffe51519ee 15-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> c: Also chek for integer overflow for '%' operator.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177163 91177308-0d34-0410-b5e6-96231b3b80d8
witch-1.c
2cd889d6d97db0cf73930873871aa4a542e84b89 15-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> c: add the missing binary operatory when checking
for integer overflow. // rdar://13423975


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177162 91177308-0d34-0410-b5e6-96231b3b80d8
witch-1.c
28c1cd2138f700742235e1e720c1f7e6dc75a11a 08-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> HeaderDoc: Support more of HeaderDoc documentation
commands; top level tags such as @interface and
their 2nd level tags such as @coclass, etc.
// rdar://12379114


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176667 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
arn-documentation.m
26facface1884eeadf305277479fe020e9b5983c 06-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> Spell Objective-C correctly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176563 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.m
88f070f99f7f352e294eed212fdf7a23c0815fe2 06-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> say objective-C in the warning and streamline
several diagnostics into one. // rdar://13094352


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176560 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.m
99a7057098c56211e641705e1ff38d4b7c8b309d 05-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> doc. parsing. Improve on diagnostics on my last patch.
// rdar://13094352.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176525 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
arn-documentation.m
bca9788dbaf5fcf241efdc82ddcda712cb22214e 05-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> doc parsing. Add @method and @callback for
checkings and few other refactoring/cleanup.
// rdar://13094352.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176509 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
arn-documentation.m
2a268f2629b49958427e8eb02f2c3d565be71acc 05-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> doc parsing. We want to issue a strong warning when
an @function comment is not followed by a function decl.
// rdar://13094352


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176468 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
8cc9c9d2235b7ac45c480de49eb5a1d10dba4154 04-Mar-2013 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing tests: move a test into a group of similar tests


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176449 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
c9320095d0126a104552ae718af461ad53316a34 04-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> [comment parsing] source fidelity for tparam command too.
// rdar://13066276


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176448 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
151b2ac8c84fe751871dcdb041efec655fab70eb 04-Mar-2013 Dmitri Gribenko <gribozavr@gmail.com> warn-documentation.cpp: reorganize tests

Tests are ordered by command in this file. It is nice to keep it that way.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176445 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
66f6c24146efccc9ad7e37dbd2bd0ea1844e6422 04-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> comment parsing. Missed a case of referring
to original command in diagnostic. // rdar://13066276


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176444 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
c98e9130bcddd0258c110d30749edd2284087e3d 01-Mar-2013 Fariborz Jahanian <fjahanian@apple.com> comment parsing. Keep the original command format
in AST for source fidelity and use it in diagnostics
to refer to the original format. // rdar://13066276


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176387 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
664e860beb2550bef24fb8946192f61648a71d7f 27-Feb-2013 Fariborz Jahanian <fjahanian@apple.com> comment parsing: Properties are considered like methods, and people
think of them as having return values that may be computed. Don't
warn when using @return in their comment. // rdar://13189938


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176147 91177308-0d34-0410-b5e6-96231b3b80d8
owarn-documentation-property.m
34b0adb52f1528fb03313bdd5fd73632c11fc678 26-Feb-2013 Matt Arsenault <Matthew.Arsenault@amd.com> Fix assertion failure when a field is given an address space.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176122 91177308-0d34-0410-b5e6-96231b3b80d8
ddress_spaces.c
9016bb771265a10f188c76342254badecc695253 26-Feb-2013 Matt Beaumont-Gay <matthewbg@google.com> Warn on dropping the return value from a warn_unused_result function, even in
macros.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176114 91177308-0d34-0410-b5e6-96231b3b80d8
nused-expr.c
745af1c348191bf31cfcd3ae61443a0321ec2d75 22-Feb-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> In LookupResult::resolveKind(), when handling multiple found declarations, ignore invalid declarations.

This reduces the "ambiguous reference" errors (which are rather strange in C/ObjC) and fixes an assertion hit
with an invalid code test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175869 91177308-0d34-0410-b5e6-96231b3b80d8
nvalid-decl.c
d5668a2447c2afeea38815b51a80a5a6ac235599 22-Feb-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> When a parameter list in a C function has an error, recover by forming a K&R function,
instead of a non-function type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175868 91177308-0d34-0410-b5e6-96231b3b80d8
lloc_size.c
nvalid-decl.c
28965bfa833926fd908a902cf2373d07c47b9067 22-Feb-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't crash when applying an alloc_size attribute on a K&R function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175867 91177308-0d34-0410-b5e6-96231b3b80d8
lloc_size.c
b83a5d8fb2306e3ef5c6a5c2af0bf52a824f2149 22-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix typo 'with with' in diagnostic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175823 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-regparm.c
90a7820de7685cec75fcd47e98f0f9623c0f0477 20-Feb-2013 Jordan Rose <jordan_rose@apple.com> Revert "intmax_t is long long on Darwin, not long."

'long' and 'long long' are different for the purposes of mangling.
This caused <rdar://problem/13254874>.

This reverts commit c2f994d31ec85e9af811af38eb1b28709aef0b2c.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175681 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-size_t.c
a905c4fd256396b589013304d9793cc199b8a0c6 20-Feb-2013 Jordan Rose <jordan_rose@apple.com> intmax_t is long long on Darwin, not long.

<rdar://problem/11540697>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175588 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-size_t.c
d4c3d66be70ae2d0bd828329022dc428cc277a1c 20-Feb-2013 John McCall <rjmccall@apple.com> Add a new 'type_visibility' attribute to allow users to
control the visibility of a type for the purposes of RTTI
and template argument restrictions independently of how
visibility propagates to its non-type member declarations.

Also fix r175326 to not ignore template argument visibility
on a template explicit instantiation when a member has
an explicit attribute but the instantiation does not.

The type_visibility work is rdar://11880378

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175587 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-visibility.c
6a93c86fc73d84a40d3460be04444669c8439e20 18-Feb-2013 Tim Northover <Tim.Northover@arm.com> AArch64: add atomic support parameters to TargetInfo

This allows Clang to detect and deal wih __atomic_* operations properly on
AArch64. Previously we produced an error when encountering them at high
optimisation levels.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175438 91177308-0d34-0410-b5e6-96231b3b80d8
tomic-ops.c
3285c78041f80a26f6a947e2922e15c4af6e00bb 15-Feb-2013 Enea Zaffanella <zaffanella@cs.unipr.it> Fixed diagnostic nondeterministic order bug (pr14901).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175289 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-det-order.c
3c86a5c2f60d4f68afde96e2138b6933b30d6aa8 12-Feb-2013 Nick Lewycky <nicholas@mxc.ca> The meat of this patch is in BuildCXXMemberCalLExpr where we make it use
MarkMemberReferenced instead of marking functions referenced directly. An audit
of callers to MarkFunctionReferenced and DiagnoseUseOfDecl also caused a few
other changes:
* don't mark functions odr-used when considering them for an initialization
sequence. Do mark them referenced though.
* the function nominated by the cleanup attribute should be diagnosed.
* operator new/delete should be diagnosed when building a 'new' expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174951 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-cleanup.c
b30c0382022abc891f1c6586b80db14550442d25 07-Feb-2013 Chad Rosier <mcrosier@apple.com> Testcase for r174477.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174640 91177308-0d34-0410-b5e6-96231b3b80d8
nvalid-cast.cpp
5024bf501a03bc9423476cb976bc4029dd9a56f5 07-Feb-2013 Tim Northover <Tim.Northover@arm.com> Add AArch64 wchar definition to test

This should allow it to pass if the default triple is AArch64

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174620 91177308-0d34-0410-b5e6-96231b3b80d8
char.c
eb54aa584dbe19c0f7c4a9a0010815a85423858b 06-Feb-2013 Ted Kremenek <kremenek@apple.com> Remove unneeded test. We have plenty of subgroup relations between warnings,
and for those we care about we should have a general way of testing them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174531 91177308-0d34-0410-b5e6-96231b3b80d8
ncompatible-pointer-types-error.c
5846720f08a6b225484bfe663599c2b057a99bc8 05-Feb-2013 Ted Kremenek <kremenek@apple.com> Change subexpressions to be visited in the CFG from left-to-right.

This is a more natural order of evaluation, and it is very important
for visualization in the static analyzer. Within Xcode, the arrows
will not jump from right to left, which looks very visually jarring.
It also provides a more natural location for dataflow-based diagnostics.

Along the way, we found a case in the analyzer diagnostics where we
needed to indicate that a variable was "captured" by a block.

-fsyntax-only timings on sqlite3.c show no visible performance change,
although this is just one test case.

Fixes <rdar://problem/13016513>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174447 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unreachable.c
3fa3feab35096b608f1d79bb541798b37a55e7b9 02-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> PR15132: Replace "address expression must be an lvalue or a function
designator" diagnostic with more correct and more human-friendly "cannot take
address of rvalue of type 'T'".

For the case of & &T::f, provide a custom diagnostic, rather than unhelpfully
saying "cannot take address of rvalue of type '<overloaded function type>'".

For the case of &array_temporary, treat it just like a class temporary
(including allowing it as an extension); the existing diagnostic wording
for the class temporary case works fine.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174262 91177308-0d34-0410-b5e6-96231b3b80d8
omplex-imag.c
xpr-address-of.c
arargs.c
5f838aa9c82c22b6ed2a0cb090969a706c8a1775 01-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix diagnostic for bad alignas use: it can't be applied to functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174160 91177308-0d34-0410-b5e6-96231b3b80d8
lignas.c
be507b6e72df8ab5e7d8c31eb4453e1bdf5fcfaf 01-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> Implement [dcl.align]p5 and C11 6.7.5/4: alignas cannot underalign.
Also support alignas(0), which C++11 and C11 require us to ignore.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174157 91177308-0d34-0410-b5e6-96231b3b80d8
lignas.c
a31f65b10e61ca8f2f427b1df176c10ea8a0efa2 01-Feb-2013 Michael Han <fragmentshaders@gmail.com> [Sema][Attr]Fix alignment attribute printing.

Remove "IsMSDeclspec" argument from Align attribute since the arguments in Attr.td should
only model those appear in source code. Introduce attribute Accessor, and teach TableGen
to generate syntax kind accessors for Align attribute, and use those accessors to decide
if an alignment attribute is a declspec attribute.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174133 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-print.c
f843a580c4a54ca147f22422ee8ccfd2347784fc 01-Feb-2013 Fariborz Jahanian <fjahanian@apple.com> [Comment parsing] Add support for recognizing
\headerfile command and representing it in an xml
document. Patch reviewed by Dmitri Gribenko.
// rdar://12397511


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174109 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
e8d411997899a87e1a9f63ad3f52b38e7931687c 31-Jan-2013 Richard Trieu <rtrieu@google.com> Add indents to AST dumping and removed parenthesis from AST nodes.
Indents were given the color blue when outputting with color.
AST dumping now looks like this:

Node
|-Node
| `-Node
`-Node
`-Node

Compared to the previous:

(Node
(Node
(Node))
(Node
(Node)))



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174022 91177308-0d34-0410-b5e6-96231b3b80d8
mplicit-cast-dump.c
e1ac4aec0d30d2d81876e555017e727cc374ff5e 30-Jan-2013 Tim Northover <Tim.Northover@arm.com> Also promote fp16 types to double when they're anonymous variadic arguments.

__fp16 isn't covered by the standard, but this resolves the oddity that float
gets promoted when passed variadically, but not the smaller type. This is
required by the AArch64 ABI, and a sane action elsewhere.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173918 91177308-0d34-0410-b5e6-96231b3b80d8
ariadic-promotion.c
e6738d81680aa9bb94ab386d29d4118fed01673d 30-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix test failure from previous change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173899 91177308-0d34-0410-b5e6-96231b3b80d8
arn-main.c
7586a6e6b7d79d4be031d2d0d6a35d5996cd0db9 30-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Semantic analysis and CodeGen support for C11's _Noreturn. This is modeled as
an attribute for consistency with our other noreturn mechanisms.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173898 91177308-0d34-0410-b5e6-96231b3b80d8
eturn-noreturn.c
7adf4179f827b14b025135829dadeaa2442e1d42 30-Jan-2013 Fariborz Jahanian <fjahanian@apple.com> c: When checking on validity of sizeof passed as size of
argument to be memset, check for its type to be complete
before calling Context.getTypeSize(PointeeTy) to prevent
crash. // rdar://13081751.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173872 91177308-0d34-0410-b5e6-96231b3b80d8
emset-invalid-1.c
e702ff302bdb3c53a252b0bcd2deab72fdee274f 29-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Test update missed in r173789.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173790 91177308-0d34-0410-b5e6-96231b3b80d8
lignas.c
d03de6aaa312d57dcd6e2bc76bed1e89f5c5019d 29-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Downgrade 'attribute ignored when parsing type' from error to warning, to match
the diagnostic's warn_ name. Switch some places (notably C++11 attributes)
which really wanted an error over to a different diagnostic. Finally, suppress
the diagnostic entirely for __ptr32, __ptr64 and __w64, to avoid producing
diagnostics in important system headers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173788 91177308-0d34-0410-b5e6-96231b3b80d8
allingconv.c
ypes.c
4cd81c5bf5957b2b10ddf253035f6e1596082108 29-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Implement C++11 [dcl.align]p1 and C11 6.7.5/2 rules for alignas and _Alignas.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173779 91177308-0d34-0410-b5e6-96231b3b80d8
lignas.c
cae4a5ca43323eb861d702f880a6c62dd5ef4fc5 29-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Test that we print MS keyword attributes without a __declspec(...) adornment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173754 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-print.c
5cd532ca0bc1cb8110e24586d064f72332d8b767 29-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Replace AS_MSTypespec with AS_Keyword, for representing any attribute spelled
as a keyword. Rationalize existing attributes to use it as appropriate, and to
not lie about some __declspec attributes being GNU attributes. In passing,
remove a gross hack which was discarding attributes which we could handle. This
results in us actually respecting the __pascal keyword again.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173746 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-print.c
d1e5c0df2acb01192eedda14534fe990e1e26c46 27-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: attach any tag type's documentation to its typedef if latter
does not have one of its own. // rdar://13067629

Original patch (r173586 and r173587) by Fariborz Jahanian, modified by me.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173626 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
10442564e1ba3c4dfb184cc4e36beffbee4811c3 26-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: actually check for a block command after "\param x"

This fixes PR15068.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173539 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
909df54cc33153fb9f90c135d032722a19ce809c 25-Jan-2013 Fariborz Jahanian <fjahanian@apple.com> Add space after ';'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173462 91177308-0d34-0410-b5e6-96231b3b80d8
witch-1.c
78c28be6873965cce4026bbebef18c6224b5287d 25-Jan-2013 Fariborz Jahanian <fjahanian@apple.com> Improve diagnsotic further on integer overflow.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173461 91177308-0d34-0410-b5e6-96231b3b80d8
witch-1.c
a7972a08e0fb16e5e7e8364ab6fc8889debf18ab 25-Jan-2013 Fariborz Jahanian <fjahanian@apple.com> Fixes text of diagnostics in integer overflow patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173388 91177308-0d34-0410-b5e6-96231b3b80d8
witch-1.c
ad48a500596d7d678b99c7f94326cfa856c3b49f 24-Jan-2013 Fariborz Jahanian <fjahanian@apple.com> Patch to check for integer overflow. It has been
commented on and approved by Richard Smith.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173377 91177308-0d34-0410-b5e6-96231b3b80d8
witch-1.c
c7629d941557f7179eb8fa8a2e2a74d749cbaf7c 24-Jan-2013 Jordan Rose <jordan_rose@apple.com> Handle universal character names and Unicode characters outside of literals.

This is a missing piece for C99 conformance.

This patch handles UCNs by adding a '\\' case to LexTokenInternal and
LexIdentifier -- if we see a backslash, we tentatively try to read in a UCN.
If the UCN is not syntactically well-formed, we fall back to the old
treatment: a backslash followed by an identifier beginning with 'u' (or 'U').

Because the spelling of an identifier with UCNs still has the UCN in it, we
need to convert that to UTF-8 in Preprocessor::LookUpIdentifierInfo.

Of course, valid code that does *not* use UCNs will see only a very minimal
performance hit (checks after each identifier for non-ASCII characters,
checks when converting raw_identifiers to identifiers that they do not
contain UCNs, and checks when getting the spelling of an identifier that it
does not contain a UCN).

This patch also adds basic support for actual UTF-8 in the source. This is
treated almost exactly the same as UCNs except that we consider stray
Unicode characters to be mistakes and offer a fixit to remove them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173369 91177308-0d34-0410-b5e6-96231b3b80d8
cn-identifiers.c
5209e2bc4d18e679dcacfd6f6a0120aa1d4a757f 24-Jan-2013 Jordan Rose <jordan_rose@apple.com> Unify diagnostics for \x, \u, and \U without any following hex digits.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173368 91177308-0d34-0410-b5e6-96231b3b80d8
cn-cstring.c
8b3326527eb83fbab624a7173acd0d6813dc5845 24-Jan-2013 Chad Rosier <mcrosier@apple.com> Fail these tests in a way that doesn't cause unexpected successes, per Daniel's
suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173367 91177308-0d34-0410-b5e6-96231b3b80d8
s-inline-asm.c
872a6f6bfecf462a7cb1f124e2f5ee31c7a7e39d 24-Jan-2013 Chad Rosier <mcrosier@apple.com> Temporarily XFAIL this test; the compiler will segfault if the target-specific
parser is not included in the compiler. Thanks to Renato for discovering the
underlying issue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173365 91177308-0d34-0410-b5e6-96231b3b80d8
s-inline-asm.c
ae07378ff9bf4af9bdd97a4607437ace4c32b7e7 24-Jan-2013 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Add an error when trying to compile MS-style inline assembly
for an unsupported architecture.
rdar://13063988

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173364 91177308-0d34-0410-b5e6-96231b3b80d8
s-inline-asm-invalid-arch.c
51d8c52ad36129760eaa586f85176037e2cd0d0e 24-Jan-2013 Michael Han <fragmentshaders@gmail.com> PR14922: when printing an attribute, use the real syntax of the attribute (GNU, C++11, MS Declspec) instead of hardcoded GNU syntax.

Introduce a spelling index to Attr class, which is an index into the attribute spelling list of an attribute defined in Attr.td.
This index will determine the actual spelling used by an attribute, as it incorporates both the syntax and naming of the attribute.
When constructing an attribute AST node, the spelling index is computed based on attribute kind, scope (if it's a C++11 attribute), and
name, then passed to Attr that will use the index to print itself.

Thanks to Richard Smith for the idea and review.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173358 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-print.c
ec07557a1e43ca0e7d0b6af0e69e18caaf1f0635 24-Jan-2013 Joey Gouly <joey.gouly@arm.com> Properly remove this test file, that I copied over to test/SemaOpenCL in r173352.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173353 91177308-0d34-0410-b5e6-96231b3b80d8
hiftOpenCL.cl
630f4bb9f12e330438281c4e46deb6656620b73a 23-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> Implement -Wvla correctly

GCC implements -Wvla as "warn on every VLA" (this is useful to find every VLA,
for example, if they are forbidden by coding guidelines). Currently Clang
implements -Wvla as "warn on VLA when it is an extension".

The attached patch makes our behavior match GCC. The existing vla extwarn is
moved under -Wvla-extension and is still included into -Wgnu.

This fixes PR5953.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173286 91177308-0d34-0410-b5e6-96231b3b80d8
arn-vla.c
b2e2157f905b0b6e27f1d3f5e1f38778c6731813 22-Jan-2013 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Remove the -fenable-experimental-ms-inline-asm flag. MS-style
inline assembly can be enable with -fasm-blocks or -fms-extensions alone.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173186 91177308-0d34-0410-b5e6-96231b3b80d8
s-inline-asm.c
d6ec47363870cefac1c8d136a5011abbf3a4a786 22-Jan-2013 Ted Kremenek <kremenek@apple.com> Split "discards qualifiers" warnings of -Wincompatible-pointer-types into subgroup.

This allows users to promote -Wincompatible-pointer-type warnings to
errors but keep those for "discard qualifiers" as warnings (if they
so desire).

Addresses <rdar://problem/13062738>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173184 91177308-0d34-0410-b5e6-96231b3b80d8
ncompatible-pointer-types-error.c
445743dec72f675070d4789c348607cd8cbf6090 21-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> Add a fixit for _Noreturn main,
add tests for fixits removing static and inline from main


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173024 91177308-0d34-0410-b5e6-96231b3b80d8
arn-main.c
96bd14bf5833e26db0744fb94cfc85b2a67ae5c5 18-Jan-2013 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Test case for r172773.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172774 91177308-0d34-0410-b5e6-96231b3b80d8
s-inline-asm.c
cdbe1e0d85d7d32452dd1c52758d7bfaa1c0663b 17-Jan-2013 Jordan Rose <jordan_rose@apple.com> Format strings: don't ever convert %+d to %lu.

Presumably, if the printf format has the sign explicitly requested, the user
wants to treat the data as signed.

This is a fix-up for r172739, and also includes several test changes that
didn't make it into that commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172762 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-fixit.c
de03c15ad92b44a4be11507ca2501bb9dd014dce 17-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> Parsing support for C11's _Noreturn keyword. No semantics yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172761 91177308-0d34-0410-b5e6-96231b3b80d8
eturn-noreturn.c
205ecf01939d6e9c903f0e1d51455b2d882d076b 17-Jan-2013 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Updates and test case for r172743.
Part of rdar://12576868

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172744 91177308-0d34-0410-b5e6-96231b3b80d8
s-inline-asm.c
87b73ba920f523ef13f2420cbdb958a281aa6f33 17-Jan-2013 Matt Beaumont-Gay <matthewbg@google.com> Suppress all -Wunused-value warnings from macro body expansions.

This is inspired by a number of false positives in real code, including
PR14968. I've added test cases reduced from these false positives to
test/Sema/unused-expr.c, as well as corresponding test cases that pass the
offending expressions as arguments to a no-op macro to ensure that we do warn
there.

This also removes my previous tweak from r166522/r166534, so that we warn on
unused cast expressions in macro arguments.

There were several test cases that were using -Wunused-value to test general
diagnostic emission features; I changed those to use other warnings or warn on
a macro argument expression. I stared at the test case for PR14399 for a while
with Richard Smith and we believe the new test case exercises the same
codepaths as before.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172696 91177308-0d34-0410-b5e6-96231b3b80d8
nused-expr.c
a6f97071338e525d18e607ca286e338639dd2a5e 17-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> Implement a fixit for -Wmain-return-type


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172684 91177308-0d34-0410-b5e6-96231b3b80d8
nu89.c
arn-main-return-type.c
2a5bb509e2d33a0f7aa4bb0ba53c73b5dfdd6bb4 17-Jan-2013 Rafael Espindola <rafael.espindola@gmail.com> Check for internal weak decls after merging.

This fixes pr14946. The problem was that the linkage computation was done too
early, so things like "extern int a;" would be given external linkage, even if
a previous declaration was static.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172667 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-weak.c
7dfd18275259df609f8574a25302fc73a000aa64 16-Jan-2013 Reed Kotler <rkotler@mips.com> First step in implementation of mips16 and nomips16 attributes.
Waiting for new llvm attribute code for the next step.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172626 91177308-0d34-0410-b5e6-96231b3b80d8
ips16_attr_allowed.c
ips16_attr_not_allowed.c
d147f8fa3ef5dbebd1f24b72e52dedaebeaaa4b5 12-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> Add a comment to test to clarify the intention here

Comment is taken from the commit message of r151080, by Jean-Daniel Dupas


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172332 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
c3cd6f7a5d33ad44f6c9cf4faa7046c77baa128e 12-Jan-2013 Matt Beaumont-Gay <matthewbg@google.com> Fix -Wunused-comparison for comparisons in arguments to function-like macros.

Previously, -Wunused-comparison ignored comparisons in both macro bodies and
macro arguments, but we would still emit a -Wunused-value warning for either.
Now we correctly emit -Wunused-comparison for expressions in macro arguments.

Also, add isMacroBodyExpansion to SourceManager, to go along with
isMacroArgExpansion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172279 91177308-0d34-0410-b5e6-96231b3b80d8
nused-expr-system-header.c
294ddc63398f2c9435fcfbdb4da4ac3a23c1cbba 11-Jan-2013 Rafael Espindola <rafael.espindola@gmail.com> Reject incompatible redeclarations of extern C symbols.

Before we were only checking if the new declaration itself was marked extern
C. Fixes prpr14766.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172243 91177308-0d34-0410-b5e6-96231b3b80d8
unction-redecl.c
4d8efb48b9de9feee79c948ef9d05febd6d0c20b 11-Jan-2013 Fariborz Jahanian <fjahanian@apple.com> Improve diagnostic per Richard's suggestion
(which may yet change if we move the diagnostic
outside case value).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172242 91177308-0d34-0410-b5e6-96231b3b80d8
witch-1.c
f6e65cc9a654d54411c43fd014e911a407ad4075 10-Jan-2013 Fariborz Jahanian <fjahanian@apple.com> Provide a better warning when case value overflows.
// rdar://11577384


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172102 91177308-0d34-0410-b5e6-96231b3b80d8
witch-1.c
a18e70b25c85d7e653e642b5e6e58d6063af3d83 10-Jan-2013 Fariborz Jahanian <fjahanian@apple.com> Issue warning when case value is too large to fit
in case condition type. // rdar://11577384.
Test is conditionalized on x86_64-apple triple as
I am not sure if the INT_MAX/LONG_MAX values in the test
will pass this test for other hosts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172016 91177308-0d34-0410-b5e6-96231b3b80d8
witch-1.c
d130fd2e141f1fef412c2d58e7385370801bd718 08-Jan-2013 Rafael Espindola <rafael.espindola@gmail.com> Clear LV cache when dropping availability attributes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171906 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-availability.c
8c4222adbc0fd22928e751be6a75328fc9283a72 08-Jan-2013 Rafael Espindola <rafael.espindola@gmail.com> Don't crash when trying to apply the availability attribute to a block.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171899 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-availability.c
d63b19ea855a66df8c58764604d48497c48829d9 08-Jan-2013 Rafael Espindola <rafael.espindola@gmail.com> Clear the LV cache when merging the availability attribute.

The availability implies default visibility, so it can change the computed
visibility.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171840 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-availability.c
cbb99efceb3a2c27ba2382df97f3b69c75974f94 08-Jan-2013 Ted Kremenek <kremenek@apple.com> Don't warn about undefined varargs argument behavior in unreachable code.

Fixes <rdar://problem/12322000>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171831 91177308-0d34-0410-b5e6-96231b3b80d8
arargs_unreachable.c
8e721b714a92de803000c65fb8a57a1d8a810322 07-Jan-2013 Rafael Espindola <rafael.espindola@gmail.com> Add support for attribute((mode(unwind_word))).
Patch by Nick Lewycky. Fixes pr8703.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171781 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-mode.c
7a83421776416d6a9044fb03b5b02208b47646c1 07-Jan-2013 David Tweed <david.tweed@arm.com> Scalar shifts in the OpenCL specification (as of v. 1.2) are defined to be
with respect to the lower "left-hand-side bitwidth" bits, even when negative);
see OpenCL spec 6.3j. This patch both implements this behaviour in the code
generator and "constant folding" bits of Sema, and also prevents tests
to detect undefinedness in terms of the weaker C99 or C++ specifications
from being applied.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171755 91177308-0d34-0410-b5e6-96231b3b80d8
hiftOpenCL.cl
c792d6d0b39cd6926be28ccb925992204d1af0e1 04-Jan-2013 Rafael Espindola <rafael.espindola@gmail.com> Unqualify the parameter type.
This fixes a regression from 168895.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171519 91177308-0d34-0410-b5e6-96231b3b80d8
mplicit-cast-dump.c
ee3d9f0be3d2080abb1cf76d7d327a044791b22a 02-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> Type safety attributes: add tests for enumerations (users are actually doing
this, ensure we don't regress)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171412 91177308-0d34-0410-b5e6-96231b3b80d8
arn-type-safety-mpi-hdf5.c
9b403c555a294530305f40dfee859b73070de542 28-Dec-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR14729: Fix typo in CheckICE for BinaryConditionalOperators.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171191 91177308-0d34-0410-b5e6-96231b3b80d8
-c-e.c
38980086c0f791e8c23cc882574f18e5b4a87db6 25-Dec-2012 Guy Benyei <guy.benyei@intel.com> Add intel_ocl_bicc calling convention as a function attribute to clang. The calling convention is already implemented in LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171056 91177308-0d34-0410-b5e6-96231b3b80d8
allingconv.c
a734a0eab27678262bea07786b6ff30d5c7a6356 22-Dec-2012 Ted Kremenek <kremenek@apple.com> Add back -Wduplicate-enum which I mistakenly removed.

This was removed with -Wunique-enum, which is still removed. The
corresponding thread on cfe-comments for that warning is here:

http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-September/024224.html

If we get specific user feedback for -Wduplicate-enum we can evaluate
whether or not to keep it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170974 91177308-0d34-0410-b5e6-96231b3b80d8
arn-duplicate-enum.c
ca57ccdf480fc002202c74011bdf14687f164a5a 19-Dec-2012 Dmitri Gribenko <gribozavr@gmail.com> Fix PR14591: Windows newlines in doxygen comments cause failed assertion in
TextDiagnostic

Patch by Janusz Chorko.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170566 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation-crlf.c
8bfb700a3ddcfffc32d97ad8a6565563e249d3ee 18-Dec-2012 Bill Wendling <isanbard@gmail.com> Add tests to check recent changes to some builtins.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170458 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.c
8a0086cfd21e5a89f96715d7a504178c5fc0ca26 18-Dec-2012 Anders Carlsson <andersca@mac.com> When warning about a missing prototype because a function declaration is missing 'void', insert a fixit to add the void.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170399 91177308-0d34-0410-b5e6-96231b3b80d8
arn-missing-prototypes.c
372df4548267ce5d6ecf1da68902f0d793271a4f 17-Dec-2012 Rafael Espindola <rafael.espindola@gmail.com> Fix isThisDeclarationADefinition for extern following tentative.

An extern declaration following a tentative definition should not itself be
considered a tentative definition.
Fixes pr14614.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170377 91177308-0d34-0410-b5e6-96231b3b80d8
xtern-redecl.c
9b629fcb8b2606886ed30630f8a896a8bf606518 12-Dec-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Test case for r170037.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170038 91177308-0d34-0410-b5e6-96231b3b80d8
s-inline-asm.c
15490fd42d7d8dca2f9b5b3a9dc074892ca1acd7 05-Dec-2012 Chad Rosier <mcrosier@apple.com> [driver, ms-inline asm] MS-Style inline assembly is controlled by the
-fasm-blocks flag, not the -fms-extensions flag.
rdar://12808010

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169422 91177308-0d34-0410-b5e6-96231b3b80d8
s-inline-asm.c
8b8a09e496fbed361d4c8e9e8cc259454a094258 29-Nov-2012 Rafael Espindola <rafael.espindola@gmail.com> Merge function types in C.

Among other differences, GCC accepts

typedef int IA[];
typedef int A10[10];
static A10 *f(void);
static IA *f(void);
void g(void) {
(void)sizeof(*f());
}

but clang used to reject it with:

invalid application of 'sizeof' to an incomplete type 'IA' (aka 'int []')

The intention of c99's 6.2.7 seems to be that we should use the composite type
and accept as gcc does.

Doing the type merging required some extra fixes:
* Use the type from the function type in initializations, even if an parameter
is available.
* Fix the merging of the noreturn attribute in function types.
* Make CodeGen handle the fact that an parameter type can be different from
the corresponding type in the function type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168895 91177308-0d34-0410-b5e6-96231b3b80d8
erge-decls.c
84268904947ada7e251932a6f5b0f4364df7a2c7 29-Nov-2012 Richard Smith <richard-llvm@metafoo.co.uk> Reject uses of __int128 on platforms that don't support it. Also move the ugly
'getPointerWidth(0) >= 64' test to be a method on TargetInfo, ready to be
properly cleaned up.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168856 91177308-0d34-0410-b5e6-96231b3b80d8
28bitint.c
55f6c336b132b4b9bbbda070bb0f9ee8b03a6ed3 27-Nov-2012 Eli Friedman <eli.friedman@gmail.com> Test for r168674.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168675 91177308-0d34-0410-b5e6-96231b3b80d8
id_t.c
ec351f169dd608e566018829f4441ea18688ef38 27-Nov-2012 Rafael Espindola <rafael.espindola@gmail.com> Add a testcase that r168411 would break.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168669 91177308-0d34-0410-b5e6-96231b3b80d8
erge-decls.c
4875bf2dc8e4ac99863c4756857e553e02090b48 23-Nov-2012 Rafael Espindola <rafael.espindola@gmail.com> Check that we don't warn on this testcase. This is basically a test that
Decl::isUsed checks the attribute. If the function had a body just the check
is DeclMustBeEmitted would be sufficient.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168514 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-used.c
bf823c09124def7057d6cfd13db0e16ac44af6fe 18-Nov-2012 NAKAMURA Takumi <geek4civic@gmail.com> clang/test/Sema/warn-documentation.cpp: Try to fix up the testcase in r168277.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168278 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
36cbbe916f66f08d36492e75809fbf54416a5e8d 18-Nov-2012 Dmitri Gribenko <gribozavr@gmail.com> Documentation parsing: propely handle a lone '\endverbatim' and emit a warning.

We actually used to assert on this.

Thanks to NAKAMURA Takumi for noticing this!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168277 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
97f8461a2c553f68a258612d2322e4281c3f0915 17-Nov-2012 Andy Gibbs <andyg1001@hotmail.co.uk> Made the "expected string literal" diagnostic more expressive

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168267 91177308-0d34-0410-b5e6-96231b3b80d8
tatic-assert.c
5b64e77c2d51ca3e9313ed4107d3c4d927895cd6 15-Nov-2012 Eli Friedman <eli.friedman@gmail.com> Fix a trivial bool-related bug I spotted while skimming David Fang's
current list of powerpc-darwin8 failures.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168016 91177308-0d34-0410-b5e6-96231b3b80d8
pc-bool.c
383ec17ecaac9ac4fce2747640623274a139badf 12-Nov-2012 David Blaikie <dblaikie@gmail.com> Correct printing of nested anonymous type member accesses.

Patch by Florent Bruneau!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167736 91177308-0d34-0410-b5e6-96231b3b80d8
st-print.c
ef7bceadf4b43c953855013577afac4c2fcb1d62 08-Nov-2012 Benjamin Kramer <benny.kra@googlemail.com> Set TLSSupported to false on Haiku.

Haiku does not support this (yet). Leaving it set to true leads to
configure scripts detecting __thread being available and Clang emitting
code for it, resulting in binaries the runtime_loader will refuse to
load.

Patch by Jonathan Schleifer!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167576 91177308-0d34-0410-b5e6-96231b3b80d8
ls.c
5a24980d059cd9fbe8375a4c549313101ad20698 03-Nov-2012 Dmitri Gribenko <gribozavr@gmail.com> Handle CK_NullToPointer casts in -Wtype-safety properly. Fixes PR14249.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167358 91177308-0d34-0410-b5e6-96231b3b80d8
arn-type-safety-mpi-hdf5.c
arn-type-safety.c
arn-type-safety.cpp
80a8eb76a0043271adcfee5cb1e643ce3927fcbf 02-Nov-2012 Eli Friedman <eli.friedman@gmail.com> Tweak wording and add diagnostic groups to misc diagnostics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167274 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.c
ast-to-union.c
xprs.c
aee56faf90c04a75d9c432a92a8fdd2c875559a7 02-Nov-2012 Quentin Colombet <qcolombet@apple.com> Update the front end to use minsize attribute

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167266 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-minsize.c
0adc4d29d64107bd82016dd5adc023c5b6c89302 26-Oct-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Add test case for r166792.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166793 91177308-0d34-0410-b5e6-96231b3b80d8
s-inline-asm.c
dd6e106621992978e6eb928a502379f934f2a8e9 26-Oct-2012 David Tweed <david.tweed@arm.com> These tests require an actual x86 registered target, so mark them as such. Tested on ARM.

Patch by Joey Gouly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166765 91177308-0d34-0410-b5e6-96231b3b80d8
s-inline-asm.c
681b89826f960f1069c89a51cd7090cda73f31b7 26-Oct-2012 Bill Wendling <isanbard@gmail.com> Fix grammar-o.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166759 91177308-0d34-0410-b5e6-96231b3b80d8
einous-extensions-on.c
6c8b6498bed5f378018285c42b367dc2e06a98cd 24-Oct-2012 Eli Friedman <eli.friedman@gmail.com> Add an additional test for namespaces and -Wmissing-variable-declarations. Move C++ test into SemaCXX.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166616 91177308-0d34-0410-b5e6-96231b3b80d8
arn-missing-variable-declarations.cpp
6d919fb67bf6aa3db09608fb2948b558977c6929 24-Oct-2012 Matt Beaumont-Gay <matthewbg@google.com> Address feedback from Eli Friedman on r166522.

In particular, we do want to warn on some unused cast subexpressions within
macros.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166534 91177308-0d34-0410-b5e6-96231b3b80d8
nused-expr.c
c7db84d0146a6f22b19949fb0128e2148aa92467 24-Oct-2012 Matt Beaumont-Gay <matthewbg@google.com> Don't emit -Wunused-value warnings from macro expansions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166522 91177308-0d34-0410-b5e6-96231b3b80d8
nused-expr.c
2e2d03c70274bba1fa762e123842994238f68f41 23-Oct-2012 Eli Friedman <eli.friedman@gmail.com> Delete junk that snuck into r166498.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166499 91177308-0d34-0410-b5e6-96231b3b80d8
arn-missing-variable-declarations.c
e4851f26eb7be1f71f919bb5890da7e3583f727d 23-Oct-2012 Eli Friedman <eli.friedman@gmail.com> Add a new warning -Wmissing-variable-declarations, to warn about variables
defined without a previous declaration. This is similar to
-Wmissing-prototypes, but for variables instead of functions.

Patch by Ed Schouten.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166498 91177308-0d34-0410-b5e6-96231b3b80d8
arn-missing-variable-declarations.c
arn-missing-variable-declarations.cpp
5f1385b81b0a6c6878ff1e35118a5b0bf52ca930 23-Oct-2012 Eli Friedman <eli.friedman@gmail.com> [ms-inline-asm] Add handling for errors coming out of the backend.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166463 91177308-0d34-0410-b5e6-96231b3b80d8
s-inline-asm.c
5f531a489774ce46370fcb005a51d46d511f7914 19-Oct-2012 David Blaikie <dblaikie@gmail.com> Clarify wording of -Wshift-op-parentheses.

Suggestion from Matt Beaumont-Gay reviewing r165283.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166296 91177308-0d34-0410-b5e6-96231b3b80d8
arentheses.cpp
8e8fb3be5bd78f0564444eca02b404566a5f3b5d 19-Oct-2012 Andy Gibbs <andyg1001@hotmail.co.uk> Prior to adding the new "expected-no-diagnostics" directive to VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166280 91177308-0d34-0410-b5e6-96231b3b80d8
R2727.c
R2728.c
R2923.c
ddress-constant.c
lign-arm-apcs.c
lign-x86-64.c
lign-x86.c
rg-scope-c99.c
rg-scope.c
rm-layout.c
ssign-null.c
itfield-layout.c
itfield-promote.c
lock-storageclass.c
uiltin_objc_msgSend.c
uiltins-decl.c
heck-increment.c
omplex-promotion.c
onst-eval-64.c
onst-ptr-int-ptr-cast.c
onstant-builtins.c
arwin-align-cast.c
num-packed.c
xpr-comma-c99.c
xpr-comma.c
ormat-string-percentm.c
mplicit-builtin-freestanding.c
nit-struct-qualified.c
nit-vector.c
nt-arith-convert.c
nr-variadic-def.c
any-logical-ops.c
ember-reference.c
ms-bitfields.c
s_wide_predefined_expr.cpp
verloaded-func-transparent-union.c
ragma-align-mac68k.c
ragma-align-packed.c
ragma-pack-2.c
ragma-pack-3.c
ragma-pack-4.c
ragma-pack-5.c
ragma-pack-6.c
eturn-silent.c
hort-enums.c
truct-cast.c
truct-packed-align.c
urpress-deprecated.c
ransparent-union-pointer.c
ypedef-prototype.c
nnamed-bitfield-init.c
a_arg_x86_64.c
ariadic-block.c
fprintf-valid-redecl.c
arn-gnu-designators.c
eak-import-on-enum.c
4a529d26d6ccfc9b3d11031f1256f4f87055c562 19-Oct-2012 Andy Gibbs <andyg1001@hotmail.co.uk> Fix directive parsing in VerifyDiagnosticConsumer so that it ensures that "expected" is at the start of the word and will no longer accept typos such as "junkexpected-*" as a valid "expected-*" directive. A very few test-cases had to be amended to adhere to the new rule.

Patch reviewed by David Blaikie.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166279 91177308-0d34-0410-b5e6-96231b3b80d8
ompound-literal.c
ector-cast.c
263366f9241366f29ba65b703120f302490c39ff 17-Oct-2012 Derek Schuff <dschuff@google.com> Add pnaclcall convention to Native Client targets.

Because PNaCl bitcode must be target-independent, it uses some
different bitcode representations from other targets (e.g. byval and
sret for structures). This means that without additional type
information, it cannot meet some native ABI requirements for some
targets (e.g. passing structures containing unions by value on
x86-64). To allow generation of code which uses the correct native
ABIs, we also support triples such as x86_64-nacl, which uses
target-dependent IR (as opposed to le32-nacl, which uses byval and
sret).

To allow interoperation between the two types of code, this patch adds
a calling convention attribute to be used in code compiled with the
target-dependent triple, which will generate code using the le32-style
bitcode. This calling convention does not need to be explicitly
supported in the backend because it determines bitcode representation
rather than native conventions (the backend just needs to undersand
how to handle byval and sret for the Native Client OS).

This patch implements __attribute__((pnaclcall)) to generate calls in
bitcode according to the le32 bitcode conventions, an attribute which
is accepted by any Native Client target, but issues a warning
otherwise.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166065 91177308-0d34-0410-b5e6-96231b3b80d8
allingconv.c
9b29f4fe3d0600edf6ba00d48f2d4f2b1984f247 16-Oct-2012 David Blaikie <dblaikie@gmail.com> Implement GCC's -Wint-to-pointer-cast.

This implementation doesn't warn on anything that GCC doesn't warn on with the
exception of templates specializations (GCC doesn't warn, Clang does). The
specific skipped cases (boolean, constant expressions, enums) are open for
debate/adjustment if anyone wants to demonstrate that GCC is being overly
conservative here. The only really obvious false positive I found was in the
Clang regression suite's MPI test - apparently MPI uses specific flag values in
pointer constants. (eg: #define FOO (void*)~0)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166039 91177308-0d34-0410-b5e6-96231b3b80d8
lock-return.c
ast.c
-c-e.c
5f608aedb6c5d32d2f7c51f9354a75b21f1eeaee 13-Oct-2012 Eli Friedman <eli.friedman@gmail.com> Make -mms-bitfields behave consistently.

Patch by Jeremiah Zanin.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165849 91177308-0d34-0410-b5e6-96231b3b80d8
ms-bitfields.c
ragma-ms_struct.c
eae5a820bced67465c8517793a1602dfaeed8a06 10-Oct-2012 Logan Chien <tzuhsiang.chien@gmail.com> Fix PR 11709: Change the definition of va_list to meet AAPCS requirement

AAPCS ABI Section 7.1.4 [1] specifies that va_list
should be defined as struct __va_list { void *__ap;};
And in C++, it is defined in namespace std.

[1] http://infocenter.arm.com/help/topic
/com.arm.doc.ihi0042d/IHI0042D_aapcs.pdf

Patch by Weiming Zhao.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165609 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins-arm.c
3ef38eea7ce400718e4ab523b4704ae1fd8f940f 09-Oct-2012 Eli Friedman <eli.friedman@gmail.com> Make sure we allow "#pragma options align=mac68k" in function-local contexts. <rdar://problem/12453134>



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165462 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-align-mac68k.c
6b34c176994aaa781eff6cd8755a48cfb109e809 08-Oct-2012 David Blaikie <dblaikie@gmail.com> Use a single note diagnostic for all the precedent/parentheses warnings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165384 91177308-0d34-0410-b5e6-96231b3b80d8
arentheses.c
d190057934331390ff67ebf51d66186dd5e392f0 06-Oct-2012 Benjamin Kramer <benny.kra@googlemail.com> Expose __builtin_bswap16.

GCC has always supported this on PowerPC and 4.8 supports it on all platforms,
so it's a good idea to expose it in clang too. LLVM supports this on all targets.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165362 91177308-0d34-0410-b5e6-96231b3b80d8
onstant-builtins-2.c
onstant-builtins.c
54db3244f425dae51cde7c6298ec42d0764f8ed8 05-Oct-2012 Aaron Ballman <aaron@aaronballman.com> Changing line endings from Windows to Unix. No functional changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165329 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftCompatibility-x86.c
tdcall-fastcall-x64.c
b3f55c5728aaf0d28579e67db3dd34c2934e7805 05-Oct-2012 David Blaikie <dblaikie@gmail.com> Implement -Wshift-op-parentheses for: a << b + c

This appears to be consistent with GCC's implementation of the same warning
under -Wparentheses. Suppressing a << b + c for cases where 'a' is a user
defined type for compatibility with C++ stream IO. Otherwise suggest
parentheses around the addition or subtraction subexpression.

(this came up when MSVC was complaining (incorrectly, so far as I can tell)
about a perceived violation of this within the LLVM codebase, PR14001)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165283 91177308-0d34-0410-b5e6-96231b3b80d8
arentheses.cpp
9595c7e2533c836537dc300e75d059c29feb7094 04-Oct-2012 Eli Friedman <eli.friedman@gmail.com> Permanently end the whole "pragma got handled by the parser too early"
mess by handling all pragmas which the parser touches uniformly.
<rdar://problem/12248901>, etc.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165195 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-pack-and-options-align.c
d44e43e46f81cc83b8f1e4384724a9923426bb2a 02-Oct-2012 Aaron Ballman <aaron@aaronballman.com> Splitting this test case into two because the behavior for the calling convention code is target-specific.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165016 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftCompatibility-x86.c
icrosoftCompatibility.c
82bfa19fe3be324b13fdbcda46304b52c500f0d4 02-Oct-2012 Aaron Ballman <aaron@aaronballman.com> Allowing individual targets to determine whether a given calling convention is allowed or ignored with warning. This allows for correct name mangling for x64 targets on Windows, which in turn allows for linking against the Win32 APIs.

Fixes PR13782

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165015 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftCompatibility-x64.c
icrosoftCompatibility.c
allingconv.c
tdcall-fastcall-x64.c
tdcall-fastcall.c
faab5618b5beed350d7444de97cf513ef1a42ca6 01-Oct-2012 Fariborz Jahanian <fjahanian@apple.com> availability in structured documents. Takes
care of comments by Dimitri and Doug.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164957 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-availability-macosx.c
ttr-availability.c
1952354bd376062c3ab3d328c0fc6c36530c9309 29-Sep-2012 Dmitri Gribenko <gribozavr@gmail.com> Move the 'find macro by spelling' infrastructure to the Preprocessor class and
use it to suggest appropriate macro for __attribute__((deprecated)) in
-Wdocumentation-deprecated-sync.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164892 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation-fixits.cpp
70d38f3179251bb3e7253a52bf54f8fa2314590a 28-Sep-2012 Richard Smith <richard-llvm@metafoo.co.uk> Allow __builtin_bswap32/64 in constant expressions, like gcc does. Patch by Tijl Coosemans!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164841 91177308-0d34-0410-b5e6-96231b3b80d8
onstant-builtins-2.c
onstant-builtins.c
c888133119dece5f3a60a1f02a8a3c3916898206 26-Sep-2012 Nico Weber <nicolasweber@gmx.de> Make this test actually test something

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164677 91177308-0d34-0410-b5e6-96231b3b80d8
o-format-y2k-turnsoff-format.c
4c6d6dc793b95c1712333d8393c98ba15c7bdd97 25-Sep-2012 Hans Wennborg <hans@hanshq.net> Fix failing test/Sema/wchar.c on ARM.

Currently Sema/wchar.c fails because WCHAR_T_TYPE is defined as int,
however on ARM wchar_t is unsigned int.

This patch changes that, so this test passes for ARM.

Patch by Joey Gouly!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164598 91177308-0d34-0410-b5e6-96231b3b80d8
char.c
b0f6b9c94077446ceb29167add2e87fb99733a55 24-Sep-2012 Bob Wilson <bob.wilson@apple.com> Replace an assertion with an error for empty __asm statements.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164551 91177308-0d34-0410-b5e6-96231b3b80d8
s-inline-asm.c
e3b136bd873508c9ac0ee6eba98c2a810a177eba 24-Sep-2012 Dmitri Gribenko <gribozavr@gmail.com> Change the wording of the extension warning from
> 'long long' is an extension when C99 mode is not enabled
to
> 'long long' is a C++11 extension
while compiling in C++98 mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164545 91177308-0d34-0410-b5e6-96231b3b80d8
89-2.c
89.c
0bd9838751384181ff387f2fb346896792b89617 22-Sep-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment sema: warn when comment has \deprecated but declaration does not have a
deprecation attribute ('deprecated', 'availability' or 'unavailable').

This warning is under a separate flag, -Wdocumentation-deprecated-sync, so it
can be turned off easily while leaving other -Wdocumentation warnings on.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164467 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation-fixits.cpp
arn-documentation.cpp
2ad11cd666f8e80463b5fd155072633f8e1283a4 22-Sep-2012 Abramo Bagnara <abramo.bagnara@bugseng.com> Avoid multiple atomic builtin declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164454 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.c
a193f20916f0e0e5a3b0f76ca69e2b3870c1a325 20-Sep-2012 Fariborz Jahanian <fjahanian@apple.com> Improvements to my patch in r164143 per
Richard's comments. // rdar://12202422


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164316 91177308-0d34-0410-b5e6-96231b3b80d8
ompare.c
utof-range-constant-compare.c
a405b2523b8857e0ba7e6374648b14f618879f33 20-Sep-2012 David Blaikie <dblaikie@gmail.com> Include types when a definition's type differs from a prior declaration.

This is some really old code (took me a while to find the test cases) & the
diagnostic text is slightly incorrect (it should really only apply to
re/declarations/, redefinitions are an error regardless of whether the types
match). Not sure if anyone cares about it, though.

For now this just makes the diagnostic more clear in less obvious cases where
the type of a declaration might not be explicitly written (eg: because it
uses decltype)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164313 91177308-0d34-0410-b5e6-96231b3b80d8
ypes.c
561e3c68864d11f39a07a6d1711ce08d2739a263 20-Sep-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR13881: Add -Wzero-length-array for zero length array extension, and move it into -Wgnu.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164272 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
15a9356464f0809e1cb24aa3a7cc2577914ff5bb 18-Sep-2012 Fariborz Jahanian <fjahanian@apple.com> c: warn when an integer value comparison with an
integral expression have the obvious result.
Patch reviewed by John McCall off line.
// rdar://12202422


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164143 91177308-0d34-0410-b5e6-96231b3b80d8
ompare.c
utof-range-constant-compare.c
43f8c40b05482894d94a8779a5ccd0f9a35420f3 18-Sep-2012 Ted Kremenek <kremenek@apple.com> Per discussion on cfe-dev, remove -Wunique-enums entirely. There
is no compelling argument that this is a generally useful warning,
and imposes a strong stylistic argument on code beyond what it was
intended to find warnings in.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164083 91177308-0d34-0410-b5e6-96231b3b80d8
arn-duplicate-enum.c
ec504e0d677594fe975e29b25d6d47be54038baf 15-Sep-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: don't treat typedef to a typedef to a function as a
'function-like' type that can be annotated with \param.

Thanks to Eli Friedman for noticing!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163985 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
bc57b108b2253e26b83768dba196c28564952f18 15-Sep-2012 Richard Smith <richard-llvm@metafoo.co.uk> const _Atomic(T) is not an atomic type, so do not allow it as the type 'A' in
C11 7.17's atomic operations. GNU's __atomic_* builtins do allow const-qualified
atomics, though (!!) so don't restrict those.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163964 91177308-0d34-0410-b5e6-96231b3b80d8
tomic-ops.c
388a594cd04aae78be452f6eacb9ca6be239c1f8 14-Sep-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: support the "\invariant" command.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163905 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
abcf0dccc9cd4c802f4e7797bf452c6808d2226f 13-Sep-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: handle \deprecated command. It is a block command, but it
should be fine to use it without further explanations in the attached
paragraph, so the warning about empty paragraph was turned off for it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163836 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
670941c28c0683ecc251dafdf093a71629625dc9 13-Sep-2012 Jordan Rose <jordan_rose@apple.com> Format strings: offer a fixit for Darwin's %D/%U/%O to ISO %d/%u/%o.

<rdar://problem/12061922>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163772 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-darwin.c
275b6f52c7bcafc1f3cf291813b5c60ee776965a 13-Sep-2012 Jordan Rose <jordan_rose@apple.com> Format strings: %D, %U, and %O are valid on Darwin (same as %d, %u, %o).

These will warn under -Wformat-non-iso, and will still be rejected
outright on other platforms.

<rdar://problem/12061922>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163771 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-darwin.c
b774d73540ba62a5e6a8e9217b320b27a946cfad 12-Sep-2012 NAKAMURA Takumi <geek4civic@gmail.com> clang/test: [PR8833] Introduce the feature "LP64" to suppress LLP64-incompatible tests.

I think some of them could be rewritten to fit also LLP64.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163699 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
ompound-literal.c
44ca53f34deb5efe9fc6f246781f66f1ed83eabc 12-Sep-2012 Ted Kremenek <kremenek@apple.com> Teach -Wuninitialized to recognize __attribute__((analyzer_noreturn))
for halting the propagation of uninitialized value tracking along
a path. Unlike __attribute__((noreturn)), this attribute (which
is used by clients of the static analyzer) can be used to annotate
functions that essentially never return, but in rare cares may be
allowed to return for (special) debugging purposes. This attribute
has been shown in reducing false positives in the static analyzer
by pruning false postives, and is equally applicable here.

Handling this attribute in the CFG itself is another option, but
this is not something all clients (e.g., possibly -Wunreachable-code)
would want to see.

Addresses <rdar://problem/12281583>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163681 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
b0b8a96df25660cbdbf35d23c3ff5887c33f82f9 11-Sep-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: handle non-builtin commands correctly. After semantic
analysis registers a command, it becomes a "known" command for the lexer, since
it has an ID. Having this freedom of choice to register a command is a good
thing since BriefParser does not need this.

But the parser should still invoke the correct semantic analysis method
(actOnUnknownCommand) in this case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163646 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
eb3546eb1d9f43c9b5ed79bbc43d1ee6ebdddc5f 08-Sep-2012 NAKAMURA Takumi <geek4civic@gmail.com> clang/test/Sema/format-strings-scanf.c: Relax a couple of expressions with expected-warning-re to let matched for Win32 targets.

- format specifies type 'wchar_t **' (aka 'int **') but the argument has type 'float *'
- format specifies type 'wchar_t **' (aka 'unsigned short **') but the argument has type 'float *'

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163468 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-scanf.c
8be066e6733364cd34f25c4f7b7344f72aa23369 08-Sep-2012 Jordan Rose <jordan_rose@apple.com> Format strings: suggest %lld instead of %qd and %Ld with -Wformat-non-iso.

As a corollary to the previous commit, even when an extension is
available, we can still offer a fixit to the standard modifier.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163453 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-non-iso.c
ormat-strings.c
bbb6bb4952b77e57b842b4d3096848123ae690e7 08-Sep-2012 Jordan Rose <jordan_rose@apple.com> Format strings: %Ld isn't available on Darwin or Windows.

This seems to be a GNU libc extension; we offer a fixit to %lld on
these platforms.

<rdar://problem/11518237>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163452 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-gnu.c
ormat-strings-non-iso.c
ormat-strings-scanf.c
ormat-strings.c
2d40d9e3bd6638399260332d8c7a98ac715f7b0d 06-Sep-2012 Fariborz Jahanian <fjahanian@apple.com> c: make __attribute__((unused)) transitive.
Don't warn if annotated decl is used inside another
unused. // rdar://12233989


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163329 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unused-function.c
37c765a5ccf69fb9a467c8499675ae568811afe3 05-Sep-2012 Fariborz Jahanian <fjahanian@apple.com> c error recovery. treat an invalid redeclaration
of a c-function for what it is. Otherwise, this func
is treated as an overloadable c-function resulting in
a crash much later. // rdar://11743706


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163224 91177308-0d34-0410-b5e6-96231b3b80d8
nvalid-decl.c
9f6419f96d6cad3f7bd39f444cfc784ccbbdcd65 30-Aug-2012 Richard Trieu <rtrieu@google.com> Add -Wduplicate-enum warning. Clang will emit this warning when an implicitly
initiated enum constant has the same value as another enum constant.

For instance:
enum test { A, B, C = -1, D, E = 1 };
Clang will warn that:
A and D both have value 0
B and E both have value 1

A few exceptions are made to keep the noise down. Enum constants which are
initialized to another enum constant, or an enum constant plus or minus 1 will
not trigger this warning. Also, anonymous enums are not checked.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162938 91177308-0d34-0410-b5e6-96231b3b80d8
arn-duplicate-enum.c
c586d5dd7a997321ea96d1d28213315f86778fc8 30-Aug-2012 Eli Friedman <eli.friedman@gmail.com> Fix a crash in type merging with enum types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162886 91177308-0d34-0410-b5e6-96231b3b80d8
unction-redecl.c
0f87dd74fe1f4fc2bafe16f708500d68ed04d442 29-Aug-2012 Hans Wennborg <hans@hanshq.net> Move the test for PR13720 from Sema/init.c to Sema/thread-specifier.c.

Can't use __thread in init.c because it doesn't have a triple.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162836 91177308-0d34-0410-b5e6-96231b3b80d8
nit.c
hread-specifier.c
ae7a66f44edebe14d0499d790e91e3ef57e1f70e 29-Aug-2012 Hans Wennborg <hans@hanshq.net> The address of a TLS var is not compile-time constant (PR13720)

This makes Clang produce an error for code such as:

__thread int x;
int *p = &x;

The lvalue of a thread-local variable cannot be evaluated at compile
time.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162835 91177308-0d34-0410-b5e6-96231b3b80d8
nit.c
02e221bad95aada3190fa6189e38023cba27bc72 28-Aug-2012 Rafael Espindola <rafael.espindola@gmail.com> Fix for assertion when solving unresolved templates.
Patch by Magee, Josh.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162737 91177308-0d34-0410-b5e6-96231b3b80d8
emplate-specialization.cpp
9edd2c8a2ff6c6326ff2d5b081929e4baaa798ed 24-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment diagnostics: for unresolved parameters, do not suggest parameter fixit
with parameter that is documented.

Fixes PR13670, <rdar://problem/12155840>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162570 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
arn-documentation.m
3d1125b27e8006385a830f5b3748b7b44d227b4c 24-Aug-2012 Ted Kremenek <kremenek@apple.com> Teach CFG that 'if (x & 0)' and 'if (x * 0)' is an unfeasible branch.

Fixes <rdar://problem/11005770>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162545 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unreachable.c
70ff1091315c60fed68d7197c637ec8c588e67a1 24-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment semantic analysis: treat function typedefs as functions so that one can
use \param and \returns in documentation.

Fixes PR13533.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162507 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
arn-documentation.m
834a5bd311b4a32f89937ca5b6dd2b4111891859 23-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: parse "<blah" as an HTML tag only if "blah" is a known tag
name. This should reduce the amount of warning false positives about bad HTML
in comments when the comment author intended to put a reference to a template.
This change will also enable us parse the comment as intended in these cases.

Fixes part 1 of PR13374.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162407 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
767a1a2391e60e358ed7d793e091cc1731a5e186 17-Aug-2012 Fariborz Jahanian <fjahanian@apple.com> c: privide deprecated warning when __private_extern__ storage
specifier is unsed in a declaration; as it may not make the symbol
local to linkage unit as intended. Suggest using "hidden" visibility
attribute instead. // rdar://7703982


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162138 91177308-0d34-0410-b5e6-96231b3b80d8
sm.c
ttr-used.c
rivate-extern.c
entative-decls.c
hread-specifier.c
66400c4f913ebcba3ccfc9f10647b4ce8e29c1f7 17-Aug-2012 Fariborz Jahanian <fjahanian@apple.com> make this test case 64bit test. It fails due to
'int' vs. 'long' issue with i386.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162125 91177308-0d34-0410-b5e6-96231b3b80d8
arn-bad-function-cast.c
bbb8afd7f0bdac635583e07c72a9fcf905aa7c4c 17-Aug-2012 Fariborz Jahanian <fjahanian@apple.com> c: implement gcc's -Wbad-function-cast which warns
on unsafe cast of a c-function call. This is
a C-only option.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162109 91177308-0d34-0410-b5e6-96231b3b80d8
arn-bad-function-cast.c
d6bbc98fe4690f31904f306c61090404843466fe 17-Aug-2012 Benjamin Kramer <benny.kra@googlemail.com> Define __builtin_ffs[ll] with a signed argument instead of unsigned.

GCC documents these as unsigned, but defines them as signed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162106 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins-decl.c
0d5a069f66df09b3308ccfdce84a88170034c657 17-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Add support for "type safety" attributes that allow checking that 'void *'
function arguments and arguments for variadic functions are of a particular
type which is determined by some other argument to the same function call.

Usecases include:
* MPI library implementations, where these attributes enable checking that
buffer type matches the passed MPI_Datatype;
* for HDF5 library there is a similar usecase as MPI;
* checking types of variadic functions' arguments for functions like
fcntl() and ioctl().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162067 91177308-0d34-0410-b5e6-96231b3b80d8
28bitint.c
arn-type-safety-mpi-hdf5.c
arn-type-safety.c
arn-type-safety.cpp
a0dfca1f030b06c7f547238f63bfedc969994fcc 17-Aug-2012 Eric Christopher <echristo@apple.com> Add a missing 'break' to ensure that we reject inline assembly
constraints we don't recognize.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162064 91177308-0d34-0410-b5e6-96231b3b80d8
rm-asm.c
1599eac40a3b28de0824013dc2fb90551dfa01b0 16-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Attaching comments to declarations: parse the comment in context of the
declaration it was attached to.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162033 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
99570a58b09fca5d0b328733ab8b6717a1a04f4a 15-Aug-2012 Matt Beaumont-Gay <matthewbg@google.com> Allow 'static' and type qualifiers in K&R parameter type lists.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161980 91177308-0d34-0410-b5e6-96231b3b80d8
tatic-array.c
4cc83c2b0aed5ab06081ea3250426c3a7e58df93 15-Aug-2012 Fariborz Jahanian <fjahanian@apple.com> Patch to warn about __private_extern__ on tentative definitions
as it does something unexpected (but gcc compatible).
Suggest use of __attribute__((visibility("hidden")))
on declaration instead. // rdar://7703982


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161972 91177308-0d34-0410-b5e6-96231b3b80d8
entative-decls.c
7f397c5d97fc0c11333d939f2c07bc3b230956e2 15-Aug-2012 Hans Wennborg <hans@hanshq.net> Check for improper use of 'static' and type qualifiers in array
declarators.

They are only allowed for function parameters, and then only on the
outermost array type derivation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161934 91177308-0d34-0410-b5e6-96231b3b80d8
tatic-array.c
c41ace950dcf2254c9aa48e73647b89c35109f80 14-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Attaching comments to redeclarations: fix wrong assumptions

The reason for the recent fallout for "attaching comments to any redeclaration"
change are two false assumptions:
(1) a RawComment is attached to a single decl (not true for 'typedef struct X *Y'
where we want the comment to be attached to both X and Y);
(2) the whole redeclaration chain has only a single comment (obviously false, the
user can put a separate comment for each redeclaration).

To fix (1) I revert the part of the recent change where a 'Decl*' member was
introduced to RawComment. Now ASTContext has a separate DenseMap for mapping
'Decl*' to 'FullComment*'.

To fix (2) I just removed the test with this assumption. We might not parse
every comment in redecl chain if we already parsed at least one.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161878 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
fac8e43390fad67a5d02c9876e860496fee01868 14-Aug-2012 Benjamin Kramer <benny.kra@googlemail.com> Fix horribly broken sema of __attribute__((pcs())).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161863 91177308-0d34-0410-b5e6-96231b3b80d8
allingconv.c
10caec2600089449b58c065d56fc449d095b4536 13-Aug-2012 Fariborz Jahanian <fjahanian@apple.com> c: small refactoring of checking for __attribute__(const))
per Richard's comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161786 91177308-0d34-0410-b5e6-96231b3b80d8
nline.c
nused-expr.c
a7846852ba8b2b53664a674a41d116e0419d8768 13-Aug-2012 Fariborz Jahanian <fjahanian@apple.com> c: make __has_attribute(const) work for const
function attribute. // rdar://10253857


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161767 91177308-0d34-0410-b5e6-96231b3b80d8
nline.c
nused-expr.c
cd81df2dcff4e13eea6edfbfd52a4458d978d174 13-Aug-2012 Douglas Gregor <dgregor@apple.com> When looking for the comment associated with a declaration, adjust the
'templated' declaration for a function or class template to refer to
the function or class template itself, to which the documentation will
be attached. Fixes PR13593.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161762 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
f66a0dda541cd859a928193efba6dc5d7ba8fe54 09-Aug-2012 Eli Friedman <eli.friedman@gmail.com> Handle deprecation diagnostics correctly for C struct fields and Objective-C properties/ivars. <rdar://problem/6642337>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161534 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-deprecated.c
c3b2308f66fe8abd2c1a911b500c0b989c295819 08-Aug-2012 Eli Friedman <eli.friedman@gmail.com> Unify the codepaths for emitting deprecation warnings. The test changes are just to account for us emitting notes more consistently.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161528 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
ttr-deprecated-message.c
ttr-deprecated.c
ttr-unavailable-message.c
ypeof-use-deprecated.c
0f38acee92014cb15af980808f87144e5564031d 08-Aug-2012 Anna Zaks <ganna@apple.com> Address code review comments for Wstrncat-size warning (r161440).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161527 91177308-0d34-0410-b5e6-96231b3b80d8
arn-strncat-size.c
2016c8c4a2ebf528c54c42045bc6a30ae590147c 08-Aug-2012 Eli Friedman <eli.friedman@gmail.com> Don't add attributes for "#pragma pack" and friends to tag declarations which
are not definitions. This follows the behavior of both gcc and earlier
versions of clang. Regression from r156531. <rdar://problem/12048621>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161523 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-pack-6.c
06808f1b880f461c396450db4c6a9c6d6c6c2efc 08-Aug-2012 Eli Friedman <eli.friedman@gmail.com> Get rid of an early return in Sema::ActOnFields which doesn't make sense anymore.
Fixes a crash (<rdar://problem/11067144>), and generally seems to improve
recovery in other cases.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161474 91177308-0d34-0410-b5e6-96231b3b80d8
nvalid-decl.c
f303d4cb10648ac9c2080ae7c9dd507ba615e3a7 07-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> libclang API for comment-to-xml conversion.

The implementation also includes a Relax NG schema and tests for the schema
itself. The schema is used in c-index-test to verify that XML documents we
produce are valid. In order to do the validation, we add an optional libxml2
dependency for c-index-test.

Credits for CMake part go to Doug Gregor. Credits for Autoconf part go to Eric
Christopher. Thanks!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161431 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
f7158fa034174d2756736d1032b75d01d9deeb4c 07-Aug-2012 Hans Wennborg <hans@hanshq.net> Properly check length modfiers for %n in format strings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161408 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-scanf.c
ormat-strings-size_t.c
ormat-strings.c
58e1e54476d610d6c33ef483f216ed8a1282d35c 07-Aug-2012 Hans Wennborg <hans@hanshq.net> Remove ScanfArgType and bake that logic into ArgType.

This is useful for example for %n in printf, which expects
a pointer to int with the same logic for checking as %d
would have in scanf.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161407 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-scanf.c
9443c57150e870e308406e1e4e6d9d64712b417e 06-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment diagnostics: warn on duplicate \brief and \return commands.

Doxygen manual claims that multiple \brief or \returns commands will be merged
together, but actual behavior is different (second \brief command becomes a
part of a discussion, second \returns becomes a "Returns: blah" paragraph on
its own). Anyway, it seems to be a bad idea to use multiple \brief or \returns
commands in a single command.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161325 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
arn-documentation.m
88815f3f81361692dd281000e3e46bf163b2f28b 06-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment diagnostics: \return in void function: specialize diagnostic text for
ObjC methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161324 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
arn-documentation.m
89ab7d0012ffe02a335b765eeb9b48977a5ecd79 03-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment diagnostics: warn if \returns is used in a non-function comment or if
the function returns void.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161261 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
967e5d7ebb775a93f9c200d19d557d18bf945f10 02-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Comments: handle template paramter documentation in alias-declaration
templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161215 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
c27bc80a98b9558513b50956c930eedc9e461ae0 02-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Attaching comments to declarations: handle using-declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161211 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
bbf9e3a3e2e52c8abfa920b3ba69b533dc7ab8ef 02-Aug-2012 Hans Wennborg <hans@hanshq.net> test/Sema/tls.c: don't use -verify to check if TLS is supported

Use "%clang_cc1" vs "not %clang_cc1" instead.
Also use -fsyntax-only.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161165 91177308-0d34-0410-b5e6-96231b3b80d8
ls.c
ac87cec246a5ef07acbee715a7c50bbd48b91a54 02-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment diagnostics fixit tests: move exected-warning constructs from the
comment being tested.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161144 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation-fixits.cpp
b7a1199081a59213492fdba794b796bcba500664 02-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment diagnostics: add tests for \tparam fixits.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161142 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation-fixits.c
arn-documentation-fixits.cpp
e48667f2ca71842fa000e9fddd241309a611578b 01-Aug-2012 Hans Wennborg <hans@hanshq.net> TLS is not supported on OpenBSD

This fixes PR13502 and adds a test to keep track of which
targets support TLS and which do not.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161124 91177308-0d34-0410-b5e6-96231b3b80d8
ls.c
96b098674908eaa59a9128f3305cda6fbbdad563 01-Aug-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: add support for \tparam command on all levels.

The only caveat is renumbering CXCommentKind enum for aesthetic reasons -- this
breaks libclang binary compatibility, but should not be a problem since API is
so new.

This also fixes PR13372 as a side-effect.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161087 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
5deddafd3ef51e94b4ac4d80e38271d3768b1af6 31-Jul-2012 Hans Wennborg <hans@hanshq.net> -Wformat: better handling of qualifiers on pointer arguments

Warn about using pointers to const-qualified types as arguments to
scanf. Ignore the volatile qualifier when checking if types match.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161052 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-scanf.c
ormat-strings.c
78a1b196cc6854a29c0ff2d6ea5f5643be6040c6 30-Jul-2012 Matt Beaumont-Gay <matthewbg@google.com> Do not warn on correct use of the '%n' format specifier.

While '%n' can be used for evil in an attacker-controlled format string, there
isn't any acute danger in using it in a literal format string with an argument
of the appropriate type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160984 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
e5deb79d0e7f1c81fdc9ae89ed5a4edc9a589581 30-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment parser: don't crash on a completely empty \param followed by a block
command


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160975 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
cec9ce49dcf4b4b768043f96c8ef8c1d4cdbb6b9 30-Jul-2012 Hans Wennborg <hans@hanshq.net> Make -Wformat check the argument type for %n.

This makes Clang check that the corresponding argument for "%n" in a
format string is a pointer to int.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160966 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-scanf.c
ormat-strings.c
4684778993c667246039b4664acbce59dc99440c 27-Jul-2012 Hans Wennborg <hans@hanshq.net> Make -Wformat walk the typedef chain when looking for size_t, etc.

Clang's -Wformat fix-its currently suggest using "%zu" for values of
type size_t (in C99 or C++11 mode). However, for a type such as
std::vector<T>::size_type, it does not notice that type is actually
typedeffed to size_t, and instead suggests a format for the underlying
type, such as "%lu" or "%u".

This commit makes the format string fix mechanism walk the typedef chain
so that it notices if the type is size_t, even if that isn't "at the
top".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160886 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-fixit.c
34653184b0dbd9423215b8324b23c260ab7efa2e 25-Jul-2012 Ted Kremenek <kremenek@apple.com> Turn -Wobjc-root-class on by default. <rdar://problem/11203649>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160707 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.m
arn-self-assign-field.mm
2e7210458d391159b121edb77e3b7f35b69f4f68 24-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing tests: fix test


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160700 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
b43f63822e051f2d28d8e083b688b2f113d6ba9c 24-Jul-2012 Jordan Rose <jordan_rose@apple.com> Add __has_feature(attribute_availability_with_message).

This tests for the ability to include a "message" field in availability
attributes, like so:

extern void ATSFontGetName(const char *oName)
__attribute__((availability(macosx,introduced=8.0,deprecated=9.0,
message="use CTFontCopyFullName")));

This was actually supported in Clang 3.1, but we got a request for a
__has_feature so that header files can use this more safely. It's
unfortunate that the 3.1 release doesn't include this, however.

<rdar://problem/11886458>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160699 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-availability.c
56bf6fd5ea33e3c8c798d908483f3a6266c7a615 24-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment diagnostics tests: add a function with zero arguments, for completeness.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160697 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
6582277bfc8bb587602e2c0689b6b2ff4b9bef53 24-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment diagnostics: add warning for multiple \param commands with duplicate
parameter names.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160696 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
56df4a9e0461d4dfb2a740cb6b0ce531d6c82538 24-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> When a && or || appears as the condition of a ?:, perform appropriate
short-circuiting when building the CFG. Also be sure to skip parens before
checking for the && / || special cases. Finally, fix some crashes in CFG
printing in the presence of calls to destructors for array of array of class
type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160691 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
78d1a10e13a1abfd4830bccf2a97b2993da1ed5c 24-Jul-2012 Nick Lewycky <nicholas@mxc.ca> Emit debug info for dynamic initializers. Permit __attribute__((nodebug)) on
variables that have static storage duration, it removes debug info on the
emitted initializer function but not all debug info about this variable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160659 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-nodebug.c
bed28ac1d1463adca3ecf24fca5c30646fa9dbb2 23-Jul-2012 Sylvestre Ledru <sylvestre@debian.org> Fix a typo (the the => the)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160622 91177308-0d34-0410-b5e6-96231b3b80d8
onditional-expr.c
9f08f49929324ec6863e81b22a43fb2e8575b433 20-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Fix PR13411: Comment parsing: failed assertion on unterminated verbatim block.

The assertion was wrong in case we have a verbatim block without a closing
command.

Also add tests for closing command name in a verbatim block, since now it can
be empty in such cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160568 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
858e69fe1305bdffb76a200c0f498685f11e65ae 19-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Fix ParagraphComment::isWhitespace(): a paragraph without a non-whitespace
TextComment node was considered whitespace even if it contained other child
nodes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160474 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
26dc97cbeba8ced19972a259720a71aefa01ef43 17-Jul-2012 Eli Friedman <eli.friedman@gmail.com> Don't treat overflow in floating-point conversions as a hard error in constant evaluation. <rdar://problem/11874571>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160394 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
379b28183a7dcb715c3f3eb2da4b0157d6d8ffbe 17-Jul-2012 Fariborz Jahanian <fjahanian@apple.com> Issue warning when assigning out-of-range integer values to enums.
Due to performance cost, this is an opt-in option placed
under -Wassign-enum. // rdar://11824807


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160382 91177308-0d34-0410-b5e6-96231b3b80d8
arn-outof-range-assign-enum.c
6cfa78f6bd4e7d5e23366a0907f8f8792366bc4c 17-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> Uninitialized variables: two little changes:
* Treat compound assignment as a use, at Jordy's request.
* Always add compound assignments into the CFG, so we can correctly diagnose the use in 'return x += 1;'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160334 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
9532e0d89ca2afa556f032aa9377f6ec1d3eaa3e 17-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> -Wuninitialized: Split the classification of DeclRefExprs as initialization or
use out of TransferFunctions, and compute it in advance rather than on-the-fly.

This allows us to handle compound assignments with DeclRefExprs on the RHS
correctly, and also makes it trivial to treat const& function parameters as not
initializing the argument. The patch also makes both of those changes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160330 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
d320ffc0f58df23eb0e698c79105a68de9c0e37a 15-Jul-2012 Rafael Espindola <rafael.espindola@gmail.com> Without this patch clang warns on

struct __attribute__((visibility("hidden"))) zed {
};
struct __attribute__((visibility("hidden"))) zed;

Which is a bit silly and got a lot noisier now that we correctly handle
visibility pragmas. This patch fixes that and also has some extra quality
improvements:

* We now produce an error instead of a warning for

struct __attribute__((visibility("hidden"))) zed {
};
struct __attribute__((visibility("default"))) zed;

* The "after definition" warning now points to the new attribute that is
ignored instead of pointing to the declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160227 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-decl-after-definition.c
3f635c08b2d0b2d5bafb38da09589cb238407faa 14-Jul-2012 Ted Kremenek <kremenek@apple.com> Refine CFG so that '&&' and '||' don't lead to extra confluence points when used in a branch, but
instead push the terminator for the branch down into the basic blocks of the subexpressions of '&&' and '||'
respectively. This eliminates some artifical control-flow from the CFG and results in a more
compact CFG.

Note that this patch only alters the branches 'while', 'if' and 'for'. This was complex enough for
one patch. The remaining branches (e.g., do...while) can be handled in a separate patch, but they
weren't immediately tackled because they were less important.

It is possible that this patch introduces some subtle bugs, particularly w.r.t. to destructor placement.
I've tried to audit these changes, but it is also known that the destructor logic needs some refinement
in the area of '||' and '&&' regardless (i.e., their are known bugs).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160218 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
abd56c816e9164b17bb3e7154a511b0c9896ffdb 13-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Attaching comments to declarations during parsing: handle more Objective-C declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160156 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.m
3f38bf2d441fac379c427f86153fbb0cb41256c6 13-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: repaint the bikesched: rename 'HTML open tags' to 'HTML start tags' and 'HTML close tags' to 'HTML end tags' according to HTML spec.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160153 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
3d986980bd02594b1a5aa7b9f9f68d201621ced7 13-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Make concepts of optional and forbidden end tags separate. Thanks Jordan for pointing this!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160149 91177308-0d34-0410-b5e6-96231b3b80d8
arn-documentation.cpp
a5ef44ff5d93a3be6ca67782828157a71894cf0c 11-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Enable comment parsing and semantic analysis to emit diagnostics. A few
diagnostics implemented -- see testcases.

I created a new TableGen file for comment diagnostics,
DiagnosticCommentKinds.td, because comment diagnostics don't logically
fit into AST diagnostics file. But I don't feel strongly about it.

This also implements support for self-closing HTML tags in comment
lexer and parser (for example, <br />).

In order to issue precise diagnostics CommentSema needs to know the
declaration the comment is attached to. There is no easy way to find a decl by
comment, so we match comments and decls in lockstep: after parsing one
declgroup we check if we have any new, not yet attached comments. If we do --
then we do the usual comment-finding process.

It is interesting that this automatically handles trailing comments.
We pick up not only comments that precede the declaration, but also
comments that *follow* the declaration -- thanks to the lookahead in
the lexer: after parsing the declgroup we've consumed the semicolon
and looked ahead through comments.

Added -Wdocumentation-html flag for semantic HTML errors to allow the user to
disable only HTML warnings (but not HTML parse errors, which we emit as
warnings in -Wdocumentation).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160078 91177308-0d34-0410-b5e6-96231b3b80d8
oxygen-comments.c
arn-documentation-almost-trailing.c
arn-documentation-fixits.c
arn-documentation.cpp
arn-documentation.m
7c81b43bef441960e921e0eb72d249369b7dd96c 03-Jul-2012 Nico Weber <nicolasweber@gmx.de> Rename -Wself-assign-memvar to -Wself-assign-field to improve local consistency a bit.

(cf -Wunused-private-field and several other existing -field diagnostics.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159633 91177308-0d34-0410-b5e6-96231b3b80d8
arn-self-assign-field.mm
arn-self-assign-memvar.mm
a9e8b9e3e90fcfe10a04624a89c39b63c32614d1 03-Jul-2012 Richard Smith <richard-llvm@metafoo.co.uk> -Wuninitialized: assume that an __attribute__((returns_twice)) function might
initialize any variable. This is extremely conservative, but is sufficient for
now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159620 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
f70a88612a4bc2de2872a518267b9b4891ab6431 30-Jun-2012 Jordan Rose <jordan_rose@apple.com> Add support for the C11 _Alignof keyword.

This behaves like the existing GNU __alignof and C++11 alignof keywords;
most of the patch is simply adding the third token spelling to various places.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159494 91177308-0d34-0410-b5e6-96231b3b80d8
lignas.c
43bb1793c523f714bca1c49d804ba7c0cb62aca2 29-Jun-2012 Nico Weber <nicolasweber@gmx.de> Warn on self-assignment to member variables. PR13104.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159394 91177308-0d34-0410-b5e6-96231b3b80d8
arn-self-assign-memvar.mm
b4e8008d5e65443cb28f7ff5c2a8b3b04f03657b 26-Jun-2012 Nico Weber <nicolasweber@gmx.de> Give L__FUNCTION__ the right type in templates. PR13206.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159171 91177308-0d34-0410-b5e6-96231b3b80d8
s_wide_predefined_expr.cpp
94d92fb96eef1c7c9b1f7ce66756169ae035cfce 26-Jun-2012 Nico Weber <nicolasweber@gmx.de> Add tests that I wrote for r159060 but forgot to `svn add`.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159170 91177308-0d34-0410-b5e6-96231b3b80d8
s_wide_predefined_expr.cpp
a1c5965906aecee1a35adf3e808943db4d7a2b98 23-Jun-2012 Hans Wennborg <hans@hanshq.net> Add triple to test/Sema/attr-tls_model.c

Not all targets support __thread variables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159080 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-tls_model.c
5e2d5dec7736f6f9292d4212dec67295909f1328 23-Jun-2012 Hans Wennborg <hans@hanshq.net> Support the tls_model attribute (PR9788)

This adds support for the tls_model attribute. This allows the user to
choose a TLS model that is better than what LLVM would select by
default. For example, a variable might be declared as:

__thread int x __attribute__((tls_model("initial-exec")));

if it will not be used in a shared library that is dlopen'ed.

This depends on LLVM r159077.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159078 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-tls_model.c
4b2239bec687dd8d45524205209c2629febb6663 22-Jun-2012 Dmitri Gribenko <gribozavr@gmail.com> Mark Doxygen warnings DefaultIgnore.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159026 91177308-0d34-0410-b5e6-96231b3b80d8
oxygen-comments.c
9dda4746867a747c1c3421d8a04a1b666aeb5809 22-Jun-2012 Dmitri Gribenko <gribozavr@gmail.com> Add a warning about almost-Doxygen trailing comments: //< and /*< ... */


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159001 91177308-0d34-0410-b5e6-96231b3b80d8
oxygen-comments.c
05233276b5b0d76e9ebd75eaa2709dff9b316590 21-Jun-2012 Jordan Rose <jordan_rose@apple.com> Don't warn for -Wstatic-in-inline if the used function is also inline.

Also, don't warn if the used function is __attribute__((const)), in which case
it's not supposed to use global variables anyway.

The inline-in-inline thing is a heuristic, and one that's possibly incorrect
fairly often because the function being inlined could definitely use global
variables. However, even some C standard library functions are written using
other (trivial) static-inline functions in the headers, and we definitely don't
want to be warning on that (or on anything that /uses/ these trivial inline
functions). So we're using "inlined" as a marker for "fairly trivial".

(Note that __attribute__((pure)) does /not/ guarantee safety like ((const),
because ((const)) does not guarantee that global variables are not being used,
and the warning is about globals not being shared across TUs.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158898 91177308-0d34-0410-b5e6-96231b3b80d8
nline.c
07c877de7bbd1e0f04c34414dff0dcd7a124f2c7 20-Jun-2012 Jordan Rose <jordan_rose@apple.com> Reword -Winternal-linkage-in-inline, and rename it to -Wstatic-in-inline.

Now that this is a C-only warning, we can use "static" instead of "internal
linkage", which is a term developers are probably more familiar with.
This makes for a better warning message. The warning name was changed to match,
since "internal linkage" is not mentioned in the warning text anymore.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158853 91177308-0d34-0410-b5e6-96231b3b80d8
nline.c
fc685ace387734599c475426b1a8efdb491054b8 20-Jun-2012 Aaron Ballman <aaron@aaronballman.com> Reapplying the changes from r158717 as they were rolled back to avoid merge conflicts from a separate problematic patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158750 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftCompatibility.c
icrosoftExtensions.c
3532936f4f50c15fcec4d00f4cbb81a7a9dd9b7e 19-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Revert r158700 and dependent patches r158716, r158717, and r158731.

The original r158700 caused crashes in the gcc test suite,
g++.abi/vtable3a.C among others. It also caused failures in the libc++
test suite.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158749 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftCompatibility.c
icrosoftExtensions.c
ed35fd1c6db1680b4526ba64c94e5da6ec203be7 19-Jun-2012 Aaron Ballman <aaron@aaronballman.com> Improves parsing and semantic analysis for MS __declspec attributes. This includes support for the align (which fixes PR12631).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158717 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftCompatibility.c
icrosoftExtensions.c
c4429b9ee5045525f532d00e820a81b7eeac28f8 19-Jun-2012 Jordan Rose <jordan_rose@apple.com> Change -Winternal-linkage-in-inline from ExtWarn to Warning in C++.

Per post-commit review, it's not appropriate to use ExtWarn in C++, because
we can't prove that the inline function will actually be defined in more than
one place (and thus we can't prove that this violates the ODR).

This removes the warning entirely from uses in the main source file in C++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158689 91177308-0d34-0410-b5e6-96231b3b80d8
nline.c
0eb3f45a92f706d50de55aefb19d66febfba78aa 19-Jun-2012 Jordan Rose <jordan_rose@apple.com> Support -Winternal-linkage-in-inline in C++ code.

This includes treating anonymous namespaces like internal linkage, and allowing
const variables to be used even if internal. The whole thing's been broken out
into a separate function to avoid nested ifs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158683 91177308-0d34-0410-b5e6-96231b3b80d8
nline.c
11b46a0a49075f338eb4849c2b7d680945be9250 18-Jun-2012 Jordan Rose <jordan_rose@apple.com> Allow internal decls in inline functions if the function is in the main file.

This handles the very common case of people writing inline functions in their
main source files and not tagging them as inline. These cases should still
behave as the user intended. (The diagnostic is still emitted as an extension.)

I'm reworking this code anyway to account for C++'s equivalent restriction in
[basic.def.odr]p6, but this should get some bots back to green.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158666 91177308-0d34-0410-b5e6-96231b3b80d8
nline.c
174930db339bb7213353db9e7b5aa94ecf4c12ea 18-Jun-2012 Nuno Lopes <nunoplopes@sapo.pt> fix PR13071 / rdar://problem/11634669 :
crash on invalid function decl with alloc_size attribute

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158663 91177308-0d34-0410-b5e6-96231b3b80d8
lloc_size.c
96c67d1c2aff532729c9edb297617094d1e77cc1 18-Jun-2012 Nuno Lopes <nunoplopes@sapo.pt> alloc_size attribute: there's nothing wrong with alloc_size(1,1). It just means the function allocates x^2 bytes. GCC also accepts this syntax

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158662 91177308-0d34-0410-b5e6-96231b3b80d8
lloc_size.c
7e58ad5a6756f31b48a0d54d5f5c367328150a46 18-Jun-2012 Joerg Sonnenberger <joerg@bec.de> Don't warn about address-to-member used as part of initialisation, if
the member expression is in parentheses.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158651 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
8f40dcc4ddbe4ef796dd1bf0696ac66d4e40e99a 17-Jun-2012 Richard Smith <richard-llvm@metafoo.co.uk> -Wuninitialized bugfix: when entering the scope of a variable with no
initializer, it is uninitialized, even if we may be coming from somewhere where
it was initialized.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158611 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
106af9e86adbbb3a05f2c339d509fcd3b4274504 15-Jun-2012 Jordan Rose <jordan_rose@apple.com> Warn when a static variable is referenced in a non-static inline function.

This is explicitly forbidden in C99 6.7.4p3. This is /not/ forbidden in C++,
probably because by default file-scope const/constexpr variables have internal
linkage, while functions have external linkage. There's also the issue of
anonymous namespaces to consider. Nevertheless, there should probably be a
similar warning, since the semantics of inlining a function that references
a variable with internal linkage do not seem well-defined.

<rdar://problem/11577619>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158531 91177308-0d34-0410-b5e6-96231b3b80d8
nline.c
d73ef135ba029db59c0b5649e6117845d9e39600 06-Jun-2012 Jordan Rose <jordan_rose@apple.com> Add pedantic warning -Wempty-translation-unit (C11 6.9p1).

In standard C since C89, a 'translation-unit' is syntactically defined to have
at least one "external-declaration", which is either a decl or a function
definition. In Clang the latter gives us a declaration as well.

The tricky bit about this warning is that our predefines can contain external
declarations (__builtin_va_list and the 128-bit integer types). Therefore our
AST parser now makes sure we have at least one declaration that doesn't come
from the predefines buffer.

Also, remove bogus warning about empty source files. This doesn't catch source
files that only contain comments, and never fired anyway because of our
predefines.

PR12665 and <rdar://problem/9165548>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158085 91177308-0d34-0410-b5e6-96231b3b80d8
89-2.c
ee0259d308e72141982a85b40863e760a8447edf 05-Jun-2012 Jordan Rose <jordan_rose@apple.com> Teach printf/scanf about enums with fixed underlying types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157961 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-enum-fixed-type.cpp
ormat-strings-enum.c
3af16fdfddc63cf6c611cc1eb2c7822d901bd470 04-Jun-2012 Hans Wennborg <hans@hanshq.net> Test the '__thread' before 'static' warning.

Also fix the '__thread' before 'extern' case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157921 91177308-0d34-0410-b5e6-96231b3b80d8
hread-specifier.c
7af7de7d6b121132dfe8c3b9b5febe2b37aafd62 30-May-2012 Richard Trieu <rtrieu@google.com> Add new -Wunique-enum which will warn on enums which all elements have the
same value and were initialized with literals. Clang will warn on code like
this:

enum A {
FIRST = 1,
SECOND = 1
};



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157666 91177308-0d34-0410-b5e6-96231b3b80d8
witch.c
350e956532d99ce2e804a478df5b6f1f5e096d88 27-May-2012 Fariborz Jahanian <fjahanian@apple.com> -Wdeprecated warning to include reference (as a note)
to the declaration in this patch. // rdar://10893232


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157537 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-deprecated.c
ttr-unavailable-message.c
bdb97ff687ce85e45cc728b87612ed546f48c1e7 26-May-2012 Richard Smith <richard-llvm@metafoo.co.uk> In response to some discussions on IRC, tweak the wording of the new
-Wsometimes-uninitialized diagnostics to make it clearer that the cause
of the issue may be a condition which must always evaluate to true or
false, rather than an uninitialized variable.

To emphasize this, add a new note with a fixit which removes the
impossible condition or replaces it with a constant.

Also, downgrade the diagnostic from -Wsometimes-uninitialized to
-Wconditional-uninitialized when it applies to a range-based for loop,
since the condition is not written explicitly in the code in that case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157511 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
2815e1a075c74143a0b60a632090ece1dffa5c7c 25-May-2012 Richard Smith <richard-llvm@metafoo.co.uk> Split a chunk of -Wconditional-uninitialized warnings out into a separate flag,
-Wsometimes-uninitialized. This detects cases where an explicitly-written branch
inevitably leads to an uninitialized variable use (so either the branch is dead
code or there is an uninitialized use bug).

This chunk of warnings tentatively lives within -Wuninitialized, in order to
give it more visibility to existing Clang users.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157458 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
a6115068cde719142eb394db88612c185cabd05b 24-May-2012 Eli Friedman <eli.friedman@gmail.com> Add a warning to diagnose statements in C++ like "*(volatile int*)x;". Conceptually, this is part of -Wunused-value, but I added a separate flag -Wunused-volatile-lvalue so it doesn't get turned off by accident with -Wno-unused-value. I also made a few minor improvements to existing unused value warnings in the process. <rdar://problem/11516811>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157362 91177308-0d34-0410-b5e6-96231b3b80d8
nused-expr.c
587de5be6bc8b9d046015b20079d45ac4b98bc14 24-May-2012 Nuno Lopes <nunoplopes@sapo.pt> implement Sema support for the alloc_size attribute
Portions of this patch by Xi Wang. Reviewed by Jordy Rose. Thank you both.

Codegen support will follow soon.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157360 91177308-0d34-0410-b5e6-96231b3b80d8
lloc_size.c
3f664061e58aabd01996f01b96eb9f5c9e45c3e2 18-May-2012 Rafael Espindola <rafael.espindola@gmail.com> Centralize the handling of the "attribute declaration must precede definition"
warning. This also makes us warn on tags, which, ironically, is the only case
gcc warns on.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157039 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-decl-after-definition.c
abf145ab57fc56bfb9c48333fcc65b49a564dc60 17-May-2012 Matt Beaumont-Gay <matthewbg@google.com> Use the argument location instead of the format string location when warning
about argument type mismatch.

This gives a nicer diagnostic in cases like
printf(fmt,
i);
where previously the snippet just pointed at 'fmt' (with a note at the
definition of fmt).

It's a wash for cases like
printf("%f",
i);
where previously we snippeted the offending portion of the format string,
but didn't indicate which argument was at fault.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156968 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
3940ce83438e2332ba541f4e65e700fbefe0c7a8 16-May-2012 Douglas Gregor <dgregor@apple.com> Produce more useful 'duplicate case' diagnostics. Fixes PR9243, from Terry Long!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156904 91177308-0d34-0410-b5e6-96231b3b80d8
witch.c
be0ee875d8a91c031a085cbbd73ad9e8dc1aa8ff 15-May-2012 David Blaikie <dblaikie@gmail.com> Improve some of the conversion warnings to fire on conversion to bool.

Moves the bool bail-out down a little in SemaChecking - so now
-Wnull-conversion and -Wliteral-conversion can fire when the target type is
bool.

Also improve the wording/details in the -Wliteral-conversion warning to match
the -Wconstant-conversion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156826 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
nr-def-call.c
c608c3c0781e15b74fbbda03f8708cc85a3dd488 15-May-2012 Richard Smith <richard-llvm@metafoo.co.uk> Further improvement to wording of overload resolution diagnostics, and including
the sole parameter name in the diagnostic in more cases. Patch by Terry Long!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156807 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
420efd83934ee78f04d73880e2ed1b7fdef3328c 13-May-2012 Rafael Espindola <rafael.espindola@gmail.com> Produce a warning for mismatched section attributes. Completest pr9356.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156727 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-section.c
ee409a916e9b97ed6bc2f48d8d6aac6b8b773d7b 12-May-2012 Benjamin Kramer <benny.kra@googlemail.com> Add support for __attribute__((hot)) and __attribute__((cold)).

Currently cold functions are marked with the "optsize" attribute in CodeGen
so they are always optimized for size. The hot attribute is just ignored,
LLVM doesn't have a way to express hotness at the moment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156723 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-coldhot.c
b2749b134a190c3b60cf22c11686afd8fcc7c6d0 12-May-2012 Douglas Gregor <dgregor@apple.com> Make sure that we recognize __attribute__((align)) as a synonym for
__attribute__((aligned)). Fixes <rdar://problem/11435441>, a
regression I introduced in r156003. This is the narrow fix; a more
comprehensive fix is coming.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156657 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-aligned.c
e2c60667d1bc29b7e148f9c9828dcbdbfc5b82b0 12-May-2012 Matt Beaumont-Gay <matthewbg@google.com> Merge branch 'format-string-braced-init'

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156653 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
f7b8056f1ff0c0409a9523a34f78b69ab8314bec 11-May-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR11857: When the wrong number of arguments are provided for a function
which expects exactly one argument, include the name of the argument in
the diagnostic text. Patch by Terry Long!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156607 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
bf9da1f8292bb66720ada94a050ede9dca17f60a 11-May-2012 Rafael Espindola <rafael.espindola@gmail.com> Fix a recent regression with the merging of format attributes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156597 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
dd44f34301316b814277d6a8c146d86c7115330b 10-May-2012 Rafael Espindola <rafael.espindola@gmail.com> Warn about visibility attributes in typedefs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156534 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-visibility.c
98ae834a3e289f84f0765d0d0ca7ff22ccaba458 10-May-2012 Rafael Espindola <rafael.espindola@gmail.com> Fix an old (2009) FIXME:

// FIXME: This needs to happen before we merge declarations. Then,
// let attribute merging cope with attribute conflicts.

This was already being done for variables, but for functions we were merging
then first and then applying the attributes. To avoid duplicating merging
logic, some of the helpers in SemaDeclAttr.cpp become methods that can
handle merging two attributes in one decl or inheriting attributes from one
decl to another.

With this change we are now able to produce errors for variables with
incompatible visibility attributes or warn about unused dllimports in
variables.

This changes the attribute list iteration back to being in reverse source
code order, as that matches what decl merging does and avoids differentiating
the two cases is the merge*Attr methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156531 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-visibility.c
llimport-dllexport.c
00e1f6f5fed4f33f67181578be0232accd342282 09-May-2012 Ted Kremenek <kremenek@apple.com> Teach IsTailPaddedMemberArray() (used by -Warray-bounds) that a FieldDecl may have a Typedef type, and not always a ConstantArrayType.

Fixes <rdar://problem/11387038>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156464 91177308-0d34-0410-b5e6-96231b3b80d8
rray-bounds-ptr-arith.c
5f164afca376b05b6fcbc5ab85ea108b6d6ee2b9 08-May-2012 Douglas Gregor <dgregor@apple.com> Fix fmin*/fmax* library builtin signatures.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156396 91177308-0d34-0410-b5e6-96231b3b80d8
mplicit-builtin-decl.c
101d4e0c8ffbcdaaa58cddf1c20f98aa1b4501c4 08-May-2012 Hans Wennborg <hans@hanshq.net> Make -Wformat accept printf("%hhx", c); with -funsigned-char

For "%hhx", printf expects an unsigned char. This makes Clang
accept a 'char' argument for that also when using -funsigned-char.

This fixes PR12761.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156388 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
9b79fc9c57dc9d541c2a5737c3e2c24cc68d485d 08-May-2012 Rafael Espindola <rafael.espindola@gmail.com> Process attributes in the order they appear in the source code. This make clang
match gcc behavior for two conflicting visibilities in the same decl. It also
makes handling of dllimport/dllexport more natural.

As a bonus we now warn on the dllimport in

void __attribute__((dllimport)) foo13();
void __attribute__((dllexport)) foo13();

as does gcc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156343 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-availability.c
ttr-visibility.c
llimport-dllexport.c
3b294360febd89e3383143af086efe2014571afa 06-May-2012 Rafael Espindola <rafael.espindola@gmail.com> Split mergeAvailabilityAttr out of handleAvailabilityAttr. This is important
for having a uniform logic for adding attributes to a decl. This in turn
is needed to fix the FIXME:

// FIXME: This needs to happen before we merge declarations. Then,
// let attribute merging cope with attribute conflicts.
ProcessDeclAttributes(S, NewFD, D,
/*NonInheritable=*/false, /*Inheritable=*/true);

The idea is that mergeAvailabilityAttr will become a method. Once attributes
are processed before merging, it will be called from handleAvailabilityAttr to
handle multiple attributes in one decl:

void f(int) __attribute__((availability(ios,deprecated=3.0),
availability(ios,introduced=2.0)));

and from SemaDecl.cpp to handle multiple decls:

void f(int) __attribute__((availability(ios,deprecated=3.0)));
void f(int) __attribute__((availability(ios,introduced=2.0)));

As a bonus, use the new structure to diagnose incompatible availability
attributes added to different decls (see included testcases).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156269 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-availability.c
7ad5c996e9519ed4e9afd1f0166be1cd2be8415a 05-May-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Use raw_ostream in TypePrinter and eliminate uses of temporary std::strings.

Part of rdar://10796159

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156228 91177308-0d34-0410-b5e6-96231b3b80d8
ector-ops.c
a30d8600b9b52922a92a90b30993564ba257537a 04-May-2012 James Molloy <james.molloy@arm.com> Add a predefine __WINT_UNSIGNED__, similar to __WCHAR_UNSIGNED__, and test them both for ARM and X86.

Use this to fully fix Sema/format-strings.c for non-x86 platforms.

Reviewed by Chandler on IRC.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156169 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
392da48160bd92ceb486792780467cbfdb2d0e8c 04-May-2012 James Molloy <james.molloy@arm.com> Fix handling of wint_t - we can't assume wint_t is purely an integer promotion of wchar_t - they may differ in signedness.

Teach ASTContext about WIntType, and have it taken from TargetInfo like WCharType. Should fix test/Sema/format-strings.c for ARM, with the exception of one subtest which will fail if wint_t and wchar_t are the same size and wint_t is signed, wchar_t is unsigned.

There'll be a followup commit to fix that.

Reviewed by Chandler and Hans at http://llvm.org/reviews/r/8



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156165 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
927a57cb8fb4134dec68997a476d84a15b29f9a8 04-May-2012 Bob Wilson <bob.wilson@apple.com> Add a test for r156092.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156132 91177308-0d34-0410-b5e6-96231b3b80d8
nputs/format-unused-system-args.h
ormat-strings.c
b9e05f1b326996f3a46b6e2c66050e77bed0e223 04-May-2012 Stephen Canon <scanon@apple.com> Add support for full-width 128-bit integer literals.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156123 91177308-0d34-0410-b5e6-96231b3b80d8
28bitint.c
7b0a3e378c441cec60f929d13bd48846c267a008 03-May-2012 Richard Trieu <rtrieu@google.com> Fix a note without a SourceLocation.

#define TEST int y; int x = y;
void foo() {
TEST
}

-Wuninitialized gives this warning:
invalid-loc.cc:4:3: warning: variable 'y' is uninitialized when used here
[-Wuninitialized]
TEST
^~~~
invalid-loc.cc:2:29: note: expanded from macro 'TEST'
#define TEST int y; int x = y;
^
note: initialize the variable 'y' to silence this warning
1 warning generated.

The second note lacks filename, line number, and code snippet. This change
will remove the fixit and only point to variable declaration.

invalid-loc.cc:4:3: warning: variable 'y' is uninitialized when used here
[-Wuninitialized]
TEST
^~~~
invalid-loc.cc:2:29: note: expanded from macro 'TEST'
#define TEST int y; int x = y;
^
invalid-loc.cc:4:3: note: variable 'y' is declared here
TEST
^
invalid-loc.cc:2:14: note: expanded from macro 'TEST'
#define TEST int y; int x = y;
^
1 warning generated.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156045 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
548d17c977959a5ed395ea1a407901f1314e575c 02-May-2012 Rafael Espindola <rafael.espindola@gmail.com> Walk the decls looking for the last one that has an attribute. We do have to walk
them, otherwise we cannot produce an error for both

struct HIDDEN test4; // canonical
struct test4;
struct DEFAULT test4;

and

struct test5; // canonical
struct HIDDEN test5;
struct DEFAULT test5;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156016 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-visibility.c
4e31b4d6cf25029aa280d691e9023359c0ef4204 01-May-2012 Rafael Espindola <rafael.espindola@gmail.com> Extend the error about incompatible visibility attributes in different
decls to work on function templates specializations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155943 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-visibility.c
6df1fa92a3d4d157602be19dff06259d9db2e2c1 01-May-2012 John McCall <rjmccall@apple.com> Test verified.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155932 91177308-0d34-0410-b5e6-96231b3b80d8
s_class_layout.cpp
bfd7a525bcf372004787cb641b8c1566b9e8aba5 01-May-2012 James Molloy <james.molloy@arm.com> Unify Options.td and CC1Options.td, in a first step towards unifying the serialization logic in Frontend and Driver.

Reviewed by Eric, Doug and Chandler, and here: http://llvm.org/reviews/r/7/



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155916 91177308-0d34-0410-b5e6-96231b3b80d8
pack-struct.c
c2244f6aa1c378657b96f7e076a705845466a93e 01-May-2012 John McCall <rjmccall@apple.com> Add a disclaimer to the new test, plus a user-declared ctor
to force the emission of vtordisps.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155906 91177308-0d34-0410-b5e6-96231b3b80d8
s_class_layout.cpp
441c6239c6df8c759bacf6510efbfd434b647066 01-May-2012 John McCall <rjmccall@apple.com> Add support for laying out vtordisps according to our current
working knowledge of the Microsoft ABI. Based on a patch by
Dmitry Sokolov.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155905 91177308-0d34-0410-b5e6-96231b3b80d8
s_class_layout.cpp
6d3b93d631640125f912339df19b0d2a15af5c9b 01-May-2012 Douglas Gregor <dgregor@apple.com> Turn the mixed-sign-comparison diagnostic into a runtime behavior
diagnostic, from Eitan Adler!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155876 91177308-0d34-0410-b5e6-96231b3b80d8
ompare.c
e59392176c2369df2bdd11b7786cb38abac00198 28-Apr-2012 Julien Lerouge <jlerouge@apple.com> Currently __builtin_annotation() only annotates an i32.

i32 __builtin_annotation(i32, string);

Applying it to i64 (e.g., long long) generates the following IR.

trunc i64 {{.*}} to i32
call i32 @llvm.annotation.i32
zext i32 {{.*}} to i64

The redundant truncation and extension make the result difficult to use.

This patch makes __builtin_annotation() generic.

type __builtin_annotation(type, string);

For the i64 example, it simplifies the generated IR to:

call i64 @llvm.annotation.i64

Patch by Xi Wang!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155764 91177308-0d34-0410-b5e6-96231b3b80d8
nnotate.c
45a0b264512ee0e9ba874bb3bfeb7f5b96789117 26-Apr-2012 Rafael Espindola <rafael.espindola@gmail.com> Reject cases like

struct __attribute__((visibility("hidden"))) a;
struct __attribute__((visibility("default"))) b;

which gcc already rejects.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155603 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-visibility.c
d6724367519b4f98dcce091854549282c11d70a0 23-Apr-2012 Fariborz Jahanian <fjahanian@apple.com> with -Wdeprecated, include a note to its deprecated declaration
location. // rdar://10893232


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155385 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
ttr-availability-ios.c
ttr-availability-macosx.c
ttr-availability.c
ttr-deprecated-message.c
2850376184b7e7aa81b5034ba44b001f8c55e07a 16-Apr-2012 Eli Friedman <eli.friedman@gmail.com> Per Richard's comments on r154794, add the checks necessary to handle constant-folding relational comparisons safely in case the user is using -fwrapv or equivalent.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154849 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
a31698842e9893559d58a7bf1a987f2ae90bea0b 16-Apr-2012 Eli Friedman <eli.friedman@gmail.com> Make constant evaluation for pointer comparisons work correctly for some uncommon cases. <rdar://problem/10962435>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154794 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval-64.c
onst-eval.c
030c7e9d105fdd9b5cb11b5b16c258bcb39bdac1 16-Apr-2012 David Blaikie <dblaikie@gmail.com> Fix tests that weren't actually verifying anything.

Passing -verify to clang without -cc1 or -Xclang silently passes (with a
printed warning, but lit doesn't care about that). This change adds -cc1 or,
as is necessary in one case, -Xclang to fix this so that these tests are
actually verifying as intended.

I'd like to change the driver so this kind of mistake could not be made, but
I'm not entirely sure how. Further, since the driver only warns about unknown
flags in general, we could have similar bugs with a misspellings of arguments
that would be nice to find.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154776 91177308-0d34-0410-b5e6-96231b3b80d8
urpress-deprecated.c
2c39d71bb7cefdfe6116fa52454f3b3dc5abd517 13-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> Implement the missing pieces needed to support libstdc++4.7's <atomic>:
__atomic_test_and_set, __atomic_clear, plus a pile of undocumented __GCC_*
predefined macros.

Implement library fallback for __atomic_is_lock_free and
__c11_atomic_is_lock_free, and implement __atomic_always_lock_free.

Contrary to their documentation, GCC's __atomic_fetch_add family don't
multiply the operand by sizeof(T) when operating on a pointer type.
libstdc++ relies on this quirk. Remove this handling for all but the
__c11_atomic_fetch_add and __c11_atomic_fetch_sub builtins.

Contrary to their documentation, __atomic_test_and_set and __atomic_clear
take a first argument of type 'volatile void *', not 'void *' or 'bool *',
and __atomic_is_lock_free and __atomic_always_lock_free have an argument
of type 'const volatile void *', not 'void *'.

With this change, libstdc++4.7's <atomic> passes libc++'s atomic test suite,
except for a couple of libstdc++ bugs and some cases where libc++'s test
suite tests for properties which implementations have latitude to vary.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154640 91177308-0d34-0410-b5e6-96231b3b80d8
tomic-ops.c
37050841d7b852497b85d5275d9ea92c07ddf059 13-Apr-2012 David Blaikie <dblaikie@gmail.com> Warn on 64-to-32 for source value of x bits where 64 >= x > 32.

The codepath already only works for source bits > target bits, it's just that
it was testing for the source expr bits to be exactly 64. This meant simple
cases (int i = x_long / 2) were missed & ended up under the general
-Wconversion warning, which a user might not have enabled.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154626 91177308-0d34-0410-b5e6-96231b3b80d8
onversion-64-32.c
ff34d401ff385ef7173ca612432b4ea717fff690 12-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> Implement support for 18 of the GNU-compatible __atomic builtins.

This is not quite sufficient for libstdc++'s <atomic>: we still need
__atomic_test_and_set and __atomic_clear, and may need a more complete
__atomic_is_lock_free implementation.

We are also missing an implementation of __atomic_always_lock_free,
__atomic_nand_fetch, and __atomic_fetch_nand, but those aren't needed
for libstdc++.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154579 91177308-0d34-0410-b5e6-96231b3b80d8
tomic-ops.c
16aac6f6eb31eb5118424773411867fc3cd5fbc6 12-Apr-2012 Eli Friedman <eli.friedman@gmail.com> Add test for a construct we currently reject, constant-evaluating a load from a constant string. Given that gcc doesn't accept this, we should continue to not accept it, even though it was accidentally supported by clang for a brief period.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154564 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
fafbf06732746f3ceca21d452d77b144ba8652ae 11-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> Provide, and document, a set of __c11_atomic_* intrinsics to implement C11's
<stdatomic.h> header.

In passing, fix LanguageExtensions to note that C11 and C++11 are no longer
"upcoming standards" but are now actually standardized.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154513 91177308-0d34-0410-b5e6-96231b3b80d8
tomic-ops.c
bc1029b4a47282cb4ce27c7014acb864b10a4043 06-Apr-2012 Eli Friedman <eli.friedman@gmail.com> Implement C90 pedantic warning for duplicate declaration specifiers which are duplicated via a typedef. Patch by Tim Northover.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154136 91177308-0d34-0410-b5e6-96231b3b80d8
89.c
ae916a14cf727b4ce3ac316f4fd780d1c83c5baf 06-Apr-2012 Eli Friedman <eli.friedman@gmail.com> Properly implement the C rules for composite types for qualified pointers in conditionals. Patch by Tim Northover.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154134 91177308-0d34-0410-b5e6-96231b3b80d8
onditional-expr.c
e31b8fb25b458f00e31dcd657c0840e5238e0f05 05-Apr-2012 David Blaikie <dblaikie@gmail.com> Enable warn_impcast_literal_float_to_integer by default.

This diagnostic seems to be production ready, it's just an oversight that it
wasn't turned on by default.

The test changes are a bit of a mixed bag. Some tests that seemed like they
clearly didn't need to use this behavior have been modified not to use it.
Others that I couldn't be sure about, I added the necessary expected-warnings
to.

It's possible the diagnostic message could be improved to make it clearer that
this warning can be suppressed by using a value that won't lose precision when
converted to the target type (but can still be a floating point literal, such
as "bool b = 1.0;").

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154068 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
5a5a971908a1fd064454db44c42333a3aecf3d5b 04-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> For PR11916: Add support for g++'s __int128 keyword. Unlike __int128_t, this is
a type specifier and can be combined with unsigned. This allows libstdc++4.7 to
be used with clang in c++98 mode.

Several other changes are still required for libstdc++4.7 to work with clang in
c++11 mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153999 91177308-0d34-0410-b5e6-96231b3b80d8
28bitint.c
ypes.c
b778305e95f9977e6710f2b04830ecc36398ab5e 22-Mar-2012 Richard Trieu <rtrieu@google.com> Change the binary operator data recursive evaluator to not stop at the first
non-constant value encountered. This allows the evaluator to deduce that
expressions like (x < 5 || true) is equal to true. Previously, it would visit
x and determined that the entire expression is could not evaluated to a
constant.

This fixes PR12318.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153226 91177308-0d34-0410-b5e6-96231b3b80d8
eturn.c
54faba4f7f3f0e8f1376da1c459312596ad5486d 21-Mar-2012 Fariborz Jahanian <fjahanian@apple.com> For enums with no tag name, display its location in
the diagnostic instead of displaying ''.
// rdar://11082110


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153219 91177308-0d34-0410-b5e6-96231b3b80d8
witch.c
9354f6aaa70e1543d122644fee0c3f834324d2fc 21-Mar-2012 Fariborz Jahanian <fjahanian@apple.com> fixes the diagnostic issued in // rdar://11069896


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153217 91177308-0d34-0410-b5e6-96231b3b80d8
lock-return.c
cde7a1dc68af2eb063a039b5a31c3b7dd92b1aa9 21-Mar-2012 Chad Rosier <mcrosier@apple.com> Report the natural alignment of unsigned long long, not the preferred alignment.
rdar://11054144


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153216 91177308-0d34-0410-b5e6-96231b3b80d8
lign-x86.c
4e648e4770d85febaf15ad8b7bad458bd7338ae2 21-Mar-2012 Fariborz Jahanian <fjahanian@apple.com> Allow void blocks to return witn a void expression in
c-mode to match behavior with void functions in c. Issue
warning with -pedantic. // rdar://11069896


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153200 91177308-0d34-0410-b5e6-96231b3b80d8
lock-return.c
0961a01ebec0e31664bfe464bf4a0ac7b0891a1f 16-Mar-2012 David Chisnall <csdavec@swan.ac.uk> Warn on flexible array members when in C89 mode, with -pedantic.
This fixes PR 4307.

Patch by Eitan Adler!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152918 91177308-0d34-0410-b5e6-96231b3b80d8
89.c
cc2f77a7dbc5fb58fe188d55fbfb074e80fe5663 15-Mar-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [Sema] Introduce a data recursive evaluator specific to binary operators.

This allows us to handle extreme cases of chained binary operators without causing stack
overflow.
The binary operators that are handled with the data recursive evaluator are
comma, logical, or operators that have operands with integral or enumeration type.

Part of rdar://10941790.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152819 91177308-0d34-0410-b5e6-96231b3b80d8
any-logical-ops.c
1d23c4219527d9a2bc75f5cdb1ffcaefb8bcc61b 15-Mar-2012 David Blaikie <dblaikie@gmail.com> Unpluralize -Wfoo-conversions warnings for consistency.

Err on the side of brevity and rename (while providing aliases for the original
name) -Wbool-conversions, -Wint-conversions, and -Wvector-conversions for
consistency with constant, literal, string, and sign conversion warnings. And
name the diagnostic groups explicitly while I'm here rather than rewriting the
string in the groups and sema td files.

Curiously, vector-conversion is not under -Wconversion. Perhaps it should be.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152776 91177308-0d34-0410-b5e6-96231b3b80d8
rm-neon-types.c
ector-assign.c
ector-cast.c
ector-ops.c
69730c115c2d0fec2f20609d905d920a5a41b29b 12-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix parsing of type-specifier-seq's. Types are syntactically allowed to be
defined here, but not semantically, so

new struct S {};

is always ill-formed, even if there is a struct S in scope.

We also had a couple of bugs in ParseOptionalTypeSpecifier caused by it being
under-loved (due to it only being used in a few places) so merge it into
ParseDeclarationSpecifiers with a new DeclSpecContext. To avoid regressing, this
required improving ParseDeclarationSpecifiers' diagnostics in some cases. This
also required teaching ParseSpecifierQualifierList about constexpr... which
incidentally fixes an issue where we'd allow the constexpr specifier in other
bad places.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152549 91177308-0d34-0410-b5e6-96231b3b80d8
nvalid-struct-init.c
cb00cc44dd6a2a24b8b46e88b9e57a12a38a626b 10-Mar-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove the part of test/Sema/pragma-pack-2.c that has irregular "#pragma pack"s.

Before r151307 this part worked without compiler errors but now it only verifies
that our handling of irregular pragmas is broken compared to gcc, it has no
practical usefulness; it creates invalid structs that cannot be used for 'offsetof' testing.

If we later decide to handle irregular pragmas without compiler errors we can
put back this part.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152480 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-pack-2.c
26b75c07317a3b50a8a00a1623e3ef38af1d8349 09-Mar-2012 Richard Smith <richard-llvm@metafoo.co.uk> Improve diagnostics for UCNs referring to control characters and members of the
basic source character set in C++98. Add -Wc++98-compat diagnostics for same in
literals in C++11. Extend such support to cover string literals as well as
character literals, and mark N2170 as done.

This seems too minor to warrant a release note to me. Let me know if you disagree.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152444 91177308-0d34-0410-b5e6-96231b3b80d8
cn-cstring.c
f85626453123f9691bcef13cff963f556e209c27 09-Mar-2012 Hans Wennborg <hans@hanshq.net> -Wformat-non-iso: warn about positional arguments (pr12017)

This renames the -Wformat-non-standard flag to -Wformat-non-iso,
rewords the current warnings a bit (pointing out that a format string
is not supported by ISO C rather than being "non standard"),
and adds a warning about positional arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152403 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-c90.c
ormat-strings-fixit.c
ormat-strings-non-iso.c
ormat-strings-non-standard.c
27949f65b089fec7902b2a15d718b3d1b0ccf988 06-Mar-2012 Fariborz Jahanian <fjahanian@apple.com> Undo patch for // rdar://10735698



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152128 91177308-0d34-0410-b5e6-96231b3b80d8
lock-missing-return-type-warning.c
arn-unused-parameters.c
abf9d908cce6ffe2ee7b739d98fc7344a4f9fe3b 05-Mar-2012 Fariborz Jahanian <fjahanian@apple.com> patch to optionally warn for block implementations without explicit
return types that return non-void values. // rdar://10735698


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152047 91177308-0d34-0410-b5e6-96231b3b80d8
lock-missing-return-type-warning.c
arn-unused-parameters.c
1cb2d742eb6635aeab6132ee5f0b5781d39487d7 02-Mar-2012 Nico Weber <nicolasweber@gmx.de> Add -Wstring-plus-int, which warns on "str" + int and int + "str".

It doesn't warn if the integer is known at compile time and within
the bounds of the string.

Discussion: http://comments.gmane.org/gmane.comp.compilers.clang.scm/47203



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151943 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.c
a0e005b06b271f6dd1fdbbeed03d9e14f7f3e6a3 02-Mar-2012 Fariborz Jahanian <fjahanian@apple.com> Change diagnostic test for my last patch.
// rdar://10961370


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151923 91177308-0d34-0410-b5e6-96231b3b80d8
ariadic-incomplete-arg-type.c
e853bb34ec1f86e12dcdaa9b5e782fac2117b08f 02-Mar-2012 Fariborz Jahanian <fjahanian@apple.com> c/objc: problem originally reported as an objective-c bug.
But it is in the underlying c part of clang. clang crashes
in IRGen when passing an incomplete type argument to
variadic function (instead of diagnosing the bug).
// rdar://10961370


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151862 91177308-0d34-0410-b5e6-96231b3b80d8
ariadic-incomplete-arg-type.c
3638fabcf2eddcd072c06d0f90f774547f6d7e01 01-Mar-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove test/Sema/many-logical-ops.c since it fails in linux variants.

Will bring it up once the issue is fixed properely.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151830 91177308-0d34-0410-b5e6-96231b3b80d8
any-logical-ops.c
16f1f717af196b1448258857b2e6dcfe144b39d0 29-Feb-2012 James Molloy <james.molloy@arm.com> Reapply r151638 and r151641.

The bug that was caught by Apple's internal buildbots was valid and also showed another bug in my implementation.

These are now fixed, with regression tests added to catch them both (not Darwin-specific).

Original log:
====================

Revert r151638 because it causes assertion hit on PCH creation for Cocoa.h

Original log:
---------------------
Correctly track tags and enum members defined in the prototype of a function, and ensure they are properly scoped.

This fixes code such as:

enum e {x, y};
int f(enum {y, x} n) {
return 0;
}

This finally fixes PR5464 and PR5477.
---------------------

I also reverted r151641 which was enhancement on top of r151638.

====================




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151712 91177308-0d34-0410-b5e6-96231b3b80d8
ecl-in-prototype.c
n-ptr-as-fn-prototype.c
f41e8753c3c52346186cae4eb6ca60f053487632 29-Feb-2012 NAKAMURA Takumi <geek4civic@gmail.com> clang/test/Analysis/stats.c: Mark this as XFAIL: mingw32.

FIXME: Could we guarantee not to get stack overflow also on mingw?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151692 91177308-0d34-0410-b5e6-96231b3b80d8
any-logical-ops.c
32a9a7543f0296b0ae141899005f788bbe4262ca 29-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Revert r151638 because it causes assertion hit on PCH creation for Cocoa.h

Original log:
---------------------
Correctly track tags and enum members defined in the prototype of a function, and ensure they are properly scoped.

This fixes code such as:

enum e {x, y};
int f(enum {y, x} n) {
return 0;
}

This finally fixes PR5464 and PR5477.
---------------------

I also reverted r151641 which was enhancement on top of r151638.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151667 91177308-0d34-0410-b5e6-96231b3b80d8
ecl-in-prototype.c
fbcf0405b7da1c8606e4223b4f91835643ecd5b4 28-Feb-2012 James Molloy <james.molloy@arm.com> Correctly track tags and enum members defined in the prototype of a function, and ensure they are properly scoped.

This fixes code such as:

enum e {x, y};
int f(enum {y, x} n) {
return 0;
}

This finally fixes PR5464 and PR5477.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151638 91177308-0d34-0410-b5e6-96231b3b80d8
ecl-in-prototype.c
c1b66e6003262b284937b542aa159a0c79619ff4 28-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> When evaluating integer expressions include a check for sub-expressions
depth and error if we exceed a max value, to make sure we avoid a stack overflow.

This is a hacky temporary fix. rdar://10913206.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151585 91177308-0d34-0410-b5e6-96231b3b80d8
any-logical-ops.c
2fa975c94027c6565cb112ffcf93c05b22922c0e 26-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Revert r151460 as it is not enough to address the issue.

Original log:
When evaluating integer expressions handle logical operators outside
VisitBinaryOperator() to reduce stack pressure for source with huge number
of logical operators.

Fixes rdar://10913206.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151464 91177308-0d34-0410-b5e6-96231b3b80d8
any-logical-ops.c
8ed20910d8b5c35d28c5cbe7e9170d40837192dd 25-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> When evaluating integer expressions handle logical operators outside
VisitBinaryOperator() to reduce stack pressure for source with huge number
of logical operators.

Fixes rdar://10913206.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151460 91177308-0d34-0410-b5e6-96231b3b80d8
any-logical-ops.c
aa5ab26ed93382b812147f532dcbf4afb5494040 24-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Handle "#pragma GCC visibility" in a few more places. Switch over "#pragma pack" to use the same handling that gcc does. Fixes <rdar://problem/10871094> and <rdar://problem/10893316>.

(Hopefully, common usage of these pragmas isn't irregular enough to break our current handling. Doug has ideas for a more crazy approach if necessary.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151307 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-pack-2.c
9428772f16e379bcad35254251f96e3d1077c730 23-Feb-2012 Aaron Ballman <aaron@aaronballman.com> Turned on support for __declspecs: noreturn, noinline, nothrow and naked in MS compatibility mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151295 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftCompatibility.c
47611c88fb0446673c6e590ab461934054be290a 23-Feb-2012 Aaron Ballman <aaron@aaronballman.com> Turned on support for __declspec(deprecated) in MS compatibility mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151225 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
76517426dc8bf7734c07eefc35171a6bfdba1a2b 22-Feb-2012 Hans Wennborg <hans@hanshq.net> Warn about non-standard format strings (pr12017)

This adds the -Wformat-non-standard flag (off by default,
enabled by -pedantic), which warns about non-standard
things in format strings (such as the 'q' length modifier,
the 'S' conversion specifier, etc.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151154 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-c90.c
ormat-strings-non-standard.c
ormat-strings.c
51e47df5a57430f1b691b04258e663cce68aef9d 21-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Fix a crash in the diangostic code in EvalConstant. PR12043.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151100 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
f57c413e444b441fa75ae8911d183c19b53bdd56 21-Feb-2012 Jean-Daniel Dupas <devlists@shadowlab.org> When calling a non variadic format function(vprintf, vscanf, NSLogv, …), warn if the format string argument is a parameter that is not itself declared as a format string with compatible format.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151080 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
dfb80ded6767f7b79a0f1fa4f6921d543ff0a643 18-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix wrong-code bug: __imag on a scalar lvalue should produce a zero rvalue,
rather than an lvalue referring to the scalar.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150889 91177308-0d34-0410-b5e6-96231b3b80d8
omplex-imag.c
32addd519c6699000ff79c387a1c87f0ab7c3698 16-Feb-2012 Hans Wennborg <hans@hanshq.net> Format string analysis: give 'q' its own enumerator.

This is in preparation for being able to warn about 'q' and other
non-standard format string features.

It also allows us to print its name correctly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150697 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-scanf.c
ormat-strings.c
a2d7dfab309375fbf016b650fa74f9b5d03a9752 16-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Shift Microsoft enum extensions from -fms-extensions to -fms-compatibility, so -fms-extensions doesn't affect enum semantics in incompatible ways. <rdar://problem/10657186>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150663 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftCompatibility.c
icrosoftExtensions.c
be6126a2a784e1446460b8d15c2b26f880c871fc 15-Feb-2012 Hans Wennborg <hans@hanshq.net> Make -Wformat fix-its preserve original conversion specifiers.

This commit makes PrintfSpecifier::fixType() and ScanfSpecifier::fixType()
only fix a conversion specification enough that Clang wouldn't warn about it,
as opposed to always changing it to use the "canonical" conversion specifier.
(PR11975)

This preserves the user's choice of conversion specifier in cases like:

printf("%a", (long double)1);
where we previously suggested "%Lf", we now suggest "%La"

printf("%x", (long)1);
where we previously suggested "%ld", we now suggest "%lx".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150578 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-fixit.c
625bb569df0c34feec0d52c0ec5215f21ef2e054 14-Feb-2012 Dmitri Gribenko <gribozavr@gmail.com> Generalize -Wempty-body: warn when statement body is empty (closes: PR11329)

* if, switch, range-based for: warn if semicolon is on the same line.
* for, while: warn if semicolon is on the same line and either next
statement is compound statement or next statement has more
indentation.

Replacing the semicolon with {} or moving the semicolon to the next
line will always silence the warning.

Tests from SemaCXX/if-empty-body.cpp merged into SemaCXX/warn-empty-body.cpp.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150515 91177308-0d34-0410-b5e6-96231b3b80d8
efault.c
tatements.c
witch.c
75d8ba38965998a07a057c6d1d72359d2cc62c09 14-Feb-2012 John McCall <rjmccall@apple.com> Warn about non-int main() results in GNU C mode instead of erroring.

Based on a patch by Vasiliy Korchagin!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150500 91177308-0d34-0410-b5e6-96231b3b80d8
89.c
nu89.c
4ee01ef7bd170b6f3f3f71882b407cd6408c5b1e 13-Feb-2012 Hans Wennborg <hans@hanshq.net> Fix typo in PrintfConversionSpecifier::isDoubleArg()

This makes the printf diagnostics issue warnigns for %a, %A, %e, etc.
when used with the wrong argument.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150370 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
5b9cc5df25c2198f270dd1d5c438fdce70d4051d 12-Feb-2012 Sebastian Redl <sebastian.redl@getdesigned.at> Represent C++ direct initializers as ParenListExprs before semantic analysis
instead of having a special-purpose function.

- ActOnCXXDirectInitializer, which was mostly duplication of
AddInitializerToDecl (leading e.g. to PR10620, which Eli fixed a few days
ago), is dropped completely.
- MultiInitializer, which was an ugly hack I added, is dropped again.
- We now have the infrastructure in place to distinguish between
int x = {1};
int x({1});
int x{1};
-- VarDecl now has getInitStyle(), which indicates which of the above was used.
-- CXXConstructExpr now has a flag to indicate that it represents list-
initialization, although this is not yet used.
- InstantiateInitializer was renamed to SubstInitializer and simplified.
- ActOnParenOrParenListExpr has been replaced by ActOnParenListExpr, which
always produces a ParenListExpr. Placed that so far failed to convert that
back to a ParenExpr containing comma operators have been fixed. I'm pretty
sure I could have made a crashing test case before this.

The end result is a (I hope) considerably cleaner design of initializers.
More importantly, the fact that I can now distinguish between the various
initialization kinds means that I can get the tricky generalized initializer
test cases Johannes Schaub supplied to work. (This is not yet done.)

This commit passed self-host, with the resulting compiler passing the tests. I
hope it doesn't break more complicated code. It's a pretty big change, but one
that I feel is necessary.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150318 91177308-0d34-0410-b5e6-96231b3b80d8
aren-list-expr-type.cpp
8327118ff60cd9c4812fba1e5ba4eb3cb5ed3401 11-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> Make sure to try instantiating a templated type which is used in an _Atomic
before complaining that it's incomplete.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150308 91177308-0d34-0410-b5e6-96231b3b80d8
tomic-type.c
3e78b19e51034dd27c6e0d811522148345e299e4 09-Feb-2012 Aaron Ballman <aaron@aaronballman.com> Switching to using dyn_cast_or_null, and fixing line endings in the test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150209 91177308-0d34-0410-b5e6-96231b3b80d8
nit.c
0ca7e8bf904d1c2cf70d271f3a06c1d71ff7e4fb 09-Feb-2012 Aaron Ballman <aaron@aaronballman.com> Attempting to initialize a union member that does not exist no longer crashes.

Patch by Remi Gacogne

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150144 91177308-0d34-0410-b5e6-96231b3b80d8
nit.c
1a2b8e27135ec72f183dd4510612f6d5d7ee088a 08-Feb-2012 Ted Kremenek <kremenek@apple.com> Move -Wcovered-switch-default out of -Wswitch (and -Wall), and make it an opt-in warning.

This is a great warning, but it was observed that a ton of real world code violates
it all the time for (semi-)legitimate reasons. This warnings is fairly pedantic, which is good,
but not for everyone. For example, there is a fair amount of idiomatic code out there
that does "default: abort()", and similar idioms.

Addresses <rdar://problem/10814651>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150055 91177308-0d34-0410-b5e6-96231b3b80d8
witch.c
2837a2f02195e624b14b419b2d3e6682a6bc5a0f 08-Feb-2012 Jean-Daniel Dupas <devlists@shadowlab.org> non-literal strftime format string is not unsafe.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150009 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
11e70d7fe2eb11874c3619ad26dc2b525b81074f 07-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Fix a bug in semantic analysis involving anonymous structs and flexible arrays.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149966 91177308-0d34-0410-b5e6-96231b3b80d8
nonymous-struct-union.c
04ca25276245fbcf0a353e965de476080fa01b99 07-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Fix a couple of nasty bugs involving negative enum constants. <rdar://problem/10760113>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149965 91177308-0d34-0410-b5e6-96231b3b80d8
num.c
56ff283a1f8e4e898568426f56e67a096efd1f80 07-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Fix a minor regression from my potentially-evaluated expression changes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149930 91177308-0d34-0410-b5e6-96231b3b80d8
la.c
282e7e66748cc6dd14d6f7f2cb52e5373c531e61 04-Feb-2012 Richard Smith <richard-llvm@metafoo.co.uk> In C++11 mode, when an integral constant expression is desired and we have a
value of class type, look for a unique conversion operator converting to
integral or unscoped enumeration type and use that. Implements [expr.const]p5.

Sema::VerifyIntegerConstantExpression now performs the conversion and returns
the converted result. Some important callers of Expr::isIntegralConstantExpr
have been switched over to using it (including all of those required for C++11
conformance); this switch brings a side-benefit of improved diagnostics and, in
several cases, simpler code. However, some language extensions and attributes
have not been moved across and will not perform implicit conversions on
constant expressions of literal class type where an ICE is required.

In passing, fix static_assert to perform a contextual conversion to bool on its
argument.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149776 91177308-0d34-0410-b5e6-96231b3b80d8
-c-e.c
witch.c
acbabf177079ed41c055b1484465082f9f1d3d06 03-Feb-2012 Hans Wennborg <hans@hanshq.net> Don't warn about anonymous struct/union in C11.

Also, in C, call this a C11 extension rather than a GNU extension.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149695 91177308-0d34-0410-b5e6-96231b3b80d8
nonymous-struct-union-c11.c
rray-init.c
7a0a31ce0cd38147bfe853f71a3f7261444ddf4c 03-Feb-2012 Chad Rosier <mcrosier@apple.com> [frontend] Don't allow a mapping to a warning override an error/fatal mapping.
rdar://10736625

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149662 91177308-0d34-0410-b5e6-96231b3b80d8
eturn.c
afdb041308bca3e875b23e7a22d879e9039bff03 03-Feb-2012 Anna Zaks <ganna@apple.com> Do not show macro expansion in strncat warnings, which can be defined as
a builtin.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149657 91177308-0d34-0410-b5e6-96231b3b80d8
arn-strncat-size.c
34ff062936ac78142a2c0dc8d1ae6a40df456819 02-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Change the check for constant-conversion with width-1 bitfields so it doesn't suppress quite as many cases. Based off a testcase in the gcc testsuite.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149572 91177308-0d34-0410-b5e6-96231b3b80d8
onstant-conversion.c
c36bedc90c687caa71748480c60707ea4608b092 01-Feb-2012 Anna Zaks <ganna@apple.com> Add a new compiler warning, which flags anti-patterns used as the size
argument in strncat.

The warning is ignored by default since it needs more qualification.

TODO: The warning message and the note are messy when
strncat is a builtin due to the macro expansion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149524 91177308-0d34-0410-b5e6-96231b3b80d8
arn-strncat-size.c
ee625afea71ef5a9c1e386564919b86915d96b0d 01-Feb-2012 Nico Weber <nicolasweber@gmx.de> Fix crash on invalid in microsoft anonymous struct extension.

Fixes PR11847. Patch from Jason Haslam!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149460 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
48b68a0dc345b3208cbd9dda719b9b3ec167c8c2 01-Feb-2012 Bob Wilson <bob.wilson@apple.com> Use the new Triple::getMacOSXVersion function in another place.

I removed support for "*-darwin*-iphoneos" triples, since we now have
iOS listed as a separate OS in the triples.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149455 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-availability-ios.c
289e31f386fe8b5e489588533e34c4e21df764bd 31-Jan-2012 Ted Kremenek <kremenek@apple.com> Revert r149359. This was a hack to a problem with an easy workaround, and it doesn't feel like general solution.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149404 91177308-0d34-0410-b5e6-96231b3b80d8
onversion-64-32.c
220947bd5a66b0f25f5e74d6029769dfb34f07b4 31-Jan-2012 Jean-Daniel Dupas <devlists@shadowlab.org> FormatCheckers should emit all diagnostics using EmitFormatDiagnostic().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149394 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-scanf.c
ormat-strings.c
fdba18263ffd624846701ad115d35edb3e2ee0a7 31-Jan-2012 Ted Kremenek <kremenek@apple.com> Don't warn about -Wshorten-64-to-32 in unreachable code. Fixes <rdar://problem/10759934>. Apparently this is a common idiom in Linux (among other places).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149359 91177308-0d34-0410-b5e6-96231b3b80d8
onversion-64-32.c
34269df5db40b7c4b4f52aed579d9b3108ff79e4 30-Jan-2012 Jean-Daniel Dupas <devlists@shadowlab.org> Update on format attribute handling.
- Remove the printf0 special handling as we treat it as printf anyway.
- Perform basic checks (non-literal, empty) for all formats and not only printf/scanf.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149236 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
4188760f6bb20f91c6883dffd89204419f852dee 29-Jan-2012 John McCall <rjmccall@apple.com> Complain about attempts to use 'protected' visibility on targets
like Darwin that don't support it. We should also complain about
invalid -fvisibility=protected, but that information doesn't seem
to exist at the most appropriate time, so I've left a FIXME behind.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149186 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-visibility.c
5faf5d31fa634e1fdb576c4d9708cd4efa5ea310 28-Jan-2012 Jean-Daniel Dupas <devlists@shadowlab.org> Remove the "C" in "implicitly declaring C library function" diagnostic
because all functions are not C functions (i.e. NSLog).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149150 91177308-0d34-0410-b5e6-96231b3b80d8
lock-return.c
mplicit-builtin-decl.c
0fa063816818ac53a0015a5d2b0328812005b40e 27-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Turn off implicit truncation warning for compound assignment to bitfields; it might be reasonable in some cases, but it clearly doesn't make sense in some cases, like the included testcase.

<rdar://problem/10238797>, part 2.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149095 91177308-0d34-0410-b5e6-96231b3b80d8
onstant-conversion.c
3a643afa402d51b5fc4faccb4329e9c4392d4551 27-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Make the bitfield implicit truncation warning slightly more aggressive, and make the printed warning a bit more accurate. The new behavior matches gcc's -Wconversion. <rdar://problem/10238797>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149089 91177308-0d34-0410-b5e6-96231b3b80d8
onstant-conversion.c
f2e4cd760a5836ee8941d1b9be6b2e2c2dde23e6 26-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: evaluate (bool)&x as true when x is a local variable or a temporary.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149045 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
43d1251a471d19ce83aa8ce91c0104addada5add 25-Jan-2012 Jean-Daniel Dupas <devlists@shadowlab.org> Add "multiple format attributes" support on block.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148890 91177308-0d34-0410-b5e6-96231b3b80d8
lock-printf-attribute-1.c
9d24c2cbd9cf1b7c165ccb13221f2efb2f4b49b0 24-Jan-2012 Ted Kremenek <kremenek@apple.com> Teach scanf/printf checking about '%Ld' and friends (a GNU extension). Fixes PR 9466.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148859 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-scanf.c
ormat-strings.c
2dd52e3815d040e340a5d953d838cd2268e25372 24-Jan-2012 David Blaikie <dblaikie@gmail.com> Reword/rename -Wswitch-unreachable-default.

Rewording the diagnostic to be more precise/correct: "default label in switch
which covers all enumeration values" and changed the switch to
-Wcovered-switch-default

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148783 91177308-0d34-0410-b5e6-96231b3b80d8
witch.c
arn-unreachable.c
e1d82deb6839bf972aa6301da40f06e8926f0af5 24-Jan-2012 David Blaikie <dblaikie@gmail.com> Improve -Wswitch-enum diagnostic message.

Changing wording to include the word "explicitly" (as in "enumeration value ...
not /explicitly/ handled by switch"), as suggested by Richard Smith.

Also, now that the diagnostic text differs between -Wswitch and -Wswitch-enum,
I've simplified the test cases a bit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148781 91177308-0d34-0410-b5e6-96231b3b80d8
witch-enum.c
witch.c
f96708d477e1a41a7c1c8087bcf1869045cf4f1c 24-Jan-2012 Fariborz Jahanian <fjahanian@apple.com> fixes location of "availability" attribute so warning is displayed at
its line. // rdar://10711037


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148747 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-availability.c
413c2c9d9c85ceb588e9cb965853f178a3a52bc9 23-Jan-2012 David Blaikie <dblaikie@gmail.com> Rename -Wswitch-enum-redundant-default to -Wswitch-redundant-default.

This is for consistency, since the flag is actually under -Wswitch now, rather
than -Wswitch-enum (since it's really valuable for the former and rather
orthogonal to the latter)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148680 91177308-0d34-0410-b5e6-96231b3b80d8
witch-enum.c
arn-unreachable.c
585d7795c2dddaa510b3bb1b3b18633bfcfdf643 23-Jan-2012 David Blaikie <dblaikie@gmail.com> Implement -Wswitch-enum correctly.

Clang previously implemented -Wswitch-enum the same as -Wswitch. This patch
corrects the behavior to match GCC's. The critical/only difference being that
-Wswitch-enum is not silenced by the presence of a default case in the switch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148679 91177308-0d34-0410-b5e6-96231b3b80d8
witch-enum.c
9366750a5a97c8aeae1df4898ea849b087865195 22-Jan-2012 David Blaikie <dblaikie@gmail.com> Fix -Wswitch to warn about out of bounds enum cases even when there's a default

For consistency with GCC & reasonable sanity. The FIXME suggests that the
original author was perhaps using the default check for some other purpose,
not realizing the more obvious limitation/false-negatives it creates, but this
doesn't seem to produce any regressions & fixes the included test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148649 91177308-0d34-0410-b5e6-96231b3b80d8
witch.c
31ceb61172bca7ebc3fb90e9125864c7a29c55c0 21-Jan-2012 David Blaikie <dblaikie@gmail.com> Add -Wswitch-enum-redundant-default.

This warning acts as the complement to the main -Wswitch-enum warning (which
warns whenever a switch over enum without a default doesn't cover all values of
the enum) & has been an an-doc coding convention in LLVM and Clang in my
experience. The purpose is to ensure there's never a "dead" default in a
switch-over-enum because this would hide future -Wswitch-enum errors.

The name warning has a separate flag name so it can be disabled but it's grouped
under -Wswitch-enum & is on-by-default because of this.

The existing violations of this rule in test cases have had the warning disabled
& I've added a specific test for the new behavior (many negative cases already
exist in the same test file - and none regressed - so I didn't add more).

Reviewed by Ted Kremenek ( http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120116/051690.html )

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148640 91177308-0d34-0410-b5e6-96231b3b80d8
witch.c
arn-unreachable.c
71b8fb5d4233420d2ed2f150a54ea61431bd8684 21-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Make clang's AST model sizeof and typeof with potentially-evaluated operands correctly, similar to what we already do with typeid.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148610 91177308-0d34-0410-b5e6-96231b3b80d8
-c-e.c
la-2.c
ef1440b6eca118d46291166ce3302f9bba8e639b 20-Jan-2012 Ted Kremenek <kremenek@apple.com> The 'l' length modifier makes sense with the scanlist conversion specifier.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148586 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-scanf.c
ce506ae231703a23ea95335cd4de19c60082f361 20-Jan-2012 Ted Kremenek <kremenek@apple.com> Tighten format string diagnostic and make it a bit clearer (and a bit closer to GCC's).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148579 91177308-0d34-0410-b5e6-96231b3b80d8
lock-printf-attribute-1.c
ormat-strings-c90.c
ormat-strings-int-typedefs.c
ormat-strings-scanf.c
ormat-strings-size_t.c
ormat-strings.c
o-format-y2k-turnsoff-format.c
43e875d2610afcf9e7017b71f46116dc86624fd9 18-Jan-2012 Kaelyn Uhrain <rikka@google.com> Convert SemaDecl.cpp to pass callback objects to CorrectTypo.

Includes tests highlighting the cases where accuracy has improved
(there is one call that does no filtering beyond selecting the set
of allowed keywords, and one call that only triggers for ObjC code
for which a test by someone who knows ObjC would be welcome). Also
fixes a small typo in one of the suggestion messages, and drops a
malformed "expected-note" for a suggestion that did not occur even
when the malformed note was committed as r145930.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148420 91177308-0d34-0410-b5e6-96231b3b80d8
mplicit-decl.c
c8769460f1c03bc321b00f5611f9965e8385e64d 17-Jan-2012 Hans Wennborg <hans@hanshq.net> Treat -Wformat=0 as an alias for -Wformat.

Fixes PR9195.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148300 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-scanf.c
244ee7b89a483fd3764637abdf95de2893b437d0 15-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> Pedantic diagnostic correction: in C++, we have integral constant expressions,
not integer constant expressions. In passing, fix the 'folding is an extension'
diagnostic to not claim we're accepting the code, since that's not true in
-pedantic-errors mode, and add this diagnostic to -Wgnu.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148209 91177308-0d34-0410-b5e6-96231b3b80d8
R2963-enum-constant.c
117c45666c99f1797c708767d7c0ccaa7902ec42 14-Jan-2012 Douglas Gregor <dgregor@apple.com> Make sure to consider non-DeclContext scopes properly when finding
multiple name lookup results in C/Objective-C. Fixes a regression a
caused in r147533, found by Enea Zaffanella!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148154 91177308-0d34-0410-b5e6-96231b3b80d8
unction.c
37969b7e14d6a4dfd934ef6d3738cc90b832ec1d 12-Jan-2012 Hans Wennborg <hans@hanshq.net> scanf: parse the 'm' length modifier, and check that the right arguments
are used with that and the 'a' length modifier.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148029 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-c90.c
ormat-strings-scanf.c
28058d179ae40edc66135458849f1073c841bc74 12-Jan-2012 Hans Wennborg <hans@hanshq.net> scanf analysis: the 'a' length modifier is valid with a scanlist

Before r148025 we (accidentally) didn't check whether a length modifier is
appropriate for a scanlist, but now we do.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148026 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-c90.c
ormat-strings-scanf.c
6de0b48c5531cfe7370e1a9eeaed0566fa65dc9b 12-Jan-2012 Hans Wennborg <hans@hanshq.net> scanf analysis: don't bail out after successful parse of scanlist

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148025 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-scanf.c
72b8f788149de5d667a0f76b674685bbd82dfc46 11-Jan-2012 Douglas Gregor <dgregor@apple.com> Extend test-case as requested by Eli

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147974 91177308-0d34-0410-b5e6-96231b3b80d8
11-typedef-redef.c
ec3bd728cc6505c98543b001a1988c237f5fb9a9 11-Jan-2012 Douglas Gregor <dgregor@apple.com> Improve the diagnostic when trying to redefine a typedef with a
variably-modified type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147973 91177308-0d34-0410-b5e6-96231b3b80d8
11-typedef-redef.c
c0004df84fca9225b66a50adc66cf21c34298227 11-Jan-2012 Douglas Gregor <dgregor@apple.com> C11 allows typedefs to be redefined. Implement this in C11 mode, and
downgrade the default-error warning to an ExtWarn in
C90/99. <rdar://problem/10668057>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147925 91177308-0d34-0410-b5e6-96231b3b80d8
11-typedef-redef.c
7ead5c7b6fd48cf549e55b4db499c26ecf88ae75 10-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Implement the missing pieces of Evaluate for _Complex types. With that complete, remove some code from CGExprConstant which is no longer necessary. While I'm here, a couple minor tweaks to _Complex-in-C++. (Specifically, make _Complex types literal types, and don't warn for _Complex int.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147840 91177308-0d34-0410-b5e6-96231b3b80d8
omplex-init-list.c
d87a0cd2b3e1c9e9f01212875f4cbe5b7bb7ab57 06-Jan-2012 Matt Beaumont-Gay <matthewbg@google.com> Suppress -Wunused-value within macros from system headers.

Along the way, move a helper function from SemaChecking.cpp to a more
accessible home in SourceManager.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147692 91177308-0d34-0410-b5e6-96231b3b80d8
nputs/unused-expr-system-header.h
nused-expr-system-header.c
a0b2ba1d0ec27240f922c95b5acd8df905e3d3e0 06-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Minor refactoring of sentinel warning on blocks. Add a test for this warning.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147641 91177308-0d34-0410-b5e6-96231b3b80d8
lock-sentinel-attribute.c
73076431605556fdbf28d287d084a73a24a8b8d4 05-Jan-2012 John McCall <rjmccall@apple.com> The value of a const weak variable is not an integer constant.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147575 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
952b35dc07d5c77592a1b6bd54257511fcdb1ca9 03-Jan-2012 Ted Kremenek <kremenek@apple.com> Add test case for PR 9774, which got fixed along the way.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147479 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unreachable.c
d7c56e1114bfe7d461786903bb720d2c6efc05a1 29-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Change the diagnostics which said 'accepted as an extension' to instead say
'is an extension'. The former is inappropriate and confusing when building with
-Werror/-pedantic-errors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147357 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
89.c
ompound-literal.c
14b94366a829d2ed1b1b6d5cec1bb83aad9aeca2 21-Dec-2011 Eli Friedman <eli.friedman@gmail.com> Attempt to fix test on 32-bit hosts.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147030 91177308-0d34-0410-b5e6-96231b3b80d8
tatic-init.c
6bd9719fd97abac1b8126eae866e96db88be4ac8 21-Dec-2011 Eli Friedman <eli.friedman@gmail.com> Fix a case where Expr::isConstantInitializer would return true for an expression we can't support. In a slightly amusing twist, the case in question was already in the clang regression tests marked as a valid construct. <rdar://problem/10020074>



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147026 91177308-0d34-0410-b5e6-96231b3b80d8
tatic-init.c
9c7a925d93ff4a7b753f4fe0ba097abf82ba68f4 20-Dec-2011 Chandler Carruth <chandlerc@gmail.com> Remove some extraneous carriage returns from these files. One of the
Windows subversion clients isn't setup to default to eol:native again...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146952 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-declspec-ignored.c
fc038e9ef8ed262724f42597ca5c844de97b1202 17-Dec-2011 Eli Friedman <eli.friedman@gmail.com> Remove a non-gcc-compatible extension that would apply attributes on declarations without a declarator to structs. Add a warning for ignored attributes. Patch by Michael Han.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146796 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-declspec-ignored.c
ttr-deprecated.c
arn-cast-align.c
25b009a9d2a79929112d3c28c7dd1730bf5246c8 16-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> PR11594: Don't blindly build a UnaryOperator UO_Minus on an expression which
might not be an rvalue when checking array accesses. Instead, pass through a
flag indicating the array index is negated.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146753 91177308-0d34-0410-b5e6-96231b3b80d8
rray-bounds-ptr-arith.c
31b9a984d7eaa3e886e2da231f165434c15e82ef 15-Dec-2011 Hans Wennborg <hans@hanshq.net> Fix test/Sema/format-strings-scanf.c

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146651 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-scanf.c
d02deebce5f1b283101e035a7f5d5bab0d2068ec 15-Dec-2011 Hans Wennborg <hans@hanshq.net> Support the 'a' length modifier in scanf format strings as a C90
extension.

This fixes gcc.dg/format/c90-scanf-3.c and ext-4.c (test for excess
errors).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146649 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-c90.c
ormat-strings-scanf.c
b17ee5bff0d7986c14cdddb279e0131bd7f9678d 15-Dec-2011 Eli Friedman <eli.friedman@gmail.com> Enhance the -Wsign-compare handling to suppress the -Wsign-compare warning in the case of a shifted bitfield. PR11572.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146634 91177308-0d34-0410-b5e6-96231b3b80d8
ompare.c
2fe9b7fb07dff15dd15dd8755a9a9e6de0fe46fc 15-Dec-2011 Richard Trieu <rtrieu@google.com> Modify how the -verify flag works. Currently, the verification string and
diagnostic message are compared. If either is a substring of the other, then
no error is given. This gives rise to an unexpected case:

// expect-error{{candidate function has different number of parameters}}

will match the following error messages from Clang:

candidate function has different number of parameters (expected 1 but has 2)
candidate function has different number of parameters

It will also match these other error messages:

candidate function
function has different number of parameters
number of parameters

This patch will change so that the verification string must be a substring of
the diagnostic message before accepting. Also, all the failing tests from this
change have been corrected. Some stats from this cleanup:

87 - removed extra spaces around verification strings
70 - wording updates to diagnostics
40 - extra leading or trailing characters (typos, unmatched parens or quotes)
35 - diagnostic level was included (error:, warning:, or note:)
18 - flag name put in the warning (-Wprotocol)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146619 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-unavailable-message.c
lock-misc.c
uiltins.c
ormat-strings-size_t.c
mplicit-builtin-redecl.c
verloadable-complex.c
verloadable.c
hread-specifier.c
364a59ed8f0b3adb6a9eb9f2d687650ec1d0d8e5 12-Dec-2011 Fariborz Jahanian <fjahanian@apple.com> Fixes a bug in calculation of field offsets of ms_struct
fields by just following what comment says.
// rdar://10513599


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146414 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-ms_struct.c
c08e618f990e3a01a86ee221df73268a66664be8 12-Dec-2011 Hans Wennborg <hans@hanshq.net> Fix signature of vsscanf in Builtins.def

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146392 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-scanf.c
d95a8ab030fd2e6daec901f3d0be8c7bb2b7c941 12-Dec-2011 Hans Wennborg <hans@hanshq.net> Fix signature of sscanf in Builtins.def

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146390 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-scanf.c
439ddaada2df048ecad2c0ba1934f8a890812618 12-Dec-2011 Hans Wennborg <hans@hanshq.net> Make fscanf, vscanf, etc. be recognized as scanf-like functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146367 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-scanf.c
6fcd932dfd6835f70cc00d6f7c6789793f6d7b66 10-Dec-2011 Hans Wennborg <hans@hanshq.net> Check that arguments to a scanf call match the format specifier,
and offer fixits when there is a mismatch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146326 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-fixit.c
ormat-strings-int-typedefs.c
ormat-strings-scanf.c
e7edf30143e565574c9bed0f1dbeaa47bb9a0891 10-Dec-2011 NAKAMURA Takumi <geek4civic@gmail.com> test/Sema/attr-availability.c: Add explicit -triple x86_64-apple-darwin9, for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146321 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-availability.c
006e42f0c8b65b783d565ef10b938a9e82fc02e3 10-Dec-2011 Fariborz Jahanian <fjahanian@apple.com> Add ability to supply additional message to availability macros,
// rdar://10095131


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146304 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-availability.c
f48fdb0937e67f691393f9ffdf75653e5128ea13 09-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> C++11 constant expressions: Don't use CheckICE in C++11; instead, determine
whether an expression is a (core) constant expression as a side-effect of
evaluation. This takes us from accepting far too few expressions as ICEs to
accepting slightly too many -- fixes for the remaining cases are coming next.

The diagnostics produced when an expression is found to be non-constant are
currently quite poor (with generic wording but reasonable source locations),
and will be improved in subsequent commits.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146289 91177308-0d34-0410-b5e6-96231b3b80d8
-c-e.c
witch.c
f4f0c6095d1f481b94c6821c65e3bf1c9df42af7 09-Dec-2011 Hans Wennborg <hans@hanshq.net> Make printf warnings refer to wint_t and wchar_t by name
in addition to underlying type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146254 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-int-typedefs.c
117348caf0a8f91782e9e32e32a8689576f394d7 09-Dec-2011 Hans Wennborg <hans@hanshq.net> fix format specifier fixit for printf("%ld", "foo");

It should reset the length modifier (unless it's a wchar_t string).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146252 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-fixit.c
e052d46f4db91f9ba572859ffc984e85cbf5d5ff 09-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> Replace the implementation of __builtin_constant_p (which was based on the GCC
documentation) with one based on what GCC's __builtin_constant_p is actually
intended to do (discovered by asking a friendly GCC developer).

In particular, an expression which folds to a pointer is now only considered to
be a "constant" by this builtin if it refers to the first character in a string
literal.

This fixes a rather subtle wrong-code issue when building with glibc. Given:

const char cs[4] = "abcd";
int f(const char *p) { return strncmp(p, cs, 4); }

... the macro magic for strncmp produces a (potentially crashing) call to
strlen(cs), because it expands to an expression starting with:

__builtin_constant_p(cs) && strlen(cs) < 4 ? /* ... */

Under the secret true meaning of __builtin_constant_p, this is guaranteed to be
safe!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146236 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.c
5a477dbf7589f516effe56fa2ed7d4680b5c1094 09-Dec-2011 Fariborz Jahanian <fjahanian@apple.com> deprecated enum should not warn when used initializing another deprecated enumerator.
// rdar://10535640


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146218 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-availability-macosx.c
e3ca33aba226c7b5d50703df008ef0ef5f9ea7da 08-Dec-2011 Hans Wennborg <hans@hanshq.net> Only do typo correction for implicit function decls when
they are treated as errors.

Doing typo correction when these are just warnings slows down the
compilation of source which deliberately uses implicit function
declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146153 91177308-0d34-0410-b5e6-96231b3b80d8
89.c
mplicit-decl.c
a792aff1c7de253b89c473fdb7eef4a5bba83aec 07-Dec-2011 Hans Wennborg <hans@hanshq.net> Make printf warnings refer to intmax_t et al. by name
in addition to underlying type.

For example, the warning for printf("%zu", 42.0);
changes from "conversion specifies type 'unsigned long'" to "conversion
specifies type 'size_t' (aka 'unsigned long')"

(This is a second attempt after r145697, which got reverted.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146032 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-int-typedefs.c
ormat-strings-size_t.c
aa9c3503867bc52e1f61c4da676116db1b1cdf01 07-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> When folding the size of a global scope VLA to a constant, require the array
bound to not have side effects(!). Add constant-folding support for expressions
of void type, to ensure that we can still fold ((void)0, 1) as an array bound.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146000 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
122de3e131a6902d22c97471520ec9005cca6f03 06-Dec-2011 Hans Wennborg <hans@hanshq.net> Suggest typo corrections for implicit function declarations.

A mistyped function call becomes an inmplicit function declaration in C.
Suggest typo correction when one can be found.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145930 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.c
89.c
mplicit-decl.c
649657e7d6c150136cae5ab22e39b9794cff80cc 04-Dec-2011 Fariborz Jahanian <fjahanian@apple.com> Move block return type inference diagnostic to a common place where
Function or array lvalue conversions happens.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145782 91177308-0d34-0410-b5e6-96231b3b80d8
lock-return.c
0586520acb2f368c874943353a222be7f00c3068 03-Dec-2011 Fariborz Jahanian <fjahanian@apple.com> If block literal return type is not specified, return type of the block is
inferred from return types. All the return statements have to agree about the type.
// rdar://10466373


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145774 91177308-0d34-0410-b5e6-96231b3b80d8
lock-explicit-noreturn-type.c
lock-return.c
687b5df89d4ba91219df578d02087c68c09a0332 03-Dec-2011 Nick Lewycky <nicholas@mxc.ca> Revert r145697 and dependent patch r145702. It added a dependency from
lib/Analysis to lib/Sema which is cyclical.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145724 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-int-typedefs.c
377cc6e3e8a6d9d0c90a315d29ce84836383d059 02-Dec-2011 Hans Wennborg <hans@hanshq.net> Make r145697 actually work.

Use the canonical type of the typedef to compare with the underlying type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145702 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-int-typedefs.c
5fdc1b993dcb01e8a994fdacfc4eb089832c82e3 02-Dec-2011 Hans Wennborg <hans@hanshq.net> Make conversion specifier warning refer to typedef if possible.

For example, the warning for printf("%zu", 42.0);
changes from "conversion specifies type 'unsigned long'" to "conversion
specifies type 'size_t' (aka 'unsigned long')"

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145697 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-int-typedefs.c
bff22ac1f8b78e4c19d5c3e00226ecea3b24e60f 02-Dec-2011 Eli Friedman <eli.friedman@gmail.com> Fix bitfield handling for record layout with #pragma pack. <rdar://problem/10494810> and PR9560.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145673 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-pack-5.c
c5f9a011a5c13361a3a56ed7fa3507b4b585063e 02-Dec-2011 Eric Christopher <echristo@apple.com> Add support for AVX registers to clang inline asm. Add a small testcase
and update the Sema testcase with a register that we won't hit for a while
I hope.

Fixes rdar://10510405

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145671 91177308-0d34-0410-b5e6-96231b3b80d8
sm.c
901dd668931a70932ad09092959c42693409a3cd 01-Dec-2011 Eli Friedman <eli.friedman@gmail.com> Fix MSVC class layout for empty classes. Patch by Dmitry Sokolov.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145544 91177308-0d34-0410-b5e6-96231b3b80d8
s_class_layout.cpp
39b4fc888d2b9b8fe1a9c982964b5054ba1c3c73 28-Nov-2011 Fariborz Jahanian <fjahanian@apple.com> pinpoint name/location of deprecated/unavailable enumerator
whose enum has been made deprecated/unavailable in the warning.
// rdar://10201690


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145264 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-deprecated.c
ttr-unavailable-message.c
2ad226bdc847df6b6b6e4f832856478ab63bb3dc 16-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> PR11391: Don't try to evaluate the LHS of a _Complex assignment as an rvalue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144799 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
b755a9da095d2f2f04444797f1e1a9511693815b 16-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Fix PR11385: A pointer constant expression which has been cast via an integer is
not safely derived. Don't allow lvalue-to-rvalue conversions on the result of
dereferencing such a pointer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144783 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
ddadaa4579dbb12dcfad62ee86e1e52e12f298ee 12-Nov-2011 Eli Friedman <eli.friedman@gmail.com> Add missing casts to AST.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144455 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
8ac2c66a1442985091c5ec2b33ce6d3df3bcb529 11-Nov-2011 Eli Friedman <eli.friedman@gmail.com> Make sure that restrict-qualifying an array actually adds a restrict qualifier. PR11354. (operator bool() is evil!)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144355 91177308-0d34-0410-b5e6-96231b3b80d8
unction.c
6f9f03ef370ad48ece0c5d10edda28f39ccadb5d 08-Nov-2011 Bob Wilson <bob.wilson@apple.com> Check pointer types for arguments of Neon load/store macros. rdar://9958031

The Neon load/store intrinsics need to be implemented as macros to avoid
hiding alignment attributes on the pointer arguments, and the macros can
only evaluate those pointer arguments once (in case they have side effects),
so it has been hard to get the right type checking for those pointers.
I tried various alternatives in the arm_neon.h header, but it's much more
straightforward to just check directly in Sema.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144075 91177308-0d34-0410-b5e6-96231b3b80d8
rm-neon-types.c
9da235244c2de2bcca654b518c66133c30ebde53 08-Nov-2011 John McCall <rjmccall@apple.com> Fix the layout of vb-tables and vf-tables in the MS C++ ABI.
Based on work by Dmitry Sokolov!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144072 91177308-0d34-0410-b5e6-96231b3b80d8
s_class_layout.cpp
32bae37b821e6ade738849ac14e3d3de06afb0be 05-Nov-2011 Bob Wilson <bob.wilson@apple.com> Fix vector macros to correctly check argument types. <rdar://problem/10261670>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143792 91177308-0d34-0410-b5e6-96231b3b80d8
86-builtin-palignr.c
74f4634781cee06e28eb741bda5d0f936fdd1948 04-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: although we don't know whether a literal will
be at the same address as another object, we do know it won't alias a null
pointer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143674 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
19bda3ad8b5d37e505214e82fab1d0a0bf00f0fd 02-Nov-2011 Eli Friedman <eli.friedman@gmail.com> Add an option to emulate the strange Apple gcc behavior of #pragma pack.

<rdar://problem/10374763>



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143527 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-pack-apple.c
65ac598c7ba7e36f2ad611f2bb39cc957053be5d 01-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> When constant-folding, don't look at the initializer of a global const variable
if it's marked as weak: that definition may not end up being used.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143496 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
6a7c94af983717e2c2d6aebe42cb4737c1c7b9e6 31-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Refactoring and test for r143360. Support for array rvalue to pointer decay is
needed for C++11, and will follow later.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143363 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
7993e8a2a26bf408c2a6d45f24fffa12db336b2b 31-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Fix assert on constant expression evaluation of floating point increment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143320 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
342f1f8b0a402c5a7f8c5055db7f60a7808f1687 30-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Don't crash if a GCC binary conditional is used in a constant expression on an
integer-cast pointer value.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143299 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
ee591a90c2e26c1ba33a4befb364a1c35fb2c311 29-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Fix assertion in constant expression evaluation. The LHS of a floating-point
binary operator isn't an rvalue if it's an assignment operator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143250 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
55733de16f492dadbf5f4d2809d6c610ba6d86ae 28-Oct-2011 Richard Trieu <rtrieu@google.com> Fix for PR9751 to change the behavior of -Wformat warnings. If the format
string is part of the function call, then there is no difference. If the
format string is not, the warning will point to the call site and a note
will point to where the format string is.

Fix-it hints for strings are moved to the note if a note is emitted. This will
prevent changes to format strings that may be used in multiple places.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143168 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-no-fixit.c
ormat-strings-scanf.c
ormat-strings.c
29e97cb35fab314388f62b68fefa78947e93c1dc 27-Oct-2011 Hans Wennborg <hans@hanshq.net> Teach format string analysis that "%zu" means size_t.

The code had it backwards, thinking size_t was signed, and using that for "%zd".

Also let the analysis get the types for (u)intmax_t while we are at it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143099 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-size_t.c
90eed219f4215adf300800ab7478f568c7a4b2a3 27-Oct-2011 Fariborz Jahanian <fjahanian@apple.com> Do not warn when weak-import attribute is applied to enum
decl. in Darwin due to certain projects requirement.
// rdar://10277579


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143082 91177308-0d34-0410-b5e6-96231b3b80d8
eak-import-on-enum.c
6ca4a9ae99d65948e578d3e7d1f58ab6a947d2d7 25-Oct-2011 Ted Kremenek <kremenek@apple.com> Tweak printf format string parsing to accept 'hh' conversion specifier to accept any char, not just signed char. Fixes <rdar://problem/10303638>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142908 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
32cb47174304bc7ec11478b9497c4e10f48273d9 24-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> In accordance with the C89, C99 and C++98 standards, ICEs can only contain
floating-point literals if they are the immediate operands of casts.
ImplicitCastExpr is not a cast in the language-standards sense.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142832 91177308-0d34-0410-b5e6-96231b3b80d8
-c-e.c
5e745da03df27ac620b0a5cc280d0d1757cfbac1 22-Oct-2011 Ted Kremenek <kremenek@apple.com> Only emit implicit constant conversion truncation warnings in reachable code. Apparently this is what GCC does, and some code depends on this. Fixes <rdar://problem/10321089>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142716 91177308-0d34-0410-b5e6-96231b3b80d8
onstant-conversion.c
onversion.c
9bc2c6e3b49523029f54596501cc1f3f2ebcaec2 22-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Add tests for CodeGen types in MS ABI. Based on patch by r4start.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142697 91177308-0d34-0410-b5e6-96231b3b80d8
s_class_layout.cpp
227e483cb1f77ea6dcd38c2ca9fb490894a5f887 22-Oct-2011 Eli Friedman <eli.friedman@gmail.com> More ASTRecordLayout changes for MS ABI; based on patch by r4start.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142694 91177308-0d34-0410-b5e6-96231b3b80d8
s_class_layout.cpp
b57791e5b40afa6691063c83d0e95c416fb19fde 21-Oct-2011 Douglas Gregor <dgregor@apple.com> Treat the Microsoft/Borland keyword "__except" as a context-sensitive
keyword, because both libstdc++ and libc++ use "__except" as an
identifier. Fixes <rdar://problem/10322555>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142636 91177308-0d34-0410-b5e6-96231b3b80d8
_try.c
0d381810da19dd7677b9a79fca516d298fa5addb 19-Oct-2011 Matt Beaumont-Gay <matthewbg@google.com> Only warn at self-initialization if some later use is always uninitialized.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142538 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
68db6f0541bb9d54ab2ddffec4f7e2c0294e1f85 19-Oct-2011 Hans Wennborg <hans@hanshq.net> Break out ssize_t test from Sema/format-strings-fixit.c

Move to a separate test that sets a specific target triple
so that the type of ssize_t is known.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142481 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-fixit-ssize_t.c
ormat-strings-fixit.c
36e76089b30180ba86598be95bbb0989657fe2fc 18-Oct-2011 Hans Wennborg <hans@hanshq.net> Another attempt at fixing format-strings-fixit.c.

Use "%f" as format string to make sure it doesn't match size_t, etc.
whatever they might be typedeffed to, so that the fixit always applies.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142348 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-fixit.c
4886e32e1f0bc778a47d23ac88a9c72f2c6305b0 18-Oct-2011 Hans Wennborg <hans@hanshq.net> 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142345 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-fixit.c
a7da2155167676a6a5d9fca4de947a9cab2a4908 18-Oct-2011 Hans Wennborg <hans@hanshq.net> 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142342 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-fixit.c
97c0aefe8c0523417ffe8a500a220286e11e7a46 18-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Rewrite parts of MS ABI C++ layout. Based on work by r4start; I ended up doing this while I was trying to review his patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142325 91177308-0d34-0410-b5e6-96231b3b80d8
s_class_layout.cpp
6ec96438ede86b1a00f80dff25027f5a876613a8 17-Oct-2011 Tanya Lattner <tonic@nondot.org> 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142250 91177308-0d34-0410-b5e6-96231b3b80d8
ector-ops.c
d82e5d30930f80a92c1270e270fdb475e3718d25 17-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Perform an lvalue-to-rvalue conversion on an array index in a __builtin_offsetof expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142179 91177308-0d34-0410-b5e6-96231b3b80d8
ffsetof.c
20cdbeb8f36576f469db195b4140c293c7281718 16-Oct-2011 Peter Collingbourne <peter@pcc.me.uk> Add sema checks for calls to functions taking static array parameters

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142157 91177308-0d34-0410-b5e6-96231b3b80d8
tatic-array.c
8eb5b29ec11f5f6922132a68f8e88a9b0f69a489 15-Oct-2011 Anton Korobeynikov <asl@math.spbu.ru> Missed tests for half FP support


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142017 91177308-0d34-0410-b5e6-96231b3b80d8
p16-sema.c
9ce6377714a8eb8f577c87028300421e72b00dc9 14-Oct-2011 Matt Beaumont-Gay <matthewbg@google.com> Only warn in -Wliteral-conversion if the conversion loses information

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141955 91177308-0d34-0410-b5e6-96231b3b80d8
nr-def-call.c
9e7617220135a6f6226cf09cb242cc1b905aedb4 13-Oct-2011 Ted Kremenek <kremenek@apple.com> Tweak -Wuninitialized's handling of 'int x = x' to report that as the root cause of an uninitialized variable IFF there are other uses of that uninitialized variable. Fixes <rdar://problem/9259237>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141881 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
18c407fcb25ea88a52ad48fcc4397c3616dd185d 12-Oct-2011 Bob Wilson <bob.wilson@apple.com> Change __extension__ to disable only diagnostics controlled by -pedantic.

This changes clang to match GCC's behavior for __extension__, which temporarily
disables the -pedantic flag. Warnings that are enabled without -pedantic
are not affected. Besides the general goodness of matching GCC's precedent,
my motivation for this is that macros in the arm_neon.h header need to use
__extension__ to avoid pedantic complaints about their use of statement
expressions, yet we still want to warn about incompatible pointer arguments
for those macros.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141804 91177308-0d34-0410-b5e6-96231b3b80d8
mplicit-int.c
6700415542121e2cb7d867728046ffa21e402019 12-Oct-2011 Rafael Espindola <rafael.espindola@gmail.com> Add returns_twice to functions that are known to return twice. This implements
the same behavior of gcc by keeping the attribute out of the function type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141803 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-returns-twice.c
a268fc0f2229eb132ebc8501b140093aeb5516bf 11-Oct-2011 Daniel Dunbar <daniel@zuster.org> Frontend: Replace -nostdinc by -nostdsysteminc (which is just system include
paths). The -nostdinc behavior is now -nostdsysteminc + -nobuiltininc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141691 91177308-0d34-0410-b5e6-96231b3b80d8
onversion.c
276b061970939293f1abaf694bd3ef05b2cbda79 11-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Initial implementation of __atomic_* (everything except __atomic_is_lock_free).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141632 91177308-0d34-0410-b5e6-96231b3b80d8
tomic-ops.c
682eae243ae3d96fe3dc302091034e08c414db10 07-Oct-2011 Chandler Carruth <chandlerc@gmail.com> Hack in a workaround for PR11082 until we have a proper fix. This
un-breaks every glib-dependent compile with Clang.

I'm not sure this is even the best workaround, so suggestions welcome.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141381 91177308-0d34-0410-b5e6-96231b3b80d8
ypes.c
aa2176b4cd1115adb29f29eca3e6e2fc6d543170 07-Oct-2011 Ted Kremenek <kremenek@apple.com> r141345 also fixed a -Wuninitialized bug where loop conditions were not always flagged as being uninitialized. Addresses <rdar://problem/9432305>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141346 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
c5f740ecdbc21d5ba08f97b89cc05c9d4f230fda 07-Oct-2011 Ted Kremenek <kremenek@apple.com> Fix infinite loop in -Wuninitialized reported in PR 11069.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141345 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
b001de7458d17c17e6d8b8034c7cfcefd3b70c00 07-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Support for C1x _Atomic specifier (see testcase). This is primarily being committed at the moment to help support C++0x <atomic>, but it should be a solid base for implementing the full specification of C1x _Atomic.

Thanks to Jeffrey Yasskin for the thorough review!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141330 91177308-0d34-0410-b5e6-96231b3b80d8
tomic-type.c
d211cb709510fbe7e75167b9feee0050851d001a 06-Oct-2011 Ted Kremenek <kremenek@apple.com> Use a sidetable in ASTContext for ParmVarDecls whose index exceeds the 8 bits reserved for that value in VarDecl. Fixes PR 10538.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141273 91177308-0d34-0410-b5e6-96231b3b80d8
any-parameters.c
88934e85f81abdc4fb5202325252be3bcab5ebf0 05-Oct-2011 Daniel Dunbar <daniel@zuster.org> Driver & AST: Implement support for -fpack-struct and -fpack-struct= command
line options.
- <rdar://problem/10120602>, PR9631

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141211 91177308-0d34-0410-b5e6-96231b3b80d8
pack-struct.c
53c8167d7a007daae87f342c0fedd03f1dcf1b62 05-Oct-2011 Fariborz Jahanian <fjahanian@apple.com> c: assignment/init of a function pointer whose function(s)
return to one which does not return (has noreturn attribute)
should warn as it is an unsafe assignment. // rdar://10095762
c++ already handles this. This is the c version.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141141 91177308-0d34-0410-b5e6-96231b3b80d8
nitialize-noreturn.c
e82247a71a1a76e78f3b979b64d5f6412ab40266 01-Oct-2011 John McCall <rjmccall@apple.com> Hey, maybe we shouldn't silently ignore decl attributes
on declarators written as types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140931 91177308-0d34-0410-b5e6-96231b3b80d8
ypes.c
9afbfbe71c8e69e2643d468a041473d07d2635d4 30-Sep-2011 Eli Friedman <eli.friedman@gmail.com> Support dllimport and dllexport on x86-64 Windows. PR10978. Patch by Ruben Van Boxem.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140871 91177308-0d34-0410-b5e6-96231b3b80d8
llimport-dllexport.c
8dfac0baaf0f81d3945bcb306480e358ba8d1f08 30-Sep-2011 John McCall <rjmccall@apple.com> Add explicit attributes to mark functions as having had their
CoreFoundation object-transfer properties audited, and add a #pragma
to cause them to be automatically applied to functions in a particular
span of code. This has to be implemented largely in the preprocessor
because of the requirement that the region be entirely contained in
a single file; that's hard to impose from the parser without registering
for a ton of callbacks.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140846 91177308-0d34-0410-b5e6-96231b3b80d8
nputs/pragma-arc-cf-code-audited.h
ragma-arc-cf-code-audited.c
3fedbe1f71c18fba01d39109d606f421a0103a2a 30-Sep-2011 Eli Friedman <eli.friedman@gmail.com> Some fixes for MS-style asm parsing: specifically, add some error checking, and handle asm comments using semicolons correctly. (The comments are actually surprisingly tricky.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140837 91177308-0d34-0410-b5e6-96231b3b80d8
s-fuzzy-asm.c
97db7265ac1993e14e5877292e23d5ed2e9cf719 29-Sep-2011 Fariborz Jahanian <fjahanian@apple.com> c - Enumerators may inherit the deprecated/unavailable
attributes from the enumeration type.
// rdar://10201690


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140800 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-deprecated.c
ttr-unavailable-message.c
82d0b0aab9088e977c2a44c4a5a90479c63149fe 29-Sep-2011 Peter Collingbourne <peter@pcc.me.uk> Add support for alignment-specifiers in C1X and C++11, remove
support for the C++0x draft [[align]] attribute and add the C1X
standard header file stdalign.h

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140796 91177308-0d34-0410-b5e6-96231b3b80d8
lignas.c
arn-cast-align.c
4cd5791f4aa6deb572979bb38c1deedbc155efe0 29-Sep-2011 Ted Kremenek <kremenek@apple.com> Do not warn about empty format strings when there are no data arguments. Fixes <rdar://problem/9473155>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140777 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
39834ba5a9a9e998cc542f683d0e6327b406f088 28-Sep-2011 Eli Friedman <eli.friedman@gmail.com> PR11002: Make sure we emit sentinel warnings with a valid source location. (Ideally, we want to use the location returned by getLocForEndOfToken, but that is not always successful.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140658 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-sentinel.c
2fe363622c32c471e8a68c68ba5cc372644f24fb 27-Sep-2011 Eli Friedman <eli.friedman@gmail.com> Some changes to improve compatibility for MSVC-style C++ struct layout. Patch from r4start at gmail.com (with some minor modifications by me).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140623 91177308-0d34-0410-b5e6-96231b3b80d8
s_class_layout.cpp
8a5d929268beeb69b654120fb0b4f8893ad230eb 26-Sep-2011 Eli Friedman <eli.friedman@gmail.com> CheckStringInit has side effects; make sure we don't run it in VerifyOnly mode, at least for the moment. <rdar://problem/10185490>.

Sebastian, please take a look at this; I'm not entirely sure it is the right thing to do.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140552 91177308-0d34-0410-b5e6-96231b3b80d8
nit.c
0c706c29f20b6fa36759fa41333b9c3ec0bd2969 20-Sep-2011 Eli Friedman <eli.friedman@gmail.com> Add list initialization for complex numbers in C. Essentially, this allows "_Complex float x = {1.0f, 2.0f};". See changes to docs/LanguageExtensions.html for a longer description.

<rdar://problem/9397672>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140090 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
omplex-init-list.c
cb4d7c202e74783d9c820f155ae27605aa9f5c16 12-Sep-2011 Hans Wennborg <hans@hanshq.net> Silence ?: precendence warning when parenthesis are present.

Fixes PR10898. The warning should be silent when there are parenthesis
around the condition expression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139492 91177308-0d34-0410-b5e6-96231b3b80d8
arentheses.c
arentheses.cpp
4f4f349208b2b2307454e169ac7b039e989f003f 10-Sep-2011 David Blaikie <dblaikie@gmail.com> Show either a location or a fixit note, not both, for uninitialized variable warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139463 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
77f68bb90af93b95045fb994e7cd68137adcc132 10-Sep-2011 Julien Lerouge <jlerouge@apple.com> Bring llvm.annotation* intrinsics support back to where it was in llvm-gcc: can
annotate global, local variables, struct fields, or arbitrary statements (using
the __builtin_annotation), rdar://8037476.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139423 91177308-0d34-0410-b5e6-96231b3b80d8
nnotate.c
2315318436b3e94d54c220c3b8986e8002394a43 06-Sep-2011 Richard Smith <richard-llvm@metafoo.co.uk> PR10867: Work around a bug in lit. Multiple RUN: lines are joined with &&, so:

RUN: foo
RUN: bar || true

is equivalent to:

RUN: foo && bar || true

which is equivalent to:

RUN: (foo && bar) || true

This resulted in several of the fixit tests not really testing anything.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139132 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-fixit.c
6f27542da8843b5c1c579b86e342385bcc43d5f0 02-Sep-2011 Ted Kremenek <kremenek@apple.com> -Wuninitialized: fix insidious bug resulting from interplay of blocks and dead code. Fixes <rdar://problem/10060250>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139027 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
b0656ec72e25e5c8e463c2dc39914636f0cb06d1 31-Aug-2011 Chandler Carruth <chandlerc@gmail.com> Improve the diagnostic text for -Wmissing-noreturn to include the name
of the function in question when applicable (that is, not for blocks).
Patch by Joerg Sonnenberger with some stylistic tweaks by me.

When discussing this weth Joerg, streaming the decl directly into the
diagnostic didn't work because we have a pointer-to-const, and the
overload doesn't accept such. In order to make my style tweaks to the
patch, I first changed the overload to accept a pointer-to-const, and
then changed the diagnostic printing layer to also use
a pointer-to-const, cleaning up a gross line of code along the way.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138854 91177308-0d34-0410-b5e6-96231b3b80d8
eturn-noreturn.c
62088e3317c74a3a8baf2db3e1bd7ab0b7ddc590 27-Aug-2011 Ted Kremenek <kremenek@apple.com> Control 'invalid conversion specifier' warnings under a subflag (-Wformat-invalid-specifier) of -Wformat. Fixes <rdar://problem/10031930>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138686 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
e7a2764b2c98859aa42a3fd36d55cd34c7fe883e 25-Aug-2011 Ted Kremenek <kremenek@apple.com> Teach -Wunreachable-code about dead code caused by macro expansions. This should suppress false positives resulting from 'assert' and friends.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138576 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unreachable.c
f40fd6bbb2684db5efb18627ea355613c235d23f 24-Aug-2011 Eli Friedman <eli.friedman@gmail.com> Refactor and fix checking for initialization of flexible array members. The old version had the checks scattered across the code, missed some checks, and had a couple nasty bugs in existing checks.

Fixes PR10648 and another similar accepts-invalid bug.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138398 91177308-0d34-0410-b5e6-96231b3b80d8
lexible-array-init.c
540dda6f2e4982b3eab0300c804345f5b6104c11 23-Aug-2011 Ted Kremenek <kremenek@apple.com> Fix regression in -Wuninitialized involving VLAs. It turns out that we were modeling sizeof(VLAs)
incorrectly in the CFG, and also the static analyzer. This patch regresses the analyzer a bit, but
that needs to be followed up with a better solution.

Fixes <rdar://problem/10008112>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138372 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
00fd773ae92aa452be1bb139a186599b2c43531a 19-Aug-2011 Ted Kremenek <kremenek@apple.com> Rename -Wstrl-incorrect-size to -Wstrlcpy-strlcat-size. This warning really is just specific to strlcpy and strlcat.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138038 91177308-0d34-0410-b5e6-96231b3b80d8
arn-strlcpycat-size.c
8f7462237ff542a4556775f98709ed300aa1731a 19-Aug-2011 Ted Kremenek <kremenek@apple.com> Enhance -Wstrl-incorrect-size to not report a FIXIT for destinations that are flexible arrays or have size 1.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138004 91177308-0d34-0410-b5e6-96231b3b80d8
arn-strlcpycat-size.c
bd5da9d1a711e90b3bc265b4798954085c0b48d9 18-Aug-2011 Ted Kremenek <kremenek@apple.com> Reapply r137903, but fix the definition of size_t in the test case to use __SIZE_TYPE__ (and hence be portable).

Also, change the warning to -Wstrl-incorrect-size.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137980 91177308-0d34-0410-b5e6-96231b3b80d8
arn-strlcpycat-size.c
1cb4f664fd4f72a65a145e9ff8a7e2540ab09156 18-Aug-2011 Ted Kremenek <kremenek@apple.com> Revert r137903, "Add experimental -Wstrlcpy-size warning that looks to see if the size argument for strlcpy/strlcat is the size of the *source*, and not the size of the *destination*. This warning is off by default (for now)."

This currently doesn't work on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137920 91177308-0d34-0410-b5e6-96231b3b80d8
arn-strlcpycat-size.c
1e473ccb0e0f6fd1954bef330f7193c1a3fb3ba1 18-Aug-2011 Ted Kremenek <kremenek@apple.com> Implement '-Weverything', which enables all warnings except those explicitly mapped to be ignored.

Currently this includes -pedantic warnings as well; we'll need to consider whether these should
be included.

This works as expected with -Werror.

Test cases were added to Sema/warn-unused-parameters.c, but they should probably be broken off into
their own test file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137910 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unused-parameters.c
4b53117c9942db2e08f18be25d9ccf7daf6af0b2 18-Aug-2011 Ted Kremenek <kremenek@apple.com> Add experimental -Wstrlcpy-size warning that looks to see if the size argument for strlcpy/strlcat is the size of the *source*, and not the size of the *destination*. This warning is off by default (for now).

Warning logic provided by Geoff Keating.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137903 91177308-0d34-0410-b5e6-96231b3b80d8
arn-strlcpycat-size.c
ec8058f64bbcd79bd47748f4cf8628123dd3bae6 17-Aug-2011 Chandler Carruth <chandlerc@gmail.com> Treating the unused equality comparisons as something other than part of
-Wunused was a mistake. It resulted in duplicate warnings and lots of
other hacks. Instead, this should be a special sub-category to
-Wunused-value, much like -Wunused-result is.

Moved to -Wunused-comparison, moved the implementation to piggy back on
the -Wunused-value implementation instead of rolling its own, different
mechanism for catching all of the "interesting" statements.

I like the unused-value mechanism for this better, but its currently
missing several top-level statements. For now, I've FIXME-ed out those
test cases. I'll enhance the generic infrastructure to catch these
statements in a subsequent patch.

This patch also removes the cast-to-void fixit hint. This hint isn't
available on any of the other -Wunused-value diagnostics, and if we want
it to be, we should add it generically rather than in one specific case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137822 91177308-0d34-0410-b5e6-96231b3b80d8
nused-expr.c
9b127f3b44e685cbe513595b7e0115b0884b0604 15-Aug-2011 Matt Beaumont-Gay <matthewbg@google.com> Add fixit notes for -Wconstant-logical-operand.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137620 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
-c-e.c
d10f4bc5a05ce0cdc1646dbb0f706bb9d3dfc0c5 10-Aug-2011 Kaelyn Uhrain <rikka@google.com> Add a test case for the divide-by-zero fix in r137234


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137240 91177308-0d34-0410-b5e6-96231b3b80d8
rray-bounds-ptr-arith.c
3b6b7accb55980b149571d44e96f92dae500b0a9 10-Aug-2011 Douglas Gregor <dgregor@apple.com> For the availability attribute, allow a declaration to be deprecated
in the same version that it is introduced. Stuff happens.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137214 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-availability.c
9aab1489866a5afe1a8a3267f9ad7124034fd644 29-Jul-2011 Peter Collingbourne <peter@pcc.me.uk> Fix an inconsistency in Sema::ConvertArgumentsForCall in that
the callee note diagnostic was not emitted in the case where
there were too few arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136437 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
020972d5d6dc1f3c49839cfbadcccf4cbefb2f4d 27-Jul-2011 Peter Collingbourne <peter@pcc.me.uk> Forbid address-space-qualified function types, per TR 18037

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136257 91177308-0d34-0410-b5e6-96231b3b80d8
ddress_spaces.c
9f1210c3280104417a4ad30f0a00825ac8fa718a 26-Jul-2011 Chad Rosier <mcrosier@apple.com> After further discussion it has been determined that alignof should report
the preferred alignment. Thus, revert r135934, r135935, and r135940.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136062 91177308-0d34-0410-b5e6-96231b3b80d8
lign-arm-apcs-gnu.c
lign-arm-apcs.c
lign-arm.c
5485ac0bbef7c9f868df3c557383613636549bf4 26-Jul-2011 Eric Christopher <echristo@apple.com> Migrate over 2009-04-22-UnknownSize.c, 2009-07-17-VoidParameter.c,
2009-03-09-WeakDeclarations-1.c, and 2010-05-31-palignr.c from
llvm/test/FrontendC.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136033 91177308-0d34-0410-b5e6-96231b3b80d8
009-03-09-WeakDeclarations-1.c
009-04-22-UnknownSize.c
009-07-17-VoidParameter.c
010-05-31-palignr.c
822f54a7ba3eca643104623e8048be20a3391b19 25-Jul-2011 Chad Rosier <mcrosier@apple.com> Allow target to specify about using minimum alignment vs preferred. Takes care of
FIXME: Override "preferred align" for double and long long for ARM apcs-gnu ABI.
Also part of rdar://9802874

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135940 91177308-0d34-0410-b5e6-96231b3b80d8
lign-arm-apcs-gnu.c
e1467dbfd5d1068c2dd69511f16bc218475a9396 25-Jul-2011 Chad Rosier <mcrosier@apple.com> Fix r135934. Rename was intended, but without additional tests for double.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135935 91177308-0d34-0410-b5e6-96231b3b80d8
lign-arm-apcs-gnu.c
33abf4ed29594fa6af530def2a93a2bb69ab8863 25-Jul-2011 Chad Rosier <mcrosier@apple.com> Rename an alignment test to be more precise and add another test for the default
ABI.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135934 91177308-0d34-0410-b5e6-96231b3b80d8
lign-arm-apcs-gnu.c
lign-arm-apcs.c
lign-arm.c
52a75bab9da635b52c778c0ec178f51b9303ebbe 23-Jul-2011 Eric Christopher <echristo@apple.com> Migrate 2007-10-01-BuildArrayRef.c from llvm/test/FrontendC.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135840 91177308-0d34-0410-b5e6-96231b3b80d8
007-10-01-BuildArrayRef.c
7c634a04a23171cc2356e3129fb16b8e9da3bf00 22-Jul-2011 Eric Christopher <echristo@apple.com> Bring over a test from llvm/test/FrontendC that is for Sema and not CodeGen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135753 91177308-0d34-0410-b5e6-96231b3b80d8
rash-invalid-array.c
d837c0dc361a000b951593eaaa80c46b73d15b1d 22-Jul-2011 Chandler Carruth <chandlerc@gmail.com> Move duplicate uninitialized warning suppression into the
AnalysisBasedWarnings Sema layer and out of the Analysis library itself.
This returns the uninitialized values analysis to a more pure form,
allowing its original logic to correctly detect some categories of
definitely uninitialized values. Fixes PR10358 (again).

Thanks to Ted for reviewing and updating this patch after his rewrite of
several portions of this analysis.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135748 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
5254161b269829b74e7a9379b1bdfa27de72d7cc 21-Jul-2011 Richard Trieu <rtrieu@google.com> Remove warning for conditional operands of differend signedness from -Wsign-compare. Cases that previously warn on this will have a different warning emitted from -Wsign-conversion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135664 91177308-0d34-0410-b5e6-96231b3b80d8
onditional-expr.c
62d126e942f9f420c6f398d32deb914d413226a3 19-Jul-2011 Ted Kremenek <kremenek@apple.com> Fix false negative in -Wuninitialized involving a () wrapping an lvalue-to-rvalue conversion in a DeclStmt.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135525 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
d626ec404fd0f27244363200f1a85a7db219cd11 19-Jul-2011 Ted Kremenek <kremenek@apple.com> Fix assertion failure in UninitializedValues.cpp where an lvalue to rvalue conversion is wrapped in a parenthesis.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135519 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
0c8e5a0f70cbdb800d939c1807d05f380b2854d4 19-Jul-2011 Ted Kremenek <kremenek@apple.com> Reduce -Wuninitialized time by 22% (on sqlite) by removing the recursive AST crawl.

This is accomplished by forcing the needed expressions for -Wuninitialized to always be CFGElements in the CFG.
This allows us to remove a fair amount of the code for -Wuninitialized.

Some fallout:
- AnalysisBasedWarnings.cpp now specifically toggles the CFGBuilder to create a CFG that is suitable for -Wuninitialized. This
is a layering violation, since the logic for -Wuninitialized is in libAnalysis. This can be fixed with the proper refactoring.
- Some of the source locations for -Wunreachable-code warnings have shifted. While not ideal, this is okay because that analysis
already needs some serious reworking.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135480 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unreachable.c
8435069798b5621615f9f65c471c7e7808316b20 17-Jul-2011 Chandler Carruth <chandlerc@gmail.com> Revert r135217, which wasn't the correct fix for PR10358. With this
patch, we actually move the state-machine for the value set backwards
one step. This can pretty easily lead to infinite loops where we
continually try to propagate a bit, succeed for one iteration, but then
back up because we find an uninitialized use.

A reduced test case from PR10379 is included.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135359 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
05bcade0182524731cf4bc4984e08f63ddf62374 15-Jul-2011 Ted Kremenek <kremenek@apple.com> Fix false negative reported in PR 10358 by using 'Unknown' in -Wuninitialized to avoid cascading warnings. Patch by Kaelyn Uhrain.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135217 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
00fe761849278180b0d73f276e468cf4c54ff2ad 15-Jul-2011 John McCall <rjmccall@apple.com> Teach -Wconversion, -Wsign-compare etc. about division and remainder.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135208 91177308-0d34-0410-b5e6-96231b3b80d8
onversion.c
1ad35bebcc07d34202850f46b5b7be46fda1c5d1 14-Jul-2011 Ted Kremenek <kremenek@apple.com> Revert r135147 and r135075. The consensus was that this wasn't the right thing to do.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135152 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-fixit.c
ormat-strings-i386.c
ormat-strings.c
826d5b4782d5c4c38c30eaae70a243c33a76edad 14-Jul-2011 Ted Kremenek <kremenek@apple.com> Reapply r135075, but modify format-strings.c and format-strings-fixit.c test cases to be more portable with an explicit target triple.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135134 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-fixit.c
ormat-strings-i386.c
ormat-strings.c
13d99bf2e9e13820d74ecc6a28630721736c1f10 14-Jul-2011 NAKAMURA Takumi <geek4civic@gmail.com> Revert r135075, "format string checking: long and int have the same widths on 32-bit, so we shouldn't warn about using"

It fails on freebsd, mingw and msvc10.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135129 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-i386.c
8da9316c5a97887da0bf84a2ea45daf43ddf572b 13-Jul-2011 Ted Kremenek <kremenek@apple.com> format string checking: long and int have the same widths on 32-bit, so we shouldn't warn about using
an "int" format specifier with a "long" type in 32-bit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135075 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-i386.c
dc00d8158db573f4a1f91cfaa2a89171c2e5f637 13-Jul-2011 Ted Kremenek <kremenek@apple.com> Re-relax conversion specifier checking for printf format strings and conversion specifiers. My recent change was a mistake.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135048 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
45eb7022ff059ff5a291e24f57ff56428a1e8210 13-Jul-2011 Ted Kremenek <kremenek@apple.com> Fix inversion in argument type checking for format strings with conversion specifiers for character types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135046 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
862ff87c0d306af8dfdbe7ac59f181a5815546e5 13-Jul-2011 John McCall <rjmccall@apple.com> Make the integer-range analysis recognize ^= correctly,
and (while I'm at it) teach it to grok the results of simple
assignments.

The first is PR10336.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135034 91177308-0d34-0410-b5e6-96231b3b80d8
ompare.c
42068e9d420889014ee26894e421fead336b239d 13-Jul-2011 Eli Friedman <eli.friedman@gmail.com> Silliness with commas, as reported at http://blog.regehr.org/archives/558 . As it turns out, this is my fault for not noticing this was an issue when I was looking at this a long time ago. :(



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135026 91177308-0d34-0410-b5e6-96231b3b80d8
itfield.c
46d37c10404097eed7c173b17e52693edcb66486 11-Jul-2011 Eli Friedman <eli.friedman@gmail.com> Add diagnostic for constructs like "va_arg(l, float)" which have undefined behavior. PR10201.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134926 91177308-0d34-0410-b5e6-96231b3b80d8
arargs.c
15be9b0e50f9eed41d4b16e344c9050ed5197c3a 11-Jul-2011 Douglas Gregor <dgregor@apple.com> Don't complain about missing return statements for naked
functions. Fixes <rdar://problem/9731999>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134897 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-naked.c
c3e0fb406fb6fe83566dc6d8b05362e0a2c1e191 09-Jul-2011 Eli Friedman <eli.friedman@gmail.com> Change -mno-mmx to be more compatible with gcc. Specifically, -mno-mmx should not imply -mno-sse.

Note that because we don't usually touch the MMX registers anyway, all -mno-mmx needs to do is tweak the x86-32 calling convention a little for vectors that look like MMX vectors, and prevent the definition of __MMX__.

clang doesn't actually stop the user from using MMX inline asm operands or MMX builtins in -mno-mmx mode; as a QOI issue, it would be nice to diagnose, but I doubt it really matters much.

<rdar://problem/9694837>



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134770 91177308-0d34-0410-b5e6-96231b3b80d8
86-builtin-palignr.c
78b929121f44f7c983fce8c871aa913dce087561 08-Jul-2011 Eric Christopher <echristo@apple.com> Add a testcase for the previous commit and update an existing test for an
extra register.

Part of PR10299 and rdar://9740322

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134657 91177308-0d34-0410-b5e6-96231b3b80d8
sm.c
935a70c1e76d78985f20d422940280161b941299 30-Jun-2011 Hans Wennborg <hans@hanshq.net> Fix off-by-one error in StringLiteral::getLocationOfByte.

This fixes PR10223.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134183 91177308-0d34-0410-b5e6-96231b3b80d8
sm.c
150fee8b2ba3ea6faa12e68cb58adc5e2fc73825 30-Jun-2011 Hans Wennborg <hans@hanshq.net> Move test/Sema/return.cpp into test/SemaCXX/return.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134171 91177308-0d34-0410-b5e6-96231b3b80d8
eturn.cpp
62273f91b69f0f6586a00491751057c4173b893c 30-Jun-2011 Hans Wennborg <hans@hanshq.net> Test for errors for returning a value from a ctor or dtor.

This fell out when Chandler landed the patch in r134138.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134163 91177308-0d34-0410-b5e6-96231b3b80d8
eturn.cpp
54001c1e6a87b792b0711b822def2b1bfe1ad4a1 29-Jun-2011 Douglas Gregor <dgregor@apple.com> Check for deprecated/unavailable/etc attributes on fields that are
initialized via initializer lists. Fixes <rdar://problem/9694686>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134099 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-deprecated.c
e12a11f26b3ae5fca1178d415800b852d8d780ac 29-Jun-2011 Douglas Gregor <dgregor@apple.com> When redeclaring a local extern in the same scope, make sure that we
replace the existing declaration appropriately. Patch by Jordy Rose,
fixes PR10013 / <rdar://problem/9584157>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134097 91177308-0d34-0410-b5e6-96231b3b80d8
xtern-redecl.c
de31fd7eeebdc64fb043463e7f515dab8eccac8d 28-Jun-2011 Eric Christopher <echristo@apple.com> Split out logic for valid clobbers and valid inline asm registers.

Fixes rdar://9281377


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134016 91177308-0d34-0410-b5e6-96231b3b80d8
sm.c
68fe96adf787abd1e98016da0f38e26644faf7b9 27-Jun-2011 Fariborz Jahanian <fjahanian@apple.com> Handle nonnull attribute with optional argument number on
functions with arguments of transparent unions type.
// rdar://9584012


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133941 91177308-0d34-0410-b5e6-96231b3b80d8
onnull.c
6628969c3e3886b68d8a0051df7e222aa50ef118 27-Jun-2011 Chandler Carruth <chandlerc@gmail.com> Cleanup a fixme by using a specific diagnostic for subscripting
a pointer to void.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133912 91177308-0d34-0410-b5e6-96231b3b80d8
ointer-addition.c
13b21be065e9feb0759303bd51b8e8653130f0fb 27-Jun-2011 Chandler Carruth <chandlerc@gmail.com> Factor out (some of) the checking for invalid forms of pointer
arithmetic into a couple of common routines. Use these to make the
messages more consistent in the various contexts, especially in terms of
consistently diagnosing binary operators with invalid types on both the
left- and right-hand side. Also, improve the grammar and wording of the
messages some, handling both two pointers and two (different) types.

The wording of function pointer arithmetic diagnostics still strikes me
as poorly phrased, and I worry this makes them slightly more awkward if
more consistent. I'm hoping to fix that with a follow-on patch and test
case that will also make them more helpful when a typedef or template
type parameter makes the type completely opaque.

Suggestions on better wording are very welcome, thanks to Richard Smith
for some initial help on that front.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133906 91177308-0d34-0410-b5e6-96231b3b80d8
ncomplete-decl.c
ointer-addition.c
ointer-subtract-compat.c
ypecheck-binop.c
88c1dfccf8c5d487408e3365c752ed24c867c7ce 25-Jun-2011 John McCall <rjmccall@apple.com> Two more test cases which have been long uncommitted.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133842 91177308-0d34-0410-b5e6-96231b3b80d8
ign-conversion.c
b9b4b789ebd28d6fde1c42de820b036ffaf95162 23-Jun-2011 Eli Friedman <eli.friedman@gmail.com> Fix Sema::CheckVectorOperands so that it doesn't try to insert a cast expression into the LHS of a compound assignment. Fixes compound assignment of various "compatible" vector types, including NEON-vector and gcc-vector types.

<rdar://problem/9640356>



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133737 91177308-0d34-0410-b5e6-96231b3b80d8
rm-neon-types.c
xt_vector_casts.c
d543130a3009a350017e2e411ea43bb3e5459b96 23-Jun-2011 Fariborz Jahanian <fjahanian@apple.com> Issue warning if weak_import attribute is added to an already
declared variable and ignore it. // rdar://9538608


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133654 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-weak.c
0d9106fc97cde979a995e26b18bcd2643f8afb55 22-Jun-2011 Manuel Klimek <klimek@google.com> Changes ParenListExpr to always require a type.
Removes dead code found in the process.
Adds a test to verify that ParenListExprs do not have NULL types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133637 91177308-0d34-0410-b5e6-96231b3b80d8
aren-list-expr-type.cpp
14d251cd62942bf7d56bb87a267ba2ca2f7fae3e 21-Jun-2011 Chandler Carruth <chandlerc@gmail.com> Fix a crash when a pointer-to-member function is called in the condition
expression of '?:'. Add a test case for this pattern, and also test the
code that led to the crash in a "working" case as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133523 91177308-0d34-0410-b5e6-96231b3b80d8
arentheses.cpp
33f46e22b7fc3b75c34b6d892790f80869da0300 20-Jun-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Warn for un-parenthesized '&' inside '|' (a & b | c), rdar://9553326.

Patch by Henry Mason with tweaks by me.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133453 91177308-0d34-0410-b5e6-96231b3b80d8
arentheses.c
ae0bafa229d076a0fb90b5aeccea7e3039c58751 20-Jun-2011 Chandler Carruth <chandlerc@gmail.com> Fix a problem with the diagnostics of invalid arithmetic with function
pointers I found while working on the NULL arithmetic warning. We here
always assuming the LHS was the pointer, instead of using the selected
pointer expression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133428 91177308-0d34-0410-b5e6-96231b3b80d8
ointer-addition.c
12189f573f5dafb7fa33e8dc32ff06cd6fd35963 17-Jun-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't emit 'unavailable' errors inside an unavailable function. rdar://9623855.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133264 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-unavailable-message.c
9d4562445decb576249a049f5cdaf04a138bda33 16-Jun-2011 Chandler Carruth <chandlerc@gmail.com> Make the presentation of the warnings on 'x + y ? 1 : 0' a bit more
pretty. In particular this makes it much easier for me to read messages
such as:

x.cc:42: ?: has lower ...

Where I'm inclined to associate the third ':' with a missing column
number, but in fact column numbers have been turned off. Similar
punctuation collisions happened elsewhere as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133121 91177308-0d34-0410-b5e6-96231b3b80d8
arentheses.c
arentheses.cpp
b30cd4a09bbf0adfa644b957a2b28fe31c5d45e4 15-Jun-2011 Douglas Gregor <dgregor@apple.com> Don't add redundant FormatAttr, ConstAttr, or NoThrowAttr attributes,
either imlicitly (for builtins) or explicitly (due to multiple
specification of the same attributes). Fixes <rdar://problem/9612060>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133045 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
cf739927f9b00c801867f620b04b79e3259c311f 15-Jun-2011 Nico Weber <nicolasweber@gmx.de> Warn on "void f(int a[10]) { sizeof(a); }"

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133036 91177308-0d34-0410-b5e6-96231b3b80d8
arn-sizeof-arrayarg.c
fa821380182f00eddfa536280b5a103c59e5c1c4 15-Jun-2011 Ted Kremenek <kremenek@apple.com> Sema: show shift result in hexadecimal

Change the output for -Wshift-overflow and
-Wshift-sign-overflow to an unsigned hexadecimal. It makes
more sense for looking at bits than a signed decimal does.
Also, change the diagnostic's wording from "overrides"
to "sets".

This uses a new optional argument in APInt::toString()
that adds the '0x' prefix to hexademical numbers.

This fixes PR 9651.

Patch by nobled@dreamwidth.org!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133033 91177308-0d34-0410-b5e6-96231b3b80d8
hift.c
997e15cfdc5c78cf3cd9c520dd1bcf3eef4750c0 14-Jun-2011 Fariborz Jahanian <fjahanian@apple.com> Bad table discription of fromat-y2k causes
no-format-y2k turn off -Wformat altogether.
// rdar://9504680


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133015 91177308-0d34-0410-b5e6-96231b3b80d8
o-format-y2k-turnsoff-format.c
e1eed38733ed47d44f9d8c7731817c411eaf4141 14-Jun-2011 Chris Lattner <sabre@nondot.org> when compiling in a GNU mode (e.g. gnu99) treat VLAs with a size that can be folded to a constant
as constant size arrays. This has slightly different semantics in some insane cases, but allows
us to accept some constructs that GCC does. Continue to be pedantic in -std=c99 and other
modes. This addressed rdar://8733881 - error "variable-sized object may not be initialized"; g++ accepts same code


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132983 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
-c-e.c
truct-decl.c
ypedef-variable-type.c
la.c
0adde128d96a73864569516e684faa570e3c0333 14-Jun-2011 David Majnemer <david.majnemer@gmail.com> Properly diagnose using abstract and incomplete types in va_arg

- Move a test from test/SemaTemplate/instantiate-expr-3.cpp, it did not belong there
- Incomplete and abstract types are considered hard errors


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132979 91177308-0d34-0410-b5e6-96231b3b80d8
arargs.c
b792b30ce3d31e3eb3cfee3321238cf3cc2165b0 14-Jun-2011 Chris Lattner <sabre@nondot.org> fix rdar://9546171 - -Wshorten-64-to-32 shouldn't warn on vector bitcasts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132975 91177308-0d34-0410-b5e6-96231b3b80d8
onversion-64-32.c
eca3ed7490300ae31dab178d11d70953e96a9e4e 14-Jun-2011 Eli Friedman <eli.friedman@gmail.com> Make __gnu_inline__ functions in gnu99 mode work the same way as inline functions in gnu89 mode in terms of redefinitions.

rdar://9559708 .



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132953 91177308-0d34-0410-b5e6-96231b3b80d8
nline-redef.c
nline.c
2f072b442879b8bba8c5dea11d7c61bedb1924ae 09-Jun-2011 Hans Wennborg <hans@hanshq.net> Handle overloaded operators in ?: precedence warning

This is a follow-up to r132565, and should address the rest of PR9969:

Warn about cases such as

int foo(A a, bool b) {
return a + b ? 1 : 2; // user probably meant a + (b ? 1 : 2);
}

also when + is an overloaded operator call.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132784 91177308-0d34-0410-b5e6-96231b3b80d8
arentheses.cpp
d7bc7a210993fc4f67cdf5764ce4ef33f2a8ede3 09-Jun-2011 Bob Wilson <bob.wilson@apple.com> Add isVCVT_N flag to identify Neon VCVT_N intrinsics, which require special
range checking for immediate operands. Radar 9558930.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132783 91177308-0d34-0410-b5e6-96231b3b80d8
rm-neon-types.c
618796632d213b875c510d1eb88d5086395d092e 07-Jun-2011 Eli Friedman <eli.friedman@gmail.com> Second try at fixing this test, this time without breaking 32-bit Darwin builders.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132694 91177308-0d34-0410-b5e6-96231b3b80d8
arbon.c
2e283f00fe9502150cf41bb1db70a5cd16693794 06-Jun-2011 Eli Friedman <eli.friedman@gmail.com> Start fixing up clang tests to work on the clang-native-arm-cortex-a9 builder.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132691 91177308-0d34-0410-b5e6-96231b3b80d8
arbon.c
tdcall-fastcall.c
86-builtin-palignr.c
9cfdae3144fc004cf203b05288f4dab49097ce7b 03-Jun-2011 Hans Wennborg <hans@hanshq.net> Warn about missing parentheses for conditional operator.

Warn in cases such as "x + someCondition ? 42 : 0;",
where the condition expression looks arithmetic, and has
a right-hand side that looks boolean.

This (partly) addresses http://llvm.org/bugs/show_bug.cgi?id=9969

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132565 91177308-0d34-0410-b5e6-96231b3b80d8
arentheses.c
arentheses.cpp
9277bea0e6b4202845b9a8160b4d18a6f026c2ba 01-Jun-2011 Ted Kremenek <kremenek@apple.com> Rename -Wunknown-attributes to -Wattributes to match GCC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132422 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-unknown.c
0683a1418b28b289eca4cb602ac69780f9e0a609 31-May-2011 Chandler Carruth <chandlerc@gmail.com> Expand the coverage of the warning for constants on the RHS of logical operands:

return f() || -1;

where the user meant to write '|'.

This bootstraps without any additional warnings.

Patch by Richard Trieu.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132327 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
83e0995105222b078a57e1e20ef71fbfd0f67d3d 12-May-2011 Francois Pichet <pichet2000@gmail.com> Add a Microsoft C test following r131201.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131202 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
4da89c87b2b6ca31f1015ec19aae65a02971ea9a 11-May-2011 John McCall <rjmccall@apple.com> Use a heralded conversion to bool in inline-asm constraints.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131170 91177308-0d34-0410-b5e6-96231b3b80d8
sm.c
e6c28039c63d829577a2e37170e06a1dbdf89748 11-May-2011 Ted Kremenek <kremenek@apple.com> Fix crash in -Wuninitialized when using switch statments whose condition is a logical operation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131158 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
0e9972ccccf4e2baf1f65d4cf70f26897d285442 09-May-2011 John McCall <rjmccall@apple.com> __builtin_va_list is void* on ARM, not char*.
rdar://problem/9391966



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131080 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins-arm.c
02a444dc8015347e5e5c60d5b11e8a1d6fdceaf3 02-May-2011 Chad Rosier <mcrosier@apple.com> Fixed test case asserts due to checkin of r130710.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130720 91177308-0d34-0410-b5e6-96231b3b80d8
llegal-types.c
1d59f7f8fb39fa44ddbb6e2abd321af863b1f55b 28-Apr-2011 Ted Kremenek <kremenek@apple.com> Convert assertion in memset checking to a runtime check (because real code may provide a deviant definition of memset).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130368 91177308-0d34-0410-b5e6-96231b3b80d8
emset-invalid.c
28bbe4b8acc338476fe0825769b41fb32b423c72 28-Apr-2011 John Wiegley <johnw@boostpro.com> Parsing/AST support for Structured Exception Handling

Patch authored by Sohail Somani.

Provide parsing and AST support for Windows structured exception handling.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130366 91177308-0d34-0410-b5e6-96231b3b80d8
_try.c
cd88b4171753dcb2bc0a21d78f1597c796bb8a20 26-Apr-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Gcc pads the size of an array using the alignment of its elements.

The size of the array may not be aligned according to alignment of its elements if an alignment attribute is
specified in a typedef. Fixes rdar://8665729 & http://llvm.org/PR5637.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130242 91177308-0d34-0410-b5e6-96231b3b80d8
lign-x86-64.c
lign-x86.c
c1a0a73c1fad684dd23e9aade02c4e00dbaeaee6 26-Apr-2011 Fariborz Jahanian <fjahanian@apple.com> Add ms_struct attribute on record typee
(and ignore it for now) - wip.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130224 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-ms_struct.c
8a285ae6fc4926cc4e419025eec63e2d6696e13f 26-Apr-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Emit a -Wnull-dereference warning for "*null" not just "*null = something". Addresses rdar://9269271.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130207 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
ncomplete-call.c
1e713f50e904b96623425efa7119fcb98243e111 26-Apr-2011 Ted Kremenek <kremenek@apple.com> When generating printf fixits, preserve the original formating for unsigned integers (e.g., 'x', 'o').

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130164 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-fixit.c
62c9258f4a71569a66d805fc7776526a2c76b34e 25-Apr-2011 Fariborz Jahanian <fjahanian@apple.com> Recognize gcc's ms_struct pragma (and ignore for now).
This is wip.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130138 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-ms_struct.c
a47317bbeef839ef86323e3feacd9962ca9c383a 25-Apr-2011 Eli Friedman <eli.friedman@gmail.com> PR4304: Add warning for designators in strict c89 mode.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130117 91177308-0d34-0410-b5e6-96231b3b80d8
89.c
50465d1d2f5f6dd3d8e18e2cf7bad4691e5ca6a8 23-Apr-2011 Chandler Carruth <chandlerc@gmail.com> There were some frustrating problems with the implementation of
-Wwrite-strings. First and foremost, once the positive form of the flag
was passed, it could never be disabled by passing -Wno-write-strings.
Also, the diagnostic engine couldn't in turn use -Wwrite-strings to
control diagnostics (as GCC does) because it was essentially hijacked to
drive the language semantics.

Fix this by giving CC1 a clean '-fconst-strings' flag to enable
const-qualified strings in C and ObjC compilations. Corresponding
'-fno-const-strings' is also added. Then the driver is taught to
introduce '-fconst-strings' in the CC1 command when '-Wwrite-strings'
dominates.

This entire flag is basically GCC-bug-compatibility driven, so we also
match GCC's bug where '-w' doesn't actually disable -Wwrite-strings. I'm
open to changing this though as it seems insane.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130051 91177308-0d34-0410-b5e6-96231b3b80d8
arn-write-strings.c
a61aedc48efae959d951d2aadadbac3e6d49acc5 22-Apr-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> For -Wlogical-op-parentheses, point at '&&', not '||'. Fixes rdar://9125333.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130009 91177308-0d34-0410-b5e6-96231b3b80d8
arentheses.c
6b6b42aed07726178f61954ac6e51f47da00275c 19-Apr-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> We regard a function as 'unused' from the codegen perspective, so our warnings diverge from
gcc's unused warnings which don't get emitted if the function is referenced even in an unevaluated context
(e.g. in templates, sizeof, etc.). Also, saying that a function is 'unused' because it won't get codegen'ed
is somewhat misleading.

- Don't emit 'unused' warnings for functions that are referenced in any part of the user's code.
- A warning that an internal function/variable won't get emitted is useful though, so introduce
-Wunneeded-internal-declaration which will warn if a function/variable with internal linkage is not
"needed" ('used' from the codegen perspective), e.g:

static void foo() { }

template <int>
void bar() {
foo();
}

test.cpp:1:13: warning: function 'foo' is not needed and will not be emitted
static void foo() { }
^

Addresses rdar://8733476.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129794 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unused-function.c
1c860d5640e8eebb11a5d515a761242b66761b0b 19-Apr-2011 Peter Collingbourne <peter@pcc.me.uk> Add a new expression classification, CL_AddressableVoid

CL_AddressableVoid is the expression classification used for void
expressions whose address can be taken, i.e. the result of [], *
or void variable references in C, as opposed to things like the
result of a void function call.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129783 91177308-0d34-0410-b5e6-96231b3b80d8
xpr-address-of.c
ba80af4615ae2a042ba439f188336106c1184a66 19-Apr-2011 Matt Beaumont-Gay <matthewbg@google.com> Fix line endings

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129740 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-args.c
831efaeb4ba2c0939db6eeb77229d9e47dd03c9c 15-Apr-2011 Ted Kremenek <kremenek@apple.com> Improve diagnostics on GNU attributes by warning about attributes that should have no arguments or parameters. Patch by Michael Han!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129560 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-args.c
c6eb44b321c543c5bcf28727228a0cceced57e2e 15-Apr-2011 Peter Collingbourne <peter@pcc.me.uk> C1X: implement static asserts

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129555 91177308-0d34-0410-b5e6-96231b3b80d8
tatic-assert.c
f111d935722ed488144600cea5ed03a6b5069e8f 15-Apr-2011 Peter Collingbourne <peter@pcc.me.uk> C1X: implement generic selections

As an extension, generic selection support has been added for all
supported languages. The syntax is the same as for C1X.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129554 91177308-0d34-0410-b5e6-96231b3b80d8
eneric-selection.c
f65076ebf5e8bc5ae7b77fe3c3a65dc5db8d763f 10-Apr-2011 Chandler Carruth <chandlerc@gmail.com> Enhance the diagnostic for literal float -> int conversions to suggest
rewriting the literal when the value is integral. It is not uncommon to
see code written as:

const int kBigNumber = 42e5;

Without any real awareness that this is no longer an ICE. The note helps
automate and ease the process of fixing code that violates the warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129243 91177308-0d34-0410-b5e6-96231b3b80d8
nr-def-call.c
584b9d6bd0ce199787900695fe75528fcde405fe 08-Apr-2011 Chandler Carruth <chandlerc@gmail.com> Switch 'is possibly uninitialized' to 'may be uninitialized' based on
Chris's feedback.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129127 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
f04eb2de1f17dce4dfaebbf9002844087b7d357d 08-Apr-2011 Chandler Carruth <chandlerc@gmail.com> Now that the analyzer is distinguishing between uninitialized uses that
definitely have a path leading to them, and possibly have a path leading
to them; reflect that distinction in the warning text emitted.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129126 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables-vectors.c
ninit-variables.c
b88fb027bfe2f85da3a341f42549900bd658ac8b 05-Apr-2011 Chandler Carruth <chandlerc@gmail.com> Commit a bit of a hack to fully handle the situation where variables are
marked explicitly as uninitialized through direct self initialization:

int x = x;

With r128894 we prevented warnings about this code, and this patch
teaches the analysis engine to continue analyzing subsequent uses of
'x'. This should wrap up PR9624.

There is still an open question of whether we should suppress the
maybe-uninitialized warnings resulting from variables initialized in
this fashion. The definitely-uninitialized uses should always be warned.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128932 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
b414c4fae51c5792d3074b4b78fc8737b1d8387c 05-Apr-2011 Chandler Carruth <chandlerc@gmail.com> Fix PR9624 by explicitly disabling uninitialized warnings for direct self-init:

int x = x;

GCC disables its warnings on this construct as a way of indicating that
the programmer intentionally wants the variable to be uninitialized.
Only the warning on the initializer is turned off in this iteration.

This makes the code a lot more ugly, but starts commenting the
surprising behavior here. This is a WIP, I want to refactor it
substantially for clarity, and to determine whether subsequent warnings
should be suppressed or not.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128894 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
d40066b0fb883839a9100e5455e33190b9b8abac 05-Apr-2011 Ted Kremenek <kremenek@apple.com> Fix PR 9626 (duplicated self-init warnings under -Wuninitialized) with numerous CFG and UninitializedValues analysis changes:

1) Change the CFG to include the DeclStmt for conditional variables, instead of using the condition itself as a faux DeclStmt.
2) Update ExprEngine (the static analyzer) to understand (1), so not to regress.
3) Update UninitializedValues.cpp to initialize all tracked variables to Uninitialized at the start of the function/method.
4) Only use the SelfReferenceChecker (SemaDecl.cpp) on global variables, leaving the dataflow analysis to handle other cases.

The combination of (1) and (3) allows the dataflow-based -Wuninitialized to find self-init problems when the initializer
contained control-flow.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128858 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
6f41715df2c6a31c0c3ab3088b8cd18a3c8321b8 04-Apr-2011 Ted Kremenek <kremenek@apple.com> -Wuninitialized: use "self-init" warning when issue uninitialized values warnings from the dataflow analysis that include within the initializer of a variable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128843 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
5360c921a91dc43b442f069ba86d7b9df66362fc 04-Apr-2011 Ted Kremenek <kremenek@apple.com> -Wuninitialized: don't issue fixit for initializer if a variable declaration already has an initializer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128838 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
5862f0e1ac29c5af8089b4bf119fd4493f6ab58c 04-Apr-2011 Ted Kremenek <kremenek@apple.com> When emitting a "too many arguments to function call..." error, also include a note with a location for the function prototype.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128833 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
unction-redecl.c
bc8b44c4ee7f9c4c3ad296369e72feda61bdb580 01-Apr-2011 Ted Kremenek <kremenek@apple.com> -Wuninitialized should not warn about variables captured by blocks as byref.

Note this can potentially be enhanced to detect if the __block variable
is actually written by the block, or only when the block "escapes" or
is actually used, but that requires more analysis than it is probably worth
for this simple check.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128681 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
7870b133ac7b03bd53388f51250d009325f43399 27-Mar-2011 Anton Yartsev <anton.yartsev@gmail.com> AltiVec vector comparison logic now affect only vectors of fundamental AltiVec vector types. It fixes bug 9347.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128381 91177308-0d34-0410-b5e6-96231b3b80d8
ector-ops.c
d06fea8580658470f92fb5d0d3d7ab5b475728dc 27-Mar-2011 Anton Yartsev <anton.yartsev@gmail.com> supported: AltiVec vector initialization with a single literal according to PIM section 2.5.1 - after initialization all elements have the value specified by the literal

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128375 91177308-0d34-0410-b5e6-96231b3b80d8
ltivec-init.c
6cc425e21330a5fa456077def0fc727b92e6ecde 26-Mar-2011 Douglas Gregor <dgregor@apple.com> Test attribute merging for the availability attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128334 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-availability-ios.c
b53e417ba487f4193ef3b0485b420e0fdae643a2 26-Mar-2011 Douglas Gregor <dgregor@apple.com> Extend the new 'availability' attribute with support for an
'unavailable' argument, which specifies that the declaration to which
the attribute appertains is unavailable on that platform.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128329 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-availability-macosx.c
a8d459e8a68b1270b0c35fb73e8cc090b2b69e36 23-Mar-2011 Ted Kremenek <kremenek@apple.com> Fix CFG-construction bug when run from AnalysisBasedWarnings::IssueWarnings() where block-level expressions that need
to be recorded in the Stmt*->CFGBlock* map were not always done so. Fixes <rdar://problem/9171946>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128170 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
d97f558f48865aa96e7bdf9c1c9315790c3d77c9 23-Mar-2011 Fariborz Jahanian <fjahanian@apple.com> Support for Transparent unions used as overloadable
function parameter. // rdar:// 9129552
and PR9406.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128159 91177308-0d34-0410-b5e6-96231b3b80d8
verloaded-func-transparent-union.c
0a0d2b179085a52c10402feebeb6db8b4d96a140 23-Mar-2011 Douglas Gregor <dgregor@apple.com> Implement a new 'availability' attribute, that allows one to specify
which versions of an OS provide a certain facility. For example,

void foo()
__attribute__((availability(macosx,introduced=10.2,deprecated=10.4,obsoleted=10.6)));

says that the function "foo" was introduced in 10.2, deprecated in
10.4, and completely obsoleted in 10.6. This attribute ties in with
the deployment targets (e.g., -mmacosx-version-min=10.1 specifies that
we want to deploy back to Mac OS X 10.1). There are several concrete
behaviors that this attribute enables, as illustrated with the
function foo() above:

- If we choose a deployment target >= Mac OS X 10.4, uses of "foo"
will result in a deprecation warning, as if we had placed
attribute((deprecated)) on it (but with a better diagnostic)
- If we choose a deployment target >= Mac OS X 10.6, uses of "foo"
will result in an "unavailable" warning (in C)/error (in C++), as
if we had placed attribute((unavailable)) on it
- If we choose a deployment target prior to 10.2, foo() is
weak-imported (if it is a kind of entity that can be weak
imported), as if we had placed the weak_import attribute on it.

Naturally, there can be multiple availability attributes on a
declaration, for different platforms; only the current platform
matters when checking availability attributes.

The only platforms this attribute currently works for are "ios" and
"macosx", since we already have -mxxxx-version-min flags for them and we
have experience there with macro tricks translating down to the
deprecated/unavailable/weak_import attributes. The end goal is to open
this up to other platforms, and even extension to other "platforms"
that are really libraries (say, through a #pragma clang
define_system), but that hasn't yet been designed and we may want to
shake out more issues with this narrower problem first.

Addresses <rdar://problem/6690412>.

As a drive-by bug-fix, if an entity is both deprecated and
unavailable, we only emit the "unavailable" diagnostic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128127 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-availability-ios.c
ttr-availability-macosx.c
ttr-availability.c
4f38f414b8676ea43439d6ad3315e32042d315cb 23-Mar-2011 John McCall <rjmccall@apple.com> Fix an error with the declaration of block parameters that depend
on previous block parameters that crept in as part of my captures
work a month or so ago.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128121 91177308-0d34-0410-b5e6-96231b3b80d8
lock-args.c
ac4df2454d5462c3bf5f369d65c3ad651100fa40 23-Mar-2011 John McCall <rjmccall@apple.com> Warn about unused declaration-specifiers on tag declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128118 91177308-0d34-0410-b5e6-96231b3b80d8
truct-decl.c
c9dcb45795d9be5c33d4cc03ebfab5ee2f173a7c 17-Mar-2011 Ted Kremenek <kremenek@apple.com> Make test more portable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127799 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables-vectors.c
1cbc31515e9b979f55178ffd4587e8671f7ebbfa 17-Mar-2011 Ted Kremenek <kremenek@apple.com> Extend -Wuninitialized to support vector types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127794 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables-vectors.c
0a65f946721f1505e5577b1910f3193888696573 17-Mar-2011 Ted Kremenek <kremenek@apple.com> Rename -Wuninitialized-maybe to -Wconditional-uninitialized.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127793 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
db9e9e61f8311d8852bd15730f78e56f3ffa0508 15-Mar-2011 Ted Kremenek <kremenek@apple.com> Remove warning for null characters in CFString literals. Clang handles them just fine, and GCC 4.2 doesn't warn here either.

We added this warning back in 2007 when we were comparing against GCC 4.0.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127704 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.c
908c09f64e50db64c935255089ffcf4615ca4b0e 15-Mar-2011 Ted Kremenek <kremenek@apple.com> Take 2: merge -Wuninitialized-experimental into -Wuninitialized. Only *must-be-uninitialized* warnings are reported, with *maybe-uninitialized* under a separate flag. I await any fallout/comments/feedback, although hopefully this will produce no noise for users.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127670 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
f7bafc77ba12bb1beb665243a0334cd81e024728 15-Mar-2011 Ted Kremenek <kremenek@apple.com> Split warnings from -Wuninitialized-experimental into "must-be-initialized" and "may-be-initialized" warnings, each controlled by different flags.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127666 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
f3f5379f6da7f8f141a53e2945871a5aa5431e02 15-Mar-2011 Ted Kremenek <kremenek@apple.com> Remove old UninitializedValues analysis.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127656 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
5a5b38f4afaf4f203b96a11ba79890c7cd4cc4b8 12-Mar-2011 Douglas Gregor <dgregor@apple.com> When we're determining whether to complain about a conversion from one
enumeration type to another in C, classify enumeration constants as if
they had the type of their enclosing enumeration. Fixes
<rdar://problem/9116337>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127514 91177308-0d34-0410-b5e6-96231b3b80d8
onversion.c
02b3774347158753dd72c1bb8a29eb78a16440ab 09-Mar-2011 NAKAMURA Takumi <geek4civic@gmail.com> include/clang/Basic/BuiltinsX86.def: __builtin_ia32_crc32**() should be defined to take unsigned args and to return unsigned value.

mingw-w64's intrin.h declares __builtin_ia32_crc32**() as external.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127329 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins-decl.c
e224ba7e3e604113aa160c379293bcb6425e8f36 07-Mar-2011 Carl Norum <carl.norum@apple.com> Fix tests to account for new warning "expected ';' at end of declaration list". Sorry, folks!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127188 91177308-0d34-0410-b5e6-96231b3b80d8
lign-x86.c
nonymous-struct-union.c
rm-layout.c
onst-eval.c
issing-field-initializers.c
arn-gnu-designators.c
bdc49d360f98c1194d50b8bbb24885bf8d4c1ac4 02-Mar-2011 John McCall <rjmccall@apple.com> Pretty up the wrong-number-of-arguments-for-attribute diagnostic by
using a custom plural form. Split out the range diagnostics as their
own message.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126840 91177308-0d34-0410-b5e6-96231b3b80d8
nnotate.c
ttr-cleanup.c
ttr-naked.c
ttr-nodebug.c
ttr-noinline.c
ttr-noreturn.c
ttr-regparm.c
ttr-unused.c
allingconv.c
onstructor-attribute.c
eon-vector-types.c
entinel-attribute.c
fb7cb35fa0a8131853b1b049ca7be77980e144f5 01-Mar-2011 Ted Kremenek <kremenek@apple.com> Don't warn about unused values in ternary ?: expressions unless both the LHS and RHS are "unused" (side-effect free).

Patch by Justin Bogner! Fixes PR 8282.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126779 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unused-value.c
425a31e03a619d50f5f958433fcdc533788e41b7 01-Mar-2011 Ted Kremenek <kremenek@apple.com> Don't warning about shifting by too many bits in dead code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126770 91177308-0d34-0410-b5e6-96231b3b80d8
hift.c
082bf7a47f78ff4a645cea358d70bf45a858b238 01-Mar-2011 Ted Kremenek <kremenek@apple.com> Don't wanr about "negative shifts" in code that is unreachable. Fixes PR 5544.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126762 91177308-0d34-0410-b5e6-96231b3b80d8
hift.c
3b332ab132fa85c83833d74d400f6e126f52fbd2 26-Feb-2011 John McCall <rjmccall@apple.com> Don't crash during constant-evaluation of 1/(1/0). PR9262.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126541 91177308-0d34-0410-b5e6-96231b3b80d8
-c-e.c
0289b666b5f866bd39a6e1d96e56ba348c7fecf2 25-Feb-2011 Peter Collingbourne <peter@pcc.me.uk> Rename test/Sema/expr-comma-c89.c to expr-comma-c99.c. Spotted by
Anton Lokhmotov.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126482 91177308-0d34-0410-b5e6-96231b3b80d8
xpr-comma-c89.c
xpr-comma-c99.c
7decebfc7b9dc841f228c93cc2e41e3e62911ff8 25-Feb-2011 Ted Kremenek <kremenek@apple.com> Teach TextDiagnosticPrinter to print out '-Werror' in addition to the warning flag for a warning mapped to an error.

For example:

t.c:7:9: error: using the result of an assignment as a condition without parentheses [-Werror,-Wparentheses]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126466 91177308-0d34-0410-b5e6-96231b3b80d8
arentheses.c
b43e8ad893706a2499c4901b8f5cb289553d66b1 25-Feb-2011 Ted Kremenek <kremenek@apple.com> Don't warn about using PredefinedExprs as format string literals. These never can be a real security issue.

Fixes PR 9314.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126447 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
5fa05cb906e9ddd34ef2ae2a872014aeaf4bc04d 24-Feb-2011 Chandler Carruth <chandlerc@gmail.com> Simplify messages as requested by Chris.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126389 91177308-0d34-0410-b5e6-96231b3b80d8
hift.c
21206d5e3167d5e8066c005c1773afc80ff50ae6 24-Feb-2011 Chandler Carruth <chandlerc@gmail.com> Implement a warning for known shift overflows on constant shift
expressions. Consider the code:

int64_t i = 10 << 30;

This compiles fine, but most developers expect it to produce the value
for 10 gigs, not -2 gigs. This is actually undefined behavior because
the LHS is a signed integer type.

The warning is currently gated behind -Wshift-overflow.

There is a special case where only the sign bit is overridden that gets
a custom error message and is by default ignored. This case is much less
likely to cause observed buggy behavior, it's just undefined behavior
according to the spec. This warning can be enabled with
-Wshift-sign-overflow.

Original patch by Oleg Slezberg, with style tweaks and some correctness
fixes by me.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126342 91177308-0d34-0410-b5e6-96231b3b80d8
hift.c
d067c07c6cbf099b25aba38bcb66f38e79d0c420 23-Feb-2011 Chandler Carruth <chandlerc@gmail.com> Fix the behavior of -Wignored-qualifiers on return type qualifiers in
several ways. We now warn for more of the return types, and correctly
locate the ignored ones. Also adds fix-it hints to remove the ignored
qualifiers. Fixes much of PR9058, although not all of it.

Patch by Hans Wennborg, a couple of minor style tweaks from me.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126321 91177308-0d34-0410-b5e6-96231b3b80d8
eturn.c
c56c004e0b8030e8ca8614e7febe581221938b75 23-Feb-2011 Ted Kremenek <kremenek@apple.com> Teach CFGBuilder about null pointer constants in conditionals, and how they can be used to prune branches. Fixes false null pointer dereference warning in PR 8183.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126305 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
377e215da11e0208f5c8eedf35f507f972559fe6 23-Feb-2011 Ted Kremenek <kremenek@apple.com> Add test case (from PR 8876) for suppressing 'indirection of non-volatile null pointer...' warning due to reachability analysis.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126294 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
351ba91eaa6d30e523587b2d7ed676a5172c6e56 23-Feb-2011 Ted Kremenek <kremenek@apple.com> Enhance Sema::DiagRuntimeBehavior() to delay some diagnostics to see if the related code is reachable. This suppresses some
diagnostics that occur in unreachable code (e.g., -Warray-bound).

We only pay the cost of doing the reachability analysis when we issue one of these diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126290 91177308-0d34-0410-b5e6-96231b3b80d8
-c-e.c
1756ce44b0e03d6a6fd2d42add6e3227d4d04d34 22-Feb-2011 Douglas Gregor <dgregor@apple.com> We need a longer long when testing this pathe Microsoft fixed-underlying-type extension for enumeration types

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126250 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
86f208c1a112c3e8984e63daec15ccf0a1a84329 22-Feb-2011 Douglas Gregor <dgregor@apple.com> Enable enumeration types with a fixed underlying type, e.g.,

enum X : long { Value = 0x100000000 };

when in Microsoft-extension mode (-fms-extensions). This (now C++0x)
feature has been supported since Microsoft Visual Studio .NET 2003.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126243 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
cd9ec3b4fb3d042f89aa5b572de7df3ef9ee4a80 22-Feb-2011 Douglas Gregor <dgregor@apple.com> Implement the GNU C extension which permits the initialization of an
array from a constant array compound literal. Fixes PR9261.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126230 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
284cc8d8a90ae6558e0a4b60b7dc1ddcfd220758 22-Feb-2011 Douglas Gregor <dgregor@apple.com> Warn about implicit conversions between values of different, named
enumeration types. Fixes <rdar://problem/8559831>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126183 91177308-0d34-0410-b5e6-96231b3b80d8
onversion.c
95bba6f26fa68cc8c163f35f4b4f218ab279117a 22-Feb-2011 Anders Carlsson <andersca@mac.com> Move some Objective-C tests to SemaObjC and CodeGenObjC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126175 91177308-0d34-0410-b5e6-96231b3b80d8
lock-as-object.m
dar6248119.m
751969957e4cbd4c8b5bf8508ab8620e24743005 21-Feb-2011 Chandler Carruth <chandlerc@gmail.com> Allow -Wformat to be enabled without -Wformat-security. GCC gates
-Wformat-security on -Wformat, not vice-versa.

Fixes PR8486. Patch by Oleg Slezberg.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126096 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
c1de52de64725945e5ae87e6f99ddedf161856e5 19-Feb-2011 Chris Lattner <sabre@nondot.org> Fix PR9253, allowing attribute(aligned) to reduce the alignment of
a typedef.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126059 91177308-0d34-0410-b5e6-96231b3b80d8
truct-packed-align.c
82214a80c0163e01e4d8dec1426023c89277dbb4 19-Feb-2011 Chandler Carruth <chandlerc@gmail.com> Initial steps to improve diagnostics when there is a NULL and
a non-pointer on the two sides of a conditional expression.

Patch by Stephen Hines and Mihai Rusu.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125995 91177308-0d34-0410-b5e6-96231b3b80d8
onditional-expr.c
febb5b884b1bb946b83800cb77cbea0119570d84 18-Feb-2011 Chris Lattner <sabre@nondot.org> fix rdar://9024687, a crash on invalid that we used to silently ignore.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125962 91177308-0d34-0410-b5e6-96231b3b80d8
cope-check.c
2fda14afb1e3234aad9a15e83c8ab5285fee35a4 18-Feb-2011 Chris Lattner <sabre@nondot.org> break testcase over multiple lines to make it easier to read.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125810 91177308-0d34-0410-b5e6-96231b3b80d8
lock-labels.c
57ad37823e198f977cac605dbfbaefb4daf325e9 17-Feb-2011 Chris Lattner <sabre@nondot.org> Step #2/N of __label__ support: keep pushing LabelDecl forward,
making them be template instantiated in a more normal way and
make them handle attributes like other decls.

This fixes the used/unused label handling stuff, making it use
the same infrastructure as other decls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125771 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unused-label.c
a5b9332418f25338f118358e27303cd510d54107 17-Feb-2011 Chandler Carruth <chandlerc@gmail.com> Implement a sub-group of -Wconversion: -Wliteral-conversion. This
specifically targets literals which are implicitly converted, a those
are more often unintended and trivial to fix. This can be especially
helpful for diagnosing what makes 'const int x = 1e6' not an ICE.

Original patch authored by Jim Meehan with contributions from other
Googlers and a few cleanups from myself.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125745 91177308-0d34-0410-b5e6-96231b3b80d8
nr-def-call.c
ad8dcf4a9df0e24051dc31bf9e6f3cd138a34298 17-Feb-2011 Chris Lattner <sabre@nondot.org> Step #1/N of implementing support for __label__: split labels into
LabelDecl and LabelStmt. There is a 1-1 correspondence between the
two, but this simplifies a bunch of code by itself. This is because
labels are the only place where we previously had references to random
other statements, causing grief for AST serialization and other stuff.

This does cause one regression (attr(unused) doesn't silence unused
label warnings) which I'll address next.

This does fix some minor bugs:
1. "The only valid attribute " diagnostic was capitalized.
2. Various diagnostics printed as ''labelname'' instead of 'labelname'
3. This reduces duplication of label checking between functions and blocks.

Review appreciated, particularly for the cindex and template bits.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125733 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unused-label.c
c71a2c0ce03ec74391ff2b43b0a966860f23786e 17-Feb-2011 Ted Kremenek <kremenek@apple.com> Fix assertion failure in -Warray-bounds on template parameters used as arrays.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125693 91177308-0d34-0410-b5e6-96231b3b80d8
rray-bounds.c
bac77374729b3bed72f41b66cd80d6e0d38ace3b 16-Feb-2011 Ted Kremenek <kremenek@apple.com> Placate Doug and change capitalization of diagnostic note.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125688 91177308-0d34-0410-b5e6-96231b3b80d8
rray-bounds.c
8fd0a5dfb025a51f48b7931b95efbf35d3c5dfc3 16-Feb-2011 Ted Kremenek <kremenek@apple.com> Tweak -Warray-bounds diagnostics based on feedback from Chandler.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125649 91177308-0d34-0410-b5e6-96231b3b80d8
rray-bounds.c
a0125d8520f65aca581378c235384e7affefa1fc 16-Feb-2011 Ted Kremenek <kremenek@apple.com> Add trivial buffer overflow checking in Sema.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125640 91177308-0d34-0410-b5e6-96231b3b80d8
rray-bounds.c
db27d82dee4b66d1d3571bb3a308484ba4bb8294 15-Feb-2011 Peter Collingbourne <peter@pcc.me.uk> OpenCL: standardise naming of test cases

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125590 91177308-0d34-0410-b5e6-96231b3b80d8
pencl-cond.c
pencl-init.c
d263fd1451299b1e5f5f1acb2bb13b0a4119aee8 11-Feb-2011 Fariborz Jahanian <fjahanian@apple.com> Fix a block sema bug where result type of initializer
is unqualified but its initialized is qualified.
This is for c only and fixes the imm. problem.
c++ is more involved and is wip.
// rdar://8979379


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125386 91177308-0d34-0410-b5e6-96231b3b80d8
lock-call.c
lock-return.c
332bb2a2e3cd0a5af85758847a8050ae8ceee5f3 08-Feb-2011 John McCall <rjmccall@apple.com> When checking the 'weak' and 'weakref' attributes, look for non-external
linkage rather than the presence of the 'static' storage class specifier.
Fixes rdar://problem/8814626.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125126 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-weak.c
da263795abd39437d73d23fcf34dcd3afc1d7df3 08-Feb-2011 John McCall <rjmccall@apple.com> dgregor accidentally killed this assert, but on investigation, it can fire
on invalid code and we don't really care, so kill it harder.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125068 91177308-0d34-0410-b5e6-96231b3b80d8
lock-args.c
1b528445016c2dba23babeea07e352ca8b816262 07-Feb-2011 Ted Kremenek <kremenek@apple.com> Move uninitialized variable checking back under -Wuninitialized-experimental. It is clear from user feedback that this warning is not quite ready.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125007 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
553304523bcce281aa3b1afe0f84ae34a90a3c86 03-Feb-2011 Ted Kremenek <kremenek@apple.com> Reenable -Wuninitialized warning for captured block variables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124782 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
609e3170841dac81c3b7b6b9eccb9c520e42c9b2 03-Feb-2011 Ted Kremenek <kremenek@apple.com> Based on user feedback, swap -Wuninitialized diagnostics to have the warning refer to the bad use, and the note to the variable declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124758 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
40249e7487c3314f185c63302aaad9edde6dfd53 02-Feb-2011 John McCall <rjmccall@apple.com> When diagnosing address-space changes, apply array-to-pointer decay first.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124702 91177308-0d34-0410-b5e6-96231b3b80d8
ddress_spaces.c
9fcbceed43e5610fdff43defe533934733453ae2 01-Feb-2011 Ted Kremenek <kremenek@apple.com> Enhance -Wuninitialized to better reason about || and &&, tracking dual dataflow facts and properly merging them.

Fixes PR 9076.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124666 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
86c05f3f28bcf07c97dfb1881686fc43be2f47c2 01-Feb-2011 John McCall <rjmccall@apple.com> Perform the bad-address-space conversions check as part of
CheckPointerTypesForAssignment.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124632 91177308-0d34-0410-b5e6-96231b3b80d8
ddress_spaces.c
49a61727986332f2eba61fb2657800d76c5a4bb9 31-Jan-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix the diagnostic when we are shadowing an external variable and there exists a locally scoped extern with the same name.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124580 91177308-0d34-0410-b5e6-96231b3b80d8
arn-shadow.c
6684d85e9075e3c1750d911c69a517145a82a410 31-Jan-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Diagnose if extern local variable is followed by non-extern and vice-versa.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124579 91177308-0d34-0410-b5e6-96231b3b80d8
rivate-extern.c
6df96e0756f62edc859d649069daf523536c4221 31-Jan-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> 'extern' variables in functions don't shadow externs in global scope. Fixes rdar://8883302.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124578 91177308-0d34-0410-b5e6-96231b3b80d8
arn-shadow.c
96554fd1aa7350498de8911fb6f303a9262e6ec0 27-Jan-2011 Ted Kremenek <kremenek@apple.com> Teach -Wuninitialized about indirect goto. Fixes PR 9071.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124394 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
2a5c45b1ae4406459fbb39cb477951987c59cb0f 27-Jan-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Allow #pragma unused to be used on global variables like gcc. Fixes rdar://8793832.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124383 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-unused.c
40900ee8f3072d05456134b57c0fad85a6bb21a6 27-Jan-2011 Ted Kremenek <kremenek@apple.com> Teach -Wuninitialized not to assert when analyzing
blocks that reference captured variables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124348 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
fd6b874f3af26bc64a1d5781833c197b314afb8b 26-Jan-2011 Ted Kremenek <kremenek@apple.com> Merge -Wuninitialized-experimental into -Wuninitialized.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124279 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
dd0f7942c5415ce146dcc02d57fc503c683f8625 26-Jan-2011 Ted Kremenek <kremenek@apple.com> Tweak -Wuninitialized-experimental to not emit
a warning for uses of an uninitialized variable
when the use is a void cast, e.g. (void) x.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124278 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
a4356adfd4a79bd63f86e2b30878795ce7b9b0a6 26-Jan-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Correct r124242 making sure function chunk that gets diagnosed is really about the block.
Clairvoyance by John!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124264 91177308-0d34-0410-b5e6-96231b3b80d8
lock-return.c
ce95566b36a4ff16e90507633dad8b7a76572999 26-Jan-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Diagnose calling convention attribute incompatibilities. Fixes rdar://8876096.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124244 91177308-0d34-0410-b5e6-96231b3b80d8
tdcall-fastcall.c
98650449dc769dd6217f183c846dcaf9e6f94930 26-Jan-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Change error "function cannot return array type" -> "blocks cannot return array type" when blocks are involved.
Addresses rdar://8876238.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124242 91177308-0d34-0410-b5e6-96231b3b80d8
lock-return.c
a8c17a5babab35f2db26bf218e7571d1af4afedf 25-Jan-2011 Ted Kremenek <kremenek@apple.com> Teach -Wuninitialized-experimental to also warn
about uninitialized variables captured by blocks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124213 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
d6b8de0e7b01196bd2bee207feb81bc409a5baf9 25-Jan-2011 John McCall <rjmccall@apple.com> Change the wording of the bad-decl-for-attribute warning and error
to make it clear that we're talking about the declarations and not the types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124175 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-naked.c
ttr-nodebug.c
ttr-noinline.c
ttr-used.c
ttr-weak.c
onstructor-attribute.c
llimport-dllexport.c
entinel-attribute.c
nused-expr.c
86-attr-force-align-arg-pointer.c
9660803cd332d5c605899435019bb3b37fca3acc 23-Jan-2011 Ted Kremenek <kremenek@apple.com> Teach -Wuninitialized-experimental about sizeof().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124076 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
dcfb360f6e1aaab0754a98e1e245c2607c46058a 21-Jan-2011 Ted Kremenek <kremenek@apple.com> Provide -Wuninitialized-experimental fixits
for floats, and also check if 'nil' is declared
when suggesting it for initializing ObjC pointers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124004 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
fbb178a0b47fca1b0fb78c5d41198614cf52aa70 21-Jan-2011 Ted Kremenek <kremenek@apple.com> Add basic fixits for -Wuninitialized-experimental
to suggest initializations for pointer and
ObjC pointer types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123995 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
94b1b4d785bc0f09f6af4be394e59d51f35dda60 21-Jan-2011 Ted Kremenek <kremenek@apple.com> Enhance -Wuninitialized-experimental diagnostics
to issue the warning at an uninitialized variable's
declaration, but to issue notes at possible
uninitialized uses (which could be multiple).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123994 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
13bd4236ab8297350be388ab442b4c42eb8fe437 20-Jan-2011 Ted Kremenek <kremenek@apple.com> Add rudimentary path-sensitivity to UnintializedValuesV2
analysis for short-circuited operations. For branch written like "if (x && y)",
we maintain two sets of dataflow values for the outgoing
branches. This suppresses some common false positives
for -Wuninitialized-experimental.

This change introduces some assertion failures
when running on the LLVM codebase. WIP.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123923 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
3b6575108a5b6d8b92ac3a9a7794bf6c3a210907 19-Jan-2011 John McCall <rjmccall@apple.com> Change the canonical representation of array types to store qualifiers on the
outermost array types and not on the element type. Move the CanonicalType
member from Type to ExtQualsTypeCommonBase; the canonical type on an ExtQuals
node includes the qualifiers on the ExtQuals. Assorted optimizations enabled
by this change.

getQualifiers(), hasQualifiers(), etc. should all now implicitly look through
array types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123817 91177308-0d34-0410-b5e6-96231b3b80d8
ypedef-retain.c
c21fed361c11f13db345cba69101578578d8fb79 18-Jan-2011 Ted Kremenek <kremenek@apple.com> Teach UninitializedValuesV2 to implicitly reason about C++
references by monitoring whether an access to
a variable is solely to compute it's lvalue or
to do an lvalue-to-rvalue conversion (i.e., a load).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123777 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
e188933adf2cfe2821b8acba2de6d5d152bc246b 18-Jan-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Properly do a float -> _Complex double conversion, fixes rdar://8875946.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123759 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
4dccb90e92ba9e4abffe0177493b6db9949678dd 18-Jan-2011 Ted Kremenek <kremenek@apple.com> Correctly enable test/Sema/unit-variables.c,
thus identifying a minor logical flaw in
UninitializedValuesV2.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123734 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
c104e53639de4424b83955acfadc977773b5883d 18-Jan-2011 Ted Kremenek <kremenek@apple.com> Teach UninitializedValuesV2 about "int x = x" and
also properly handle confluence of loops.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123733 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
5be38be82a6631786624625d010d695d529802a8 17-Jan-2011 Francois Pichet <pichet2000@gmail.com> Remove a c++ file test I inadvertently added in Sema last week.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123608 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.cpp
610068c8cd2321f90e147b12cf794e1f840b6405 15-Jan-2011 Ted Kremenek <kremenek@apple.com> Add initial prototype for implementation of
-Wuninitialized based on CFG dataflow analysis. WIP.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123512 91177308-0d34-0410-b5e6-96231b3b80d8
ninit-variables.c
2b57aefea762f526405937b3c01901f8e1047edb 11-Jan-2011 Abramo Bagnara <abramo.bagnara@gmail.com> Added warning about invalid register specification for local variables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123236 91177308-0d34-0410-b5e6-96231b3b80d8
sm.c
a15a5eede90e41ce1bf49ecc42d54895dfd86d15 11-Jan-2011 Francois Pichet <pichet2000@gmail.com> In Microsoft mode, force 64 bit hex integer constants to signed type if the LL or i64 suffix is used. This MSVC behavior.

For example:

void f(long long){ printf("long long"); }
void f(unsigned long long) { printf("unsigned long long"); }
int main() {
f(0xffffffffffffffffLL);
}
Will print "long long" using MSVC.

This patch also fixes 16 compile errors related to overloading issues when parsing the MSVC 2008 C++ standard lib.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123231 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.cpp
65197b4b0c55bb74af0450230d61ee9461223721 08-Jan-2011 Ted Kremenek <kremenek@apple.com> Add semantic checking that the "thousands grouping"
prefix in a printf format string is matched
with the appropriate conversion specifier.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123055 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
bd18d4584aae0ed6f7111ef5713784cf29fe663f 08-Jan-2011 Ted Kremenek <kremenek@apple.com> Add printf format string parsing support for '
prefix to format conversions (POSIX extension).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123054 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
9ce5270f0aadaaf03a0cf705787f42ce9eb1194c 07-Jan-2011 Ted Kremenek <kremenek@apple.com> Fix crash in CFGBuilder on invalid code. We still need
to reject this code, but at least clang doesn't
crash anymore.

Crash reported in PR 8880.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123017 91177308-0d34-0410-b5e6-96231b3b80d8
tatements.c
711c52bb20d0c69063b52a99826fb7d2835501f1 05-Jan-2011 John McCall <rjmccall@apple.com> Refactor the application of type attributes so that attributes from
the declaration-specifiers and on the declarator itself are moved
to the appropriate declarator chunk. This permits a greatly
simplified model for how to apply these attributes, as well as
allowing a much more efficient query for the GC attribute.
Now all qualifier queries follow the same basic strategy of
"local qualifiers, local qualifiers on the canonical type,
then look through arrays". This can be easily optimized by
changing the canonical qualified-array-type representation.

Do not process type attributes as decl attributes on declarations
with declarators.

When computing the type of a block, synthesize a prototype
function declarator chunk if the decl-spec type was not a
function. This simplifies the logic for building block signatures.

Change the logic which inserts an objc_read_weak on a block
literal to only fire if the block has a __weak __block variable,
rather than if the return type of the block is __weak qualified,
which is not actually a sensible thing to ask.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122871 91177308-0d34-0410-b5e6-96231b3b80d8
lock-return.c
tdcall-fastcall.c
b2b5cc0cf908d516a107d373db963f692449a8a8 04-Jan-2011 Chandler Carruth <chandlerc@gmail.com> Enhance the diagnostic for negative array sizes to include the
declaration name of the array when present. This ensures that
a poor-man's C++03 static_assert will include the user error message
often embedded in the name.

Update all the tests to reflect the new wording, and add a test for the
name behavior.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122802 91177308-0d34-0410-b5e6-96231b3b80d8
rray-constraint.c
6b9109e9d5446f213b12d2a6b76495bffb06b794 03-Jan-2011 Douglas Gregor <dgregor@apple.com> When we attempt to create a built-in that involves a library type we
don't have access to (e.g., fprintf, which needs the library type
FILE), fail with a warning and forget about the builtin
entirely. Previously, we would actually provide an error, which breaks
autoconf's super-lame checks for fprintf, longjmp, etc. Fixes PR8316.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122744 91177308-0d34-0410-b5e6-96231b3b80d8
mplicit-builtin-decl.c
baf86955a9a390f2643a1ea9806832eb4a92f716 01-Jan-2011 Rafael Espindola <rafael.espindola@gmail.com> Produce a better error message for invalid register names.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122670 91177308-0d34-0410-b5e6-96231b3b80d8
sm.c
927b180b8debfcfd80d36fdec9d0fddba1c283e7 28-Dec-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added scalar casts test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122599 91177308-0d34-0410-b5e6-96231b3b80d8
ast.c
96fc8e4086df323c49f17cac594db1d2f066a2e9 11-Dec-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Improved complex constants evaluation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121616 91177308-0d34-0410-b5e6-96231b3b80d8
omplex-int.c
f5fe2925b87cf382f2f13983c81679e38067122b 07-Dec-2010 Rafael Espindola <rafael.espindola@gmail.com> Fix PR8720 by printing an error message with a substring that the gcc testsuite searches for.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121137 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-alias.c
abc56c726178fc7c8a3f45185768426a6e9d584e 04-Dec-2010 John McCall <rjmccall@apple.com> When deciding whether to complain about the type of a boolean condition, use
the type of the expression *after* array/function decay.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120895 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
f6a1648197562e0b133440d612d9af297d0a86cc 04-Dec-2010 John McCall <rjmccall@apple.com> Although we currently have explicit lvalue-to-rvalue conversions, they're
not actually frequently used, because ImpCastExprToType only creates a node
if the types differ. So explicitly create an ICE in the lvalue-to-rvalue
conversion code in DefaultFunctionArrayLvalueConversion() as well as several
other new places, and consistently deal with the consequences throughout the
compiler.

In addition, introduce a new cast kind for loading an ObjCProperty l-value,
and make sure we emit those nodes whenever an ObjCProperty l-value appears
that's not on the LHS of an assignment operator.

This breaks a couple of rewriter tests, which I've x-failed until future
development occurs on the rewriter.

Ted Kremenek kindly contributed the analyzer workarounds in this patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120890 91177308-0d34-0410-b5e6-96231b3b80d8
dr6094103-unordered-compare-promote.c
ae3038c5e8bfce47337e83aeb253256633fbb701 04-Dec-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Mark functions referenced by 'cleanup' attribute as used. Fixes rdar://8728293

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120872 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unused-function.c
f91d7572ee7fa6f2926c8e7e816039a1154a59f8 02-Dec-2010 Peter Collingbourne <peter@pcc.me.uk> Merge transparent union types using member's unqualified type

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120736 91177308-0d34-0410-b5e6-96231b3b80d8
ransparent-union.c
7966297a70996977f167a8676568f02f4283bdd6 02-Dec-2010 Ted Kremenek <kremenek@apple.com> Fix range in printf warnings for invalid conversion specifiers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120735 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
b97c403176a5937575e7c5eea20026edfbe947f5 02-Dec-2010 Peter Collingbourne <peter@pcc.me.uk> Merge transparent union types using member's canonical param type

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120729 91177308-0d34-0410-b5e6-96231b3b80d8
ransparent-union.c
550e5ada63dc7c77263abe9a7e14053767a926a4 02-Dec-2010 Bob Wilson <bob.wilson@apple.com> Attempt to fix linux buildbots by adding -ffreestanding for arm_neon tests.
The arm_neon.h header includes stdint.h and it picks up the system header
without -ffreestanding.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120716 91177308-0d34-0410-b5e6-96231b3b80d8
rm-neon-types.c
0608f53744ccf88c4d21d6b500f6d23927533ac9 02-Dec-2010 Bob Wilson <bob.wilson@apple.com> Add a test for calling a Neon intrinsic macro with the wrong vector type.
This does not work so well with the -fno-lax-vector-conversions option for
testing the arm_neon.h header but that is a really useful test, so I split
this out to a separate Sema test to check for the warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120694 91177308-0d34-0410-b5e6-96231b3b80d8
rm-neon-types.c
bbd340717422bf011d56cd0164d2576601368111 30-Nov-2010 Fariborz Jahanian <fjahanian@apple.com> Incomplete enum types not to be treated as integer type
when checking for integer signed/unsigned-ness. PR8694,
// rdar://8707031


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120345 91177308-0d34-0410-b5e6-96231b3b80d8
num.c
8e161ed8e63bd9d3783a987d837b72b2b96c4512 23-Nov-2010 Francois Pichet <pichet2000@gmail.com> Microsoft C anonymous struct implementation.
Documentation: http://msdn.microsoft.com/en-us/library/z2cx9y4f.aspx

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120000 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
040dda5da1e619be71c9898ebd031e34d9a59b32 22-Nov-2010 NAKAMURA Takumi <geek4civic@gmail.com> test/Sema/x86-builtin-palignr.c: Now we can remove XFAIL:win32, according to r119958.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119961 91177308-0d34-0410-b5e6-96231b3b80d8
86-builtin-palignr.c
2e6c19abcf97c25f4d7458a9db89c5ab0158717d 21-Nov-2010 Anders Carlsson <andersca@mac.com> The 'X' printf type has a valid alternative form. Fixes PR8641.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119946 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
a25b6a4b43e8b9611f7506e5fe1b448833b10a46 19-Nov-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't warn for empty 'if' body if there is a macro that expands to nothing, e.g:

if (condition)
CALL(0); // empty macro but don't warn for empty body.

Fixes rdar://8436021.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119838 91177308-0d34-0410-b5e6-96231b3b80d8
f-empty-body.c
aa4fe05939ffbfd746b8f0065cc0b5e06ea94fe2 18-Nov-2010 Anton Yartsev <anton.yartsev@gmail.com> comparison of AltiVec vectors now gives bool result (fix for 7533)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119678 91177308-0d34-0410-b5e6-96231b3b80d8
ltivec-init.c
47d512c337d06376d56beeb7eccc7c581ed5ff57 17-Nov-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't emit warn_logical_and_in_logical_or for cases like "a && b || 0".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119540 91177308-0d34-0410-b5e6-96231b3b80d8
arentheses.c
567bb71a01bcf178c6fcabb3eecf7a8c4f71e674 17-Nov-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't warn for parentheses for the '&&' inside '||' for cases like:

assert(a || b && "bad");

since this is safe. This way we avoid a big source of such warnings which in this case are practically useless.

Note that we don't handle *all* cases where precedence wouldn't matter because of constants since
this is a bit costly to check, and IMO clarifying precedence with parentheses is good for
readability in general.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119533 91177308-0d34-0410-b5e6-96231b3b80d8
arentheses.c
bee77f75358a5aaf2e2e01ab9cfd37ffc514ed7a 16-Nov-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Warn about arg1 && arg2 || arg3, as GCC 4.3+ does. Fixes rdar://8659922

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119381 91177308-0d34-0410-b5e6-96231b3b80d8
arentheses.c
ba772ba69ba0661f059f49c58395f870eb5c4df3 16-Nov-2010 Chandler Carruth <chandlerc@gmail.com> This really seems like a boring set of fixes to our tests to make them more
independent of the underlying system. Let me know if any of these are too
aggressive.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119345 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-malloc.c
-c-e.c
hift.c
86-builtin-palignr.c
541b99466e6b0bce16a105cef2fbfb44e7932e2a 16-Nov-2010 Bob Wilson <bob.wilson@apple.com> Add tests for new Neon vector type attributes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119303 91177308-0d34-0410-b5e6-96231b3b80d8
eon-vector-types.c
91b6014876e9186f968f74a8975ab8fc08ef1b68 11-Nov-2010 John McCall <rjmccall@apple.com> Undo a refactor-o and base the bitfield-truncation warning on the
uncoerced value. Also, whitelist bool bitfields, which aren't
really a truncation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118778 91177308-0d34-0410-b5e6-96231b3b80d8
onstant-conversion.c
15d7d12226f83de24f96f4bf4e27ebba30fef51e 11-Nov-2010 John McCall <rjmccall@apple.com> Extend the bitfield-truncation warning to initializations.
rdar://problem/8652606



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118773 91177308-0d34-0410-b5e6-96231b3b80d8
onstant-conversion.c
1844a6e1074a5c1fd8eadac7fc7317c3e29d4653 11-Nov-2010 John McCall <rjmccall@apple.com> When -Wconversion computes the range of a type, it uses the (bit-)range
of the enumerators rather than the actual expressible range. This is
great when dealing with opaque *values* of that type, but when computing
the range of the type for purposes of converting *into* it, it produces
warnings in cases we don't care about (e.g. enum_t x = 500;). Divide
the logic into these two cases and use the more conservative range for
targets.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118735 91177308-0d34-0410-b5e6-96231b3b80d8
onstant-conversion.c
935cd6e8529edbb3b0eba660bd934b508766de37 10-Nov-2010 John McCall <rjmccall@apple.com> Tweak to bitfield-overflow warning: don't warn about storing
a positive value into a signed bitfield of the exact width of
the value.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118657 91177308-0d34-0410-b5e6-96231b3b80d8
onstant-conversion.c
5dac4c222d9ff25488ac6f0b9642fa0d939ba2f8 10-Nov-2010 John McCall <rjmccall@apple.com> Typo.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118649 91177308-0d34-0410-b5e6-96231b3b80d8
onstant-conversion.c
beb22aaa22e255241d6a81e8b0a9239f5fa584f3 10-Nov-2010 John McCall <rjmccall@apple.com> Add a warning for implicit truncation of constant values due to
bitfield assignment.

Implements rdar://problem/7809123



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118647 91177308-0d34-0410-b5e6-96231b3b80d8
onstant-conversion.c
091f23f1d6d4bcffd6641cda72a6831e08c02ea7 09-Nov-2010 John McCall <rjmccall@apple.com> Split out -Wconversion warnings about constant precision into their
own subcategory, -Wconstant-conversion, which is on by default.

Tweak the constant folder to give better results in the invalid
case of a negative shift amount.

Implements rdar://problem/6792488



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118636 91177308-0d34-0410-b5e6-96231b3b80d8
onstant-conversion.c
onversion.c
73167ec561c1dc3f34cbca2287c83985cbf2bfdf 09-Nov-2010 Fariborz Jahanian <fjahanian@apple.com> Test moved to its correct place.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118635 91177308-0d34-0410-b5e6-96231b3b80d8
uiltin_objc_msgSend.c
90ba6d5cf790c98231c93a63a5b1f7c6a95bd6b6 09-Nov-2010 Douglas Gregor <dgregor@apple.com> Fix source locations in unnamed bitfield diagnostic, from Jakub
Wieczorek! Fixes PR8025.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118481 91177308-0d34-0410-b5e6-96231b3b80d8
itfield.c
4820908be98f340a4c2a563a622ae693a7219c50 08-Nov-2010 John McCall <rjmccall@apple.com> Document Clang's support for attributes on individual enumerators and
tweak the documentation for deprecation-with-message. Provide __has_feature
tests for both. rdar://problem/8605692



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118435 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-deprecated.c
ttr-unavailable-message.c
num.c
79ca1ee4b637c01458584bb571f1b309180c780d 03-Nov-2010 Anders Carlsson <andersca@mac.com> When setting a tied check if it's already tied. If it's tied to another constraint it's invalid. Fixes PR3905.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118146 91177308-0d34-0410-b5e6-96231b3b80d8
sm.c
86eda39c8af47280273758debf0432933bdeee3c 03-Nov-2010 Anders Carlsson <andersca@mac.com> A number in an input constraint can't point to a read-write ('+') constraint. Fixes PR3904.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118145 91177308-0d34-0410-b5e6-96231b3b80d8
sm.c
20e047abc5f19dc948436c0fb891450d9cd40667 30-Oct-2010 John McCall <rjmccall@apple.com> When list-initializing a vector, try to copy-initialize from vectors instead
of descending into the subelements.

rdar://problem/8345836



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117749 91177308-0d34-0410-b5e6-96231b3b80d8
ector-init.c
95c225de9fa3d79f70ef5008c0279580a7d9dcad 28-Oct-2010 John McCall <rjmccall@apple.com> Implement an indirect-goto optimization for goto *&&lbl and respect this
in the scope checker. With that done, turn an indirect goto into a
protected scope into a hard error; otherwise IR generation has to start
worrying about declarations not dominating their scopes, as exemplified
in PR8473.

If this really affects anyone, I can probably adjust this to only hard-error
on possible indirect gotos into VLA scopes rather than arbitrary scopes.
But we'll see how people cope with the aggressive change on the marginal
feature.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117539 91177308-0d34-0410-b5e6-96231b3b80d8
cope-check.c
d8f0ade43ee3f9d13d2d98b7a3d07468c2b4096e 25-Oct-2010 Douglas Gregor <dgregor@apple.com> Look through the address-of operator to find the function being
called. Fixes another aspect of PR8314.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117308 91177308-0d34-0410-b5e6-96231b3b80d8
nr-def-call.c
4654241866c91fa312d7b26d5eb4afd070b5c602 25-Oct-2010 Douglas Gregor <dgregor@apple.com> When we're calling a function that we know based on its K&R-style
function definition, we should still use a prototype to type-check and
convert the function arguments, if such a prototype exists. Fixes
PR8314.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117305 91177308-0d34-0410-b5e6-96231b3b80d8
nr-def-call.c
4846675e0e42d1802b0ffd8972a45e72aeb3758d 24-Oct-2010 Peter Collingbourne <peter@pcc.me.uk> Implement GNU C extension: two types are compatible if they appear
as a function argument, one of the types is a transparent union type
and the other type is compatible with a union member

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117243 91177308-0d34-0410-b5e6-96231b3b80d8
ransparent-union.c
e1667190dff025936a21e5eb43889ac93b570468 24-Oct-2010 Marcin Swiderski <marcin.sfider@gmail.com> - Fixed subexpressions evaluation order for binary operators to match order in code generated with the compiler,
- Fixed test cases for unreachable code warnings produced by Sema.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117220 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unreachable.c
cd1af3d68b00aa729e382fe2cde186f237630804 24-Oct-2010 Anders Carlsson <andersca@mac.com> Move the "used but marked unused" warning behind a special warning flag for now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117219 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-unused.c
ragma-unused.c
2127eccbe15fd3b1b29aa53ccedd2e0f55ad27f9 23-Oct-2010 Anders Carlsson <andersca@mac.com> Warn if a variable marked with the "unused" attribute is used. Patch by Darin Adler!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117184 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-unused.c
ragma-unused.c
5b629aa86c987f276d00453b6c9ab8424f7903fe 23-Oct-2010 John McCall <rjmccall@apple.com> Parse attributes on enumerators and instantiate attributes on enum decls.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117182 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-deprecated.c
4d8ae4d57ed18d60da4d3786fb740607aa7c3688 21-Oct-2010 Ted Kremenek <kremenek@apple.com> Previously, the printf warnings would say your arguments type was 'int' when it was really a 'char'
or a 'short'. This fixes that and allows the hints to suggest 'h' modifiers for small ints.

Patch by Justin Bogner!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116996 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
eada35c933d8560a5d87741438a610d13d6e11d3 19-Oct-2010 NAKAMURA Takumi <geek4civic@gmail.com> test/Sema/return.c: Cygwin does not have _longjmp().

Although Cygwin-1.7 has _longjmp(), it would not be essential for this
to distinguish Cygwin's version with <cygwin/version.h>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116783 91177308-0d34-0410-b5e6-96231b3b80d8
eturn.c
842e7a22c6a0fbf0ccdb4bb9308d92ca9e9621f6 18-Oct-2010 Francois Pichet <pichet2000@gmail.com> Microsoft enum extensions. 2 things will change on -fms-extensions:
1. enum underlying type is int by default.
2. Error "enumerator value is not representable in the underlying type"is a ExtWarning

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116704 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
c6eddf50bff68683238f06625fa9fb5016a3694c 16-Oct-2010 Douglas Gregor <dgregor@apple.com> Allow list-initialization of a local variable of class type with a
flexible array member, so long as the flexibility array member is
either not initialized or is initialized with an empty initializer
list. Fixes <rdar://problem/8540437>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116647 91177308-0d34-0410-b5e6-96231b3b80d8
lexible-array-init.c
2fb985bdda20037bda228628acd4cbaa8a3b36ac 15-Oct-2010 Gabor Greif <ggreif@gmail.com> zap trailing whitespace

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116572 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.c
1f4295b966870fff784faa5a5eba3fe9e27a6406 15-Oct-2010 Gabor Greif <ggreif@gmail.com> testcase for http://llvm.org/PR8371 of my last commit, r116570

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116571 91177308-0d34-0410-b5e6-96231b3b80d8
nused-expr.c
e24b575f06985336973bb721e198bd184bf7bdd3 14-Oct-2010 Douglas Gregor <dgregor@apple.com> Tweak the typo-correction implementation to determine corrections
solely based on the names it sees, rather than actual declarations it
gets. In essence, we determine the set of names that are "close
enough" to the typo'd name. Then, we perform name lookup for each of
those names, filtering out those that aren't actually visible, and
typo-correct from the remaining results.

Overall, there isn't much of a change in the behavior of typo
correction here. The only test-suite change comes from the fact that
we make good on our promise to require that the user type 3 characters
for each 1 character corrected.

The real intent behind this change is to set the stage for an
optimization to typo correction (so that we don't need to deserialize
all declarations in a translation unit) and future work in finding
missing qualification ("'vector' isn't in scope; did you mean
'std::vector'?). Plus, the code is cleaner this way.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116511 91177308-0d34-0410-b5e6-96231b3b80d8
witch.c
75c29a012793292ff4578015a9113bf086156d7f 12-Oct-2010 Chris Lattner <sabre@nondot.org> fix PR7885, rejecting invalid uses of __builtin_constant_p.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116317 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.c
onst-eval.c
cf2e5063ae7e7ed3f8d86bb426b2208e242128ab 12-Oct-2010 John McCall <rjmccall@apple.com> C's comma operator performs lvalue conversion on both its operands;
require them to have complete types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116297 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
757e685512b8616c9de918b3d3fad8247562dce2 11-Oct-2010 Chris Lattner <sabre@nondot.org> Per discussion with Sanjiv, remove the PIC16 target from mainline. When/if
it comes back, it will be largely a rewrite, so keeping the old codebase
in tree isn't helping anyone.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116191 91177308-0d34-0410-b5e6-96231b3b80d8
itfield-promote-int-16bit.c
romote-int-16bit.c
16c5dea6c2d3e4cf529de9d9b37f6a40441acb2c 10-Oct-2010 Chris Lattner <sabre@nondot.org> fix PR8217, a silent miscompilation of invalid code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116166 91177308-0d34-0410-b5e6-96231b3b80d8
lexible-array-init.c
nit.c
83a1c5c8996a68d9be4e54de27565ce037785df1 09-Oct-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed __builtin_constant_p return type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116145 91177308-0d34-0410-b5e6-96231b3b80d8
-c-e.c
022d13de47a5f02d1e4089fa3360fae8bcb17666 08-Oct-2010 Douglas Gregor <dgregor@apple.com> This patch fixes multiple issues in clang's designated init builder and
completes support for C1X anonymous struct/union init features:

* Indexed anonymous member initializers should not be expanded. Doing so makes
little sense and would cause unresolvable semantic ambiguity in valid code
(regression introduced by r69153).

* Subobject initialization of (possibly nested) anonymous members are now
referred to with paths relative to the naming record context, eliminating the
synthesis of incorrect implicit InitListExprs that caused CodeGen to assert.

* Field lookup was missing a null check in IdentifierInfo comparison which
caused lookup for a known (already resolved) field to match the first unnamed
data member it encountered leading to silent miscompilation.

* Subobject paths are no longer built using the general purpose
Sema::BuildAnonymousStructUnionMemberPath(). If any corner cases crop up, we
will now assert earlier in Sema instead of passing invalid InitListExprs
through to CodeGen.

Fixes PR6955, from Alp Toker!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116098 91177308-0d34-0410-b5e6-96231b3b80d8
esignated-initializers.c
4081a5c5f1381c4ec77f8ab3866693917e4329c4 08-Oct-2010 John McCall <rjmccall@apple.com> __attribute__((aligned(n))) directly specifies the alignment of a declaration
unless it's a non-packed field, in which case it can only increase the
alignment. [[align]] effectively works the same way for well-formed code
(because it's ill-formed for [[align]] to decrease alignment ever).

Fixes rdar://problem/8335865



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116070 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-aligned.c
b4eb64d8426c0eaa58d398961e0e74ff85063d7c 08-Oct-2010 John McCall <rjmccall@apple.com> Track the location of the context requiring an implicit conversion and use it
to white-list conversions required by system headers. rdar://problem/8232669



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116029 91177308-0d34-0410-b5e6-96231b3b80d8
nputs/conversion.h
onversion.c
9a2b9d794bdf349b517ff799170f4409f45d147c 08-Oct-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Implement -fshort-enums (rdar://8490496).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116020 91177308-0d34-0410-b5e6-96231b3b80d8
hort-enums.c
8c4bfe52e528d6c9810cfb0c59859bca9ddc41f0 07-Oct-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed cast to union with anonymous bitfields.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115979 91177308-0d34-0410-b5e6-96231b3b80d8
ast-to-union.c
c784dc1caf0df288a383700f7b57772103b3adab 07-Oct-2010 Fariborz Jahanian <fjahanian@apple.com> Patch for adding message to unavailable attribute.
And its documentation.
Finishes off // rdar: // 6734520.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115862 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-unavailable-message.c
c4b35cfdb977f6427fe0d5725bf104e1b425d72e 06-Oct-2010 Fariborz Jahanian <fjahanian@apple.com> Add message to attribute(deprecated).
attribute(unavailable) to do next.
// rdar:// 6734520.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115842 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-deprecated-message.c
730e175910936eae49e65caea8b2ba81c67edff7 06-Oct-2010 Fariborz Jahanian <fjahanian@apple.com> Issue deprecated warning when typeof uses typedef
based on underlying type's deprecatedness.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115800 91177308-0d34-0410-b5e6-96231b3b80d8
ypeof-use-deprecated.c
b6448943ba1fe01be7cd658437dacae9d2fee8a8 06-Oct-2010 Chandler Carruth <chandlerc@gmail.com> Remove hard CRLF end-of-line markers from two files. These should be added
automatically when syncing due to the auto-props selecting svn:eol-style of
'native'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115758 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
372e103dab4239ec52b65b9eda69fd43c0b348d4 06-Oct-2010 John McCall <rjmccall@apple.com> Provide a slightly specialized diagnostic for tautological comparisons
of an enum value.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115725 91177308-0d34-0410-b5e6-96231b3b80d8
ompare.c
2b1d51bcf891f8887759aebb4b9e78dee8542e6d 06-Oct-2010 Fariborz Jahanian <fjahanian@apple.com> Issue deprecated warning when typeof uses an
expression of deprecated type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115713 91177308-0d34-0410-b5e6-96231b3b80d8
ypeof-use-deprecated.c
946928f48c96bddf3cfa126862f5ab69c2d904a0 02-Oct-2010 Chris Lattner <sabre@nondot.org> diagnose errors when a builtin that require constant arguments don't have them.
For example, on:

#include <emmintrin.h>
int foo(int N) {
__m128i white2;
white2 = _mm_slli_si128(white2, N);
return 0;
}

we used to get:
fatal error: error in backend: Cannot yet select: intrinsic %llvm.x86.sse2.psll.dq

now we get:
/Users/sabre/t.c:4:11: error: argument to '__builtin_ia32_pslldqi128' must be a
constant integer
white2 = _mm_slli_si128(white2, N);
^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /Users/sabre/t.c:1:
/Volumes/Projects/cvs/llvm/Debug+Asserts/lib/clang/2.9/include/emmintrin.h:781:13: note: instantiated from:
((__m128i)__builtin_ia32_pslldqi128((__m128i)(VEC), (IMM)*8))
^ ~~~~~~~
1 error generated.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115374 91177308-0d34-0410-b5e6-96231b3b80d8
86-builtin-palignr.c
dd0cb22bd62e1e835327f478a2dbf0b8fa439713 29-Sep-2010 Daniel Dunbar <daniel@zuster.org> Add support for attribute((naked)), patch by Zoxc on cfe-commits!
- Minor style tweaks by me.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115056 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-naked.c
1a18600b85aaa691122983dd8dcf4225cfc9ef68 28-Sep-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't warn for an unused label if it has 'unused' attribute. Fixes rdar://8483139.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114954 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unused-label.c
5cadfab3f2e7660453211eb0e00314bd40d93014 27-Sep-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Fixed isConstantInitializer for __builtin_choose_expr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114820 91177308-0d34-0410-b5e6-96231b3b80d8
ompound-literal.c
e3b159c0d4a93db8586861ff011b5a10de4ae6ef 23-Sep-2010 Ted Kremenek <kremenek@apple.com> When warning about comparing an unsigned int to being >= 0, don't issue a warning if the zero value was an
enum or was expanded from a macro.

Fixes: <rdar://problem/8414119>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114695 91177308-0d34-0410-b5e6-96231b3b80d8
ompare.c
6155d73ad1668be5335b1a060f6c49c03d4dca05 21-Sep-2010 Nate Begeman <natebegeman@mac.com> Check in support for OpenCL conditional operator on vector types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114371 91177308-0d34-0410-b5e6-96231b3b80d8
pencl-cond.c
1b2ad2fd9e2d5352144481aa1fd995d333d9adc9 20-Sep-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Revert r114316, -Wunused-value enabled by default was intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114318 91177308-0d34-0410-b5e6-96231b3b80d8
num.c
xt_vector_components.c
-c-e.c
tatements.c
nused-expr.c
6dff2288a8054bdbc97217568e5831bcce809db8 19-Sep-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Make -Wunused-value off by default, matching GCC. Fixes rdar://7126194.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114316 91177308-0d34-0410-b5e6-96231b3b80d8
num.c
xt_vector_components.c
-c-e.c
tatements.c
nused-expr.c
355a9fe26a6dec89680ddf713dd5bc7a671b298a 19-Sep-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Implement -Wunused-label.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114315 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unused-label.c
arn-unused-value.c
d2827af6f96d441d72315dbe6d8505c3be0f2aa6 19-Sep-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Warn when an expression result in a LabelStmt is unused.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114314 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unused-value.c
ce78461303f45fecb3460d1c49c9b71f27ad19c3 16-Sep-2010 Chris Lattner <sabre@nondot.org> improve the "enumeration value 'g' not handled in switch"
warning to handle multiple enumerators with one warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114093 91177308-0d34-0410-b5e6-96231b3b80d8
tatements.c
b3198178daf9d33466fc18e009e2c6692fdf29c0 16-Sep-2010 Ted Kremenek <kremenek@apple.com> Do not warn about empty bodies for 'if' statements if the body is expanded from a macro.

Fixes <rdar://problem/8436021>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114049 91177308-0d34-0410-b5e6-96231b3b80d8
f-empty-body.c
fbcb0ebb51f4b76abaa4a7b30be08c175f723369 16-Sep-2010 Ted Kremenek <kremenek@apple.com> For self-comparison warning, check the source location of both the LHS and RHS to see if they
are expanded from macros (and if so, omit the warning). Previously we were just looking at the
location of the binary expression.

Fixes <rdar://problem/8435950>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114044 91177308-0d34-0410-b5e6-96231b3b80d8
elf-comparison.c
09246183715f4b0a8728a3827bfe894b6c6016b9 15-Sep-2010 Francois Pichet <pichet2000@gmail.com> Microsoft's flexible array rules relaxation:
- in union
- as the only element of a struct/class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113909 91177308-0d34-0410-b5e6-96231b3b80d8
icrosoftExtensions.c
46358457f712a8da89d4e03a17a1d44d35c78b77 13-Sep-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Congruent diagnostic for void* arithmetic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113740 91177308-0d34-0410-b5e6-96231b3b80d8
ointer-addition.c
5726d405e71f11feaaf0c8f518abe26e909537a4 10-Sep-2010 Douglas Gregor <dgregor@apple.com> Support strlen() and __builtin_strlen() as constant expressions with
the call argument is a string literal. Fixes
<rdar://problem/8413477>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113580 91177308-0d34-0410-b5e6-96231b3b80d8
onstant-builtins-2.c
c82faca0be59b072b38bed375e21bd24f1f72647 09-Sep-2010 Ted Kremenek <kremenek@apple.com> Check format strings when a called function has more than one FormatAttr (one for 'scanf' and one for 'printf'). Fixes <rdar://problem/8409437>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113472 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
95355bb53ef3145e463b98c6fd26f8f95e26e26c 09-Sep-2010 Ted Kremenek <kremenek@apple.com> It appears that technically a null format string is not warned under -Wformat-nonliteral, as
the function processing the format string can decided whether or not to accept a null format string (e.g., asl_log). Fixes <rdar://problem/8269537>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113469 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
8caec849a765de7b0b4ae8b9769397ce62236321 09-Sep-2010 Ted Kremenek <kremenek@apple.com> Enhance -Wunreachable-code to not consider the 'default:' branch of a switch statement live if a switch on an enum value has
explicit 'case:' statements for each enum value.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113451 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unreachable.c
90b828aa279542559f655d1af666580288cb1841 09-Sep-2010 Ted Kremenek <kremenek@apple.com> Enhance -Wreturn-type to not warn when control-flow is most likely limited by a switch statement explicitly covering
all the cases for an enum value.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113450 91177308-0d34-0410-b5e6-96231b3b80d8
eturn.c
c79f767941fdfedb02d20296a042ad951a593890 08-Sep-2010 Daniel Dunbar <daniel@zuster.org> tests: Use -ffreestanding when including stdint.h, to avoid platform dependencies.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113301 91177308-0d34-0410-b5e6-96231b3b80d8
onst-ptr-int-ptr-cast.c
nit.c
7da71020b97c69b95831bd03d35e8e8404bfdea0 07-Sep-2010 Fariborz Jahanian <fjahanian@apple.com> Have Sema check for validity of CGString literal
instead of asserting in IRGen. Fixes radar 8390459.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113253 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.c
fbc5b49322577e03ed780dcdf5be514871ec381d 07-Sep-2010 Douglas Gregor <dgregor@apple.com> Provide a specific diagnostic when trying to redefine an "extern
inline" function outside of GNU89 mode. Fixes
<rdar://problem/6880464>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113204 91177308-0d34-0410-b5e6-96231b3b80d8
edefinition.c
6d6370ee10ddcd8cacc44c2d6796800c1325c732 06-Sep-2010 Chris Lattner <sabre@nondot.org> fix PR7192 by defining wchar_t in a more conventional way. The
type of L"x" can change based on command line arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113127 91177308-0d34-0410-b5e6-96231b3b80d8
arn-write-strings.c
66cf2d1290c598fcbaf1c6b50411f2513daf3b3e 05-Sep-2010 Chris Lattner <sabre@nondot.org> print "const intptr_t" instead of "intptr_t const"


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113091 91177308-0d34-0410-b5e6-96231b3b80d8
arargs-x86-64.c
58f9e13e87e57236fee4b914eea9be6f92a1c345 05-Sep-2010 Chris Lattner <sabre@nondot.org> make clang print types as "const int *" instead of "int const*",
which is should have done from the beginning. As usual, the most
fun with this sort of change is updating all the testcases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113090 91177308-0d34-0410-b5e6-96231b3b80d8
ddress_spaces.c
rray-constraint.c
sm.c
lock-call.c
lock-return.c
mplicit-builtin-decl.c
nr-def-call.c
redef.c
ector-assign.c
arn-write-strings.c
5d1d7ae120c2c8e6cba5d2a712b33500a5aecc10 03-Sep-2010 Anders Carlsson <andersca@mac.com> Get rid of the "functions declared 'noreturn' should have a 'void' result type" warning.

The rationale behind this is that it is normal for callback functions to have a non-void return type
and it should still be possible to mark them noreturn. (JavaScriptCore is a good example of this).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112918 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-noreturn.c
lock-return.c
eturn-noreturn.c
eturn.c
arn-unreachable.c
f65086b479778d7090622bfb6cd9646c541a097e 01-Sep-2010 Chris Lattner <sabre@nondot.org> when emitting an error about a missing } in a compound statement, emit
a "to match this {" note, pointing out the opener.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112709 91177308-0d34-0410-b5e6-96231b3b80d8
ecover-goto.c
e84f9ebf8c89d5600f5930b65a0df0de890791b2 26-Aug-2010 Eric Christopher <echristo@apple.com> With lax vector conversions (the default) make sure we convert between two
vectors that are the same size. Fix up testcases accordingly and add a new one
to make sure we still error if lax vector conversions are disabled.

Fixes rdar://8328190


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112122 91177308-0d34-0410-b5e6-96231b3b80d8
xt_vector_casts.c
1e32ca6e3007e09073ddafb3cb5e0adc1f83293c 25-Aug-2010 Douglas Gregor <dgregor@apple.com> Implement __builtin_printf, __builtin_fprintf. Fixes <rdar://problem/8336581>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112049 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.c
58b5259e959f42823cc93f66da1499723eae366c 25-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Recursive functions should be marked when used from another function. Fixes http://llvm.org/PR7923.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112045 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unused-function.c
9325eaf08fcccbc0d038e703f570c64daacdaa31 25-Aug-2010 Ted Kremenek <kremenek@apple.com> Fix printf format string checking for '%lc' (which expects a wint_t or compatible argument). Fixes PR 7981.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111978 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
34fd628d22f54baddf30cf80c401b2f862a31b23 19-Aug-2010 Eli Friedman <eli.friedman@gmail.com> Fix for PR7911 and PR7921: make isIntegralOrEnumerationType return false
for incomplete enum types. An incomplete enum can't really be treated as
an "integral or enumeration" type, and the incorrect treatment leads to
bad behavior for many callers.

This makes isIntegralOrEnumerationType equivalent to isIntegerType; I think
we should globally replace the latter with the former; thoughts?



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111512 91177308-0d34-0410-b5e6-96231b3b80d8
num.c
58f281f7d54976f23ed4fa23a10ff1ab9c7037fe 19-Aug-2010 Ted Kremenek <kremenek@apple.com> Add warning for functions/blocks that have attribute 'noreturn' but return a non-void result. (<rdar://problem/7562925>)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111492 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-noreturn.c
lock-return.c
eturn-noreturn.c
eturn.c
arn-unreachable.c
2767ce2e21d8bc17869b8436220bce719b3369e4 18-Aug-2010 Douglas Gregor <dgregor@apple.com> Emit an error if an array is too large. We're slightly more strict
than GCC 4.2 here when building 32-bit (where GCC will allow
allocation of an array for which we can't get a valid past-the-end
pointer), and emulate its odd behavior in 64-bit where it only allows
63 bits worth of storage in the array. The former is a correctness
issue; the latter is harmless in practice (you wouldn't be able to use
such an array anyway) and helps us pass a GCC DejaGNU test.

Fixes <rdar://problem/8212293>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111338 91177308-0d34-0410-b5e6-96231b3b80d8
rray-size-64.c
rray-size.c
bbc6454bb98d6a6ecbaafa715222c5db834307f2 15-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Commit improved version of 111026 & 111027.

Unused warnings for functions:
-static functions
-functions in anonymous namespace
-class methods in anonymous namespace
-class method specializations in anonymous namespace
-function specializations in anonymous namespace

Unused warnings for variables:
-static variables
-variables in anonymous namespace
-static data members in anonymous namespace
-static data members specializations in anonymous namespace

Reveals lots of opportunities for dead code removal in llvm codebase that will
interest my esteemed colleagues.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111086 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unused-function.c
43efa31fe601bb7c3f132f02246dc3c903d9f361 14-Aug-2010 Eli Friedman <eli.friedman@gmail.com> PR7884: Fix the implementations of __real__ and __imag__ on real floats.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111080 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
09865a903affa9c08687859d8de65470064c7bc2 14-Aug-2010 Eli Friedman <eli.friedman@gmail.com> PR3344: Downgrade "too many braces around scalar initializer" to a warning.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111067 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
05eac86d547892847ca95b5350e28d681150fa68 13-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Revert 111026 & 111027, build breakage.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111036 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unused-function.c
f6d1d43d68016e975f22264343631a55b9701495 13-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Expand the unused warnings for functions. Warn for:

-static function declarations
-functions in anonymous namespace
-class methods in anonymous namespace
-class method specializations in anonymous namespace
-function specializations in anonymous namespace

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111026 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unused-function.c
b7f4ffe073fa419613946461a2583ba2fcb72280 12-Aug-2010 John McCall <rjmccall@apple.com> 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).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110959 91177308-0d34-0410-b5e6-96231b3b80d8
arn-cast-align.c
bf87f2c1c6e2d8cb50902a6d79e8b170c19570d2 10-Aug-2010 Eli Friedman <eli.friedman@gmail.com> Fix redefinition of typedefs of fixable variably-modified array types; should
fix an issue compiling <windows.h>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110651 91177308-0d34-0410-b5e6-96231b3b80d8
ypedef-variable-type.c
d945538a36642cb0f935b268acbc32a67fae85a6 06-Aug-2010 Douglas Gregor <dgregor@apple.com> Make sure that we diagnose attribute((overloadable)) functions without
prototypes. Fixes PR7738.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110443 91177308-0d34-0410-b5e6-96231b3b80d8
verloadable.c
255210ef415b9893f0e3794e8d9a704194c12f3c 06-Aug-2010 Douglas Gregor <dgregor@apple.com> Introduce implicit conversions between AltiVec vectors and GCC
vectors, from Anton Yartsev!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110437 91177308-0d34-0410-b5e6-96231b3b80d8
ltivec-init.c
97ba481f3f45e5b63b4a354bfb471ce146b7de57 03-Aug-2010 John McCall <rjmccall@apple.com> Labels (and case statement) don't create independent scope parents for the
purposes of the jump checker. Also extend Ted's iteration fix to labels.

Fixes PR7789.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110082 91177308-0d34-0410-b5e6-96231b3b80d8
cope-check.c
447234dd459a00a5ed9b7c3e066162cd7a75bf2d 29-Jul-2010 Douglas Gregor <dgregor@apple.com> Allow a looser form of compatibility checking (which ignores
qualifiers) when checking a K&R function definition against a previous
prototype. Fixes <rdar://problem/8193107>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109751 91177308-0d34-0410-b5e6-96231b3b80d8
nr-def-call.c
0333296d142d45bf2723635848928815b7491f91 29-Jul-2010 Douglas Gregor <dgregor@apple.com> Reword the empty struct/union warning in C to note that such structs and unions have size 0 in C, size 1 in C++. Put this warning under -Wc++-compat.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109748 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
ompound-literal.c
c46111e821664fcdf54d07325a384570972e9cae 28-Jul-2010 Douglas Gregor <dgregor@apple.com> Make the pointer arguments to the __sync_* builtins pointers to
volatile-qualified types. Fixes <rdar://problem/8228293>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109618 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.c
dee832c8958ca100c671881b6541fbb857a33592 27-Jul-2010 Benjamin Kramer <benny.kra@googlemail.com> Mark __builtin_eh_return as noreturn. Patch by Dimitry Andric.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109452 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.c
b7690b425845b636849f25074d64d30aad646473 24-Jul-2010 Chris Lattner <sabre@nondot.org> turn down the logical bitwise confusion warning to not warn
when the RHS of the ||/&& is ever 0 or 1. This handles a variety of
creative idioms for "true" used in C programs and fixes many false
positives at the expense of a few false negatives. This fixes
rdar://8230351.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109314 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
witch.c
eb024acef8a8fef3cb5e01a2e0c3efb90372c8af 23-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> Allow __func__ and __FUNCTION__ and __PRETTY_FUNCTION__ inside blocks.
Radar 8218839.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109272 91177308-0d34-0410-b5e6-96231b3b80d8
lock-misc.c
f60946222721d9ba3c059563935c17b84703187a 23-Jul-2010 Douglas Gregor <dgregor@apple.com> Vectors are not integer types, so the type system should not classify
them as such. Type::is(Signed|Unsigned|)IntegerType() now return false
for vector types, and new functions
has(Signed|Unsigned|)IntegerRepresentation() cover integer types and
vector-of-integer types. This fixes a bunch of latent bugs.

Patch from Anton Yartsev!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109229 91177308-0d34-0410-b5e6-96231b3b80d8
ector-ops.c
1e51c200b17cb6b0238c10a8760ae04765688f16 20-Jul-2010 Ted Kremenek <kremenek@apple.com> Hookup checking for invalid length modifiers in scanf format strings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108907 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-scanf.c
baa400654bd6f8396f9a07188445ae7955b060a3 20-Jul-2010 Ted Kremenek <kremenek@apple.com> Don't warn when a '%%' or '%*d' (scanf) is used in a format string with positional arguments, since
these don't actually consume an argument.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108757 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-scanf.c
ormat-strings.c
c09b6a59e02ae265fce51b8c11e2a045bcdaa888 19-Jul-2010 Ted Kremenek <kremenek@apple.com> Hook up 'invalid conversion' warning for scanf format strings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108750 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-scanf.c
be86ecc82772546d9e404a32002e446ac0c725d9 19-Jul-2010 Ted Kremenek <kremenek@apple.com> Add missing conversion specifier parsing for 'u', 'x', 'o', and 's'. Fixes <rdar://problem/8204052>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108742 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-scanf.c
db4325b098eff5e9e660db19f0148423fb21f27f 18-Jul-2010 Chandler Carruth <chandlerc@gmail.com> Improve the representation of the atomic builtins in a few ways. First, we make
their call expressions synthetically have the "deduced" types based on their
first argument. We only insert conversions in the AST for arguments whose
values require conversion to match the value type expected. This keeps PR7600
closed by maintaining the return type, but avoids assertions due to unexpected
implicit casts making the type unsigned (test case added from Daniel).

The magic is moved into the codegen for the atomic builtin which inserts the
casts as needed at the IR level to raise the type to an integer suitable for
the LLVM intrinsic. This shouldn't cause any real change in functionality, but
now we can make the builtin be more truly polymorphic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108638 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.c
8d438087bd7120990663e4df78a9c9fdb02c5209 17-Jul-2010 Eli Friedman <eli.friedman@gmail.com> Check for casts to an incomplete type in C. Improves diagnostics for cast to
incomplete union (PR5692) and incomplete enum, and fixes obscure
accepts-invalid on cast to incomplete struct.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108630 91177308-0d34-0410-b5e6-96231b3b80d8
ast-incomplete.c
bb09d1e7b2ce1d59e571397e8300d9e18cba8456 16-Jul-2010 Ted Kremenek <kremenek@apple.com> Remove unicode quotes characters that somehow made it into a recent commit of mine.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108552 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-scanf.c
b7c21018ec1049580cf6df88db09e606550a7baa 16-Jul-2010 Ted Kremenek <kremenek@apple.com> Hook up warning for an incomplete scanlist in scanf format strings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108542 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-scanf.c
32d0900b21505284287864267332dbff1f646868 16-Jul-2010 Ted Kremenek <kremenek@apple.com> Tweak zero-field width in scanf format string diagnostic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108541 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-scanf.c
ddc6ff6b9aff656504c1e84ee7dc9f617a20f866 16-Jul-2010 Daniel Dunbar <daniel@zuster.org> Sema: Fix a bug with #pragma options align=reset, reset against an empty stack
is well defined, it resets to the default alignment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108508 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-align-packed.c
1e4c33a677ba085bbbbfff211719ae4bb571c5b1 16-Jul-2010 Ted Kremenek <kremenek@apple.com> Add initial test cases for scanf format string checking.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108503 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-scanf.c
1058253c364b2c98e6cecfe15d18d3562db245f4 16-Jul-2010 Daniel Dunbar <daniel@zuster.org> Builtins/ARM: __clear_cache doesn't seem to have a consistent prototype, declare
the builtin as void __clear_cache(...) to workaround this, which appears to
match what GCC does.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108487 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins-arm.c
35e12c90c1b107a75c5615aa76fdbd403661aaa6 15-Jul-2010 Douglas Gregor <dgregor@apple.com> Make the "unused result" warning a warning about run-time behavior, so
that we don't warn when there isn't going to be any computation anyway.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108442 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
xpr-comma-c89.c
xpr-comma.c
23ef3e4f044d701d0f84980fd9816fedf17fc0cb 15-Jul-2010 Chris Lattner <sabre@nondot.org> restrict the && -> & warning to cover a case daniel noted.
Don't warn about "logically bool" expressions on the RHS,
even if they fold to a constant.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108388 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
5495f37302f7c82192dab1ce8d9c9fe76ed0ee37 14-Jul-2010 Chandler Carruth <chandlerc@gmail.com> Wire up '-Wignored-qualifiers' to the warning on 'const' in 'const int f()'.
This flag and warning match GCC semantics. Also, move it to -Wextra as this is
a largely cosmetic issue and doesn't seem to mask problems. Subsequent fixes to
the tests which no longer by default emit the warning. Added explicit test
cases for both C and C++ behavior with the warning turned on.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108325 91177308-0d34-0410-b5e6-96231b3b80d8
lock-call.c
lock-return.c
eturn.c
truct-cast.c
90a8f27f144233b53cac0c88a1595f7f05105b7e 13-Jul-2010 Chris Lattner <sabre@nondot.org> Add a warning to catch a bug recently caught by code review, like this:
t2.c:2:12: warning: use of logical && with constant operand; switch to bitwise &
or remove constant [-Wlogical-bitwise-confusion]
return x && 4;
^ ~

wording improvement suggestions are welcome.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108260 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
-c-e.c
witch.c
5291c3cec0dbe8ad1d8e7e67e93af2b1586d5400 13-Jul-2010 Douglas Gregor <dgregor@apple.com> When forming a function call or message send expression, be sure to
strip cv-qualifiers from the expression's type when the language calls
for it: in C, that's all the time, while C++ only does it for
non-class types.

Centralized the computation of the call expression type in
QualType::getCallResultType() and some helper functions in other nodes
(FunctionDecl, ObjCMethodDecl, FunctionType), and updated all relevant
callers of getResultType() to getCallResultType().

Fixes PR7598 and PR7463, along with a bunch of getResultType() call
sites that weren't stripping references off the result type (nothing
stripped cv-qualifiers properly before this change).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108234 91177308-0d34-0410-b5e6-96231b3b80d8
lock-call.c
lock-return.c
truct-cast.c
cfd41cfd0bd199672449db88d0502d37131a5c1f 12-Jul-2010 Ted Kremenek <kremenek@apple.com> Add test case for <rdar://problem/8177927> (which triggered an assertion failure in SemaChecking).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108159 91177308-0d34-0410-b5e6-96231b3b80d8
truct-decl.c
64d092c232bc282762430df9eb67beafffaa2fdc 12-Jul-2010 Chandler Carruth <chandlerc@gmail.com> Fix another aspect of PR7047, macro expansions. Previously, this was hacked
around by exempting enums from the check, but this doesn't handle a lot of
cases. A better approach is to directly check if the operator comes from
a macro expansion.

I've removed a reference to the rdar that originally led to the enum
suppression when removing it's overly contrived test case. Let me know if that
number or a more reasilistic test case involving enums is still needed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108128 91177308-0d34-0410-b5e6-96231b3b80d8
elf-comparison.c
184aa4e6ded190bfb3bbe207040467f8d7e28a04 12-Jul-2010 Chris Lattner <sabre@nondot.org> fix PR7280 by making the warning on code like this:

int test1() {
return;
}

default to an error.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108108 91177308-0d34-0410-b5e6-96231b3b80d8
unction.c
mplicit-decl.c
eturn.c
d201457cc781f1b13d0f4b1268ff934e6004cbff 09-Jul-2010 Chandler Carruth <chandlerc@gmail.com> Fix PR7600, and correctly convert the result of an atomic builtin to the
expected value type. This is necessary as the builtin is internally represented
as only operating on integral types.

Also, add a FIXME to add support for floating point value types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108002 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.c
27f46ee38d9a6a28cf0438218a198a9da1cee5d6 09-Jul-2010 Douglas Gregor <dgregor@apple.com> Refer to implicit "conversions" rather than implicit "casts", which
don't technically exist in the language. <rdar://problem/8085982>



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107995 91177308-0d34-0410-b5e6-96231b3b80d8
ddress_spaces.c
onversion-64-32.c
onversion.c
7d5c45ed9dc2842ce8e65ea26ced0957be36a569 08-Jul-2010 Chandler Carruth <chandlerc@gmail.com> Add support for differentiating between attributes ignored when handled and
unknown attributes that we discard. Add a diagnostic group for unknown
attribute warnings to allow turning these off when we don't care. Also
consolidates the tests for this case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107864 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-deprecated.c
ttr-unknown.c
3e31552aed7c6e9c915bbc8d457ec84bb4a8d7e9 08-Jul-2010 Nate Begeman <natebegeman@mac.com> Fix an issue with opencl init list checking.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107824 91177308-0d34-0410-b5e6-96231b3b80d8
pencl-init.c
8b5dec3002bd3e17061a8bf1fc35ba82912ec768 07-Jul-2010 Chris Lattner <sabre@nondot.org> implement PR7569, warning about assignment to null, which
people seem to write when they want a deterministic trap.
Suggest instead that they use a volatile pointer or
__builtin_trap.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107756 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
27cac990649d9c1217f018921749683464a28e6b 30-Jun-2010 Douglas Gregor <dgregor@apple.com> Clean up the diagnostic complaining about the element type of a vector
type so that it actually complains about the element type itself.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107299 91177308-0d34-0410-b5e6-96231b3b80d8
xt_vector_casts.c
ypes.c
90cd672ed107d5986936c577ce47ad7374096bd2 30-Jun-2010 Douglas Gregor <dgregor@apple.com> Complain about the application of a transparent_union attribute to a
union whose first field has integral vector type. Also, clean up this
diagnostic a bit. Thanks to Eli for spotting this change in semantics
last week.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107296 91177308-0d34-0410-b5e6-96231b3b80d8
ransparent-union.c
25973455aed1cdc9c40b208c792b5db4f8f1297d 30-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix rdar://8139785 "implement warning on dead expression in comma operator"

As a bonus, fix the warning for || and && operators; it was emitted even if one of the operands had side effects, e.g:

x || test_logical_foo1();

emitted a bogus "expression result unused" for 'x'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107274 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
xpr-comma-c89.c
xpr-comma.c
-c-e.c
arn-unused-value.c
acb0bd85d30ecacbe872ca9d9cfac5d7b6038a43 30-Jun-2010 Douglas Gregor <dgregor@apple.com> Re-improve recovery when the condition of a switch statement does not
have integral or enumeration type, so that we still check the contents
of the switch body. My previous patch made this worse; now we're back
to where we were previously.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107223 91177308-0d34-0410-b5e6-96231b3b80d8
omplex-int.c
c30614b7e2bad089f2509499379de509f33162d6 30-Jun-2010 Douglas Gregor <dgregor@apple.com> Factor the conversion from a switch condition to an integral or
enumeration type out into a separate, reusable routine. The only
functionality change here is that we recover a little more
aggressively from ill-formed switch conditions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107222 91177308-0d34-0410-b5e6-96231b3b80d8
omplex-int.c
84b0316f720bd089d87acb21ec0002b2da33e6c9 29-Jun-2010 Daniel Dunbar <daniel@zuster.org> Sema: Fix a subtle i64 -> i32 truncation which broke layout of large structures
with bit-fields.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107185 91177308-0d34-0410-b5e6-96231b3b80d8
itfield-layout.c
6623584c0ec508110d75572eef092bf98fedf3f4 29-Jun-2010 Douglas Gregor <dgregor@apple.com> With packed enums, an enumerator's value may be stored in more bits
than the enumeration type itself takes. Fixes PR7477.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107163 91177308-0d34-0410-b5e6-96231b3b80d8
num-packed.c
b3fc0603e5b64b659bc6a37cc209dc404d3093f4 29-Jun-2010 Daniel Dunbar <daniel@zuster.org> tests: Spell %clang_cc1 correctly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107152 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-align-mac68k-unsupported.c
ragma-align-mac68k.c
ragma-align-packed.c
7d99e989c1a20e358f472e35d615313f2fe223db 24-Jun-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes a regression when redeclaration of a global satic
is an extern local to a function. Radar 8125274.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106773 91177308-0d34-0410-b5e6-96231b3b80d8
xtern-redecl.c
00619623af0b9d3271e31402ec1a95e84c2c4526 23-Jun-2010 Douglas Gregor <dgregor@apple.com> Vector types are not arithmetic types, either. Note that we now ban
__real myvec and __imag myvec, since they aren't all that useful (it's
just an identity function) but we might want to use them in more
restricted cases in the future (e.g., "__real mycomplexvec" could
extract the real parts of a vector of complex numbers).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106601 91177308-0d34-0410-b5e6-96231b3b80d8
xt_vector_casts.c
nit.c
4b1317264037732fff3653ac6f494b124c726e1b 23-Jun-2010 Douglas Gregor <dgregor@apple.com> Teach Type::isRealType() that vector types are never real types. All
of the callers of isRealType() already assumed this, and one of them
(increment/decrement) mistakenly permitted increments of vector types
because of it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106596 91177308-0d34-0410-b5e6-96231b3b80d8
xt_vector_casts.c
0c293ea13d452c1a47a05ada5a5ee9acc69c66cc 23-Jun-2010 Douglas Gregor <dgregor@apple.com> Type Type::isRealFloatingType() that vectors are not floating-point
types, updating callers of both isFloatingType() and
isRealFloatingType() accordingly. Caught at least one issue where we
allowed one to declare a vector of vectors (!), along with cleaning up
the standard-conversion logic for C++.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106595 91177308-0d34-0410-b5e6-96231b3b80d8
xt_vector_casts.c
45f9b7e8f23072d662ee1cc758f4ecb0da5e3322 21-Jun-2010 Tom Care <tcare@apple.com> Bug 7377: printf checking fails to flag some undefined behavior
http://llvm.org/bugs/show_bug.cgi?id=7377

Updated format string highlighting and fixits to take advantage of the new CharSourceRange class.
- Change HighlightRange to allow highlighting whitespace only in a CharSourceRange (for warnings about the ' ' (space) flag)
- Change format specifier range helper function to allow for half-open ranges (+1 to end)
- Enabled previously failing tests (FIXMEs/XFAILs removed)
- Small fixes and additions to format string test cases

M test/Sema/format-strings.c
M test/Sema/format-strings-fixit.c
M lib/Frontend/TextDiagnosticPrinter.cpp
M lib/Sema/SemaChecking.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106480 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-fixit.c
ormat-strings.c
2bf6d7b1f7406ca4dfe841d4f6ef4b91dce195e4 21-Jun-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes a corner case bug whereby declaring and defining an extern variable in a
particular sequence causes its definition to not be generated in the object file.
(fixes radar 8071804).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106424 91177308-0d34-0410-b5e6-96231b3b80d8
ar-redecl.c
8e19890c329279c5ac35ab71a35423d429d80165 18-Jun-2010 Douglas Gregor <dgregor@apple.com> Don't complain about missing field initializers when the initializer
list is completely empty, from Lasse Kärkkäinen! Fixes PR7413.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106320 91177308-0d34-0410-b5e6-96231b3b80d8
issing-field-initializers.c
d2c6490385555eaabfaf611d1cf6e89544163c4a 18-Jun-2010 Douglas Gregor <dgregor@apple.com> Merge the "regparm" attribute from a previous declaration of a
function to redeclarations of that function. Fixes PR7025.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106317 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-regparm.c
4c6021995032a898fb0502d5d1fd2df37638e57b 18-Jun-2010 Tom Care <tcare@apple.com> Printf format strings: Added some more tests and fixed some minor bugs.
- Precision toStrings shouldn't print a dot when they have no value.
- Length of char length modifier is now returned correctly.
- Added several fixit tests.

Note: fixit tests are currently broken due to a bug in HighlightRange. Marking as XFAIL for now.

M test/Sema/format-strings-fixit.c
M include/clang/Analysis/Analyses/PrintfFormatString.h
M lib/Analysis/PrintfFormatString.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106275 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-fixit.c
e4ee9663168dfb2b4122c768091e30217328c9fa 17-Jun-2010 Tom Care <tcare@apple.com> Bug 7377: Fixed several bad printf format string bugs.
- Added warning for undefined behavior when using field specifier
- Added warning for undefined behavior when using length modifier
- Fixed warnings for invalid flags
- Added warning for ignored flags
- Added fixits for the above warnings
- Fixed accuracy of detecting several undefined behavior conditions
- Receive normal warnings in addition to security warnings when using %n
- Fix bug where '+' flag would remain on unsigned conversion suggestions

Summary of changes:
- Added expanded tests
- Added/expanded warnings
- Added position info to OptionalAmounts for fixits
- Extracted optional flags to a wrapper class with position info for fixits
- Added several methods to validate a FormatSpecifier by component, each checking for undefined behavior
- Fixed conversion specifier checking to conform to C99 standard
- Added hooks to detect the invalid states in CheckPrintfHandler::HandleFormatSpecifier

Note: warnings involving the ' ' (space) flag are temporarily disabled until whitespace highlighting no longer triggers assertions. I will make a post about this on cfe-dev shortly.

M test/Sema/format-strings.c
M include/clang/Basic/DiagnosticSemaKinds.td
M include/clang/Analysis/Analyses/PrintfFormatString.h
M lib/Analysis/PrintfFormatString.cpp
M lib/Sema/SemaChecking.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106233 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
01cb1aa458516b9061a65ea4b8a2ca55f71cb34f 17-Jun-2010 Ted Kremenek <kremenek@apple.com> Fix format string checking of '%c' by treating it as an integer conversion. Fixes PR 7391.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106196 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-fixit.c
ormat-strings.c
13927a431dd733336cfd664bf0840747a71b0a43 16-Jun-2010 Ted Kremenek <kremenek@apple.com> Extend format string type-checking to include '%p'. Fixes remaining cases PR 4468.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106151 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-fixit.c
ormat-strings.c
6907fbe758d23e1aec4c0a67e7b633d1d855feb4 12-Jun-2010 John McCall <rjmccall@apple.com> When deciding whether an expression has the boolean nature, don't look through
explicit casts. Fixes PR7359.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105871 91177308-0d34-0410-b5e6-96231b3b80d8
witch.c
876e994957472eda4b40136d4e1d6e08e2be338f 11-Jun-2010 Tom Care <tcare@apple.com> Small fixes regarding printf fix suggestions.
- Added some handling of flags that become invalid when changing the conversion specifier.
- Changed fixit behavior to remove unnecessary length modifiers.
- Separated some tests out and added some comments.

modified:
lib/Analysis/PrintfFormatString.cpp
test/Sema/format-strings-fixit.c


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105807 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-fixit.c
3bfc5f49e0e37e235bb0d33bcbcb36af9d1f84ab 09-Jun-2010 Tom Care <tcare@apple.com> Added FixIt support to printf format string checking.
- Refactored LengthModifier to be a class.
- Added toString methods in all member classes of FormatSpecifier.
- FixIt suggestions keep user specified flags unless incorrect.

Limitations:
- The suggestions are not conversion specifier sensitive. For example, if we have a 'pad with zeroes' flag, and the correction is a string conversion specifier, we do not remove the flag. Clang will warn us on the next compilation.

A test/Sema/format-strings-fixit.c
M include/clang/Analysis/Analyses/PrintfFormatString.h
M lib/Analysis/PrintfFormatString.cpp
M lib/Sema/SemaChecking.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105680 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-fixit.c
d64fdd0c056f1e50488519254f852fa8050f0470 08-Jun-2010 Douglas Gregor <dgregor@apple.com> Warn about comparisons between arrays and improve self-comparison
warnings, from Troy Straszheim! Fixes PR6163.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105631 91177308-0d34-0410-b5e6-96231b3b80d8
ompare.c
xt_vector_comparisons.c
elf-comparison.c
6deecb0d46bcfd048e651d2db7c4fb0d6407da96 05-Jun-2010 Rafael Espindola <rafael.espindola@gmail.com> Correctly align large arrays in x86-64. This fixes PR5599.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105500 91177308-0d34-0410-b5e6-96231b3b80d8
lign-x86-64.c
2a480e356e45be74c3c3afe586b77cf923cd4181 29-May-2010 Fariborz Jahanian <fjahanian@apple.com> Changed text of 'empty enum' diagnostics to say so.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105013 91177308-0d34-0410-b5e6-96231b3b80d8
num.c
0511552e20c79ec48638038b9a10a70a34654e5c 29-May-2010 Fariborz Jahanian <fjahanian@apple.com> Empty enum in c is now error to match gcc's behavior.
(radar 8040068).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105011 91177308-0d34-0410-b5e6-96231b3b80d8
num.c
unction-redecl.c
6f739145b94ede1ca98b5a5e0e179c817c405d7b 27-May-2010 Daniel Dunbar <daniel@zuster.org> Parse/Sema: Add support for '#pragma options align=packed', which, it should be
noted, is not the same as __attribute__((packed)). That would be ridiculous!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104865 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-align-packed.c
638e7cf3a09436dce7f3150ff8e4f27d190bd2ed 27-May-2010 Daniel Dunbar <daniel@zuster.org> Parse/Sema: Add support for '#pragma options align=native'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104864 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-pack-and-options-align.c
c6082fe347a414a2e19f2ad8fe41720f10733296 27-May-2010 Daniel Dunbar <daniel@zuster.org> Sema: Add initial support for '#pragma options align=mac68k'.
- Docs are fairly sketchy, if someone wants to pore through gcc to look for
holes I'd appreciate any failing test cases!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104809 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-align-mac68k.c
613fd67e575ff1c038535b18dafebca070f3ed91 27-May-2010 Daniel Dunbar <daniel@zuster.org> Sema: Reject '#pragma options align=mac68k' everywhere except i386-apple-darwin.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104789 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-align-mac68k-unsupported.c
ea75a8286fb87ce7549e08d9dcb597f91479f54d 27-May-2010 Daniel Dunbar <daniel@zuster.org> Sema: Support for #pragma options align={reset,natural}. '#pragma options align'
shares the stack with '#pragma pack', who knew!?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104786 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-pack-and-options-align.c
b90f4b3fb94056609da9cca5eef7358d95a363b2 26-May-2010 Douglas Gregor <dgregor@apple.com> Tell the string literal parser when it's not permitted to emit
diagnostics. That would be while we're parsing string literals for the
sole purpose of producing a diagnostic about them. Fixes
<rdar://problem/8026030>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104684 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
0fddb97901dbe36a8253dee29961cba8e0a87cf6 22-May-2010 Douglas Gregor <dgregor@apple.com> Implement support for variable length arrays in C++. VLAs are limited
in several important ways:

- VLAs of non-POD types are not permitted.
- VLAs cannot be used in conjunction with C++ templates.

These restrictions are intended to keep VLAs out of the parts of the
C++ type system where they cause the most trouble. Fixes PR5678 and
<rdar://problem/8013618>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104443 91177308-0d34-0410-b5e6-96231b3b80d8
89.c
0fb97083cc0f8a82e404e22991ae80d2216e71d5 18-May-2010 John McCall <rjmccall@apple.com> If a switch condition is constant, don't warn about missing enum cases.
If a switch condition is constant, warn if there's no case for it.

Constant switch conditions do come up in reasonable template code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104010 91177308-0d34-0410-b5e6-96231b3b80d8
witch.c
ebc2fb2ce1f5e775bc8d58b421b2aabbf4f40f57 12-May-2010 John McCall <rjmccall@apple.com> Correct spelling of expected error message. Apparently I forgot to re-run
the test suite after modifying this diagnostic.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103537 91177308-0d34-0410-b5e6-96231b3b80d8
cope-check.c
ddb0b4d5391d3e6bc9dcf93dc42310b20c96b6fc 12-May-2010 John McCall <rjmccall@apple.com> When checking scopes for indirect goto, be more permissive (but still safe)
about the permitted scopes. Specifically:
1) Permit labels and gotos to appear after a prologue of variable initializations.
2) Permit indirect gotos to jump out of scopes that don't require cleanup.
3) Diagnose possible attempts to indirect-jump out of scopes that do require
cleanup.
This requires a substantial reinvention of the algorithm for checking indirect
goto. The current algorithm is Omega(M*N), with M = the number of unique
scopes being jumped from and N = the number of unique scopes being jumped to,
with an additional factor that is probably (worst-case) linear in the depth
of scopes. Thus the entire thing is likely cubic given some truly bizarre
ill-formed code; on well-formed code the additional factor collapses to
an amortized constant (when amortized over the entire function) and so
the algorithm is quadratic. Even this requires every label to appear in
its own scope, which would be very unusual for indirect-goto code (and
extremely unlikely for well-formed code); it is far more likely that
all labels will be in the same scope and so the algorithm becomes linear.
For such a marginal feature, I am fairly happy with this result.

(this is using JumpDiagnostic's definition of scope, where successive
variables in a block appear in their own scope)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103536 91177308-0d34-0410-b5e6-96231b3b80d8
cope-check.c
c6dfe194f623b02c123759f235b504d4850fc178 09-May-2010 Douglas Gregor <dgregor@apple.com> Don't complain about an __builtin_va_arg expression's result being
unused, since the operation has side effects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103360 91177308-0d34-0410-b5e6-96231b3b80d8
nused-expr.c
a7d3c04fcfe9d4af2f7758f46aef26b1a8f8ac09 07-May-2010 Rafael Espindola <rafael.espindola@gmail.com> Fix PR4386 by implementing gcc's old behaviour (4.2) when initializing
variables with a comparison of a function pointer with 0.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103253 91177308-0d34-0410-b5e6-96231b3b80d8
nit.c
8eb662ed5e04bd0f494c7dbefacb7d45660ab9fa 07-May-2010 John McCall <rjmccall@apple.com> After some discussion, conservatively extend our sentinel check to discard
casts, but still require the (casted) type to be a pointer. Fixes PR5685.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103216 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-sentinel.c
323ed74658bc8375278eabf074b4777458376540 06-May-2010 John McCall <rjmccall@apple.com> Rearchitect -Wconversion and -Wsign-compare. Instead of computing them
"bottom-up" when implicit casts and comparisons are inserted, compute them
"top-down" when the full expression is finished. Makes it easier to
coordinate warnings and thus implement -Wconversion for signedness
conversions without double-warning with -Wsign-compare. Also makes it possible
to realize that a signedness conversion is okay because the context is
performing the inverse conversion. Also simplifies some logic that was
trying to calculate the ultimate comparison/result type and getting it wrong.
Also fixes a problem with the C++ explicit casts which are often "implemented"
in the AST with a series of implicit cast expressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103174 91177308-0d34-0410-b5e6-96231b3b80d8
ompare.c
onditional-expr.c
onversion.c
5f970eee81372dfc6a1457c3d6d052af04e32a38 04-May-2010 Douglas Gregor <dgregor@apple.com> When instantiating a function that was declared via a typedef, e.g.,

typedef int functype(int, int);
functype func;

also instantiate the synthesized function parameters for the resulting
function declaration.

With this change, Boost.Wave builds and passes all of its regression
tests.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103025 91177308-0d34-0410-b5e6-96231b3b80d8
unction-redecl.c
72be24f39c162448e53dd73cf57cc6357114361e 30-Apr-2010 Douglas Gregor <dgregor@apple.com> Fix a thinko that caused us not to compute __builtin_offset as a
constant expression in C.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102762 91177308-0d34-0410-b5e6-96231b3b80d8
ffsetof.c
b1f1b267351be74013f966f4834cde1eddbe0233 30-Apr-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Attribute noreturn is now put in declaration attributes. Fixed a double warning generation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102705 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-noreturn.c
9d5d60ff8d7991234abcc6a9fe9903db930be0a1 29-Apr-2010 Douglas Gregor <dgregor@apple.com> Diagnose __builtin_offsetof expressions that refer to bit-fields

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102548 91177308-0d34-0410-b5e6-96231b3b80d8
ffsetof.c
6a15c8586cc3e5d6e01c4c4e8b4374584569b58f 28-Apr-2010 Daniel Dunbar <daniel@zuster.org> Revert "Fix for PR6953: per gcc, regparm and noreturn affect the compatibility of", it is breaking the builds of quite a few projects (emacs, dovecot, gnutar, bison).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102501 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-regparm.c
24f2801e2c0ac5c1fc8549ed8f91b4d0fbd8c6ac 27-Apr-2010 Eli Friedman <eli.friedman@gmail.com> Fix for PR6953: per gcc, regparm and noreturn affect the compatibility of
function types.

This could potentially have unexpected side-effects, so look here if there are
new regressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102464 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-regparm.c
d1aa800a19c956c72319025dd302ae78ed47f9ee 23-Apr-2010 Anders Carlsson <andersca@mac.com> Change the 'declared at' diagnostic to say 'declared here'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102163 91177308-0d34-0410-b5e6-96231b3b80d8
lock-misc.c
684de63867fac4ffe2f4c97756a16bfcb2d8b54b 22-Apr-2010 Daniel Dunbar <daniel@zuster.org> ARM/APCS: Don't respect bit-field types when laying out structures.
- This fixes the last known ABI issues with ARM/APCS.

- I've run the first 1k ABITests with '--no-unsigned --no-vector --no-complex'
on {armv6, armv7} x {-mno-thumb, -mthumb}, and the first 10k tests for armv7
-mthumb, for both function return types and single argument calls. These all
pass now (they failed horribly before without --no-bitfield).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102070 91177308-0d34-0410-b5e6-96231b3b80d8
rm-layout.c
a41a8c5972c2632247ae7913cf6ce65d45f7e702 22-Apr-2010 Douglas Gregor <dgregor@apple.com> Whenever we complain about a failed initialization of a function or
method parameter, provide a note pointing at the parameter itself so
the user does not have to manually look for the function/method being
called and match up parameters to arguments. For example, we now get:

t.c:4:5: warning: incompatible pointer types passing 'long *' to
parameter of
type 'int *' [-pedantic]
f(long_ptr);
^~~~~~~~
t.c:1:13: note: passing argument to parameter 'x' here
void f(int *x);
^



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102038 91177308-0d34-0410-b5e6-96231b3b80d8
rray-constraint.c
ttr-format.c
lock-misc.c
ormat-strings.c
ncompatible-sign.c
redefined-function.c
ransparent-union.c
ector-assign.c
ector-cast.c
58f9782219c6e31b680ba1a3b52c775889e4f6c1 20-Apr-2010 John Thompson <John.Thompson.JTSoftware@gmail.com> Altivec vector literal initializer count mismatch error removed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101868 91177308-0d34-0410-b5e6-96231b3b80d8
ltivec-init.c
c5e869b7949d162ee93c6200c0100a27544bdaa3 19-Apr-2010 Eric Christopher <echristo@apple.com> Add a testcase for PR6501 (too many/too few arguments to a function call).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101800 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
00522ad7a35f071bb91e6bdc02319fbec87f0703 19-Apr-2010 Eric Christopher <echristo@apple.com> Temporarily XFAIL this test on windows.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101796 91177308-0d34-0410-b5e6-96231b3b80d8
86-builtin-palignr.c
5e8965525282a48fd34af05183b8c3705a5b00d5 19-Apr-2010 Eric Christopher <echristo@apple.com> Remove the argument number from the constant integer diagnostic.
Update all of the testcases accordingly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101795 91177308-0d34-0410-b5e6-96231b3b80d8
uiltin-prefetch.c
uiltin-stackaddress.c
uiltins.c
86-builtin-palignr.c
d13ada13cb570ff9c0123ed267e2a7abfe662d23 18-Apr-2010 Daniel Dunbar <daniel@zuster.org> tests: Don't force triple in x86-builtin-palignr test, this test should be
portable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101719 91177308-0d34-0410-b5e6-96231b3b80d8
86-builtin-palignr.c
26d2427abe442b557298c295d2a84cdf13c260eb 17-Apr-2010 Eric Christopher <echristo@apple.com> New test to verify that we see constant integers here.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101611 91177308-0d34-0410-b5e6-96231b3b80d8
86-builtin-palignr.c
691ebc3f3225542e5abd85e107ebdbec907cf510 17-Apr-2010 Eric Christopher <echristo@apple.com> Consolidate most of the integer constant expression builtin requirement
checking into a single function and use that throughout. Remove some
now unnecessary diagnostics and update tests with now more accurate
diagnostics.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101610 91177308-0d34-0410-b5e6-96231b3b80d8
uiltin-prefetch.c
uiltin-stackaddress.c
uiltins.c
2b334bb3126a67895813e49e6228dad4aec0b4d6 17-Apr-2010 Chris Lattner <sabre@nondot.org> make our existing "switch on bool" warning work for C. Since
the result of comparisons are 'int' in C, it doesn't work to
test just the result type of the expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101576 91177308-0d34-0410-b5e6-96231b3b80d8
tatements.c
c75d6ccf16170af42d31508a026b42382ab8f118 15-Apr-2010 Anders Carlsson <andersca@mac.com> Improve the bit-field too wide error message.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101384 91177308-0d34-0410-b5e6-96231b3b80d8
itfield.c
55b38842d12ffd9f9ff3a0e16fae2cfe61ab0fe6 14-Apr-2010 Douglas Gregor <dgregor@apple.com> When diagnosing suspicious precedence or assignments, move the fix-it
that adds parentheses from the main diagnostic down to a new
note. This way, when the fix-it represents a choice between two
options, each of the options is associted with a note. There is no
default option in such cases. For example:

/Users/dgregor/t.c:2:9: warning: & has lower precedence than ==; ==
will be
evaluated first [-Wparentheses]
if (x & y == 0) {
^~~~~~~~
/Users/dgregor/t.c:2:9: note: place parentheses around the &
expression to
evaluate it first
if (x & y == 0) {
^
( )
/Users/dgregor/t.c:2:9: note: place parentheses around the ==
expression to
silence this warning
if (x & y == 0) {
^
( )



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101249 91177308-0d34-0410-b5e6-96231b3b80d8
arentheses.c
dd17394d225b06376e9ae1d23f36cec463fdef01 14-Apr-2010 Chris Lattner <sabre@nondot.org> implement altivec.h and a bunch of support code, patch by Anton Yartsev!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101215 91177308-0d34-0410-b5e6-96231b3b80d8
ltivec-init.c
03a4bee558b63ead66e942c6b26381df9a8b1754 09-Apr-2010 Ted Kremenek <kremenek@apple.com> Remove fixit for string literal comparison. Telling the user to use 'strcmp' is bad, and
we don't have enough information to tell them how to use 'strncmp'. Instead, change the
diagnostic to indicate they should use 'strncmp'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100890 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
08a41901e18aeb91b87d031b93df70374af02564 09-Apr-2010 Douglas Gregor <dgregor@apple.com> Improve diagnostics like "initializing <type> from an expression of
type..." with "initializing <type> with an expression of type...",
which reads better. Thanks to John for the improved wording.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100873 91177308-0d34-0410-b5e6-96231b3b80d8
nonymous-struct-union.c
rray-init.c
lock-call.c
lock-return.c
ast-to-union.c
ompound-literal.c
num.c
nvalid-init-diag.c
redef.c
truct-compat.c
arn-write-strings.c
1a4221cbe1912421ed7e29d0bbac39e9792af8a2 09-Apr-2010 Chris Lattner <sabre@nondot.org> Don't warn about unused static functions if they are marked with
attr constructor or destructor. Patch by Jean-Daniel Dupas!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100870 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unused-function.c
d4eea8362605807327735727a9098abe1eb23b19 09-Apr-2010 Douglas Gregor <dgregor@apple.com> Improve diagnostics when we fail to convert from a source type to a
destination type for initialization, assignment, parameter-passing,
etc. The main issue fixed here is that we used rather confusing
wording for diagnostics such as

t.c:2:9: warning: initializing 'char const [2]' discards qualifiers,
expected 'char *' [-pedantic]
char *name = __func__;
^ ~~~~~~~~

We're not initializing a 'char const [2]', we're initializing a 'char
*' with an expression of type 'char const [2]'. Similar problems
existed for other diagnostics in this area, so I've normalized them all
with more precise descriptive text to say what we're
initializing/converting/assigning/etc. from and to. The warning for
the code above is now:

t.c:2:9: warning: initializing 'char *' from an expression of type
'char const [2]' discards qualifiers [-pedantic]
char *name = __func__;
^ ~~~~~~~~

Fixes <rdar://problem/7447179>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100832 91177308-0d34-0410-b5e6-96231b3b80d8
ddress_spaces.c
nonymous-struct-union.c
rray-constraint.c
rray-init.c
lock-call.c
lock-misc.c
lock-return.c
ast-to-union.c
ompound-literal.c
onditional-expr.c
onditional.c
num.c
xt_vector_casts.c
unction-ptr.c
unction-redecl.c
ncompatible-sign.c
nvalid-init-diag.c
ointer-conversion.c
redef.c
redefined-function.c
tatements.c
truct-compat.c
ypedef-retain.c
ector-assign.c
ector-cast.c
arn-write-strings.c
355fa3a65d2bffb2cb230e5c3d8cd14ec5570329 09-Apr-2010 Ted Kremenek <kremenek@apple.com> Use '%clang_cc1' instead of '%clang' to make the warning output more consistent across
platforms (for this test).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100827 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unused-parameters.c
cb821d045f5e445384f34d05a526955036073c4a 08-Apr-2010 Douglas Gregor <dgregor@apple.com> Downgrade the "declaration does not declare anything" error to a
warning. It's not harmful to have such pointless declarations, and GCC
does not diagnose this issue consistently.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100814 91177308-0d34-0410-b5e6-96231b3b80d8
nonymous-struct-union.c
ecl-invalid.c
eclspec.c
b4c0c2df7a40c753f2eddd8726f807877be4be07 08-Apr-2010 Ted Kremenek <kremenek@apple.com> Match GCC's behavior and do not include '-Wunused-parameter' in '-Wunused'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100810 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unused-parameters.c
a8b48e4b68605297e6a426531993a4d4eeaff094 08-Apr-2010 Ted Kremenek <kremenek@apple.com> Update test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100801 91177308-0d34-0410-b5e6-96231b3b80d8
eturn.c
e1fcf29951432de60e9fba243d500d069e929900 08-Apr-2010 Ted Kremenek <kremenek@apple.com> Include all warnings under '-Wunused' in '-Wmost' and '-Wall'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100786 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unused-function.c
arn-unused-value.c
83e7a78a9fa3fc495a575bca0e3d4d7ce26184ef 08-Apr-2010 Chris Lattner <sabre@nondot.org> rename llvm::llvm_report_error -> llvm::report_fatal_error



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100708 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-section.c
arn-missing-braces.c
c46a246f5fb00bf8448a1081e7d7e73bb6dbfbf5 07-Apr-2010 Ted Kremenek <kremenek@apple.com> Don't emit an 'unused expression' warning for '||' and '&&' expressions that contain assignments
or similar side-effects.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100676 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unused-value.c
3aae6093dd8f3aecb66d7ff1f4b44e6a86765db4 07-Apr-2010 John McCall <rjmccall@apple.com> Teach -Wsign-compare to treat 1 << blah as "idiomatically non-negative".
Fixes a spurious warning in LLVM.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100595 91177308-0d34-0410-b5e6-96231b3b80d8
ompare.c
209acbd6d0c1b4444eb8c1682717753e1cbe38de 07-Apr-2010 John McCall <rjmccall@apple.com> Devote a special diagnostic to the typo
(void*) someFunction(5, 10, 15, 20);
where the cast is presumably meant to be to 'void'.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100574 91177308-0d34-0410-b5e6-96231b3b80d8
nused-expr.c
aec586056d8670c99ba7c4833be13e4eb123cddb 31-Mar-2010 John McCall <rjmccall@apple.com> Support __attribute__((unused)) on types. This suddenly started firing
a lot for me on selfhosts, I dunno why.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99981 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-unused.c
7727acf243ee61c0757d86c95b69dbee56a3d898 31-Mar-2010 John McCall <rjmccall@apple.com> Fix PR6327: restore invariants when there's a parse error in an initializer.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99980 91177308-0d34-0410-b5e6-96231b3b80d8
nit.c
0b4c9b5834a0a5520d2cd32227a53cf7f73fedca 29-Mar-2010 Douglas Gregor <dgregor@apple.com> Support __attribute__((packed)) (along with other attributes) at the
end of a struct/class/union in C++, from Justin Bogner!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99811 91177308-0d34-0410-b5e6-96231b3b80d8
truct-packed-align.c
6ee765348b2855c702fa593fb030ef6abe0d01f6 25-Mar-2010 Ted Kremenek <kremenek@apple.com> Fix two bugs in format-string checking:
(1) Do not assume the data arguments start after the format string
(2) Do not use the fact that a function is variadic to treat it like a va_list printf function

Fixes PR 6697.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99480 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
02668985d9ae546ab391740a66fa498ebac09874 24-Mar-2010 Douglas Gregor <dgregor@apple.com> Control warnings about GNU extensions with -Wgnu, which has a subgroup
for GNU designated-initializer syntax (-Wgnu-designator).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99421 91177308-0d34-0410-b5e6-96231b3b80d8
arn-gnu-designators.c
bc52595e01323ca22d65c68aafd53a1acb8c1fb6 23-Mar-2010 Duncan Sands <baldrick@free.fr> Ignore a more comprehensive set of gcc-special format attributes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99277 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-format.c
c263704cb007eb95b79f37b12a8092c47146d452 23-Mar-2010 Ted Kremenek <kremenek@apple.com> For forward-declared static inline functions, delay CFG-based warnings until we
encounter a definition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99243 91177308-0d34-0410-b5e6-96231b3b80d8
eturn.c
d064fdc4b7b64ca55b40b70490c79d6f569df78e 23-Mar-2010 Ted Kremenek <kremenek@apple.com> Only perform CFG-based warnings on 'static inline' functions that
are called (transitively) by regular functions/blocks within a
translation untion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99233 91177308-0d34-0410-b5e6-96231b3b80d8
eturn.c
3c989027f68e2d9dfd57c018ccc550bd9fb79920 22-Mar-2010 Chris Lattner <sabre@nondot.org> (re)implement PR6542, accepting and discarding the __gcc_tdiag__
format attribute specifier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99213 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-format.c
a87d477c69ec31a0d24b7c53e4a781fb76617809 22-Mar-2010 Chris Lattner <sabre@nondot.org> merge some tests.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99212 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-format.c
ormat-attr-pr4470.c
ormat-attribute-printf0.c
6580d5bd5eb365a97ec2c65116be20e2239df022 22-Mar-2010 Chris Lattner <sabre@nondot.org> rename test


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99211 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-format.c
ormat-attribute.c
b1332d7a5228600ae86276b12883ec0ac9500ec1 22-Mar-2010 Chris Lattner <sabre@nondot.org> merge two tests.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99209 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-sentinel.c
unction-pointer-sentinel-attribute.c
61784e31a9efcc5c8a9da298f10fcde29d01f225 22-Mar-2010 Chris Lattner <sabre@nondot.org> rename test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99208 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-sentinel.c
unction-sentinel-attr.c
1a6154cf2e609b4ede74cb8d9a38ce28cbe833e9 22-Mar-2010 Chris Lattner <sabre@nondot.org> move a test to a more appropriate directory


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99200 91177308-0d34-0410-b5e6-96231b3b80d8
86-intrinsics-headers.c
053f4bddcb10bd3b17cd6a66fe52e265498603ed 22-Mar-2010 John McCall <rjmccall@apple.com> -Wshadow should only warn about parameter declarations when we're
entering a function or block definition, not on every single declaration.
Unfortunately we don't have previous-lookup results around when it's time
to make this decision, so we have to redo the lookup. The alternative is
to use delayed diagnostics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99172 91177308-0d34-0410-b5e6-96231b3b80d8
arn-shadow.c
01620704304f819b82ecef769ec114e541a364d7 21-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> Fix PR6618.

If a struct has an invalid field, mark it as invalid. Also avoid producing
errors about incomplete types that are invalid.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99150 91177308-0d34-0410-b5e6-96231b3b80d8
ested-redef.c
db59bc867af39cf09053fa49f3c20bd7a6319f3f 20-Mar-2010 Eric Christopher <echristo@apple.com> Add sse4.2 support to this test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99052 91177308-0d34-0410-b5e6-96231b3b80d8
86-intrinsics-headers.c
a369a95f756b6190b5611ff4118b4cabfc704dc0 20-Mar-2010 John McCall <rjmccall@apple.com> Implement -Wshadow for parameter declarations as well.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99037 91177308-0d34-0410-b5e6-96231b3b80d8
arn-shadow.c
355c96ef5a42de8929a53c8dbd4d852cb6d61181 20-Mar-2010 Eric Christopher <echristo@apple.com> Add include for smmintrin.h to this test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99019 91177308-0d34-0410-b5e6-96231b3b80d8
86-intrinsics-headers.c
73061d054128e486e70e0f2874b23d6eca067e5b 19-Mar-2010 John McCall <rjmccall@apple.com> Pretty-print anonymous types using their kind and presumed location.
Fixes PR6643. Patch by Mike M!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98946 91177308-0d34-0410-b5e6-96231b3b80d8
nvalid-init-diag.c
c48c916b8cebba954429715f15bd5b5e8e4d4574 17-Mar-2010 Douglas Gregor <dgregor@apple.com> Remove warning about shadowing a built-in; built-ins aren't actually
considered to be a part of the translation unit unless they're named
in a way that brings them into existence.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98729 91177308-0d34-0410-b5e6-96231b3b80d8
arn-shadow.c
8596bbe00e3cd670652ddaf0c22d14aa84bb6fb8 17-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> Issue error when a byref array is accessed in a block
literal. Fixes radar 7760213.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98693 91177308-0d34-0410-b5e6-96231b3b80d8
lock-byref-args.c
lock-misc.c
9a8cb8d4bdbb3eaf6e8cd8cb3e47b343694c01f8 16-Mar-2010 John McCall <rjmccall@apple.com> Forgot the testcases.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98685 91177308-0d34-0410-b5e6-96231b3b80d8
arn-shadow.c
4b7a834e0fecddd9eaf1f4567867c718e4eebf50 15-Mar-2010 John McCall <rjmccall@apple.com> Add support for -Wwrite-strings. Patch by Mike M! Fixes PR 4804.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98541 91177308-0d34-0410-b5e6-96231b3b80d8
arn-write-strings.c
1c471f3e1c0ec8cbc82447bb35908dfc55463e46 13-Mar-2010 John McCall <rjmccall@apple.com> Check compatibility of vector types using their canonicalizations.
Fixes an assertion arising C overload analysis, but really I can't imagine
that this wouldn't cause a thousand other uncaught failures.

Fixes PR6600.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98400 91177308-0d34-0410-b5e6-96231b3b80d8
verloadable.c
0faede6f31b07bcec7b776f2b420c3ea9bb3e58c 12-Mar-2010 John McCall <rjmccall@apple.com> Improve the unused-value check to look into comma expressions and filter out
voids in sub-expressions. Patch by Mike M!

Fixes PR4806.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98335 91177308-0d34-0410-b5e6-96231b3b80d8
eturn.c
arn-unused-value.c
d1b47bf17fde73fac67d8664bd65273742c00ecd 11-Mar-2010 John McCall <rjmccall@apple.com> Warn about comparing an unsigned expression with 0 in tautological ways.
Patch by mikem!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98279 91177308-0d34-0410-b5e6-96231b3b80d8
ompare.c
d7358a3a63e66aafc49f394613a3afe4403d7c6b 11-Mar-2010 John McCall <rjmccall@apple.com> Remember the PR number.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98276 91177308-0d34-0410-b5e6-96231b3b80d8
issing-field-initializers.c
80639debfb2d90b2f1ffdbcd9a391f744cb0a393 11-Mar-2010 John McCall <rjmccall@apple.com> Implement -Wmissing-field-initializers. Patch by mikem!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98275 91177308-0d34-0410-b5e6-96231b3b80d8
issing-field-initializers.c
1e1d396dc55002a2a6355048db542a38b5137002 07-Mar-2010 Tanya Lattner <tonic@nondot.org> Implement missing-braces warning and add a test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97893 91177308-0d34-0410-b5e6-96231b3b80d8
arn-missing-braces.c
dbf217af72acefe7702c65dad2d5e534b3de9674 06-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> Allow use of byref (__block attributed) arrays inside
the block. Fixes radar 7671883.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97863 91177308-0d34-0410-b5e6-96231b3b80d8
lock-byref-args.c
02db31c62ae6c68b5cbbecd09acbbc09bc03d110 05-Mar-2010 Chris Lattner <sabre@nondot.org> Emit warning on indirect goto that potentially violates
scope instead of error, PR6517


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97826 91177308-0d34-0410-b5e6-96231b3b80d8
cope-check.c
fc3a0700bd63716b89eaabfd6a3da34019ffdb2e 05-Mar-2010 Chris Lattner <sabre@nondot.org> address PR6502 by downgrading the scope checker's address
of label error to a warning controllable with a -W flag.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97815 91177308-0d34-0410-b5e6-96231b3b80d8
cope-check.c
9ea9bdbc14374f7bacdb50d3e52c664ff12150ff 02-Mar-2010 Douglas Gregor <dgregor@apple.com> Keep an explicit stack of function and block scopes, each element of
which has the label map, switch statement stack, etc. Previously, we
had a single set of maps in Sema (for the function) along with a stack
of block scopes. However, this lead to funky behavior with nested
functions, e.g., in the member functions of local classes.

The explicit-stack approach is far cleaner, and we retain a 1-element
cache so that we're not malloc/free'ing every time we enter a
function. Fixes PR6382.

Also, tweaked the unused-variable warning suppression logic to look at
errors within a given Scope rather than within a given function. The
prior code wasn't looking at the right number-of-errors count when
dealing with blocks, since the block's count would be deallocated
before we got to ActOnPopScope. This approach works with nested
blocks/functions, and gives tighter error recovery.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97518 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unused-variables.c
e6794974b706ddd51e65dcea411a6378a0f16a2e 01-Mar-2010 Chris Lattner <sabre@nondot.org> fix PR5933: don't warn about unused variables if a function has other errors in it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97498 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unused-variables.c
d49d87719b8e272134e76601e3efc0197785aa8a 01-Mar-2010 Ted Kremenek <kremenek@apple.com> Allow a '0' precision in format strings (as the man page says it is okay).
Fixes <rdar://problem/7700339>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97482 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
f9f627dbbc62fbf51b906c24c783b4249dc7e9bb 01-Mar-2010 Douglas Gregor <dgregor@apple.com> Don't warn about case-value conversions from a negative value to a
larger unsigned value, since this is implementation-defined
behavior. (We previously suppressed this warning when converting from
a signed value to an unsigned value of the same size).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97430 91177308-0d34-0410-b5e6-96231b3b80d8
witch.c
b3a4e432c90be98c6d918087750397e86d030368 28-Feb-2010 Chris Lattner <sabre@nondot.org> Implement PR6423 by using one token of lookahead to disambiguate
an *almost* always incorrect case. This only does the lookahead
in the insanely unlikely case, so it shouldn't impact performance.

On this testcase:

struct foo {
}
typedef int x;

Before:

t.c:3:9: error: cannot combine with previous 'struct' declaration specifier
typedef int x;
^

After:

t.c:2:2: error: expected ';' after struct
}
^
;



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97403 91177308-0d34-0410-b5e6-96231b3b80d8
eclspec.c
e3fc54790250076e33ad25b14e5be293514fe5ea 27-Feb-2010 Ted Kremenek <kremenek@apple.com> Fix crasher caused by setting a bit in a possibly empty bitvector while
doing printf format string checking. This is a recent regression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97318 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
efaff195ba1fa55b6fe0b0b2435b81451387d241 27-Feb-2010 Ted Kremenek <kremenek@apple.com> For printf format string checking, add support for positional format strings.
Along the way, coelesce some of the diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97297 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
7f70dc85d5055c19c8003f43a59135de211ad1b9 26-Feb-2010 Ted Kremenek <kremenek@apple.com> For printf format string checking, move the tracking of the data argument index out of
Sema and into analyze_printf::ParseFormatString(). Also use a bitvector to determine
what arguments have been covered (instead of just checking to see if the last argument consumed is the max argument). This is prep. for support positional arguments (an IEEE extension).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97248 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
23a370f9455698e5501101aea7ad8a884a8d4556 25-Feb-2010 Chandler Carruth <chandlerc@gmail.com> Add a new conversion rank to classify conversions between complex and scalar
types. Rank these conversions below other conversions. This allows overload
resolution when the only distinction is between a complex and scalar type. It
also brings the complex overload resolutin in line with GCC's.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97128 91177308-0d34-0410-b5e6-96231b3b80d8
verloadable-complex.c
78c97fb0bb295f1235469d47e1384a56252090ee 24-Feb-2010 Ted Kremenek <kremenek@apple.com> Disable one test case because of the inconsistent results it is giving on
Windows and Mac OS X. Will investigate later.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97016 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
328ce34c7d0c4e8696d352853b48b385dec1fef4 24-Feb-2010 Charles Davis <cdavis@mines.edu> When we encounter a function-specific attribute in a declaration specifier,
apply it only to the function itself, and never to the return type. Fixes part
of PR6408.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97015 91177308-0d34-0410-b5e6-96231b3b80d8
allingconv.c
910716678e8af41432f3dfb16b340168597f8c45 24-Feb-2010 Zhongxing Xu <xuzhongxing@gmail.com> Always add CallExpr as block-level expression. Inline-based interprocedural
analysis needs this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97014 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unreachable.c
87260c7eabf88eb2009ba2ba20150cd897483241 24-Feb-2010 Ted Kremenek <kremenek@apple.com> Add support for '%C' and '%S' printf conversion specifiers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97005 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
c0cd21d2a3301a7a88e0052aebdd09c2441f826d 23-Feb-2010 John McCall <rjmccall@apple.com> Don't assert on compound assignment operators that operate in FP types when
the result is integral. Fixes <rdar://problem/7676608>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96970 91177308-0d34-0410-b5e6-96231b3b80d8
onversion.c
064f7db69def9299f5f4d9a32114afc10b6a6420 23-Feb-2010 Charles Davis <cdavis@mines.edu> When comparing two calling conventions after redeclaring a function, compare
the canonical calling conventions instead of comparing the raw calling
conventions directly. Fixes PR6361.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96895 91177308-0d34-0410-b5e6-96231b3b80d8
allingconv.c
05f62474dd2b0f1cb69adbe0787f2868788aa949 23-Feb-2010 Charles Davis <cdavis@mines.edu> When a reference to a field of a struct/union/class is passed to the
__alignof__ operator, make sure to take into account the packed alignment
of the struct/union/class itself. Matches GCC's behavior and fixes PR6362.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96884 91177308-0d34-0410-b5e6-96231b3b80d8
lign-x86.c
d84aac17180075e0ede53d7762b73d3bd079b52f 22-Feb-2010 Chris Lattner <sabre@nondot.org> Add 'previous declaration is here' note for param redefinition
errors, e.g.:

t.c:1:21: error: redefinition of parameter 'x'
int test(int x, int x);
^
t.c:1:14: note: previous declaration is here
int test(int x, int x);
^



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96769 91177308-0d34-0410-b5e6-96231b3b80d8
rg-duplicate.c
lock-args.c
e01c063874fa762abfba03b920bca16e1a1f10b4 18-Feb-2010 Charles Davis <cdavis@mines.edu> Also don't warn about force_align_arg_pointer on function typedefs. (This will
break if you declare an actual function using that typedef. Come to think of it,
maybe I should make this part of the type.)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96570 91177308-0d34-0410-b5e6-96231b3b80d8
86-attr-force-align-arg-pointer.c
beaf5edfb22dd36b3d0e526291fd3a074404dd3e 18-Feb-2010 Charles Davis <cdavis@mines.edu> Two fixes related to force_align_arg_pointer:
- Also recognize __force_align_arg_pointer__.
- Don't warn if it's used on a function pointer typedef.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96568 91177308-0d34-0410-b5e6-96231b3b80d8
86-attr-force-align-arg-pointer.c
f3f8d2a52ebc0acbe6269a0302f90c21668e2404 18-Feb-2010 Charles Davis <cdavis@mines.edu> Allow redefinitions of extern inline functions in GNU89 mode, just as GCC
does. Fixes PR5253.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96553 91177308-0d34-0410-b5e6-96231b3b80d8
nline.c
2853eac24e2e70a74d7da817653b0528b976039f 18-Feb-2010 Douglas Gregor <dgregor@apple.com> Don't diagnose overflow in case statements when the conversion is a
signed<->unsigned conversion with the same bit width. Fixes
<rdar://problem/7658121>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96545 91177308-0d34-0410-b5e6-96231b3b80d8
witch.c
30ab37122300a5f6664b8ae2d0b43b4396eb6bcb 18-Feb-2010 Douglas Gregor <dgregor@apple.com> For -Wswitch-enum warnings, be sure to look through typedefs of enum
types. Fixes <rdar://problem/7643909>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96531 91177308-0d34-0410-b5e6-96231b3b80d8
witch.c
19c152581a46dd162c0cfacad05ad88646d527c5 17-Feb-2010 Douglas Gregor <dgregor@apple.com> When diagnosing enumerator values outside of the range of 'int', be
sure that we get the "too large" vs. "too small" part of the
diagnostic correct.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96524 91177308-0d34-0410-b5e6-96231b3b80d8
num.c
56bddeda24adcb927dd5ceafd75f84ebc2eb4203 17-Feb-2010 Daniel Dunbar <daniel@zuster.org> Fix test to not force triple, and also to not need stdint.h.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96499 91177308-0d34-0410-b5e6-96231b3b80d8
tatic-init.c
c777221d22e2687938c061de6698ddcccbe00fdc 17-Feb-2010 Tanya Lattner <tonic@nondot.org> Do not add functions marked with the unused attribute to the list of unused functions to warn about. Update test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96452 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unused-function.c
12ead498c4bc279472b21d446bfccec0f654779e 17-Feb-2010 Tanya Lattner <tonic@nondot.org> Fix unused function warning to handle used attributes and redeclarations. Update test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96444 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unused-function.c
ab44216009dbdaa9a3b26f541ead13e85f6e39b3 17-Feb-2010 Charles Davis <cdavis@mines.edu> Revert r95939, as suggested by Alexandre Julliard from the Wine project (and
our own Chris Lattner).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96431 91177308-0d34-0410-b5e6-96231b3b80d8
86-attr-force-align-arg-pointer.c
75d113711eb4e40029bb0426365396b76281deee 16-Feb-2010 Daniel Dunbar <daniel@zuster.org> Disable warn_unused_function for now, its breaking various project builds due to
false positives.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96375 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unused-function.c
f0122fe49329cb439d55a6712bfcaad9a6570428 16-Feb-2010 Charles Davis <cdavis@mines.edu> dllimport and dllexport are declspec attributes, too. They're also
Win32-specific.

Also, fix a test to use FileCheck instead of grepping LLVM IR.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96364 91177308-0d34-0410-b5e6-96231b3b80d8
llimport-dllexport.c
0da9e9582832ee776030a38420fc851b0118b598 16-Feb-2010 Ted Kremenek <kremenek@apple.com> Add test case to show that Clang now checks the format string
arguments of asprintf (<rdar://problem/6657191>).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96319 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
0395618b6f3a57137abf6d29284e0eef6177c0ad 16-Feb-2010 Ted Kremenek <kremenek@apple.com> Fix test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96311 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
4e4b30ec62d78b24e6556fea2624855c193d0e3e 16-Feb-2010 Ted Kremenek <kremenek@apple.com> Refactor the logic for printf argument type-checking into analyze_printf::ArgTypeResult.
Implement printf argument type checking for '%s'.

Fixes <rdar://problem/3065808>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96310 91177308-0d34-0410-b5e6-96231b3b80d8
lock-printf-attribute-1.c
ormat-strings.c
e771a7ac11fb27f0e734e5de4d858f2c268895e5 15-Feb-2010 Benjamin Kramer <benny.kra@googlemail.com> Add Sema support for __builtin_fpclassify by extending the existing check for __builtin_isinf and friends. Part of PR6083.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96291 91177308-0d34-0410-b5e6-96231b3b80d8
uiltin-unary-fp.c
c4a2638b5ef3e2d35d872614ceb655a7a22c58be 13-Feb-2010 Eli Friedman <eli.friedman@gmail.com> Fix for PR6274: teach constant folding to evaluate __builtin_expect.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96054 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
9a66c303c7024967a48877106384bf315c84e80e 12-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Complain if block-literal expression's parameter name is
missing (in c/objc mode). Fixes radar 7528255.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96017 91177308-0d34-0410-b5e6-96231b3b80d8
lock-args.c
e6bbc01d1c4ec5241df36042e0a4a12a6711934b 12-Feb-2010 Tanya Lattner <tonic@nondot.org> Implementing unused function warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95940 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unused-function.c
b84412f587bc9f2f90930cc1c63ba10cb833bd4e 12-Feb-2010 Charles Davis <cdavis@mines.edu> Warn about using the new force_align_arg_pointer attribute on a function
pointer. If you don't like the new warning, you can turn it off with
-Wno-force-align-arg-pointer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95939 91177308-0d34-0410-b5e6-96231b3b80d8
86-attr-force-align-arg-pointer.c
05efad5f3a234639bb28a2483d38bbb4cb2b2370 11-Feb-2010 John McCall <rjmccall@apple.com> Make this test not rely on the system <limits.h>. Hopefully fixes the
MSVC build.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95932 91177308-0d34-0410-b5e6-96231b3b80d8
nputs/conversion.h
onversion.c
fb6289aac127b3752a5ebedfe05ba30dfee387f5 11-Feb-2010 John McCall <rjmccall@apple.com> Test case for warnings with carets inside macro instantiations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95893 91177308-0d34-0410-b5e6-96231b3b80d8
onversion.c
5c41ee8c49995fb4fd76d686b239c15cbab261ea 11-Feb-2010 Ted Kremenek <kremenek@apple.com> Patch by Cristian Draghici:

Enhance the printf format string checking when using the format
specifier flags ' ', '0', '+' with the 'p' or 's' conversions (since
they are nonsensical and undefined). This is similar to GCC's
checking.

Also warning when a precision is used with the 'p' conversin
specifier, since it has no meaning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95869 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
5a0164d6ab843ca61437ec59a504365cb1c98f43 11-Feb-2010 Charles Davis <cdavis@mines.edu> Add support for the force_align_arg_pointer attribute. This is an x86-specific
attribute, so it uses Anton's new target-specific attribute support. It's
supposed to ensure that the stack is 16-byte aligned, but since necessary
support is lacking from LLVM, this is a no-op for now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95820 91177308-0d34-0410-b5e6-96231b3b80d8
86-attr-force-align-arg-pointer.c
60c93c9981c467738369702e7aa23fd58c2b6aac 09-Feb-2010 Douglas Gregor <dgregor@apple.com> Migrate the mish-mash of declaration checks in
Sema::ActOnUninitializedDecl over to InitializationSequence (with
default initialization), eliminating redundancy. More importantly, we
now check that a const definition in C++ has an initilizer, which was
an #if 0'd code for many, many months. A few other tweaks were needed
to get everything working again:

- Fix all of the places in the testsuite where we defined const
objects without initializers (now that we diagnose this issue)
- Teach instantiation of static data members to find the previous
declaration, so that we build proper redeclaration
chains. Previously, we had the redeclaration chain but built it
too late to be useful, because...
- Teach instantiation of static data member definitions not to try
to check an initializer if a previous declaration already had an
initializer. This makes sure that we don't complain about static
const data members with in-class initializers and out-of-line
definitions.
- Move all of the incomplete-type checking logic out of
Sema::FinalizeDeclaratorGroup; it makes more sense in
ActOnUnitializedDecl.

There may still be a few places where we can improve these
diagnostics. I'll address that as a separate commit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95657 91177308-0d34-0410-b5e6-96231b3b80d8
ncomplete-decl.c
ba915af51ced751c46e7c2b9c6f3b59d2e668825 08-Feb-2010 Douglas Gregor <dgregor@apple.com> Warn when cases are missing from a switch on a value of enumeration
type (-Wswitch), from Michal!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95592 91177308-0d34-0410-b5e6-96231b3b80d8
witch.c
04a67a6aa3dfdc92d57f7f8d93ba397348c868a4 05-Feb-2010 John McCall <rjmccall@apple.com> Standardize the parsing of function type attributes in a way that
follows (as conservatively as possible) gcc's current behavior: attributes
written on return types that don't apply there are applied to the function
instead, etc. Only parse CC attributes as type attributes, not as decl attributes;
don't accepet noreturn as a decl attribute on ValueDecls, either (it still
needs to apply to other decls, like blocks). Consistently consume CC/noreturn
information throughout codegen; enforce this by removing their default values
in CodeGenTypes::getFunctionInfo().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95436 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-noreturn.c
allingconv.c
tdcall-fastcall.c
f82b4e85b1219295cad4b5851b035575bc293010 04-Feb-2010 John McCall <rjmccall@apple.com> Allow calling convention attributes to apply to types. Patch by Chip Davis!




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95291 91177308-0d34-0410-b5e6-96231b3b80d8
allingconv.c
b0f8eacfdcd0d43f51e669f2d723992d4af9f746 03-Feb-2010 Douglas Gregor <dgregor@apple.com> When determining whether a function without a prototype is compatible
with a function with a prototype, treat parameters of enumeration type
based on the enumeration type's promotion type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95238 91177308-0d34-0410-b5e6-96231b3b80d8
unction-redecl.c
a873dfc9e7314681bb37efd9ab185045de121e43 03-Feb-2010 Douglas Gregor <dgregor@apple.com> Implement the lvalue-to-rvalue conversion where needed. The
lvalue-to-rvalue conversion adjusts lvalues of qualified, non-class
type to rvalue expressions of the unqualified variant of that
type. For example, given:

const int i;
(void)(i + 17);

the lvalue-to-rvalue conversion for the subexpression "i" will turn it
from an lvalue expression (a DeclRefExpr) with type 'const int' into
an rvalue expression with type 'int'. Both C and C++ mandate this
conversion, and somehow we've slid through without implementing it.

We now have both DefaultFunctionArrayConversion and
DefaultFunctionArrayLvalueConversion, and which gets used depends on
whether we do the lvalue-to-rvalue conversion or not. Generally, we do
the lvalue-to-rvalue conversion, but there are a few notable
exceptions:
- the left-hand side of a '.' operator
- the left-hand side of an assignment
- a C++ throw expression
- a subscript expression that's subscripting a vector

Making this change exposed two issues with blocks:
- we were deducing const-qualified return types of non-class type
from a block return, which doesn't fit well
- we weren't always setting the known return type of a block when it
was provided with the ^return-type syntax

Fixes the current Clang-on-Clang compile failure and PR6076.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95167 91177308-0d34-0410-b5e6-96231b3b80d8
lock-return.c
aa74a1e49f7c4b89539830290f76fe2c3e97187f 02-Feb-2010 Douglas Gregor <dgregor@apple.com> Implement promotion for enumeration types.

WHAT!?!

It turns out that Type::isPromotableIntegerType() was not considering
enumeration types to be promotable, so we would never do the
promotion despite having properly computed the promotion type when the
enum was defined. Various operations on values of enum type just
"worked" because we could still compute the integer rank of an enum
type; the oddity, however, is that operations such as "add an enum and
an unsigned" would often have an enum result type (!). The bug
actually showed up as a spurious -Wformat diagnostic
(<rdar://problem/7595366>), but in theory it could cause miscompiles.

In this commit:
- Enum types with a promotion type of "int" or "unsigned int" are
promotable.
- Tweaked the computation of promotable types for enums
- For all of the ABIs, treat enum types the same way as their
underlying types (*not* their promotion types) for argument passing
and return values
- Extend the ABI tester with support for enumeration types



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95117 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
99c952046600f6bfccf315aa7ad5b1be2d242cc3 02-Feb-2010 Chris Lattner <sabre@nondot.org> the declspec of a declaration can have storage-class specifiers,
type qualifiers and type specifiers in any order. For example,
this is valid: struct x {...} typedef y;

This fixes PR6208.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95094 91177308-0d34-0410-b5e6-96231b3b80d8
eclspec.c
4ed5d91db256f7dbe6bf716da0b801004c197254 02-Feb-2010 Chris Lattner <sabre@nondot.org> Implement PR6180, substantially improving the diagnostics we get from
forgetting a ';' at the end of a struct. For something like:

class c {
}
void foo() {}

we now produce:

t.cc:3:2: error: expected ';' after class
}
^
;

instead of:

t.cc:4:1: error: cannot combine with previous 'class' declaration specifier
void foo() {}
^
t.cc:2:7: error: 'class c' can not be defined in the result type of a function
class c {
^

GCC produces:

t.cc:4: error: new types may not be defined in a return type
t.cc:4: note: (perhaps a semicolon is missing after the definition of ‘c’)
t.cc:4: error: two or more data types in declaration of ‘foo’

I *think* I got the follow set right, but if I forgot anything, we'll start
getting spurious "expected ';' after class" errors, let me know if you see
any.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95042 91177308-0d34-0410-b5e6-96231b3b80d8
eclspec.c
677e4feebe4b3485504860d991d700cc3b933961 02-Feb-2010 Douglas Gregor <dgregor@apple.com> Improve handling of enumerator values for C and C++, including:

- In C++, prior to the closing '}', set the type of enumerators
based on the type of their initializer. Don't perform unary
conversions on the enumerator values.
- In C++, handle overflow when an enumerator has no initializer and
its value cannot be represented in the type of the previous
enumerator.
- In C, handle overflow more gracefully, by complaining and then
falling back to the C++ rules.
- In C, if the enumerator value is representable in an int, convert the
expression to the type 'int'.

Fixes PR5854 and PR4515.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95031 91177308-0d34-0410-b5e6-96231b3b80d8
num.c
f911eba72e6d7275e5cfdb79ab23fb2aa9cc01d0 02-Feb-2010 Ted Kremenek <kremenek@apple.com> Add format string type checking support for 'long double'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95026 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
180f2840d1d8bcb2139bfb53e2d88eda280e939e 01-Feb-2010 Ted Kremenek <kremenek@apple.com> Format string checking: selectively ignore implicit casts to 'int'
when checking if the format specifier matches the type of the data
argument and the length modifier indicates the data type is 'char' or
'short'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94992 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
d17e340e2d516139931768697bf080f60920ba9d 01-Feb-2010 Sam Weinig <sam.weinig@gmail.com> Fix for PR5185. C99 [*] VLA notation should be disallowed in function definitions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94972 91177308-0d34-0410-b5e6-96231b3b80d8
la.c
2877998bd8db2fac1c56430a4edcfa0ce138aff9 31-Jan-2010 Chandler Carruth <chandlerc@gmail.com> Really trivial patch to accept pointer to const void in indirect goto. Despite
the lack of documentation, this matches the behavior of GCC.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94954 91177308-0d34-0410-b5e6-96231b3b80d8
ndirect-goto.c
01aefc6d20fbfd50bfb83926226dee86dd31c9c5 30-Jan-2010 Daniel Dunbar <daniel@zuster.org> Recognize 'q' as a format length modifier (from BSD).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94894 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
c9a89fec60a20eb3269caa95eca048d45ab215ad 30-Jan-2010 Ted Kremenek <kremenek@apple.com> Add format string checking of 'double' arguments. Fixes <rdar://problem/6931734>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94867 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
d635c5fcc45c952b75743dd2f4c86d6950e4954e 30-Jan-2010 Ted Kremenek <kremenek@apple.com> Add basic type checking of format string conversion specifiers and their arguments. Thanks to Cristian Draghici for his help with this patch!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94864 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
cn-cstring.c
31f8e32788adb299acad455363eb7fd244642c82 30-Jan-2010 Ted Kremenek <kremenek@apple.com> Be a little more permissive than C99: allow 'unsigned' to be used for
the field width and precision of a format specifier instead of just
'int'. This matches GCC, and fixes <rdar://problem/6079850>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94856 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
f88c8e02da48afea6a04091f675af5c4facd99f1 29-Jan-2010 Ted Kremenek <kremenek@apple.com> Switch Sema over to using the new implementation of format string
checking. It passes all existing tests, and the diagnostics have been
refined to provide better range information (we now highlight
individual format specifiers) and more precise wording in the
diagnostics.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94837 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
3c9e03bda57d33097b19eef1dbb06bc5b2876551 29-Jan-2010 Ted Kremenek <kremenek@apple.com> Add comment to test linking it back to the original Bugzilla PR.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94816 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-string-percentm.c
d410fa259e485b751258e07e750cf45cad01e7ea 27-Jan-2010 Daniel Dunbar <daniel@zuster.org> ARM/APCS: Fix alignment of long double.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94685 91177308-0d34-0410-b5e6-96231b3b80d8
rm-layout.c
aec7caa3c40891727164167ece11d552422803d2 26-Jan-2010 Chandler Carruth <chandlerc@gmail.com> Correctly treat 64 bit integers specified via the mode attribute as the 'long'
type when that type is 64 bits wide, and the 'long long' type when 'long' is
only 32 bits wide. This fixes PR6108.

Also adds a bunch of test cases to ensure proper conversion between equally
sized standard types and mode-specified types on both 32 and 64 bit targets.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94527 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-mode.c
7a6ae743b2ecfdfadadf7df53b569a9a3871a8fd 25-Jan-2010 John McCall <rjmccall@apple.com> Warn on top-level 'asm volatile' (instead of misparsing it).
"Fixes" rdar://problem/7574870



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94458 91177308-0d34-0410-b5e6-96231b3b80d8
sm.c
7e52de4b45286d057b367bb1f9283a1e32d79252 24-Jan-2010 Chris Lattner <sabre@nondot.org> fix PR6034, a crash on invalid where the switch stack would get
unbalanced.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94347 91177308-0d34-0410-b5e6-96231b3b80d8
tatements.c
46171917dc87caf0c7a741a7301f36db2e20b132 23-Jan-2010 Mike Stump <mrs@apple.com> Insulate these from changes to the default for -Wunreachable-code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94326 91177308-0d34-0410-b5e6-96231b3b80d8
ompare.c
onversion.c
eturn-noreturn.c
eturn.c
cope-check.c
nused-expr.c
b5c775575b496c03d862ea03587a9f1d74193c9f 22-Jan-2010 Mike Stump <mrs@apple.com> Improve unreachable code warnings with respect to dead member and
dead array references.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94115 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unreachable.c
44582300b63ac128989643adcd12b6349b67abe4 21-Jan-2010 Mike Stump <mrs@apple.com> Improve unreachable code warnings for with respect to c-style casts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94094 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unreachable.c
e5fba7058ce34cc3d75e16e777ec6fc8096183f8 21-Jan-2010 Mike Stump <mrs@apple.com> Improve unreachable code warnings for with respect to ? :.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94093 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unreachable.c
45db90de59f6effb7bd9a55660ca97aa3feadc6c 21-Jan-2010 Mike Stump <mrs@apple.com> Improve unreachable code warnings for with respect to compound
assignments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94086 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unreachable.c
55f988efeb08b84c2dd9e4c05990b88c81fe2b58 21-Jan-2010 Mike Stump <mrs@apple.com> Improve unreachable code warnings with respect to dead binary and
unary operators.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94084 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unreachable.c
a3899eb5e30426b00b80232a15ae557dd4caa5b8 20-Jan-2010 Mike Stump <mrs@apple.com> Implement goto inside of blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93945 91177308-0d34-0410-b5e6-96231b3b80d8
lock-literal.c
lock-misc.c
cope-check.c
1d7d8d66eff7ed0f3e957d330930cc9ab8047add 19-Jan-2010 John McCall <rjmccall@apple.com> The type of a compound literal expression is not necessarily the same as the
type which was syntactically written. Fixes PR 6080.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93933 91177308-0d34-0410-b5e6-96231b3b80d8
ompound-literal.c
823000cdeeb2deb861dd92463d739c1e71fea5d2 16-Jan-2010 Mike Stump <mrs@apple.com> Generalize handling for unreachable code warnings to all binary operators.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93584 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unreachable.c
8eae0907c5094b8af61e26b8b809baf3c1ba75c8 16-Jan-2010 Mike Stump <mrs@apple.com> Refine location reporting for unreachable code warnings for comma expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93574 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unreachable.c
9a24dc1409ec1d073a7b346d3b02a0129192fb58 15-Jan-2010 Mike Stump <mrs@apple.com> Add testcase for recent checkin.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93503 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unreachable.c
64f7e258e9c43eefb7f82dfcd600abeed48dc395 13-Jan-2010 John McCall <rjmccall@apple.com> Don't a.k.a. through the primary typedef of an anonymous tag decl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93362 91177308-0d34-0410-b5e6-96231b3b80d8
nonymous-struct-union.c
num.c
d1e4d9bfd57f643d950eb1373f582bda4dfb8dc7 13-Jan-2010 Douglas Gregor <dgregor@apple.com> Don't emit string-comparison or self-comparison warnings in
unevaluated contexts, because they only matter for code that will
actually be evaluated at runtime.

As part of this, I had to extend PartialDiagnostic to support fix-it
hints.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93266 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
elf-comparison.c
cb329c506d0e041b9523618158ac925d620c24ac 12-Jan-2010 Chris Lattner <sabre@nondot.org> use DiagRuntimeBehavior to silence the div/rem by zero warning when
not in an evaluated context. This removes some bogus warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93258 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
7ef655a78863c0a7550bfe51174b9c340ab1dce0 12-Jan-2010 Chris Lattner <sabre@nondot.org> implement PR6004, warning about divide and remainder by zero.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93256 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
-c-e.c
a1e1dc77e995b746826b64752751dbf35f323767 12-Jan-2010 Chris Lattner <sabre@nondot.org> implement PR6007, diagnosing invalid attribute((section))


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93255 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-section.c
58408bc4ead86b08af56cd06fc966fd858b48b2d 11-Jan-2010 Douglas Gregor <dgregor@apple.com> Tighten up the "cannot return array or function type" diagnostic to
say either "array type" or "function type", whichever it is. No reason
to make the user guess.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93164 91177308-0d34-0410-b5e6-96231b3b80d8
eclspec.c
nvalid-decl.c
e030358cc06e1cbce3c2e00ca67c946f9164b2a8 09-Jan-2010 Chris Lattner <sabre@nondot.org> add a bunch of missing prototypes to tests


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93072 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-noreturn.c
lock-labels.c
lock-misc.c
lock-return.c
onditional.c
ormat-strings.c
mplicit-builtin-decl.c
mplicit-decl.c
81201626aa08bcc9d05c8b3c6a1d38a7d577c3ce 08-Jan-2010 John McCall <rjmccall@apple.com> Change the printing of OR_Deleted overload results to print all the candidates,
not just the viable ones. This is reasonable because the most common use of
deleted functions is to exclude some implicit conversion during calls; users
therefore will want to figure out why some other options were excluded.

Started sorting overload results. Right now it just sorts by location in the
translation unit (after putting viable functions first), but we can do better than
that.

Changed bool OnlyViable parameter to PrintOverloadCandidates to an enum for better
self-documentation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92990 91177308-0d34-0410-b5e6-96231b3b80d8
verloadable.c
c31176d5ebbcd407aa512bbd5f717e35da629e7d 08-Jan-2010 Dan Gohman <gohman@apple.com> Use -fno-math-errno by default, and remove the IsMathErrnoDefault
targethook, which is no longer being used. This fixes PR5971.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92987 91177308-0d34-0410-b5e6-96231b3b80d8
nused-expr.c
827feec561c8a1f23c099da56c4ac98364ecfc09 08-Jan-2010 Douglas Gregor <dgregor@apple.com> Improve the fix-its for -Wparentheses to ensure that the fix-it
suggestions follow recovery. Additionally, add a note to these
diagnostics which suggests a fix-it for changing the behavior to what
the user probably meant. Examples:

t.cpp:2:9: warning: & has lower precedence than ==; == will be evaluated first
[-Wparentheses]
if (i & j == k) {
^~~~~~~~
( )
t.cpp:2:9: note: place parentheses around the & expression to evaluate it first
if (i & j == k) {
^
( )

t.cpp:14:9: warning: using the result of an assignment as a condition
without
parentheses [-Wparentheses]
if (i = f()) {
~~^~~~~
( )
t.cpp:14:9: note: use '==' to turn this assignment into an equality
comparison
if (i = f()) {
^
==




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92975 91177308-0d34-0410-b5e6-96231b3b80d8
arentheses.c
539c5c34063066753f27bb0f39fdcde1acc06328 07-Jan-2010 Douglas Gregor <dgregor@apple.com> Fix the search for visible declarations within a Scope to ensure that
we look into a Scope that corresponds to a compound statement whose
scope was combined with the scope of the function that owns it. This
improves typo correction in many common cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92879 91177308-0d34-0410-b5e6-96231b3b80d8
witch.c
67dd1d4df1b28973e12e0981129b2517d2033b66 07-Jan-2010 Douglas Gregor <dgregor@apple.com> Whenever we emit a typo-correction diagnostic, also emit a note
pointing to the declaration that we found that has that name (if it is
unique).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92877 91177308-0d34-0410-b5e6-96231b3b80d8
ar-redecl.c
0acc311bf73c85fd34ce6f89a4e786b7ecd214aa 06-Jan-2010 John McCall <rjmccall@apple.com> Don't assert when dealing with unsigned casts of lvalues. Fixes PR5961.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92866 91177308-0d34-0410-b5e6-96231b3b80d8
ompare.c
60fad45739b764886f707bd204eae9ecce6db1f2 06-Jan-2010 John McCall <rjmccall@apple.com> Derive tighter ranges for & and >> in the conversion-checking code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92862 91177308-0d34-0410-b5e6-96231b3b80d8
onversion.c
f2370c9b4aade940e2253b5b33262ba507d1d71f 06-Jan-2010 John McCall <rjmccall@apple.com> Significantly rework the calculation of effective integer-expression ranges
for -Wsign-compare and -Wconversion, and use that coordinated logic to drive
both diagnostics. The new logic works more transparently with implicit
conversions, conditional operators, etc., as well as bringing -Wconversion's
ability to deal with pseudo-closed operations (e.g. arithmetic on shorts) to
-Wsign-compare.

Fixes PRs 5887, 5937, 5938, and 5939.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92823 91177308-0d34-0410-b5e6-96231b3b80d8
ompare.c
onversion.c
fc4e4e15115e2d973fcc43b2d40e401d3ac88b73 05-Jan-2010 Mike Stump <mrs@apple.com> Add a radar reference.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92678 91177308-0d34-0410-b5e6-96231b3b80d8
lock-misc.c
2849734790738585a9726a84b263c60e3be0193f 05-Jan-2010 Mike Stump <mrs@apple.com> Disallow captured arrays in blocks as well. Radar 7438948.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92677 91177308-0d34-0410-b5e6-96231b3b80d8
lock-misc.c
0d6fd570e52f5d7fc637c9f41382992a97b94b4c 05-Jan-2010 Mike Stump <mrs@apple.com> Disallow capturing vlas inside blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92676 91177308-0d34-0410-b5e6-96231b3b80d8
lock-misc.c
1cd95e210b1b084ee275e0dfa9dd8a7e65b577d7 05-Jan-2010 Mike Stump <mrs@apple.com> Avoid warnings for functions that return a value using MS-style inline
assembly code. This avoids changing the bahvior when normal asm("")
statements are used.

The type of code affected would be:

void* t4(void) { __asm mov eax, fs:[0x10] }

I hope people like this version, if not, let me know.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92531 91177308-0d34-0410-b5e6-96231b3b80d8
s-fuzzy-asm.c
bc021702e67a1c11d72a926f995cf418bb456315 04-Jan-2010 John McCall <rjmccall@apple.com> -Wsign-compare shouldn't warn when the signed operand is a conditional operator
whose operands are non-negative integer constant expressions. This comes up
in LLVM in a few places.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92525 91177308-0d34-0410-b5e6-96231b3b80d8
ompare.c
5b088a10e106a287684bef78cd6c3a3830ac0721 03-Jan-2010 Eli Friedman <eli.friedman@gmail.com> Fix minor oversight for increment/decrement of complex int. Add tests for
coverage.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92433 91177308-0d34-0410-b5e6-96231b3b80d8
omplex-int.c
bb092bafa984e9fa05136b5cef40fd4374dea0f6 31-Dec-2009 Douglas Gregor <dgregor@apple.com> Implement typo correction for id-expressions, e.g.,

typo.cpp:22:10: error: use of undeclared identifier 'radious'; did
you mean 'radius'?
return radious * pi;
^~~~~~~
radius

This was super-easy, since we already had decent recovery by looking
for names in dependent base classes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92341 91177308-0d34-0410-b5e6-96231b3b80d8
ar-redecl.c
634785ca8423b6dd6c15e80714a076c3aaa5a047 30-Dec-2009 Chris Lattner <sabre@nondot.org> testcase for previous patch!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92317 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.c
nused-expr.c
f857798fa77ac50c6d0a262d96ad6176187190e3 23-Dec-2009 Nuno Lopes <nunoplopes@sapo.pt> warn when attribute warn_unused_result is applied to void functions.
while at it, remove an outdated FIXME

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91946 91177308-0d34-0410-b5e6-96231b3b80d8
nused-expr.c
813b70d6db54dbf149cfaa14ec7502142121d86f 22-Dec-2009 Chris Lattner <sabre@nondot.org> fix a bug handling the gnu ?: extension. Patch by Storlek on IRC,
who prefers to be stealthy and mysterious.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91888 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
d6d37dee48cfc5bbcc998bd9d151e4fb3a9437e8 22-Dec-2009 Douglas Gregor <dgregor@apple.com> When filling in value initializations within an initializer list, be
sure to fill in the initialized member of a union when a member was
explicitly designated. Fixes PR5843.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91858 91177308-0d34-0410-b5e6-96231b3b80d8
esignated-initializers.c
d20254f2875d0004c57ee766f258dbcee29f4841 21-Dec-2009 Nuno Lopes <nunoplopes@sapo.pt> fix PR4010: add support for the warn_unused_result for function pointers

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91803 91177308-0d34-0410-b5e6-96231b3b80d8
nused-expr.c
cfdc81a83467973b14e4ea5e9e9af1690f135415 19-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Initialization improvements: addition of string initialization and a few
small bug fixes in SemaInit, switch over SemaDecl to use it more often, and
change a bunch of diagnostics which are different with the new initialization
code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91767 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
nit.c
char.c
38b48afd338d494099697d2611e1f45e558e469e 18-Dec-2009 Daniel Dunbar <daniel@zuster.org> clang -cc1: Rename -mcpu to -target-cpu to match other target options and not alias driver/backend option.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91671 91177308-0d34-0410-b5e6-96231b3b80d8
arbon.c
81a444a274109548f1aa6860736a100d290014bf 18-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Temporarily XFAIL this test.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91643 91177308-0d34-0410-b5e6-96231b3b80d8
s-fuzzy-asm.c
29da559b62d229f067a5b1851e438561dcbfd9bd 17-Dec-2009 Mike Stump <mrs@apple.com> Revert r91073.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91629 91177308-0d34-0410-b5e6-96231b3b80d8
eturn.c
0a8bab019dbf980911fbefa56d7debd648b7b239 17-Dec-2009 Nuno Lopes <nunoplopes@sapo.pt> implement PR3962: diagnose more faulty cases of usage of the restrict qualifier. this also removes a FIXME

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91601 91177308-0d34-0410-b5e6-96231b3b80d8
eclspec.c
80737ad5e0a67d6e3dd0a0ba48446344215a5fd5 15-Dec-2009 Daniel Dunbar <daniel@zuster.org> Update tests to use %clang instead of 'clang', and forcibly disable use of '
clang ' or ' clang -cc1 ' or ' clang-cc ' in test lines (by substituting them to
garbage).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91460 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-malloc.c
-c-e.c
eturn.c
hift.c
urpress-deprecated.c
ransparent-union.c
arn-missing-prototypes.c
arn-unused-parameters.c
char.c
86-intrinsics-headers.c
a5728872c7702ddd09537c95bc3cbd20e1f2fb09 15-Dec-2009 Daniel Dunbar <daniel@zuster.org> Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.
- This is designed to make it obvious that %clang_cc1 is a "test variable"
which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it
can be useful to redefine what gets run as 'clang -cc1' (for example, to set
a default target).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91446 91177308-0d34-0410-b5e6-96231b3b80d8
28bitint.c
R2727.c
R2728.c
R2919-builtin-types-compat-strips-crv.c
R2923.c
R2963-enum-constant.c
ddress-constant.c
ddress_spaces.c
lign-arm-apcs.c
lign-x86.c
ltivec-init.c
nnotate.c
nonymous-struct-union.c
rg-duplicate.c
rg-scope-c99.c
rg-scope.c
rray-constraint.c
rray-declared-as-incorrect-type.c
rray-init.c
sm.c
ssign-null.c
ssign.c
st-print.c
ttr-aligned.c
ttr-cleanup.c
ttr-decl-after-definition.c
ttr-deprecated.c
ttr-format_arg.c
ttr-mode.c
ttr-nodebug.c
ttr-noinline.c
ttr-noreturn.c
ttr-regparm.c
ttr-section.c
ttr-unused.c
ttr-used.c
ttr-weak.c
itfield-layout.c
itfield-promote-int-16bit.c
itfield-promote.c
itfield.c
lock-args.c
lock-as-object.m
lock-byref-args.c
lock-call.c
lock-labels.c
lock-literal.c
lock-misc.c
lock-printf-attribute-1.c
lock-return-1.c
lock-return-2.c
lock-return-3.c
lock-return.c
lock-sentinel-attribute.c
lock-storageclass.c
uiltin-object-size.c
uiltin-prefetch.c
uiltin-stackaddress.c
uiltin-unary-fp.c
uiltins.c
89-2.c
89.c
allingconv.c
arbon.c
ast-to-union.c
ast.c
heck-increment.c
ompare.c
omplex-int.c
omplex-promotion.c
ompound-literal.c
onditional-expr.c
onditional.c
onst-eval.c
onst-ptr-int-ptr-cast.c
onstant-builtins-2.c
onstant-builtins.c
onstructor-attribute.c
onversion-64-32.c
onversion.c
arwin-align-cast.c
ecl-invalid.c
ecl-type-merging.c
eclspec.c
efault.c
efault1.c
eref.c
esignated-initializers.c
llimport-dllexport.c
num.c
xpr-address-of.c
xpr-comma-c89.c
xpr-comma.c
xprs.c
xt_vector_casts.c
xt_vector_components.c
lexible-array-init.c
loating-point-compare.c
or.c
ormat-attr-pr4470.c
ormat-attribute-printf0.c
ormat-attribute.c
ormat-string-percentm.c
ormat-strings.c
reemain.c
unction-pointer-sentinel-attribute.c
unction-ptr.c
unction-redecl.c
unction-sentinel-attr.c
unction.c
nu89.c
einous-extensions-off.c
einous-extensions-on.c
f-empty-body.c
llegal-types.c
mplicit-builtin-decl.c
mplicit-builtin-freestanding.c
mplicit-builtin-redecl.c
mplicit-cast.c
mplicit-decl.c
mplicit-def.c
mplicit-int.c
ncompatible-sign.c
ncomplete-call.c
ncomplete-decl.c
ndirect-goto.c
nit-struct-qualified.c
nit-vector.c
nit.c
nline.c
nt-arith-convert.c
nvalid-decl.c
nvalid-init-diag.c
nvalid-struct-init.c
nr-def-call.c
nr-variadic-def.c
ember-reference.c
erge-decls.c
s-fuzzy-asm.c
ested-redef.c
ffsetof.c
verloadable-complex.c
verloadable.c
arentheses.c
ointer-addition.c
ointer-conversion.c
ointer-subtract-compat.c
ragma-pack-2.c
ragma-pack-3.c
ragma-pack-4.c
ragma-pack.c
ragma-unused.c
redef.c
redefined-function.c
rivate-extern.c
romote-int-16bit.c
dar6248119.m
dr6094103-unordered-compare-promote.c
ecover-goto.c
edefinition.c
eturn-noreturn.c
eturn-silent.c
cope-check.c
elf-comparison.c
entinel-attribute.c
tatements.c
tatic-init.c
tdcall-fastcall.c
truct-cast.c
truct-compat.c
truct-decl.c
truct-packed-align.c
witch.c
entative-decls.c
ext-diag.c
hread-specifier.c
ransparent-union-pointer.c
ype-spec-struct-union.c
ypecheck-binop.c
ypedef-prototype.c
ypedef-redef.c
ypedef-retain.c
ypedef-variable-type.c
ypes.c
cn-cstring.c
nnamed-bitfield-init.c
nused-expr.c
sual-float.c
a_arg_x86_32.c
a_arg_x86_64.c
ar-redecl.c
arargs-x86-64.c
arargs.c
ariadic-block.c
ector-assign.c
ector-cast.c
ector-init.c
fprintf-invalid-redecl.c
fprintf-valid-redecl.c
la.c
oid_arg.c
arn-char-subscripts.c
arn-freestanding-complex.c
arn-unused-variables.c
0479a0b9f22331da74df4ea50bce193f9bafb145 15-Dec-2009 Nate Begeman <natebegeman@mac.com> Support OpenCL 1.1 odd-length vector component accessors.

For hi/odd of an odd-length vector, the last component is undefined. Since
we shuffle with an undef vector, no CodeGen needs to change to support this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91437 91177308-0d34-0410-b5e6-96231b3b80d8
xt_vector_components.c
edd722e38b883236c9f214d5df309110500b3529 15-Dec-2009 Mike Stump <mrs@apple.com> Add testcase for recent checkin.

Patch by Chip Davis.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91436 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-noreturn.c
01ed063edbddd72c1b3f3f7b060bf9a0766e5d09 14-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Make tests use the new clang -cc1 flag.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91303 91177308-0d34-0410-b5e6-96231b3b80d8
lock-as-object.m
dar6248119.m
23b7217c24891020e48cea9188cc6b512bdaa84d 11-Dec-2009 Mike Stump <mrs@apple.com> Testcase for recent checkin.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91080 91177308-0d34-0410-b5e6-96231b3b80d8
s-fuzzy-asm.c
c9875bfa6ffecc8d8316820e2970cf7354f610d2 10-Dec-2009 Mike Stump <mrs@apple.com> Don't complain about falling off the end of a function with an asm
block, if the function is supposed to return a value as we don't know
exactly what the asm code does.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91073 91177308-0d34-0410-b5e6-96231b3b80d8
eturn.c
842aef8d942a880eeb9535d40de31a86838264cb 09-Dec-2009 John McCall <rjmccall@apple.com> First pass at implementing C++ enum semantics: calculate (and store) an
"integer promotion" type associated with an enum decl, and use this type to
determine which type to promote to. This type obeys C++ [conv.prom]p2 and
is therefore generally signed unless the range of the enumerators forces
it to be unsigned.

Kills off a lot of false positives from -Wsign-compare in C++, addressing
rdar://7455616




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90965 91177308-0d34-0410-b5e6-96231b3b80d8
ompare.c
721e77db41cd9a07d2e1c9fdf08a4bd2eee1bc98 07-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Move RequireCompleteType requirement for fields early into ActOnField so that
subsequent code which depends on a complete type does the right thing.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90727 91177308-0d34-0410-b5e6-96231b3b80d8
ested-redef.c
02dd4b1e279114cc51422fab8b42a7759421800e 05-Dec-2009 Chris Lattner <sabre@nondot.org> fix rdar://7446395, a crash on invalid, by fixing a broken assertion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90647 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
6e132aab867c189b1c3ee7463ef9d2b1f03a294d 04-Dec-2009 John Thompson <John.Thompson.JTSoftware@gmail.com> Fix for PR5650 - Revised vector_size attribute handling to be done earlier before declaration is finalized.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90600 91177308-0d34-0410-b5e6-96231b3b80d8
ector-init.c
67f85fcdab64f36233a7211f963ed1cccffcbfb8 04-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR5447: teach Evaluate to deal with floating-point conditionals.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90521 91177308-0d34-0410-b5e6-96231b3b80d8
nit.c
9aef7263d84d9224575e113878cfbb06b8343cbf 04-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR5679: make __builtin_prefetch a bit more flexible in what it accepts
as a constant integer. Also, some minor cleanup and improvements to the
diagnostics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90504 91177308-0d34-0410-b5e6-96231b3b80d8
uiltin-prefetch.c
433dd49283e16e7f48c6697dd9bd53d201500a11 29-Nov-2009 Daniel Dunbar <daniel@zuster.org> Remove unnecessary -fblocks=0.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90070 91177308-0d34-0410-b5e6-96231b3b80d8
ltivec-init.c
xprs.c
be724bab2ba7ad47aebced25e7c8ec551eb72d28 25-Nov-2009 Douglas Gregor <dgregor@apple.com> When the condition of a switch() statement is semantically invalid,
still parse the body of the switch to try to avoid spurious
diagnostics. Fixes PR5606.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89847 91177308-0d34-0410-b5e6-96231b3b80d8
witch.c
a79f8b3989558884d9dbbbdbd4da861117345865 23-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> Fix a recent regression probably caused by addition of altivec-style
type-casts in the parser.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89691 91177308-0d34-0410-b5e6-96231b3b80d8
ast.c
11ac3f54a87b57ce74060c2cef833b4fab5ccd9e 22-Nov-2009 Edward O'Callaghan <eocallaghan@auroraux.org> Fix for PR5233.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89603 91177308-0d34-0410-b5e6-96231b3b80d8
char.c
e37f4b8e2e4fe3cbdf4a9ecd85af0bb5eaadc0b4 20-Nov-2009 Daniel Dunbar <daniel@zuster.org> Driver: Use '-target-abi' 'FOO' instead of '-target-abi=FOO'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89501 91177308-0d34-0410-b5e6-96231b3b80d8
lign-arm-apcs.c
a31100e62f83933432df9092a04e48f9e5561a14 20-Nov-2009 Daniel Dunbar <daniel@zuster.org> Pass '-mcpu' 'FOO' instead of '-mcpu=FOO'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89498 91177308-0d34-0410-b5e6-96231b3b80d8
arbon.c
53e8484581ca358c3a2ccd8ea39c136c6e85d606 19-Nov-2009 Daniel Dunbar <daniel@zuster.org> Switch -f{builtin,math-errno,rtti} and -analyzer-purge-dead to -...no... variants instead of using llvm::cl::init(true) arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89315 91177308-0d34-0410-b5e6-96231b3b80d8
nused-expr.c
947e00db0767596711f8571a5d276269043a2331 17-Nov-2009 Benjamin Kramer <benny.kra@googlemail.com> Make test header independent so it doesn't fail on freebsd. I hope this doesn't
hurt the intention of the test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89096 91177308-0d34-0410-b5e6-96231b3b80d8
char.c
8ee15dc2e2a9573b2852326650813111d7647909 17-Nov-2009 Daniel Dunbar <daniel@zuster.org> Use clang to run tests which include headers from the system.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89085 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-malloc.c
xpr-comma-c89.c
xpr-comma.c
-c-e.c
eturn.c
hift.c
char.c
23afaad895486d4a9ea672f497b63ebc4c588955 17-Nov-2009 Daniel Dunbar <daniel@zuster.org> Don't #include <stdio.h> when tests don't need it, or use clang instead of clang-cc when they do.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89070 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-format_arg.c
lock-byref-args.c
lock-storageclass.c
heck-increment.c
ormat-attr-pr4470.c
ormat-strings.c
cn-cstring.c
7f92f0362ef2cf218bc19bb83e1a97dd254b5527 16-Nov-2009 Eli Friedman <eli.friedman@gmail.com> Add constant evaluation for comma operator with floating-point operand. Fixes
PR5449.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88885 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
8406aedf4782771e520614ee379594dc0a4f7d5f 11-Nov-2009 John McCall <rjmccall@apple.com> Fix PR 5422: handle lvalue results when evaluating 'based' ptrtoints as part of
the -Wconversion check.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86891 91177308-0d34-0410-b5e6-96231b3b80d8
onversion.c
3451e9282a72f09e834486ce6f5aab803f491e97 09-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> Changed error for nested type qualifier mismatch to
warning, to match gcc. It used to be warning, so
better keep it a warning (it broke a certain project).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86597 91177308-0d34-0410-b5e6-96231b3b80d8
ointer-conversion.c
8875334f783d046afd9aa8cb7bf54390f70476e4 09-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> Test case for Sean Hunt's patch which I left out.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86573 91177308-0d34-0410-b5e6-96231b3b80d8
ointer-conversion.c
8f4c59e912f08919bd051fbca3d0dd2b90382ab3 09-Nov-2009 Eli Friedman <eli.friedman@gmail.com> Add support for cdecl attribute. (As far as I know, it doesn't affect CodeGen
unless we start implementing command-line switches which override the default
calling convention, so the effect is mostly to silence unknown attribute
warnings.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86571 91177308-0d34-0410-b5e6-96231b3b80d8
allingconv.c
a23dcce1d04354a1fa4bd0a794e60ff74521db1b 09-Nov-2009 Anders Carlsson <andersca@mac.com> Add a triple to try to fix the buildbot error.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86563 91177308-0d34-0410-b5e6-96231b3b80d8
28bitint.c
1c03ca30ae962199ef702324b48550f6af7fdc32 09-Nov-2009 Anders Carlsson <andersca@mac.com> __uint128_t is indeed an unsigned integer type. Fixes PR5435.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86561 91177308-0d34-0410-b5e6-96231b3b80d8
28bitint.c
4fcfde4d5c8f25e40720972a5543d538a0dcb220 08-Nov-2009 Daniel Dunbar <daniel@zuster.org> Eliminate &&s in tests.
- 'for i in $(find . -type f); do sed -e 's#\(RUN:.*[^ ]\) *&& *$#\1#g' $i | FileUpdate $i; done', for the curious.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86430 91177308-0d34-0410-b5e6-96231b3b80d8
R2727.c
R2728.c
ttr-malloc.c
uiltin-object-size.c
mplicit-builtin-redecl.c
mplicit-def.c
arentheses.c
ragma-pack-4.c
arargs.c
char.c
86-intrinsics-headers.c
dc767a1f560ae936a08eeead8164be6f82b6b0f7 07-Nov-2009 John McCall <rjmccall@apple.com> Support -Wshorten-64-to-32 for integer types only, which seems to satisfy the
core requirements. Fixes rdar://problem/6389954



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86364 91177308-0d34-0410-b5e6-96231b3b80d8
onversion-64-32.c
e8babd198c28bf1a443ef6a989dd2fe0ab58cc08 07-Nov-2009 John McCall <rjmccall@apple.com> Improve -Wconversion by permitting binary operations on values of the target
type (or smaller) to stay "closed" within the type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86356 91177308-0d34-0410-b5e6-96231b3b80d8
onversion.c
d5c376e4a034233a8efee81404041e33d8f0df5a 07-Nov-2009 John McCall <rjmccall@apple.com> Test case for -Wconversion.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86327 91177308-0d34-0410-b5e6-96231b3b80d8
onversion.c
48f5e63aec3f2fda7f1e75565bcbba08a9d6a14f 06-Nov-2009 John McCall <rjmccall@apple.com> compare.c also needs a target triple now, and improve some comments while we're
at it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86243 91177308-0d34-0410-b5e6-96231b3b80d8
ompare.c
5dbad3d46c43e8051dac0c3775bcbaf8f1a6b8fe 06-Nov-2009 John McCall <rjmccall@apple.com> Improve the -Wsign-compare heuristics:
* If the unsigned type is smaller than the signed type, never warn, because
its value will not change when zero-extended to the larger type.
* If we're testing for (in)equality, and the unsigned value is an integer
constant whose sign bit is not set, never warn, because even though the
signed value might change, it can't affect the result of the equality.

Also make the comparison test cases much more rigorous, and have them expose
the subtle differences between C and C++ here.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86242 91177308-0d34-0410-b5e6-96231b3b80d8
ompare.c
35de813674503b87ec5117b6492cc0a4ef7d8728 06-Nov-2009 Douglas Gregor <dgregor@apple.com> Turn off -Wsign-compare warnings by default

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86233 91177308-0d34-0410-b5e6-96231b3b80d8
ompare.c
onditional-expr.c
632d772a78db7e2cd9b36f8a22aee49d44486fbf 05-Nov-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Make ASTContext::getIntWidth return 1 for all boolean type variations, not just for the unqualified, unaliased bool.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86174 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
a6fda124bf380479529d6a80b84b62cacd3cb707 05-Nov-2009 John Thompson <John.Thompson.JTSoftware@gmail.com> Adding -fshort-wchar option.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86167 91177308-0d34-0410-b5e6-96231b3b80d8
char.c
b13c87f0c9705d91d5a3e134be9934c9ad531071 05-Nov-2009 John McCall <rjmccall@apple.com> Implement the conditional-operator part of -Wsign-compare. Turn
DiagnoseSignCompare into Sema::CheckSignCompare and call it from more places.

Add some enumerator tests. These seem to expose some oddities in the
types we're converting C++ enumerators to; in particular, they're converting
to unsigned before int, which seems to contradict 4.5 [conv.prom] p2.

Note to self: stop baiting Doug in my commit messages.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86128 91177308-0d34-0410-b5e6-96231b3b80d8
ompare.c
onditional-expr.c
45aa4557fe4210034e85f4a807ff637a9dd146d6 05-Nov-2009 John McCall <rjmccall@apple.com> Implement -Wsign-compare, or at least the actual comparison part of it.
Conditional operands are next.

Fixes part of rdar://problem/7289584.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86083 91177308-0d34-0410-b5e6-96231b3b80d8
ompare.c
9112b93829da90b1612453bea4c491a1678272a4 04-Nov-2009 John McCall <rjmccall@apple.com> Diagnose the use of 'fastcall' on functions without prototypes or with
varargs prototypes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86001 91177308-0d34-0410-b5e6-96231b3b80d8
allingconv.c
tdcall-fastcall.c
d00f200f64994858492558b54c6f6f2b3d4b4310 04-Nov-2009 John McCall <rjmccall@apple.com> Diagnose __builtin_offsetof on incomplete types. Fixes
rdar://problem/7222956



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85999 91177308-0d34-0410-b5e6-96231b3b80d8
ffsetof.c
54abf7d4fa3123b8324c09d2a4dfb789fd818403 04-Nov-2009 John McCall <rjmccall@apple.com> 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.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85998 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-deprecated.c
d8ac05753dc4506224d445ff98399c01da3136e5 03-Nov-2009 John McCall <rjmccall@apple.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85924 91177308-0d34-0410-b5e6-96231b3b80d8
ecl-invalid.c
nit.c
df7c3b955e31a6951822f2adf36e98543ef14c7e 31-Oct-2009 Douglas Gregor <dgregor@apple.com> Fix the type of __builtin_expect, from Ed Schouten!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85666 91177308-0d34-0410-b5e6-96231b3b80d8
onstant-builtins-2.c
9e6b37a9f1d499e7ca0950edacd0b6569e491d7f 30-Oct-2009 Chris Lattner <sabre@nondot.org> warn about returning the address of a label.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85576 91177308-0d34-0410-b5e6-96231b3b80d8
tatements.c
addb0f69580cd4ae7c61219e126e68ec6aa3c234 29-Oct-2009 John Thompson <John.Thompson.JTSoftware@gmail.com> Fix some Window-isms to get these tests to pass on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85450 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
eturn.c
aee3c9375f97a49edef2a36f15df6abd9748e2a1 27-Oct-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Implement Chris's suggestions for the precendence warnings. Reformat the code a bit. Test the fixits.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85231 91177308-0d34-0410-b5e6-96231b3b80d8
arentheses.c
9e1d29bb369530c15230e4c92aa67239c283ece2 26-Oct-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Implement a warning for mixing bitwise logical with comparison ops. Fixes PR5297.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85117 91177308-0d34-0410-b5e6-96231b3b80d8
arentheses.c
9e4e2d1819973db3ed328a38847eefebd97285d4 26-Oct-2009 Daniel Dunbar <daniel@zuster.org> Phrase compile time assert in standard way.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85079 91177308-0d34-0410-b5e6-96231b3b80d8
ector-init.c
7a128e84006fdabfda4b8bd04f09c2739ed7f824 25-Oct-2009 Chris Lattner <sabre@nondot.org> Fix PR5298 - -Wmissing-noreturn shouldn't warn if the function is already
declared noreturn.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85075 91177308-0d34-0410-b5e6-96231b3b80d8
eturn-noreturn.c
523382640e9b099dd64ba0875a60a9356845b068 25-Oct-2009 Chris Lattner <sabre@nondot.org> Implement rdar://6756623 - use of deprecated type in deprecated typedef should not warn


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85073 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-deprecated.c
d451f836be2d2839f6ac87181c5a52f4f6be397e 25-Oct-2009 Chris Lattner <sabre@nondot.org> When parsing a top level struct declaration, make sure to
process decl attributes instead of dropping them on the floor.
This allows us to diagnose cases like the testcase. Also don't
diagnose deprecated stuff in ActOnTag: not all uses of tags
may be 'uses', and SemaType does this now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85071 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-deprecated.c
e78ec3149097df4335d9bd6a92f9c2f5f27bac2f 22-Oct-2009 Chris Lattner <sabre@nondot.org> fix #2 :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84889 91177308-0d34-0410-b5e6-96231b3b80d8
ector-init.c
4a058ded4d75ff9a76684cc685df8ea0290752d3 22-Oct-2009 Chris Lattner <sabre@nondot.org> fix testcase, thanks Daniel.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84888 91177308-0d34-0410-b5e6-96231b3b80d8
ector-init.c
9fcfe926432f3c3f7e9a61219e55c352fd358e45 22-Oct-2009 Chris Lattner <sabre@nondot.org> fix PR5265: the size of a float3 should be rounded up to its alignment.
This ensures that arrays of float3 are correctly padded.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84833 91177308-0d34-0410-b5e6-96231b3b80d8
ector-init.c
9dc9c376a9f3e0c72f33e27075caa0647dadb350 21-Oct-2009 Douglas Gregor <dgregor@apple.com> Downgrade "function declared 'noreturn' should not return" from an
error (by default) to a warning, per C++0x [dcl.attr.noreturn]. Patch
from Sean Hunt!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84762 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-noreturn.c
0a026af6deb4a9e9f30ff047e04db56eb4333741 20-Oct-2009 Chris Lattner <sabre@nondot.org> Implement PR5242: don't desugar a type more than once in a diagnostic. This
implements a framework that allows us to use information about previously
substituted values to simplify subsequent ones. Maybe this would be useful
for C++'y stuff, who knows. We now get:

t.c:4:21: error: invalid operands to binary expression ('size_t' (aka 'unsigned long *') and 'size_t')
return (size_t) 0 + (size_t) 0;
~~~~~~~~~~ ^ ~~~~~~~~~~

on the testcase. Note that size_t is only aka'd once.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84604 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
6a2b9261bf9c973c7122d9d1febce24a38fa862d 17-Oct-2009 Chris Lattner <sabre@nondot.org> teach getCorrespondingUnsignedType how to handle vectors of integers,
fixing PR4838.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84353 91177308-0d34-0410-b5e6-96231b3b80d8
ector-assign.c
5f04881eb025f61396d0555d8173730fe2759e0a 16-Oct-2009 Chris Lattner <sabre@nondot.org> Implement PR4407 - missing warnings on case value overflow,
patch by Zhanyong Wan!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84259 91177308-0d34-0410-b5e6-96231b3b80d8
witch.c
7909fee36cb2c4737e5c74bf683913bf5ab09815 13-Oct-2009 Chris Lattner <sabre@nondot.org> add rdar # I accidentally lost.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83942 91177308-0d34-0410-b5e6-96231b3b80d8
nused-expr.c
9079cd31061b00f30c7ced7874c45e15f8dd044e 13-Oct-2009 Chris Lattner <sabre@nondot.org> merge two tests.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83941 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-warn_unused_result.c
nused-expr.c
bc8d42c6f1565c0b2f93ad524edebfd7a4e6cac6 13-Oct-2009 Chris Lattner <sabre@nondot.org> make the diagnostic in the 'unused result' warning more precise
about the reason, rdar://7186119.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83940 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-warn_unused_result.c
nused-expr.c
8c8d91917c307dc3ba4f60661377c745f2a6bef2 10-Oct-2009 Anders Carlsson <andersca@mac.com> Add CheckCallReturnType and start using it for regular call expressions. This will improve error messages. For

struct B;

B f();

void g() {
f();
}

We now get

t.cpp:6:3: error: calling 'f' with incomplete return type 'struct B'
f();
^~~
t.cpp:3:3: note: 'f' declared here
B f();
^
t.cpp:1:8: note: forward declaration of 'struct B'
struct B;
^



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83692 91177308-0d34-0410-b5e6-96231b3b80d8
ncomplete-call.c
b5352cf949898cd42c8c5bc96a17a831b61ac2e5 08-Oct-2009 Douglas Gregor <dgregor@apple.com> Implement support for -Wunused-variable, from Oscar Bonilla!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83577 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unused-variables.c
27a84d01614609c094029a49f7a86f0f7f8fe7f1 30-Sep-2009 Tanya Lattner <tonic@nondot.org> Add an error for function parameters that have a qualified address space since this is not allowed by the embedded c extension spec.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83165 91177308-0d34-0410-b5e6-96231b3b80d8
ddress_spaces.c
9a8c9a2eacd80437f18edb339a37516ab7e773cd 28-Sep-2009 Douglas Gregor <dgregor@apple.com> Provide a custom diagnostic when code tries to use an unknown builtin

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83014 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.c
50dd255e5ad05f0d44bb92f358ff3f541a3d7a4b 26-Sep-2009 Chris Lattner <sabre@nondot.org> builtin_trap should be noreturn, this fixes PR5062, patch by
Roman Divacky!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82876 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.c
e7c9645c002d2ff639f7d24f94ffe793795eabcc 26-Sep-2009 Ted Kremenek <kremenek@apple.com> Add a "positive" matching test case for attribute 'noreturn' that involves a nested infinite loop.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82842 91177308-0d34-0410-b5e6-96231b3b80d8
eturn-noreturn.c
f679a986df5514bb42e001a5afd149f839ebed03 26-Sep-2009 Ted Kremenek <kremenek@apple.com> Add two more test cases for attribute 'noreturn'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82841 91177308-0d34-0410-b5e6-96231b3b80d8
eturn-noreturn.c
0953e767ff7817f97b3ab20896b229891eeff45b 24-Sep-2009 John McCall <rjmccall@apple.com> Refactor the representation of qualifiers to bring ExtQualType out of the
Type hierarchy. Demote 'volatile' to extended-qualifier status. Audit our
use of qualifiers and fix a few places that weren't dealing with qualifiers
quite right; many more remain.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82705 91177308-0d34-0410-b5e6-96231b3b80d8
ddress_spaces.c
21fb98ee003e992b0c4e204d98a19e0ef544cae3 23-Sep-2009 Chris Lattner <sabre@nondot.org> implement support for __builtin_eh_return_data_regno on x86-32 and x86-64.
This implements PR5034 and rdar://6836445.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82614 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.c
ed5d651b0d4b99d0b68bb8d4633e49b98c95bd8f 22-Sep-2009 Douglas Gregor <dgregor@apple.com> In C++, a variadic function does not need an ellipsis prior to the comma. Parse it in both C and C++, but diagnose it as an error in C with a fix-it hint to add the comma.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82576 91177308-0d34-0410-b5e6-96231b3b80d8
unction.c
21190d54634d6e244e85d28ad915ce2fe86ecbff 21-Sep-2009 Chris Lattner <sabre@nondot.org> Implement __builtin_unreachable(), a GCC 4.5 extension.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82433 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.c
1131014a6e0302f8040531e227b550230703f613 19-Sep-2009 Daniel Dunbar <daniel@zuster.org> Attempt to make a test portable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82292 91177308-0d34-0410-b5e6-96231b3b80d8
86-intrinsics-headers.c
4bf4e3034e23cc3c177b7c6dda39b28e689e7ed6 18-Sep-2009 Anders Carlsson <andersca@mac.com> Make our char vector types not be explicitly signed to match GCC and to fix compilation with C++ and -fno-lax-vector-conversions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82254 91177308-0d34-0410-b5e6-96231b3b80d8
86-intrinsics-headers.c
9f43534277119f0aef58676ce9c35130addf4c09 17-Sep-2009 Daniel Dunbar <daniel@zuster.org> clang-cc: Remove -ObjC -ObjC++ handling from clang-cc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82103 91177308-0d34-0410-b5e6-96231b3b80d8
lock-explicit-return-type.c
29813c3509a0229947e35897a9a145c4fb3bc147 16-Sep-2009 Mike Stump <mrs@apple.com> Some people don't want to fix their broken code just yet, so turn off
hard error for falling off a noreturn function.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81971 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-noreturn.c
31fddcca28ffb7a569ee8f5d565a856827d92ada 15-Sep-2009 Anders Carlsson <andersca@mac.com> Update tests

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81802 91177308-0d34-0410-b5e6-96231b3b80d8
itfield.c
xprs.c
0f9a5b5be561c2ec42399c1b466d1f3e792de191 14-Sep-2009 Sam Weinig <sam.weinig@gmail.com> -Wchar-subscripts should not warn for explicit signed char subscripts either. Another fix for PR4978.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81780 91177308-0d34-0410-b5e6-96231b3b80d8
arn-char-subscripts.c
b0a22903c3c45065c03ce2c904802d01fd67e170 14-Sep-2009 Sam Weinig <sam.weinig@gmail.com> -Wchar-subscripts should not warn for unsigned char subscripts. Fixes PR4978.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81776 91177308-0d34-0410-b5e6-96231b3b80d8
arn-char-subscripts.c
76e2b710a92bceb9575a81db181109664946986e 14-Sep-2009 Sam Weinig <sam.weinig@gmail.com> Add support for -Wchar-subscripts. Fixes PR4801.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81747 91177308-0d34-0410-b5e6-96231b3b80d8
arn-char-subscripts.c
a2a416150455d049e8663227fbe7c30c2a948618 14-Sep-2009 Daniel Dunbar <daniel@zuster.org> ARM target tweaks.
- Change TargetData string to match llvm-gcc.
- Some -target-abi support for 'apcs-gnu', most importantly the alignment of double and long long changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81732 91177308-0d34-0410-b5e6-96231b3b80d8
lign-arm-apcs.c
1eb4433ac451dc16f4133a88af2d002ac26c58ef 09-Sep-2009 Mike Stump <mrs@apple.com> Remove tabs, and whitespace cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
ttr-deprecated.c
lock-call.c
lock-explicit-return-type.c
lock-literal.c
lock-misc.c
lock-printf-attribute-1.c
lock-return.c
lock-sentinel-attribute.c
89-2.c
89.c
omplex-int.c
onditional.c
arwin-align-cast.c
loating-point-compare.c
unction-pointer-sentinel-attribute.c
unction-sentinel-attr.c
mplicit-int.c
redefined-function.c
tatic-init.c
truct-decl.c
ransparent-union-pointer.c
4ca606e898293ae58f1793f988500e2218c7a9be 08-Sep-2009 Chris Lattner <sabre@nondot.org> reject returning a block expr even when it has parens and casts in the way.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81176 91177308-0d34-0410-b5e6-96231b3b80d8
lock-return.c
9ac6f62a77be5b281a7ddc24a16669b457ac47c2 31-Aug-2009 Eli Friedman <eli.friedman@gmail.com> PR4836, part 1: add Sema support for __builtin_isnan and friends; they
are apparently used by Solaris libc despite the fact that clang claims
to be compatible with gcc 4.2, which doesn't support them.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80610 91177308-0d34-0410-b5e6-96231b3b80d8
uiltin-unary-fp.c
cc6be895054188221f7d276f2579fc2d1e8bb224 27-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Remove unnecessary include.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80275 91177308-0d34-0410-b5e6-96231b3b80d8
ompare.c
0e88b16fe88d7419fe2b48362d38c960bc93982c 27-Aug-2009 Mike Stump <mrs@apple.com> Cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80185 91177308-0d34-0410-b5e6-96231b3b80d8
lock-literal.c
91a2886d558ea6ca7a0bed73ab5acea5ae78eac2 26-Aug-2009 Douglas Gregor <dgregor@apple.com> Fix bug in __extension__ handling for declarations, from Abramo
Bagnara with a fix from Enea Zaffanella!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80094 91177308-0d34-0410-b5e6-96231b3b80d8
mplicit-int.c
3075e760ceb73b6fafc2fb4977ad68552d83aef8 23-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Catch a few more cases of illegal comparisons.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79793 91177308-0d34-0410-b5e6-96231b3b80d8
ompare.c
06c0f5b1bb1623a93a2bc4c345fb3be52a2b22a7 23-Aug-2009 Chris Lattner <sabre@nondot.org> Eli points out that we really must diagnose "void* > 0" as an extension.
Explicitly add it as an EXTENSION instead of an EXTWARN so that it only
comes out with -pedantic. Thanks Eli!




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79791 91177308-0d34-0410-b5e6-96231b3b80d8
ompare.c
6365e3e22bcec4b95c5b1ed47d501134b375a75a 22-Aug-2009 Chris Lattner <sabre@nondot.org> tweak some pointer sema checking stuff (which was added to implement PR4175) to
avoid emitting a warning on "someptr > 0". This is obviously questionable (they
could use != instead) but is reasonable, and the warning "ordered comparison
between pointer and integer" didn't make a ton of sense because 0 is a valid
null pointer constant.

Just silence the warning in this case, it is unlikely to indicate a bug.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79743 91177308-0d34-0410-b5e6-96231b3b80d8
ompare.c
04e8357f6801e9ff52673e7e899a67bbabf9de93 20-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Fix bit-field promotion to be a bit closer to the behavior of gcc.
Patch by Enea Zaffanella, with some simplifications/corrections to
isPromotableBitField by me.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79510 91177308-0d34-0410-b5e6-96231b3b80d8
itfield-promote-int-16bit.c
itfield-promote.c
a95d75769edae299816ec7fd9bbcdf1ef617c5c9 19-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Make integer promotions work correctly on PIC16 and other platforms
where sizeof(short) == sizeof(int). Move UsualArithmeticConversionsType
out of Sema, since it was only there as a historical artifact. Patch by
Enea Zaffanella.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79412 91177308-0d34-0410-b5e6-96231b3b80d8
romote-int-16bit.c
199ea95fd5ef9a089dbf7b2ade018d4444a65177 15-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Don't perform integer promotions on the operand to a cast; this
simplifies the AST, and can matter in some rare cases involving
casts to vector types. Patch by Enea Zaffanella.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79126 91177308-0d34-0410-b5e6-96231b3b80d8
ector-cast.c
bf030d7515b3e2ddf0b3c98734fc7cb3ad819de1 15-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Make test more precise.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79074 91177308-0d34-0410-b5e6-96231b3b80d8
89-2.c
07a5c22bb6fb0674c95205ae189365bf8e1b695e 15-Aug-2009 John McCall <rjmccall@apple.com> Disable all recognition of main() in -ffreestanding. Addresses bug #4720.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79070 91177308-0d34-0410-b5e6-96231b3b80d8
reemain.c
2cff7d16fe58e6d6447ec9cad2af083beb20d6b5 15-Aug-2009 Ted Kremenek <kremenek@apple.com> Change handling of attribute 'malloc' to only accept the attribute on function
declarations (and not function pointers). This is consistent with GCC. Accepting
this attribute on function pointers means that the attribute should be treated
as a type qualifier, which apparently is not what GCC does. We obviously can
change this later should we desire to enhance the 'malloc' attribute in this
way.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79060 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-malloc.c
2733b669ae5424c4a0fff49f7361b21a730eb3df 15-Aug-2009 Ted Kremenek <kremenek@apple.com> Add more attribute 'malloc' test cases involving function pointers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79055 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-malloc.c
b109069995b44f3ef182bcd1b02ad05e9ea9d21d 15-Aug-2009 Ted Kremenek <kremenek@apple.com> Per Eli Friedman's feedback, handle attribute 'malloc' being applied to
declarations of function pointers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79053 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-malloc.c
73e10b0390e77bbc12b534c91230c494676a6ebb 12-Aug-2009 Benjamin Kramer <benny.kra@googlemail.com> Rename macro to avoid a name clash on FreeBSD.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78741 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-malloc.c
2ef13e5abef0570a9f567b4671367275c05d4d34 11-Aug-2009 Nate Begeman <natebegeman@mac.com> Take 2 on AltiVec-style vector initializers.

Fixes PR4704 problems

Addresses Eli's patch feedback re: ugly cast code

Updates all postfix operators to remove ParenListExprs. While this is awful,
no better solution (say, in the parser) is obvious to me. Better solutions
welcome.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78621 91177308-0d34-0410-b5e6-96231b3b80d8
ltivec-init.c
797c3c4f5dc4fda735e55c6b5d6270a54cf6d263 10-Aug-2009 Chris Lattner <sabre@nondot.org> fix a couple of problems with section attributes:

1. Passing something that isn't a string used to cause:
"argument to annotate attribute was not a string literal"
make it say "section attribute" instead.

2. Fix the location of the above message to point to the
bad argument instead of the section token.

3. Implement rdar://4341926, by diagnosing invalid section
specifiers in the frontend rather than letting them slip all
the way to the assembler (a QoI win).

An example of #3 is that we used to produce something like this:

/var/folders/n7/n7Yno9ihEm894640nJdSQU+++TI/-Tmp-//ccFPFGtT.s:2:Expected comma after segment-name
/var/folders/n7/n7Yno9ihEm894640nJdSQU+++TI/-Tmp-//ccFPFGtT.s:2:Rest of line ignored. 1st junk character valued 46 (.).

Daniel improved clang to use llvm_report_error, so now we got:

$ clang t.c -c
fatal error: error in backend: Global variable 'x' has an invalid section specifier 'sadf': mach-o section specifier
requires a segment and section separated by a comma.

with no loc info. Now we get:

$ clang t.c -fsyntax-only
t.c:4:30: error: argument to 'section' attribute is not valid for this target: mach-o section specifier requires a segment
and section separated by a comma
int x __attribute__((section("sadf")));
^

which is nice :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78586 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-section.c
1df5109f475bcbc528eb1fb9fdb179dcadbb33a6 10-Aug-2009 Daniel Dunbar <daniel@zuster.org> Revert r78535, it is causing a number of failures to build projects.

--- Reverse-merging r78535 into '.':
D test/Sema/altivec-init.c
U include/clang/Basic/DiagnosticSemaKinds.td
U include/clang/AST/Expr.h
U include/clang/AST/StmtNodes.def
U include/clang/Parse/Parser.h
U include/clang/Parse/Action.h
U tools/clang-cc/clang-cc.cpp
U lib/Frontend/PrintParserCallbacks.cpp
U lib/CodeGen/CGExprScalar.cpp
U lib/Sema/SemaInit.cpp
U lib/Sema/Sema.h
U lib/Sema/SemaExpr.cpp
U lib/Sema/SemaTemplateInstantiateExpr.cpp
U lib/AST/StmtProfile.cpp
U lib/AST/Expr.cpp
U lib/AST/StmtPrinter.cpp
U lib/Parse/ParseExpr.cpp
U lib/Parse/ParseExprCXX.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78551 91177308-0d34-0410-b5e6-96231b3b80d8
ltivec-init.c
fd6ad3cf9c8fc6904bd5f33212207aa69743fd45 10-Aug-2009 Ryan Flynn <pizza@parseerror.com> warn, as gcc does, if __attribute__((malloc)) applied to function returning non-pointer type

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78542 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-malloc.c
76168e289ca4b307259e3bc9b3353f03b05bb6b9 09-Aug-2009 Ryan Flynn <pizza@parseerror.com> map previously ignored __attribute((malloc)) to noalias attribute of llvm function's return

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78541 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-malloc.c
25b4fdb9d63095448e6cbc97b8865b36b0c8cbb6 09-Aug-2009 Nate Begeman <natebegeman@mac.com> AltiVec-style vector initializer syntax, vec4 a = (vec4)(a, b, c, d);

In addition to being defined by the AltiVec PIM, this is also the vector
initializer syntax used by OpenCL, so that vector literals are compatible
with macro arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78535 91177308-0d34-0410-b5e6-96231b3b80d8
ltivec-init.c
87b5fa9648b144f41cb4cda98c3e37c2851bf846 08-Aug-2009 Anders Carlsson <andersca@mac.com> Add tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78491 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-pack-4.c
8045c7393bc83060f812d0f7b1221edbc767407c 08-Aug-2009 Ryan Flynn <pizza@parseerror.com> PR4700 - remove shift by 0 warning

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78488 91177308-0d34-0410-b5e6-96231b3b80d8
hift.c
d0439688fea4dedc28125d246bbdec1f5a208660 07-Aug-2009 Ryan Flynn <pizza@parseerror.com> PR3333: warn when shifting by invalid amount

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78385 91177308-0d34-0410-b5e6-96231b3b80d8
hift.c
4403a5e1f956fa86d515492dbe7c7a2817d8780d 06-Aug-2009 Ryan Flynn <pizza@parseerror.com> add support for FreeBSD's format(printf0,x,y) attribute; allows null format string.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78276 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-attribute-printf0.c
47259d9ca7840dd66f06f5f11da7768b23d1e0fd 05-Aug-2009 Douglas Gregor <dgregor@apple.com> Fix canonical type construction for function types with the noreturn
attribute. Fixes PR4865.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78224 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-noreturn.c
7cfd8910fcdc74f4fb85531db1afd7441f430180 04-Aug-2009 Daniel Dunbar <daniel@zuster.org> Fix test case for Darwin10 (which sets ssp), and move to CodeGen/


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78049 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-weak.c
7a02a3733cdd2ca672902d869fda4ef2e3f05052 04-Aug-2009 Ted Kremenek <kremenek@apple.com> Per advice that Doug Gregor gave me several months ago, clean up the
implementation of '#pragma unused' by not constructing intermediate
DeclRefExprs, but instead do the name lookup directly. The
implementation is greatly simplified.

Along the way, degrade '#pragma unused(undeclaredvariable)' to a
warning instead of being a hard error. This implements:

<rdar://problem/6761874> [sema] allow #pragma unused to reference undefined variable (with warning)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78019 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-unused.c
8f6e88f90f8e111bdcc7eac574e8c6a3b706f5b0 04-Aug-2009 Ryan Flynn <pizza@parseerror.com> PR3679: add #pragma weak test file

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78016 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-weak.c
4dabe96fc9c5333bbcb6e36114bca95160967e26 01-Aug-2009 Daniel Dunbar <daniel@zuster.org> Ok, ok, I give in. Fix tests for unused result warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77780 91177308-0d34-0410-b5e6-96231b3b80d8
num.c
3af708ff19e4ae2bf9e40550548361b00e5916bf 01-Aug-2009 Anders Carlsson <andersca@mac.com> More warnings for unused expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77763 91177308-0d34-0410-b5e6-96231b3b80d8
nused-expr.c
754431107b61a0523df5271c2876a73dd5a051e9 31-Jul-2009 Anders Carlsson <andersca@mac.com> Diagnose unused expression results for all statements, just not compound statements.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77631 91177308-0d34-0410-b5e6-96231b3b80d8
nused-expr.c
87e5732f3307c838fff6adea8ba50147110fe092 29-Jul-2009 Mike Stump <mrs@apple.com> Be sure to turn on -fblocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77406 91177308-0d34-0410-b5e6-96231b3b80d8
eturn-noreturn.c
eturn.c
4d9d51ae3b868268082f94d84d0dff4c0b1ad435 29-Jul-2009 Mike Stump <mrs@apple.com> Add support for -Wmissing-noreturn.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77391 91177308-0d34-0410-b5e6-96231b3b80d8
eturn-noreturn.c
eturn.c
5692586ae59be8d49edd7b45dd52c1ffa920ba5e 29-Jul-2009 Mike Stump <mrs@apple.com> Add noreturn support for blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77377 91177308-0d34-0410-b5e6-96231b3b80d8
lock-return-1.c
lock-return-2.c
lock-return-3.c
fb84664349ca6f37f5ec4df440f6c362cca62470 28-Jul-2009 Chris Lattner <sabre@nondot.org> fix PR4633: cast to void should silence the 'unused expression' warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77344 91177308-0d34-0410-b5e6-96231b3b80d8
nused-expr.c
efadb7768e7c7418185f5a4010ecd8b21ca9731b 28-Jul-2009 John McCall <rjmccall@apple.com> Bounds checking for address spaces.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77303 91177308-0d34-0410-b5e6-96231b3b80d8
ddress_spaces.c
e24aea225ec87b935ede6c21c964dd47a4afb810 28-Jul-2009 Mike Stump <mrs@apple.com> Ensure we can work through typedefs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77265 91177308-0d34-0410-b5e6-96231b3b80d8
eturn.c
773db1d4b5974a1849d0214900f5006f98adea5b 27-Jul-2009 Mike Stump <mrs@apple.com> Add knowledge about _longjmp being noreturn.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77254 91177308-0d34-0410-b5e6-96231b3b80d8
eturn.c
fd350b5b4ae557d6b74899b945e77508f33149a9 27-Jul-2009 Mike Stump <mrs@apple.com> Add builtin knowledge about longjmp being noreturn. Add printing for
the noreturn attribute.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77253 91177308-0d34-0410-b5e6-96231b3b80d8
eturn.c
0feecbb3165b06ff34663a8c233316aaf7f84ce1 27-Jul-2009 Mike Stump <mrs@apple.com> Add noreturn for exit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77237 91177308-0d34-0410-b5e6-96231b3b80d8
eturn.c
22bfc7bce3de6da854b6374c6f14e12121315919 27-Jul-2009 Chris Lattner <sabre@nondot.org> add bugzilla #


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77183 91177308-0d34-0410-b5e6-96231b3b80d8
eturn.c
2d3c191e1d5545e1724ee6e0550c70eef54beff2 27-Jul-2009 Mike Stump <mrs@apple.com> Fix PR4624.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77176 91177308-0d34-0410-b5e6-96231b3b80d8
eturn.c
478fbc68b1873678edfb2a3c420749635db100e6 26-Jul-2009 Ryan Flynn <pizza@parseerror.com> PR3575 - warn on declared variable or function attributes after a definition, which are currently ignored.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77095 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-decl-after-definition.c
2455636163fdd18581d7fdae816433f886d88213 25-Jul-2009 Mike Stump <mrs@apple.com> Add noreturn as a type attribute, handle printing for them and handle
calls to noreturn function pointers when CFG building.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77089 91177308-0d34-0410-b5e6-96231b3b80d8
eturn.c
8bf0ccd4c7e23a329f150323e2f9b474ff15c66c 25-Jul-2009 Daniel Dunbar <daniel@zuster.org> Make having no RUN line a failure.

Doug, please look at decltype-crash and instantiate-function-1.mm, I'm not sure
if they are actually testing the right thing / anything.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77070 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-format_arg.c
13591ed054d1b2d6d392151ba05cbc883e640648 25-Jul-2009 John McCall <rjmccall@apple.com> Semantic checking for main().

Fix some invalid main() methods in the test suite that were nicely
exposed by the new checks.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77047 91177308-0d34-0410-b5e6-96231b3b80d8
lock-args.c
5f28a1edf6decac64ca12e51ca4a929d26fc21f2 24-Jul-2009 Mike Stump <mrs@apple.com> Implement new warning for functions declared 'noreturn' when they fall off the end.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76932 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-noreturn.c
b1682c50d26e0f12130d35b7b9b77d40542c4540 23-Jul-2009 Mike Stump <mrs@apple.com> Add warning for falling off the end of a function that should return a
value. This is on by default, and controlled by -Wreturn-type (-Wmost
-Wall). I believe there should be very few false positives, though
the most interesting case would be:

int() { bar(); }

when bar does:

bar() { while (1) ; }

Here, we assume functions return, unless they are marked with the
noreturn attribute. I can envision a fixit note for functions that
never return normally that don't have a noreturn attribute to add a
noreturn attribute.

If anyone spots other false positives, let me know!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76821 91177308-0d34-0410-b5e6-96231b3b80d8
eturn.c
d1969d803cfcc65f1c334df4cc89c7fdd33ee4c9 22-Jul-2009 Mike Stump <mrs@apple.com> Prep for new warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76709 91177308-0d34-0410-b5e6-96231b3b80d8
rg-scope-c99.c
rg-scope.c
rray-constraint.c
rray-init.c
ttr-weak.c
lock-misc.c
uiltin-prefetch.c
uiltins.c
89.c
arwin-align-cast.c
ecl-type-merging.c
einous-extensions-on.c
mplicit-int.c
edefinition.c
ype-spec-struct-union.c
a_arg_x86_64.c
ec8b59ffc30c65051070e6d6cbb8e4b419210d18 20-Jul-2009 Douglas Gregor <dgregor@apple.com> Improve GCC compatibility by allowing static tentative definitions of
incomplete type (with a warning), from Enea Zaffanella!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76451 91177308-0d34-0410-b5e6-96231b3b80d8
ncomplete-decl.c
entative-decls.c
be6d259a375bbec49659d54a302c4758058f2eef 19-Jul-2009 Chris Lattner <sabre@nondot.org> enhance the goto checker to reject jumps across __block variable definitions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76376 91177308-0d34-0410-b5e6-96231b3b80d8
lock-misc.c
f23ecd91bf0205b776dfab2c5231e895019a7400 16-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Generate error on declaration containing 'static' and '__attribute__((weak))'
Patch by Ryan Flynn


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75879 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-weak.c
dbfe99ef39163fd3574332673ee175c2bb6ef3ca 16-Jul-2009 Ted Kremenek <kremenek@apple.com> Handle some more fallout with the conversion of using PointerType for
Objective-C pointers to using ObjCObjectPointerType.

Now the checking for 'attribute ((nonnull))' in Sema doesn't emit an error when
trying to apply that attribute to a parameter that is an Objective-C pointer
(this is a regression).

To prevent this regression from occuring in the future, the 'nonnull.c' test was
moved to test/SemaObjC and renamed 'nonnull.m'. I also enhanced the tests to
show that function calls involved a NULL Objective-C pointer constant does not
trigger a warning. This is consistent with GCC, but should likely be fixed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75856 91177308-0d34-0410-b5e6-96231b3b80d8
onnull.c
9685aeef5f73c9d00829bd9dcf449500fdea3086 12-Jul-2009 Daniel Dunbar <daniel@zuster.org> Remove excessive use of Carbon.h / Cocoa.h in clang tests.
- These kinds of "shotgun" tests are very slow, and do not belong in the
regression suite. If these kinds of tests are regarded to have value, they
should be added to the LLVM test-suite.

- I would actually like to remove all of these tests, but I left Sema/carbon.c
and SemaObjC/cocoa.m...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75399 91177308-0d34-0410-b5e6-96231b3b80d8
arbon-pth.c
cb52d28946367cec72ce6225a175939e234353b5 10-Jul-2009 Eli Friedman <eli.friedman@gmail.com> Misc fixes to fix tests on OpenBSD, per email to cfe-commits. Patches
by Jonathan Gray and Krister Walfridsson.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75268 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-attr-pr4470.c
9c10fcfc3b9d2076efe701b60644a9987a93c503 08-Jul-2009 Chris Lattner <sabre@nondot.org> reimplement vector comparisons as [fi]cmp+sext instead of using v[if]cmp.
Also, enable them in sema so that they are tested, and now that the x86 backend
has stablized.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74983 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
6bec78d58b2fa73939c9cc16543c14433f004d5a 07-Jul-2009 Douglas Gregor <dgregor@apple.com> Tighten up the conditions under which we build an implicit function
declaration for a builtin.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74917 91177308-0d34-0410-b5e6-96231b3b80d8
mplicit-builtin-redecl.c
f93343764765b24f53e389c7dd35f90901925451 06-Jul-2009 Douglas Gregor <dgregor@apple.com> Fix a problem with false diagnostics when comparing distinct NULL pointer types, from David Majnemer

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74850 91177308-0d34-0410-b5e6-96231b3b80d8
ompare.c
6f4a69a3107e7ff1569c747f7c6bdf7cff8cbf55 06-Jul-2009 Douglas Gregor <dgregor@apple.com> Fix bitfield promotion in the presence of explicit casts, from Abrama Bagnara.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74830 91177308-0d34-0410-b5e6-96231b3b80d8
itfield-promote.c
149f1386c60aa07de0f6a5d43ab524b22af68059 30-Jun-2009 Chris Lattner <sabre@nondot.org> Implement PR4175, catching some questionable comparisons. Patch by
David Majnemer!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74513 91177308-0d34-0410-b5e6-96231b3b80d8
ompare.c
d966a55bccae13f34d18958877c5e71dd643a125 28-Jun-2009 Anders Carlsson <andersca@mac.com> Move the check for vprintf* functions inside of SemaCheckStringLiteral. Fixes PR4470.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74413 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-attr-pr4470.c
1bd1f6e85a011fe3129dc2898857e72741d36667 28-Jun-2009 Nate Begeman <natebegeman@mac.com> OpenCL 1.0 support:
Handle rules for ExtVector + ExtVector and ExtVector + Scalar operations.
Fix problem Eli noticed where we were allowing pointer types to be splatted to
vector elements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74404 91177308-0d34-0410-b5e6-96231b3b80d8
xt_vector_casts.c
8f031b3b14e726b093fb8693c2be4ab6d779e331 27-Jun-2009 Anders Carlsson <andersca@mac.com> Implement support for the format_arg attribute. Fixes PR4442.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74369 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-format_arg.c
e8c9e9218f215ec6089f12b076c7b9d310fd5194 26-Jun-2009 Nate Begeman <natebegeman@mac.com> OpenCL 1.0 Support:
Add support for scalar to vector and partially initialized vector constant initializers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74299 91177308-0d34-0410-b5e6-96231b3b80d8
xt_vector_components.c
58d29a41271d96509f464716f79b0ab2e815b6b1 26-Jun-2009 Nate Begeman <natebegeman@mac.com> OpenCL 1.0 support: explicit casts to ext-vector types


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74247 91177308-0d34-0410-b5e6-96231b3b80d8
xt_vector_casts.c
ector-cast.c
131f4658249b2a7d2d7e30fe07e84c484f79ef99 25-Jun-2009 Nate Begeman <natebegeman@mac.com> OpenCL 1.0 Support, patch 1/N: upper case swizzle operator and hex element index.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74202 91177308-0d34-0410-b5e6-96231b3b80d8
xt_vector_components.c
6aed766538c9d996b709354386c861037b9eedba 20-Jun-2009 Douglas Gregor <dgregor@apple.com> Add -fblocks

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73804 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unused-parameters.c
e0762c92110dfdcdd207db461a4ea17afd168f1e 20-Jun-2009 Douglas Gregor <dgregor@apple.com> Keep track of when declarations are "used" according to C and
C++. This logic is required to trigger implicit instantiation of
function templates and member functions of class templates, which will
be implemented separately.

This commit includes support for -Wunused-parameter, printing warnings
for named parameters that are not used within a function/Objective-C
method/block. Fixes <rdar://problem/6505209>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73797 91177308-0d34-0410-b5e6-96231b3b80d8
arn-unused-parameters.c
7d5c74ecbbd8719436c071f38657bc8e97ee4a24 20-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Use QualType to represent block's implicit return type as
to not lose its 'const/volatile' qualifier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73795 91177308-0d34-0410-b5e6-96231b3b80d8
lock-return.c
5bc86103767c2abcbfdd6518e0ccbbbb6aa59e0f 14-Jun-2009 Eli Friedman <eli.friedman@gmail.com> PR4351: Add constant evaluation for constructs like "foo == NULL", where
foo has a constant address.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73321 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
6b5374f837f925d99b1a76bc2fe8c98c1698df7f 13-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Allow initializing a vector with a vector in addition to allowing a list
of the elements. Issue reported on cfe-dev by Mattias Holm.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73292 91177308-0d34-0410-b5e6-96231b3b80d8
nit-vector.c
687abffee40d0459fe5eecf3e5ee6e60be69d93c 08-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Don't allow defining a block with a non-prototype type. Remove a
hack which introduces some strange inconsistencies in compatibility
for block pointers.

Note that unlike an earlier revision proposed on cfe-commits, this patch
still allows declaring block pointers without a prototype.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73041 91177308-0d34-0410-b5e6-96231b3b80d8
lock-args.c
lock-call.c
lock-misc.c
dc5a1bdd4c9290eb36e32c20729751c3c47ca61d 06-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Test changes to account for removed builtins.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73004 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.c
147bd641dd264fde2fc5a0074f30eace71016ea9 04-Jun-2009 Eli Friedman <eli.friedman@gmail.com> PR4326: Handle constant evaluation for void* pointer subtraction
correctly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72886 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
bb32e6dc801746fa3e09446f3730eb613fb59c2e 03-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Back out r72764; I should have looked more carefully before committing
this. The correct replacement for "Y" and "Yt" is "x".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72765 91177308-0d34-0410-b5e6-96231b3b80d8
sm-x86.c
a3c29e11b8354af47ec21e3f8eb459e087c6f4b8 03-Jun-2009 Eli Friedman <eli.friedman@gmail.com> PR3678: Add support for "Yt" asm register constraint.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72764 91177308-0d34-0410-b5e6-96231b3b80d8
sm-x86.c
c4db24a96d062b2d3fb1f46c28a75ed728b00030 03-Jun-2009 Eli Friedman <eli.friedman@gmail.com> PR4290: Handle vfprintf in a way that doesn't give any diagnostics for
valid declarations and doesn't give an error for autoconf-style invalid
redeclarations. This isn't quite ideal, but I don't see any other way
easy way to handle it. (The only thing I can think of that's reasonably
general is adding a new builtin type FILETy which is only compatible
with a type equivalent to FILE, and that seems like overkill.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72760 91177308-0d34-0410-b5e6-96231b3b80d8
fprintf-invalid-redecl.c
fprintf-valid-redecl.c
b92abb460be254fe577ccb95355ff7debf6a7719 02-Jun-2009 Eli Friedman <eli.friedman@gmail.com> PR4142: Add %m format string specifier.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72726 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-string-percentm.c
bc4e29f307f86ddbc2f31d9530da79ad9b0c6b7b 01-Jun-2009 Eli Friedman <eli.friedman@gmail.com> PR4287: allow a variadic prototype to make a subsequent K&R style
definition variadic. I'm not completely sure it's legal, but the
standard can be interpreted as making it legal, and gcc seems to think
it's legal, so I didn't add an extension warning.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72689 91177308-0d34-0410-b5e6-96231b3b80d8
nr-variadic-def.c
8662587fa75d3fb04f873e265841c9314c7f5523 31-May-2009 Chris Lattner <sabre@nondot.org> Downgrade an error about "return in a no-return function" from being
an error to being a warning that defaults to error. If you want this to
be a warning, you have to explicitly pass -Winvalid-noreturn to clang to
map it back to a warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72669 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-noreturn.c
bb6415c69fc6440c337970e39749d4d482d9de42 31-May-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR4285: allow intializing a const wchar_t array with a wide
string.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72663 91177308-0d34-0410-b5e6-96231b3b80d8
nit.c
e540858b289b23653bcb23646f135729203635cb 29-May-2009 Eli Friedman <eli.friedman@gmail.com> Make sure we don't give the wrong warning, and make sure not to set
hadError (suppressing future diagnostics) if we didn't print an
error.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72588 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
8718a6a02ccc53fea758677781a8df3a8b0c41c9 29-May-2009 Eli Friedman <eli.friedman@gmail.com> Revert r72575, which isn't really right, and fix up other code to
handle the construct in question correctly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72581 91177308-0d34-0410-b5e6-96231b3b80d8
la.c
4f54f4e2f1af5850805033d69c5199df068d11e7 29-May-2009 Mike Stump <mrs@apple.com> Avoid dumping during semantic analysis when checking array types when
a vla is used.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72575 91177308-0d34-0410-b5e6-96231b3b80d8
la.c
2073fd555f714e9632d70e9c5a88d140930aeadb 28-May-2009 Eli Friedman <eli.friedman@gmail.com> restrict is not a keyword in gnu89 mode. Change TokenKinds.def to
reflect that.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72500 91177308-0d34-0410-b5e6-96231b3b80d8
nu89.c
1eed60297ef4701b899c6a3b9680bf08f3403422 25-May-2009 Eli Friedman <eli.friedman@gmail.com> Extend getPreferredTypeAlign to handle _Complex double and long long
correctly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72401 91177308-0d34-0410-b5e6-96231b3b80d8
lign-x86.c
9b82ce9047dabe36c4d389400f3020badcddfa51 25-May-2009 Chris Lattner <sabre@nondot.org> merge two tests.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72392 91177308-0d34-0410-b5e6-96231b3b80d8
onnull-check.c
onnull.c
3f76ae12b90f9a911fccc3612c2d4ba79b5a8b55 25-May-2009 Chris Lattner <sabre@nondot.org> reword a warning for clarity


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72391 91177308-0d34-0410-b5e6-96231b3b80d8
onnull-check.c
55d1b6a7f7b1bece532c57cc05eb8b44812ce842 22-May-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add -fblocks for the test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72280 91177308-0d34-0410-b5e6-96231b3b80d8
onnull-check.c
6409625011e4a11ff07956ff46a44d6ca4473992 22-May-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Parse typeof-specifier the same way as sizeof/alignof are parsed.

-Makes typeof consistent with sizeof/alignof
-Fixes a bug when '>' is in a typeof expression, inside a template type param:
A<typeof(x>1)> a;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72255 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
e898f8a94947c6074d76ff83943b47d5bbdf210d 21-May-2009 Fariborz Jahanian <fjahanian@apple.com> Check on null arguments in the presense of nonnull attribute.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72219 91177308-0d34-0410-b5e6-96231b3b80d8
onnull-check.c
d66f22d9f8423579322a6dd16587ed52b0a58834 19-May-2009 Fariborz Jahanian <fjahanian@apple.com> Patch finishes off application of printf attribute on blocks.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72111 91177308-0d34-0410-b5e6-96231b3b80d8
lock-printf-attribute-1.c
c219a1579c200c62d925653336e72d9d2f6c4cb7 19-May-2009 Eli Friedman <eli.friedman@gmail.com> Remove the -arch option from clang-cc: for all practical purposes, it's
redundant with -triple.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72108 91177308-0d34-0410-b5e6-96231b3b80d8
sm.c
esignated-initializers.c
tatic-init.c
5c091bab12d2e3fc69d7580a89dd3b9520bd471c 16-May-2009 Eli Friedman <eli.friedman@gmail.com> Add stricter checking for va_arg.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71942 91177308-0d34-0410-b5e6-96231b3b80d8
a_arg_x86_32.c
88f7b576dde22ca95b4c73c4fd463e2e799873a7 16-May-2009 Eli Friedman <eli.friedman@gmail.com> PR2044: reject declarations of functions returning variably modified
types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71941 91177308-0d34-0410-b5e6-96231b3b80d8
la.c
759f25237864f3a3cc23eb01f0c0ce6edcc9342d 16-May-2009 Eli Friedman <eli.friedman@gmail.com> PR3009: Get rid of bogus warning for scalar compound literals.

This patch isn't quite ideal in that it eliminates the warning for
constructs like "int a = {1};", where the braces are in fact redundant.
However, that would have required a bunch of refactoring, and it's
much less likely to cause confusion compared to redundant nested braces.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71939 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
ompound-literal.c
3bba33d6f58844d4924ab1e221dc2ff44c521624 15-May-2009 Fariborz Jahanian <fjahanian@apple.com> improved on diagnosing misplacement of sentinel attributes.
No change in functionality.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71894 91177308-0d34-0410-b5e6-96231b3b80d8
lock-sentinel-attribute.c
9f8f17cfdd6b7d1625386ad3d7a65bc4b1307885 15-May-2009 Fariborz Jahanian <fjahanian@apple.com> added -fblocks to the test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71890 91177308-0d34-0410-b5e6-96231b3b80d8
lock-sentinel-attribute.c
daf0415583e33d5d279197c65e9227c1ed92474b 15-May-2009 Fariborz Jahanian <fjahanian@apple.com> This patch finishes off the sentinel attribute handling for
blocks and function pointers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71888 91177308-0d34-0410-b5e6-96231b3b80d8
lock-sentinel-attribute.c
unction-pointer-sentinel-attribute.c
2f7c39246a968b921a6d95c7f8037fb3429e9501 14-May-2009 Fariborz Jahanian <fjahanian@apple.com> Adds recognition of sentinel attribute on block declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71788 91177308-0d34-0410-b5e6-96231b3b80d8
entinel-attribute.c
236673e8fbd391cc7827efcaa64320344900d348 14-May-2009 Fariborz Jahanian <fjahanian@apple.com> Diagnose missing sentinel argument on a funciton call
with sentinel attribute.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71778 91177308-0d34-0410-b5e6-96231b3b80d8
unction-sentinel-attr.c
1faf5baa2f5e1adecb289679fe41c8a5080e4611 13-May-2009 Daniel Dunbar <daniel@zuster.org> Add a test case to showcase a difference in #pragma pack handling
compared to gcc. This is worrisome, but I believe we are doing the
"correct" thing, and if I recall correctly I previously verified this
versus MSVC.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71723 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-pack-3.c
42ae3e81a811362c0bf78deb71b72455aadff772 13-May-2009 Ted Kremenek <kremenek@apple.com> Fix <rdar://problem/6880975> [format string] Assertion failed: (Arg < NumArgs && "Arg access out of range!").

For format string checking, only check the type of the format
specifier for non-vararg functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71672 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
82afa2d97d39cc0d5a4897716ec0a80aeab9e14b 13-May-2009 Chris Lattner <sabre@nondot.org> Fix rdar://6880951 by rejecting vectors of vectors.
It seems dubious to me that isIntegerType() returns true for
vectors of integers, but not complex integers. This should
probably be rethought, I'll file a bugzilla.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71640 91177308-0d34-0410-b5e6-96231b3b80d8
ypes.c
8f12f65fad7bfbbdbd4234efe0d484f68c3924b6 13-May-2009 Chris Lattner <sabre@nondot.org> reject use of the GNU _Decimal32 extension with a diagnostic, not an abort.
rdar://6880104


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71639 91177308-0d34-0410-b5e6-96231b3b80d8
ypes.c
38aeec7299c48cb79523f7f89776fb258c84aeea 13-May-2009 Chris Lattner <sabre@nondot.org> Fix rdar://6880874 - [sema] crash on array types with different index sizes



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71634 91177308-0d34-0410-b5e6-96231b3b80d8
ypes.c
2db15bdd945163eacfa4623fd2e32a536ed2dd3b 13-May-2009 Chris Lattner <sabre@nondot.org> Fix rdar://6881069, a crash on a form of vector_size that we
don't support. While it would be nice to support this eventually,
this form is not common at all (just seen in gcc testsuite) and
it might be better to model vector_size as a type attribute anyway.
For now just emit a nice error on it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71633 91177308-0d34-0410-b5e6-96231b3b80d8
ector-init.c
d4b19d52416c3a04a1740ab5e766d9537c8ea00e 12-May-2009 Chris Lattner <sabre@nondot.org> improve the diagnostic for uses of the GCC "global variable in a register" extension.
This implements rdar://6880449 - improve diagnostic for usage of "global register variable" GCC extension



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71599 91177308-0d34-0410-b5e6-96231b3b80d8
ecl-invalid.c
e7ac0a94f1dee3fae9292eb8372962b6d70b3e0d 08-May-2009 Chris Lattner <sabre@nondot.org> Fix the atomics sema code to convert operands to the argument types
of the underlying _N builtin, not the the type of the pointee of the
actual type. This ensures that atomics involving pointers end up
using the correct integer type when they are resolved, avoiding
aborts in codegen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71218 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.c
5caa370ea6f70bd3e7e4a9cc3b69ac1a849c8534 08-May-2009 Chris Lattner <sabre@nondot.org> reimplement __sync_* builtins to be variadic and to follow the same
semantic rules that gcc and icc use. This implements the variadic
and concrete versions as builtins and has sema do the
disambiguation. There are probably a bunch of details to finish up
but this seems like a large monotonic step forward :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71212 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.c
7bc8d964405ce3b0b95091cdb66a391e50275b3c 07-May-2009 Mike Stump <mrs@apple.com> Allow qualifiers on blocks. Radar 6441502


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71183 91177308-0d34-0410-b5e6-96231b3b80d8
lock-misc.c
af199f32b008191341f248d7d50616a6a71ba354 07-May-2009 Mike Stump <mrs@apple.com> Tighten up relationals with blocks and ints. Radar 6441502


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71171 91177308-0d34-0410-b5e6-96231b3b80d8
lock-misc.c
dd3e1664b5a0996115ef141ad2396168b3a1d288 07-May-2009 Mike Stump <mrs@apple.com> Improve semantic checking for blocks. Radar 6441502


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71145 91177308-0d34-0410-b5e6-96231b3b80d8
lock-misc.c
868bd0aa9281929ef50d2e9a8c82a036906f53f5 06-May-2009 Daniel Dunbar <daniel@zuster.org> Improve handling of (X86) target features.
- This is a WIP...

- This adds -march= handling to the driver, and fixes the defaulting
of -mcpu on Darwin (which was using the wrong test).

Instead of handling -m{sse, ...} in the driver, pass them to clang-cc as
-target-feature [+-]name

In clang-cc, communicate with the (clang) target to discover the legal
features of a target, and the features which are enabled based on
-mcpu. This is currently hardcoded just enough to not be a feature
regression, we need to get this information from the backend's
TableGen information somehow.

This is used to construct the full list of features which are being
used, which is in turn used to initialize the predefines.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71061 91177308-0d34-0410-b5e6-96231b3b80d8
arbon-pth.c
arbon.c
53202857c60214d80950a975e6e52aebf30bd16a 04-May-2009 Eli Friedman <eli.friedman@gmail.com> PR2524: downgrade taking address of expression of type 'void' to an
extension warning.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70805 91177308-0d34-0410-b5e6-96231b3b80d8
eref.c
arargs.c
f69fcaeb3843297757251a19f0a6f5bbffed7f32 03-May-2009 Chris Lattner <sabre@nondot.org> If we have mismatched integer tied operands, but the operand
number is not mentioned in the asm string, let it past sema.
Right now these are currently rejected by the llvm code generator
but this will be fixed next.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70670 91177308-0d34-0410-b5e6-96231b3b80d8
sm.c
33bbbc5ec8269bc2cde5b84f970fa49319a30267 02-May-2009 Douglas Gregor <dgregor@apple.com> When determining whether an expression refers to a bit-field, look
into the left-hand side of an assignment expression. This completes
most of PR3500; the only remaining part is to deal with the
GCC-specific implementation-defined behavior for "unsigned long" (and
other) bit-fields.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70623 91177308-0d34-0410-b5e6-96231b3b80d8
itfield.c
2d833e349029ba73d4a101831371515a25dbda60 02-May-2009 Douglas Gregor <dgregor@apple.com> Fix bitfield promotions in several more cases. We don't seem to work hard enough at determining whether an expression is a bitfield or not, yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70613 91177308-0d34-0410-b5e6-96231b3b80d8
itfield.c
c975bb04da88323fded43e71ff1839e8640fe878 02-May-2009 Mike Stump <mrs@apple.com> Add Sema checking for __block on vm declarations. Radar 6441502


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70601 91177308-0d34-0410-b5e6-96231b3b80d8
lock-misc.c
fc24e44bea29dcaabd9cf2c7663fe1c1286d90c1 01-May-2009 Douglas Gregor <dgregor@apple.com> Implement bit-field promotion rules for C99. Fixes PR3500.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70571 91177308-0d34-0410-b5e6-96231b3b80d8
itfield.c
41826bb59d2ef5e8c8a4a0cd2b06a7a011b67b4d 01-May-2009 Eli Friedman <eli.friedman@gmail.com> PR4013 and PR4105: pointer-like types can only be cast to/from integers
and other pointer-like types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70531 91177308-0d34-0410-b5e6-96231b3b80d8
ast.c
tatic-init.c
940ab971c580ca03da2e68ec92b9c0f7acfe6988 30-Apr-2009 Steve Naroff <snaroff@apple.com> Name the "return-type" DiagGroup and reference it in a few places.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70500 91177308-0d34-0410-b5e6-96231b3b80d8
eturn-silent.c
eturn.c
18857644059c45da6776f1a288eec7b4cf3a844a 30-Apr-2009 Douglas Gregor <dgregor@apple.com> Properly compute the alignment of typedefs that make use of the
"aligned" attribute. Previously, we were skipping over these
attributes when we jumped directly to the canonical type. Now,
ASTContext::getTypeInfo walks through typedefs and other
"non-canonical" types manually, looking for "aligned" attributes on
typedefs.

As part of this change, I moved the GNU-specific logic (such as
determining the alignment of void or of a function pointer) out of the
expression evaluator and into ASTContext::getTypeInfo.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70497 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-aligned.c
2c0ccd045514ae4dc951fb45b7c29216ba109bf7 30-Apr-2009 Steve Naroff <snaroff@apple.com> Warn about invalid return statements by default.

This fixes <rdar://problem/6839489> 10A345: Clang does not warm about mismatched returns (void return from a bool function)

Will implement -Wreturn-type, -Wno-return-type in another commit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70492 91177308-0d34-0410-b5e6-96231b3b80d8
eturn.c
4d150c84514dbf15975960a3ea46bdf6b7f16a5b 30-Apr-2009 Chris Lattner <sabre@nondot.org> only support int128_t on 64-bit and larger targets. 32-bit targets don't
have support for __divti3 and friends.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70480 91177308-0d34-0410-b5e6-96231b3b80d8
ypes.c
2df9ced9fd1e8c7d7b38443db07e0e811de22571 30-Apr-2009 Chris Lattner <sabre@nondot.org> initial support for __[u]int128_t, which should be basically
compatible with VC++ and GCC. The codegen/mangling angle hasn't
been fully ironed out yet. Note that we accept int128_t even in
32-bit mode, unlike gcc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70464 91177308-0d34-0410-b5e6-96231b3b80d8
ypes.c
ea000bf621552252e41fc870346e7048646709dc 30-Apr-2009 Mike Stump <mrs@apple.com> Sema checking for incorrect placement of __block. Radar 6441502


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70452 91177308-0d34-0410-b5e6-96231b3b80d8
lock-misc.c
0c74e8a4e8865ec9ebb8efc0af247a3c077236c4 30-Apr-2009 Douglas Gregor <dgregor@apple.com> Implement semantic analysis for transparent unions. This is largely
based on a patch from Anders Johnsen. CodeGen support is incomplete,
in that we do not properly coerce to the first field's type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70419 91177308-0d34-0410-b5e6-96231b3b80d8
ransparent-union.c
6c92fa75e62937f9738696840efcb258560f4568 29-Apr-2009 Mike Stump <mrs@apple.com> Fixup Sema and CodeGen for block literal attributes when the return
type and argument types are missing, and let return type deduction
happen before we give errors for returning from a noreturn block.
Radar 6441502


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70413 91177308-0d34-0410-b5e6-96231b3b80d8
lock-return.c
19c30c00e5e01e4608a43c7deb504f343f09e46d 29-Apr-2009 Mike Stump <mrs@apple.com> Sema and CodeGen support for attributes on blocks. Radar 6441502


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70403 91177308-0d34-0410-b5e6-96231b3b80d8
lock-return.c
65e6a093b1aeeab919025ff979a9f874cdffa628 29-Apr-2009 Chris Lattner <sabre@nondot.org> Fix PR4092 by improving error recovery in two ways:
1. In a struct field redefinition, don't mark the struct erroneous. The
field is erroneous, but the struct is otherwise well formed.
2. Don't emit diagnostics about functions that are known to be broken already.

Either fix is sufficient to silence the second diagnostic in the example,
but the combination is better :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70371 91177308-0d34-0410-b5e6-96231b3b80d8
truct-decl.c
655f141f4d4c92eeebcc880211313e84c0a8b2f2 29-Apr-2009 Chris Lattner <sabre@nondot.org> implement -Wformat-security properly, which is enabled by default.
This enables one specific class of non-literal format warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70368 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
be8434a0cc0355f652d59553f8aaa3c88bfe3c94 29-Apr-2009 Chris Lattner <sabre@nondot.org> tweak warning options to be more like gcc:

1. All all variants of -Wformat*, make them imply -Wformat. GCC warns
if you use -Wformatfoo without -Wformat. We just make one imply the
other.
2. Make -Wformat-nonliteral default to off, like gcc. It is an incredible
nuisance.
3. Accept but currently ignore -Wformat-extra-args.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70362 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
f7c41dab1a8de29b0991e853b8822bb0d1ddc01c 29-Apr-2009 Mike Stump <mrs@apple.com> Implement sema checking for noreturn.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70353 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-noreturn.c
ad02d7debd03ff275ac8ea27891a4ecccdb78068 28-Apr-2009 Eli Friedman <eli.friedman@gmail.com> PR4097: add logic to Evaluate to handle pointer equality comparisons.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70317 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
9895d88c34cb2eab65c622cddeaf721108d1af38 28-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Fix a minor edge case in C89 mode related to the definition of a
"function designator".

(This causes a minor glitch in the
diagnostics for C++ member pointers, but we weren't printing the
right diagnostic there anyway.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70307 91177308-0d34-0410-b5e6-96231b3b80d8
89.c
eb32fde032a250091134db56a3aeaea6b09f6594 28-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Simplify the scheme used for keywords, and change the classification
scheme to be more useful.

The new scheme introduces a set of categories that should be more
readable, and also reflects what we want to consider as an extension
more accurately. Specifically, it makes the "what is a keyword"
determination accurately reflect whether the keyword is a GNU or
Microsoft extension.

I also introduced separate flags for keyword aliases; this is useful
because the classification of the aliases is mostly unrelated to the
classification of the original keyword.

This patch treats anything that's in the implementation
namespace (prefixed with "__", or "_X" where "X" is any upper-case
letter) as a keyword without marking it as an extension. This is
consistent with the standards in that an implementation is allowed to define
arbitrary extensions in the implementation namespace without violating
the standard. This gets rid of all the nasty "extension used" warnings
for stuff like __attribute__ in -pedantic mode. We still warn for
extensions outside of the the implementation namespace, like typeof.
If someone wants to implement -Wextensions or something like that, we
could add additional information to the keyword table.

This also removes processing for the unused "Boolean" language option;
such an extension isn't supported on any other C implementation, so I
don't see any point to adding it.

The changes to test/CodeGen/inline.c are required because previously, we
weren't actually disabling the "inline" keyword in -std=c89 mode.

I'll remove Boolean and NoExtensions from LangOptions in a follow-up
commit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70281 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.c
onstant-builtins.c
xprs.c
unction.c
-c-e.c
4eeab84b6527feba5c63b819a74417677c9977a0 28-Apr-2009 Mike Stump <mrs@apple.com> Don't allow blocks to be declared as returning an array. Radar 6441502


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70277 91177308-0d34-0410-b5e6-96231b3b80d8
lock-return.c
f91f5c8a66ffd812f61819836529f8ad437f7e2b 26-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Add a bit more handling for declarations like "int a[*]".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70162 91177308-0d34-0410-b5e6-96231b3b80d8
la.c
e93569666e330ca66ed4b3f58d2c15f3d9b24cd1 26-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR4079: make sure to construct the member expressions for
offsetof correctly in the presence of anonymous structs/unions.

This could definitely use some cleanup, but I don't really want to mess
with the anonymous union/struct code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70156 91177308-0d34-0410-b5e6-96231b3b80d8
ffsetof.c
49ac88166d36f8c436780694f2ce955acde87c6a 26-Apr-2009 Chris Lattner <sabre@nondot.org> implement PR4077: [Linux kernel] inscrutable error on inline asm input/output constraint mismatch
Before we emitted:

$ clang t.c -S -m64
llvm: error: Unsupported asm: input constraint with a matching output constraint of incompatible type!

Now we produce:
$ clang t.c -S -m64
t.c:5:40: error: unsupported inline asm: input with type 'unsigned long' matching output with type 'int'
asm volatile("foo " : "=a" (a) :"0" (b));
~~~ ~^~



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70142 91177308-0d34-0410-b5e6-96231b3b80d8
sm.c
d5e3e8ec50d6ea481b3bc841dcbe853175d05122 26-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Correct the order of the parameters to CheckAssignmentConstraints in
cleanup attribute checking. The difference isn't normally visible, but it
can make a difference...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70104 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-cleanup.c
7c32f8e9be486f8f8ec2e75eba36903f7cb1b73a 26-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR4074: allow subscripting non-lvalue arrays in C90 mode.

I wasn't originally going to use this approach, but cases like
test/Sema/expr-comma.c make things difficult.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70096 91177308-0d34-0410-b5e6-96231b3b80d8
89.c
09de1767990d4828bcaf0dd22033a5dddeecbe08 26-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Change isNullPointerConstant to be strict; hopefully this won't cause
any issues now that we have our own tgmath.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70090 91177308-0d34-0410-b5e6-96231b3b80d8
-c-e.c
3b5cccad43000e2c0bae52e6ec992a9fa1900266 26-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Make VerifyIntegerConstantExpr print extension warnings for non-ICEs.

Overall, I'm not particularly happy with the current situation regarding
constant expression diagnostics, but I plan to improve it at some point.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70089 91177308-0d34-0410-b5e6-96231b3b80d8
R2963-enum-constant.c
3bf6893b77c30cb774100e0fa7ae029331675ec1 25-Apr-2009 Chris Lattner <sabre@nondot.org> fix PR4073 by making designated initializer checking code use
VerifyIntegerConstantExpression instead of isIntegerConstantExpr.
This makes it ext-warn but tolerate things that fold to a constant
but that are not valid i-c-e's.

There must be a bug in the i-c-e computation though, because it
doesn't catch this case even with pedantic.

This also switches the later code to use EvaluateAsInt which is
simpler and handles everything that evaluate does.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70081 91177308-0d34-0410-b5e6-96231b3b80d8
esignated-initializers.c
740782a78386ad3c64c670ba9b1619545bbb4901 25-Apr-2009 Chris Lattner <sabre@nondot.org> improve a diagnostic to make more sense.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70062 91177308-0d34-0410-b5e6-96231b3b80d8
truct-decl.c
5153ee66d6d4fb37b02f85df38e48dc8b46660df 25-Apr-2009 Chris Lattner <sabre@nondot.org> Change SemaType's "GetTypeForDeclarator" and "ConvertDeclSpecToType" to
always return a non-null QualType + error bit. This fixes a bunch of
cases that didn't check for null result (and could thus crash) and eliminates
some crappy code scattered throughout sema.

This also improves the diagnostics in the recursive struct case to eliminate
a bogus second error. It also cleans up the case added to function.c by forming
a proper function type even though the declarator is erroneous, allowing the
parameter to be added to the function. Before:

t.c:2:1: error: unknown type name 'unknown_type'
unknown_type f(void*P)
^
t.c:4:3: error: use of undeclared identifier 'P'
P+1;
^

After:
t.c:2:1: error: unknown type name 'unknown_type'
unknown_type f(void*P)
^



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70023 91177308-0d34-0410-b5e6-96231b3b80d8
unction.c
ested-redef.c
eaaebc7cf10dc1a2016183a262ad3256bc468759 25-Apr-2009 Chris Lattner <sabre@nondot.org> This is a pretty big cleanup for how invalid decl/type are handle.
This gets rid of a bunch of random InvalidDecl bools in sema, changing
us to use the following approach:

1. When analyzing a declspec or declarator, if an error is found, we
set a bit in Declarator saying that it is invalid.
2. Once the Decl is created by sema, we immediately set the isInvalid
bit on it from what is in the declarator. From this point on, sema
consistently looks at and sets the bit on the decl.

This gives a very clear separation of concerns and simplifies a bunch
of code. In addition to this, this patch makes these changes:

1. it renames DeclSpec::getInvalidType() -> isInvalidType().
2. various "merge" functions no longer return bools: they just set the
invalid bit on the dest decl if invalid.
3. The ActOnTypedefDeclarator/ActOnFunctionDeclarator/ActOnVariableDeclarator
methods now set invalid on the decl returned instead of returning an
invalid bit byref.
4. In SemaType, refering to a typedef that was invalid now propagates the
bit into the resultant type. Stuff declared with the invalid typedef
will now be marked invalid.
5. Various methods like CheckVariableDeclaration now return void and set the
invalid bit on the decl they check.


There are a few minor changes to tests with this, but the only major bad
result is test/SemaCXX/constructor-recovery.cpp. I'll take a look at this
next.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70020 91177308-0d34-0410-b5e6-96231b3b80d8
nvalid-decl.c
entative-decls.c
2dbd285f5033ca6dea25babfd1c43d9fec35e7e5 25-Apr-2009 Chris Lattner <sabre@nondot.org> fix PR4049, a crash on invalid, by making sema install the right number of
parameters in a functiondecl, even if the decl is invalid and has a confusing
Declarator. On the testcase, we now emit one beautiful diagnostic:

t.c:2:1: error: unknown type name 'unknown_type'
unknown_type f(void*)
^

GCC 4.0 produces:

t.c:2: error: syntax error before ‘f’
t.c: In function ‘f’:
t.c:2: error: parameter name omitted

and GCC 4.2:

t.c:2: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘f’



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70016 91177308-0d34-0410-b5e6-96231b3b80d8
unction.c
7cbeef278d6206941630ea14585ea80f44d68d69 25-Apr-2009 Chris Lattner <sabre@nondot.org> in:
typedef void foo(void);

We get a typedef for a functiontypeproto with no arguments, not
one with one argument and type void. This means the code being
removed in SemaDecl is dead.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70013 91177308-0d34-0410-b5e6-96231b3b80d8
unction.c
1725f683432715e5afe34d476024bd6f16eac3fc 22-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Add handling for complex->int, int->complex float, and float->complex
int. Note that constant int->complex float and float->complex int casts
were being miscompiled.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69821 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
3f84ad22acc25353a47ee88f55ab05dffef5d9a9 22-Apr-2009 Chris Lattner <sabre@nondot.org> change implicit int warnings to point to the identifier, not the
start of the declspec. The fixit still goes there, and we underline
the declspec. This helps when the start of the declspec came from a
macro that expanded from a system header. For example, we now produce:

t.c:2:8: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
static x;
~~~~~~ ^



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69777 91177308-0d34-0410-b5e6-96231b3b80d8
lock-literal.c
mplicit-int.c
3936024941229e235aed7f53949a117a54eebf68 22-Apr-2009 Chris Lattner <sabre@nondot.org> Fix rdar://6814950 - stdint.h isn't "-pedantic -std=c89" clean,
by marking the predefines buffer as a system header. The problem
with stdint is that it was getting problems like this:

/Volumes/Projects/cvs/llvm/Debug/lib/clang/1.0/include/stdint.h:43:9: warning: 'long long' is an extension when C99 mode is not enabled
typedef __INT64_TYPE__ int64_t;
^
<built-in>:73:29: note: instantiated from:
#define __INT64_TYPE__ long long
^

We correctly silence warnings in system headers, but only if the
spelling location of the token came from the system header. This is
designed so that if you use a system macro in your code that you don't
get punished for its definition. This is all cool except that the
predefines buffer wasn't considered a system header.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69770 91177308-0d34-0410-b5e6-96231b3b80d8
lock-literal.c
d55a71d852d4d8b785122b8d033a0c06b187067b 22-Apr-2009 Chris Lattner <sabre@nondot.org> Fix some mishandling of the attr(gnu_inline) mode when used with
extern. Previously we would warn about it and ignore the attribute.
This is incorrect, it should be handled as a c89 "extern inline"
function. Many thanks to Matthieu Castet for pointing this out and
beating me over the head until I got it.

PR3988: extern inline function are not externally visible




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69756 91177308-0d34-0410-b5e6-96231b3b80d8
unction.c
914d3db20eb3126175f19901fadbbd7b268a3667 22-Apr-2009 Mike Stump <mrs@apple.com> Resolve merge conflict better.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69748 91177308-0d34-0410-b5e6-96231b3b80d8
lock-misc.c
25efa107ae8381458ffa464c5fc7d21135bbe52d 22-Apr-2009 Mike Stump <mrs@apple.com> Tighten up blocks type checking. This was discussed back in the
r56595 timeframe, but left undone. Radar 6812711


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69745 91177308-0d34-0410-b5e6-96231b3b80d8
lock-call.c
lock-misc.c
lock-return.c
5c59e2b5215eff79372b9498c3559da9d700588d 22-Apr-2009 Chris Lattner <sabre@nondot.org> Fix rdar://6814047, a crash on invalid in blocks code I noticed when
working on the previous fix.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69742 91177308-0d34-0410-b5e6-96231b3b80d8
lock-misc.c
17f3a6d0d8026238830eacd0d765267a6ced4edc 22-Apr-2009 Chris Lattner <sabre@nondot.org> fix marking of nested blocks with the "hasBlockDeclRefExprs" to
mark exactly the blocks which have references that are "live through".
This fixes a rejects valid:
rdar://6808730 - [sema] [blocks] block rejected at global scope


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69738 91177308-0d34-0410-b5e6-96231b3b80d8
lock-misc.c
b6c8c8bd8d362c8a6cdb767415b0d21e62b77eb2 21-Apr-2009 Douglas Gregor <dgregor@apple.com> Explictly track tentative definitions within Sema, then hand those
tentative definitions off to the ASTConsumer at the end of the
translation unit.

Eliminate CodeGen's internal tracking of tentative definitions, and
instead hook into ASTConsumer::CompleteTentativeDefinition. Also,
tweak the definition-deferal logic for C++, where there are no
tentative definitions.

Fixes <rdar://problem/6808352>, and will make it much easier for
precompiled headers to cope with tentative definitions in the future.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69681 91177308-0d34-0410-b5e6-96231b3b80d8
nit.c
entative-decls.c
81045d8dcd967def69d8e0945566214a9fe9ffcc 21-Apr-2009 Chris Lattner <sabre@nondot.org> Fix PR4027 + rdar://6808859, we were rejecting implicit casts of
aggregates even though we already accept explicit ones. Easy fix.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69661 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
cf2a7211b4785068c7efa836baab90b198a4d2a6 20-Apr-2009 Chris Lattner <sabre@nondot.org> the __gnuc_inline__ attribute is actually named __gnu_inline__,
PR4023


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69618 91177308-0d34-0410-b5e6-96231b3b80d8
unction.c
df9bcd568c79779d92b2f8d04a24ca822c56523d 20-Apr-2009 Chris Lattner <sabre@nondot.org> clean up anonymous bitfield diagnostics, PR4017


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69608 91177308-0d34-0410-b5e6-96231b3b80d8
itfield.c
23d58ce9d103115fec4693285d0bcdbaccefea0f 20-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Some cleanup and bug-fixing for address-of checking. This causes a couple of
minor accepts-invalid regressions, but we weren't really rejecting them for
the right reason. We really need a more general solution to detect all the
cases of the promotion of arrays with a register storage class.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69586 91177308-0d34-0410-b5e6-96231b3b80d8
xpr-address-of.c
4fb71b0cc3c199cc0c736b4ec4fabdd01f56f4e8 19-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Print an error for uses of __thread on targets which don't support it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69553 91177308-0d34-0410-b5e6-96231b3b80d8
hread-specifier.c
f22f77f4e9149499a987e2363a0be01d0bc2d426 19-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Tests for __thread specifier.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69543 91177308-0d34-0410-b5e6-96231b3b80d8
hread-specifier.c
17a783055a41a44fda76b1747ebe6fd8ac2ba00a 19-Apr-2009 Chris Lattner <sabre@nondot.org> run the jump checker on blocks, even though they don't have gotos,
they do allow switches.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69510 91177308-0d34-0410-b5e6-96231b3b80d8
cope-check.c
38c5ebd7b1b65304c7b5c7b9bf3f9162df22e77d 19-Apr-2009 Chris Lattner <sabre@nondot.org> add a new Sema::CurFunctionNeedsScopeChecking bool that is used to avoid
calling into the jump checker when a function or method is known to contain
no VLAs or @try blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69509 91177308-0d34-0410-b5e6-96231b3b80d8
cope-check.c
deae3a735d92b999bfc3b43f2bbe75a6c5b9a1a1 19-Apr-2009 Chris Lattner <sabre@nondot.org> apparently gotos aren't allowed at all in blocks. Stub out a testcase for when/if they are.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69507 91177308-0d34-0410-b5e6-96231b3b80d8
cope-check.c
3037a822388348eb16f462c2c8aee77b2fdc286c 19-Apr-2009 Chris Lattner <sabre@nondot.org> more testcases of variably modified types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69506 91177308-0d34-0410-b5e6-96231b3b80d8
cope-check.c
b5cf1ea6f410f72290b9c7767a63717a944c7a8f 19-Apr-2009 Chris Lattner <sabre@nondot.org> second half of indirect jump checking: make sure that any
address taken labels are in function scope


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69499 91177308-0d34-0410-b5e6-96231b3b80d8
cope-check.c
04ea2b633a1f8ee662b8a99d2903a11c1b68e1ed 19-Apr-2009 Chris Lattner <sabre@nondot.org> First half of jump scope checking for indirect goto.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69498 91177308-0d34-0410-b5e6-96231b3b80d8
cope-check.c
c78476b711902757f3600d75b180e8fe299c3f33 19-Apr-2009 Chris Lattner <sabre@nondot.org> add some testcases that we do not correctly handle.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69492 91177308-0d34-0410-b5e6-96231b3b80d8
cope-check.c
2b7b2ca64ad8d293d10909a7ac119fa3fc10c95c 19-Apr-2009 Chris Lattner <sabre@nondot.org> reimplement DeclStmt handling so that we correctly handle intermixed
VLA's and statement expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69491 91177308-0d34-0410-b5e6-96231b3b80d8
cope-check.c
5b40e0cebcb883540ec3005c47a960107e65f375 19-Apr-2009 Chris Lattner <sabre@nondot.org> rearrange.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69490 91177308-0d34-0410-b5e6-96231b3b80d8
cope-check.c
35562d18ea134f88ec09f12626f403a28adb4306 19-Apr-2009 Chris Lattner <sabre@nondot.org> add testcases for some more scary/horrible things that work.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69488 91177308-0d34-0410-b5e6-96231b3b80d8
cope-check.c
b56593725243becfe2685f39eec47406299801ae 18-Apr-2009 Chris Lattner <sabre@nondot.org> unconditionally check for goto correctness. This is because switch
statements don't end up in the LabelMap so we don't have a quick way
to filter them. We could add state to Sema (a "has vla" and "has
jump" bit) to try to filter this out, but that would be sort of gross
and I'm not convinced it is the best way. Thoughts welcome.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69476 91177308-0d34-0410-b5e6-96231b3b80d8
cope-check.c
ede6e470c0cd6decd5151a32b77220aa43f70b4f 18-Apr-2009 Chris Lattner <sabre@nondot.org> merge two tests.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69466 91177308-0d34-0410-b5e6-96231b3b80d8
lock-misc.c
lock-syntax-error.c
bcfce66584e47bb07f49a86b7cb39b4fdd269a5a 18-Apr-2009 Chris Lattner <sabre@nondot.org> abstract the SwitchStack for blocks just like we do the goto labels.
This fixes a crash on invalid (test10). rdar://6805469


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69465 91177308-0d34-0410-b5e6-96231b3b80d8
lock-misc.c
a9768b72bb5ea061c9f10d6aa51b3be3241f3ec2 18-Apr-2009 Chris Lattner <sabre@nondot.org> Improve switch diagnostic to emit the "jump" message on the
specific bad case instead of on the switch. Putting it on the
switch means you don't know what case is the problem. For
example:

scope-check.c:54:3: error: illegal switch case into protected scope
case 2:
^
scope-check.c:53:9: note: jump bypasses initialization of variable length array
int a[x];
^




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69462 91177308-0d34-0410-b5e6-96231b3b80d8
cope-check.c
366920a45e3e278d35cbc3bc74d9d0676ae87dfe 18-Apr-2009 Chris Lattner <sabre@nondot.org> first step to getting switches giving "jump into vla scope" errors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69461 91177308-0d34-0410-b5e6-96231b3b80d8
cope-check.c
5718a351b3da578366ec6f07670ca33b7d9726a3 18-Apr-2009 Chris Lattner <sabre@nondot.org> add some block goto test cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69460 91177308-0d34-0410-b5e6-96231b3b80d8
lock-misc.c
5ce71c99cf00f24f876548d7f0dd0eefac47b168 18-Apr-2009 Chris Lattner <sabre@nondot.org> improve wording of scope violation error messages.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69456 91177308-0d34-0410-b5e6-96231b3b80d8
cope-check.c
a5251fcf79ae9707680d656377a6e43dcbff6c25 18-Apr-2009 Chris Lattner <sabre@nondot.org> rewrite the goto scope checking code to be more efficient, simpler,
produce better diagnostics, and be more correct in ObjC cases (fixing
rdar://6803963).

An example is that we now diagnose:

int test1(int x) {
goto L;
int a[x];
int b[x];
L:
return sizeof a;
}

with:

scope-check.c:15:3: error: illegal goto into protected scope
goto L;
^
scope-check.c:17:7: note: scope created by variable length array
int b[x];
^
scope-check.c:16:7: note: scope created by variable length array
int a[x];
^

instead of just saying "invalid jump". An ObjC example is:

void test1() {
goto L;
@try {
L: ;
} @finally {
}
}

t.m:6:3: error: illegal goto into protected scope
goto L;
^
t.m:7:3: note: scope created by @try block
@try {
^

There are a whole ton of fixme's for stuff to do, but I believe that this
is a monotonic improvement over what we had.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69437 91177308-0d34-0410-b5e6-96231b3b80d8
cope-check.c
fd0c0cf85738a664e32f24f56972b3aca2419338 18-Apr-2009 Chris Lattner <sabre@nondot.org> add another testcase


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69432 91177308-0d34-0410-b5e6-96231b3b80d8
cope-check.c
40c56f7129bdaf8a01e2ffe7ddde714a586eb45d 18-Apr-2009 Chris Lattner <sabre@nondot.org> __builtin_prefetch should be declared as "void __builtin_prefetch(const void *)",
not "const void __builtin_prefetch(void *)". This fixes PR3912.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69425 91177308-0d34-0410-b5e6-96231b3b80d8
tatements.c
885b6d8dbe5e5b3a39ea2ac7383c584f297ae03c 18-Apr-2009 Chris Lattner <sabre@nondot.org> rename test


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69424 91177308-0d34-0410-b5e6-96231b3b80d8
tatements.c
tmt_exprs.c
32b06752d05630996b43c543c80796e1e16dadde 18-Apr-2009 Chris Lattner <sabre@nondot.org> tweak redefinition of a typedef a bit to fix a couple of problems:
1. We had logic in sema to decide whether or not to emit the error
based on manually checking whether in a system header file.
2. we were allowing redefinitions of typedefs in class scope in C++
if in header file.
3. there was no way to force typedef redefinitions to be accepted
by the C compiler, which annoys me when stripping linemarkers out
of .i files.

The fix is to split the C++ class typedef redefinition path from the
C path, and change the C path to be a warning that normally maps to
error. This causes it to properly be ignored in system headers,
etc. and gives us a way to control it. Passing
-Wtypedef-redefinition now turns the error into a warning.

One behavior change is that we now diagnose cases where you redefine
a typedef in your .c file that was defined in a header file. This
seems like reasonable behavior, and the diagnostic now indicates that
it can be controlled with -Wtypedef-redefinition.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69391 91177308-0d34-0410-b5e6-96231b3b80d8
ypedef-redef.c
23a48cc69e7ed4f219996a8864cb7d3f24f1157f 17-Apr-2009 Chris Lattner <sabre@nondot.org> fix a crash on invalid by making ActOnDeclarator create decl with
a dummy *function* type when it is recovering and knows it needs
a function. rdar://6802350 - clang crash on invalid input


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69374 91177308-0d34-0410-b5e6-96231b3b80d8
unction.c
00cb00eb8ac9147c397dabf68a13f03914a52aba 17-Apr-2009 Chris Lattner <sabre@nondot.org> adjust for the new -Wvector-conversions option


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69366 91177308-0d34-0410-b5e6-96231b3b80d8
ector-assign.c
ector-cast.c
397195bf3077fb42789b326f69f7d417227a0588 17-Apr-2009 Mike Stump <mrs@apple.com> Fixup semantic analysis for nested blocks, and allow block literal
expressions that can be of static duration to be returned.
Radar 6786551


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69331 91177308-0d34-0410-b5e6-96231b3b80d8
lock-literal.c
lock-return.c
3aaa482ea5b8d20b705f6ac8573b539be88d273a 16-Apr-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6765383> clang-6: clang does not appear to support declaring a static Block 'const'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69306 91177308-0d34-0410-b5e6-96231b3b80d8
lock-literal.c
dbb4f21125699f207ce7accfc52fdd99f47ce352 15-Apr-2009 Daniel Dunbar <daniel@zuster.org> Add warning when a tentative array definition is assumed to have one element.
- Also, fixed one to actually be one (instead of zero). :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69226 91177308-0d34-0410-b5e6-96231b3b80d8
ncomplete-decl.c
cd9c51433c06705645d1ee5a13da3c9a72d7d025 15-Apr-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6786597> varargs not supported for Blocks under clang.

Teach Sema::SemaBuiltinVAStart() about blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69201 91177308-0d34-0410-b5e6-96231b3b80d8
ariadic-block.c
1b6823d48da16b64cfb13d818860a21472183ca0 15-Apr-2009 Steve Naroff <snaroff@apple.com> Revert previous patch (will commit a fix soon).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69178 91177308-0d34-0410-b5e6-96231b3b80d8
cope-check.c
ee3899e1cabcbf70d9a316b33f9b79bf3189bd01 15-Apr-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6789707> "warning: 'extern' variable has an initializer" not correct for __private_extern__.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69167 91177308-0d34-0410-b5e6-96231b3b80d8
rivate-extern.c
ffb4b6e299069139908540ce97be4462e16b53a4 15-Apr-2009 Douglas Gregor <dgregor@apple.com> Implement support for designated initializers that refer to members of
anonymous structs or unions. Fixes PR3778.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69153 91177308-0d34-0410-b5e6-96231b3b80d8
esignated-initializers.c
44e35f7b2b5da1eb338639e46bf0b5522e75c5f3 15-Apr-2009 Daniel Dunbar <daniel@zuster.org> Improve "assignment to cast" diagnostic.
- Strip off extra parens when looking for casts.
- Change the location info to point at the cast (instead of the
assignment).

For example, on

int *b;
#define a ((void*) b)
void f0() {
a = 10;
}

we now emit:

/tmp/t.c:4:3: error: assignment to cast is illegal, lvalue casts are not supported
a = 10;
^ ~
/tmp/t.c:2:12: note: instantiated from:
#define a ((void*) b)
~^~~~~~~~~~

instead of:

/tmp/t.c:4:5: error: expression is not assignable
a = 10;
~ ^


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69114 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
5717daef564a1071c34549150e7333025ea46fa2 15-Apr-2009 Daniel Dunbar <daniel@zuster.org> Strip paren expressions when trying to diagnose "cast as lvalue"
extension.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69100 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
b6645dd9ca7a44e9b5f657e14820d5edcc511ee5 14-Apr-2009 Chris Lattner <sabre@nondot.org> Fix a regression in a previous patch that broke implicit
int in a bitfield. Shantonu found this in a gcc testsuite file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69074 91177308-0d34-0410-b5e6-96231b3b80d8
mplicit-int.c
c51974328b3a378c3c40b1fa527ecb928ed2bfda 14-Apr-2009 Chris Lattner <sabre@nondot.org> implement some sema for gnuc_inline attribute. Reject always_inline and no_inline on objc methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69051 91177308-0d34-0410-b5e6-96231b3b80d8
unction.c
5466c7b0ca8ce662e2c0bc295cecba2b78d6957d 14-Apr-2009 Daniel Dunbar <daniel@zuster.org> Audit __private_extern__ handling.
- Exposed quite a few Sema issues and a CodeGen crash.

- See FIXMEs in test case, and in SemaDecl.cpp (PR3983).

I'm skeptical that __private_extern__ should actually be a storage
class value. I think that __private_extern__ basically amounts to
extern A __attribute__((visibility("hidden")))
and would be better off handled (a) as that, or (b) with an extra bit
in the VarDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69020 91177308-0d34-0410-b5e6-96231b3b80d8
rivate-extern.c
a31fecaf63dc589af70bc1604f6d2aabeb7769f7 13-Apr-2009 Eli Friedman <eli.friedman@gmail.com> PR3461: reject initializer for incomplete type. Based on patch by Tim
Northover.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68991 91177308-0d34-0410-b5e6-96231b3b80d8
ncomplete-decl.c
ecca7536488e425417dcb005c39cc15ae1947aab 13-Apr-2009 Chris Lattner <sabre@nondot.org> fix rdar://6774906, a crash handling implicit conversions between pointers
in different address spaces.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68941 91177308-0d34-0410-b5e6-96231b3b80d8
ddress_spaces.c
5186872629d6c9a48433bafe62dc06975bbbf7af 12-Apr-2009 Chris Lattner <sabre@nondot.org> fix a valgrind problem I noticed while developing another patch,
if a decl is invalid, it isn't added to the Decls array, so we
need to pass in Decls.size() to avoid reading uninit memory.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68913 91177308-0d34-0410-b5e6-96231b3b80d8
ecl-invalid.c
73f35e60966855da052e61d8ee141b879351ffcb 11-Apr-2009 Chris Lattner <sabre@nondot.org> add radar number


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68864 91177308-0d34-0410-b5e6-96231b3b80d8
arn-missing-prototypes.c
9158804749356f88be8c5a3bade75b761846273c 08-Apr-2009 Steve Naroff <snaroff@apple.com> Sema::CheckConditionalOperands(): Soften pointer/integer mismatch from error->warning.

Fixes <rdar://problem/6762239> [sema] gcc incompatibility; error on incompatible operand types in ?:.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68617 91177308-0d34-0410-b5e6-96231b3b80d8
onditional-expr.c
2c2d9dc382a561553a05bf0e96ab67e403beff09 08-Apr-2009 Douglas Gregor <dgregor@apple.com> -Wmissing-prototypes shouldn't complain about main() missing a prototype.

Fixes <rdar://problem/6759522>



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68611 91177308-0d34-0410-b5e6-96231b3b80d8
arn-missing-prototypes.c
48d1ef782c8c88066b5febf60f8f456064d7d3f0 07-Apr-2009 Daniel Dunbar <daniel@zuster.org> Driver: Manually translate a number of -f with no- variants options to
clang.
- We will eventually want some more driver infrastructre for this
probably.

- For now, the clang-cc interface stays relatively the same, but we
don't accept multiple instances anymore, or the [no-] variants
directly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68550 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
nused-expr.c
85a5319ea4b5c916d7dd665e84af61e4a8a0b9c2 07-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Diagnose uses of function specifiers on declarations which don't declare
functions. Fixes PR3941.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68541 91177308-0d34-0410-b5e6-96231b3b80d8
nline.c
3f419761288f6ce8ffc284e9e241c28b536fce35 06-Apr-2009 Chris Lattner <sabre@nondot.org> Daniel convinced me that accepting "const va_list" arguments to va_arg is
a really really bad idea. Now that we emit an error about the unpromoted
type, users should be able to understand what is going on.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68447 91177308-0d34-0410-b5e6-96231b3b80d8
arargs-x86-64.c
0d20b8a6d8af041edeb27cc4c68392454297e308 05-Apr-2009 Chris Lattner <sabre@nondot.org> in va_arg diagnostics, print out the unpromoted type. This makes the
diagnostic use the va_list typedef more often, see the difference in the
changed testcase.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68441 91177308-0d34-0410-b5e6-96231b3b80d8
arargs-x86-64.c
9dc8f19a5394c4268727f0d755623f8d56416e7c 05-Apr-2009 Chris Lattner <sabre@nondot.org> Add a warning for questionable va_args usage.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68435 91177308-0d34-0410-b5e6-96231b3b80d8
arargs-x86-64.c
arargs.c
f502691c86299ed23b7e121e27610ba5bb44a1ee 05-Apr-2009 Chris Lattner <sabre@nondot.org> GCC compatibility: gcc allows applying va_args to const
va_lists for some reason. This fixes rdar://6726818


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68434 91177308-0d34-0410-b5e6-96231b3b80d8
arargs.c
dd6f4abe816a529cfc8c0487f9a13f3b88f0aae8 02-Apr-2009 Douglas Gregor <dgregor@apple.com> Move the fix-it tests into their own subdirectory

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68325 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-c90.c
ixit-errors.c
ixit.c
74734d576b1dd082f623abb76ab204d69970dadb 02-Apr-2009 Douglas Gregor <dgregor@apple.com> When calling a function without a prototype for which we have a
definition, warn if there are too many/too few function call
arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68318 91177308-0d34-0410-b5e6-96231b3b80d8
rg-duplicate.c
unction.c
nr-def-call.c
ef5cc75782f7c3537ae81cc2a1f3aef8a5cd4c26 02-Apr-2009 Douglas Gregor <dgregor@apple.com> Make darned sure that the -fixit tests are testing what we want them to test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68289 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-c90.c
ixit.c
fe057ac36b9a76cdfa37dfa003f986461fb5fb98 02-Apr-2009 Douglas Gregor <dgregor@apple.com> Update comments in fixit tests

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68279 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-c90.c
ixit-errors.c
ixit.c
558cb56caf8906e0adbe643e3febbef0b7af1b9f 02-Apr-2009 Douglas Gregor <dgregor@apple.com> Introduce a "-fixit" mode to clang-cc that applies code-modification hints.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68268 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-c90.c
ixit-errors.c
ixit.c
c561367f6730e2795f72f31c52b39b007e952e7b 02-Apr-2009 Mike Stump <mrs@apple.com> We no longer expect an warning as this is now valid.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68263 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.c
a3a835149ed4b183e3b009a1f94a6123779d696b 02-Apr-2009 Douglas Gregor <dgregor@apple.com> Add some more code modification hints

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68261 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-errors.c
ixit.c
9b3064b55f3c858923734e8b1c9831777fc22554 02-Apr-2009 Douglas Gregor <dgregor@apple.com> Add code modification hints to various parsing-related diagnostics.

Plus, reword a extension warnings to avoid talking about "ISO C" when
the extension might also be available in C++ or C++0x.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68257 91177308-0d34-0410-b5e6-96231b3b80d8
ixit-c90.c
ixit.c
16e3fed83966be5642d37441efe61edce5136b70 01-Apr-2009 Daniel Dunbar <daniel@zuster.org> Split PTH tests from carbon.c into separate test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68223 91177308-0d34-0410-b5e6-96231b3b80d8
arbon-pth.c
arbon.c
4eee2742c37abb44782c15acd072f8aa1717e036 01-Apr-2009 Douglas Gregor <dgregor@apple.com> Add testcase for -Wmissing-prototypes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68212 91177308-0d34-0410-b5e6-96231b3b80d8
arn-missing-prototypes.c
8d69a5768dd13d9ada1c35802c4ad7f3987b99ec 01-Apr-2009 Ted Kremenek <kremenek@apple.com> Re-enable PTH testing for cocoa.h and carbon.h. This tests that PTH works on
real-world header files and these tests have caught serious bugs in the past.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68204 91177308-0d34-0410-b5e6-96231b3b80d8
arbon.c
0b5b0da1580a5e4aca7605d31abf3c066838670c 01-Apr-2009 Daniel Dunbar <daniel@zuster.org> Pull clang-cc code for generating PTH files based on the input type.
- <rdar://problem/6741594> [pth] don't abuse -x to drive pth
generation

- Simpler, and fixes PR3915.

Cleanup test cases for PTH:
- Update to use -emit-pth

- Removed PTH test of carbon.c and cocoa.mm; these didn't actually
verify anything, and since PTH is token based the extra coverage
(over cocoa.m) isn't particularly helpful.

- Split PTH tests in cocoa.m to cocoa-pth.m, solely to increase
available parallelism when running tests.

Ted, could you update the PTH test cases (include-pth.c and
cocoa-pth.m) to have some sort of positive check that the PTH is
getting used? "# of PTH cache hits" or "tokens read from PTH cache"
statistics would work great. :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68189 91177308-0d34-0410-b5e6-96231b3b80d8
arbon.c
aab0f7a749e939d1d485a436f57ae56d14ba3016 01-Apr-2009 Mike Stump <mrs@apple.com> Fix block comparisons. Radar 6732116.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68171 91177308-0d34-0410-b5e6-96231b3b80d8
lock-call.c
lock-misc.c
cfdee929290b73ae1c4e5896d5cba120bc677661 31-Mar-2009 Steve Naroff <snaroff@apple.com> Add -Wdeprecated-declarations to driver and add a test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68117 91177308-0d34-0410-b5e6-96231b3b80d8
urpress-deprecated.c
8a5c0cd90b8d607ca284274000ed8716b836d253 31-Mar-2009 Steve Naroff <snaroff@apple.com> Incorporate feedback from Eli.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68107 91177308-0d34-0410-b5e6-96231b3b80d8
cn-cstring.c
d013aa1ee78d8ead93179c179b7c0746e8d97dbb 31-Mar-2009 Chris Lattner <sabre@nondot.org> Codegen sometimes crashes on comparisons that aren't legal, just
disable this feature for now, to err on the side of rejecting instead
of sometimes crashing. rdar://6326239


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68088 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
0e3e3eb3879d5a7aaca4a393706149ddef8544f1 31-Mar-2009 Steve Naroff <snaroff@apple.com> Implement UCN support for C string literals (C99 6.4.3) and add some very basic tests. Chris Goller has graciously offered to write some test to help validate UCN support.

From a front-end perspective, I believe this code should work for ObjC @-strings. At the moment, I believe we need to tweak the code generation for @-strings (which doesn't appear to handle them). Will be investigating.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68076 91177308-0d34-0410-b5e6-96231b3b80d8
cn-cstring.c
23c4b1883b13dc17484b7214091b73f3ba29096e 29-Mar-2009 Chris Lattner <sabre@nondot.org> hoist checks for ; and in out of ParseInitDeclaratorListAfterFirstDeclarator
into ParseSimpleDeclaration, and improve a diagnostic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68009 91177308-0d34-0410-b5e6-96231b3b80d8
nit.c
eeae8f072748affce25ab4064982626361293390 28-Mar-2009 Douglas Gregor <dgregor@apple.com> Make our diagnostics about the obsolete GNU designated-initializer
syntax into extension warnings, and provide code-modification hints
showing how to fix the problem.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67885 91177308-0d34-0410-b5e6-96231b3b80d8
esignated-initializers.c
55d3aaf9a537888734762170823daf750ea9036d 27-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Finish off semantic analysis for regparm, and remove the warning. Also
remove a redundant error in CodeGen.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67868 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-regparm.c
9af5500f3f132f9a2f9abbe82113a7c7bb751472 27-Mar-2009 Chris Lattner <sabre@nondot.org> Fix rdar://6719156 - clang should emit a better error when blocks are disabled but are used anyway
by changing blocks from being disabled in the parser to being disabled
in Sema.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67816 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
33083823342649b1fccec856c1f239c09fc0d7e1 26-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Sanity-check argument to indirect goto.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67746 91177308-0d34-0410-b5e6-96231b3b80d8
ndirect-goto.c
e7450f5dbd5bed63b8ef9db86350a8fc3db011e8 24-Mar-2009 Douglas Gregor <dgregor@apple.com> Make sure to use RequireCompleteType rather than testing for
incomplete types. RequireCompleteType is needed when the type may be
completed by instantiating a template.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67643 91177308-0d34-0410-b5e6-96231b3b80d8
unction.c
ypecheck-binop.c
d7d5f0223bd30dfd618762349c6209dd1d5ea3e6 24-Mar-2009 Daniel Dunbar <daniel@zuster.org> Rename clang to clang-cc.

Tests and drivers updated, still need to shuffle dirs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67602 91177308-0d34-0410-b5e6-96231b3b80d8
28bitint.c
R2727.c
R2728.c
R2919-builtin-types-compat-strips-crv.c
R2923.c
R2963-enum-constant.c
ddress-constant.c
ddress_spaces.c
lign-x86.c
nnotate.c
nonymous-struct-union.c
rg-duplicate.c
rg-scope-c99.c
rg-scope.c
rray-constraint.c
rray-declared-as-incorrect-type.c
rray-init.c
sm.c
ssign-null.c
ssign.c
st-print.c
ttr-aligned.c
ttr-cleanup.c
ttr-deprecated.c
ttr-mode.c
ttr-nodebug.c
ttr-noinline.c
ttr-noreturn.c
ttr-unused.c
ttr-used.c
ttr-warn_unused_result.c
ttr-weak.c
itfield-layout.c
itfield.c
lock-args.c
lock-as-object.m
lock-byref-args.c
lock-call.c
lock-explicit-return-type.c
lock-labels.c
lock-literal.c
lock-misc.c
lock-return.c
lock-storageclass.c
lock-syntax-error.c
uiltin-object-size.c
uiltin-prefetch.c
uiltin-stackaddress.c
uiltins.c
89-2.c
89.c
allingconv.c
arbon.c
ast-to-union.c
ast.c
heck-increment.c
ompare.c
omplex-int.c
omplex-promotion.c
ompound-literal.c
onditional-expr.c
onditional.c
onst-eval.c
onst-ptr-int-ptr-cast.c
onstant-builtins-2.c
onstant-builtins.c
onstructor-attribute.c
arwin-align-cast.c
ecl-invalid.c
ecl-type-merging.c
eclspec.c
efault.c
efault1.c
eref.c
esignated-initializers.c
llimport-dllexport.c
num.c
xpr-address-of.c
xpr-comma-c89.c
xpr-comma.c
xprs.c
xt_vector_components.c
lexible-array-init.c
loating-point-compare.c
or.c
ormat-attribute.c
ormat-strings.c
unction-ptr.c
unction-redecl.c
unction.c
einous-extensions-off.c
einous-extensions-on.c
-c-e.c
f-empty-body.c
llegal-types.c
mplicit-builtin-decl.c
mplicit-builtin-freestanding.c
mplicit-builtin-redecl.c
mplicit-cast.c
mplicit-decl.c
mplicit-def.c
mplicit-int.c
ncompatible-sign.c
ncomplete-call.c
ncomplete-decl.c
nit-struct-qualified.c
nit.c
nt-arith-convert.c
nvalid-decl.c
nvalid-init-diag.c
nvalid-struct-init.c
nr-def-call.c
ember-reference.c
erge-decls.c
s-fuzzy-asm.c
ested-redef.c
onnull.c
ffsetof.c
verloadable-complex.c
verloadable.c
ointer-addition.c
ointer-subtract-compat.c
ragma-pack-2.c
ragma-pack.c
ragma-unused.c
redef.c
redefined-function.c
dar6248119.m
dr6094103-unordered-compare-promote.c
ecover-goto.c
edefinition.c
cope-check.c
elf-comparison.c
entinel-attribute.c
hift.c
tatic-init.c
tdcall-fastcall.c
tmt_exprs.c
truct-cast.c
truct-compat.c
truct-decl.c
truct-packed-align.c
witch.c
entative-decls.c
ext-diag.c
ransparent-union-pointer.c
ype-spec-struct-union.c
ypecheck-binop.c
ypedef-prototype.c
ypedef-redef.c
ypedef-retain.c
ypedef-variable-type.c
ypes.c
nnamed-bitfield-init.c
nused-expr.c
sual-float.c
a_arg_x86_64.c
ar-redecl.c
arargs.c
ector-assign.c
ector-cast.c
ector-init.c
la.c
oid_arg.c
arn-freestanding-complex.c
char.c
42edd0d32a729d2735a6fb152ba6bf349bf0a169 24-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Fix PR3868 by making Evaluate handle cases like "(long)&a + 4".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67593 91177308-0d34-0410-b5e6-96231b3b80d8
nit.c
ff59a8ab68326c7f50c78f0cc5a99b1f8fd02b01 24-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Fix a couple of tests.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67592 91177308-0d34-0410-b5e6-96231b3b80d8
mplicit-builtin-decl.c
4726d03ab3abce41911c31d1354a18f1258cae4d 23-Mar-2009 Ted Kremenek <kremenek@apple.com> Implement '#pragma unused'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67569 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-unused.c
374e156647e4250274eb66102839abf0ee9d7fe8 23-Mar-2009 Douglas Gregor <dgregor@apple.com> Fix PR3855. When we encounter an incompatible redeclaration of a
library function, accept this declaration and pretend that we do not
know that this is a library function. autoconf depends on this
(broken) behavior.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67541 91177308-0d34-0410-b5e6-96231b3b80d8
mplicit-builtin-decl.c
mplicit-builtin-redecl.c
d1659a6bd96132ffab70613b23f5716424fa364f 23-Mar-2009 Douglas Gregor <dgregor@apple.com> Tighten up the determination of whether a function declaration has a
prototype. Thanks Eli!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67533 91177308-0d34-0410-b5e6-96231b3b80d8
unction-redecl.c
38179b29df101e3f55dbdff4d15d4d55cd82e2bd 23-Mar-2009 Douglas Gregor <dgregor@apple.com> Thanks to Eli for pointing out my misreading of 6.2.2p5

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67530 91177308-0d34-0410-b5e6-96231b3b80d8
entative-decls.c
a1f47c447a919c6a05c63801cb6a52c4c288e2cc 23-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Minor enhancements to Evaluate.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67503 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
f05c05d2e1a2952e6cc7c3e54366fb8d99ff579c 23-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Partial implementation of PR3342: break out pointer sign
incompatibilities in assignments from other pointer incompatibilities.
Based off of the patch in PR3342. (This doesn't implement -Wno-pointer-sign,
but I don't know the driver code very well.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67494 91177308-0d34-0410-b5e6-96231b3b80d8
ncompatible-sign.c
04831aa3271edc5f00a651bf7152c2902981d7c3 23-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Adjust isModifiableLvalue to give a slightly more useful diagnostic for
attempting to illegally modify a BlockDeclRefExpr.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67491 91177308-0d34-0410-b5e6-96231b3b80d8
lock-literal.c
5fdeae17da443c50c62f602733d06193a71b170f 23-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Fix code to mark block variables as const to actually work. Fix
isObjCObjectPointerType to work with qualified types. Adjust test for
changes.

If the SemaExpr changes are wrong or break existing code, feel free to
delete the "ExprTy.addConst();" line and revert my changes to
test/Sema/block-literal.c.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67489 91177308-0d34-0410-b5e6-96231b3b80d8
lock-literal.c
21bab842fb9e25fa8be50ae065090fef514fefed 22-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Add testcase for incomplete call/return types for calls.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67486 91177308-0d34-0410-b5e6-96231b3b80d8
ncomplete-call.c
082d936a5b8323ac2c04558d8bca277a647831a3 20-Mar-2009 Ted Kremenek <kremenek@apple.com> Fix <rdar://problem/6704086> by allowing the format string checking in Sema to
allow non-literal format strings that are variables that (a) permanently bind to
a string constant and (b) whose string constants are resolvable within the same
translation unit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67404 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
b82dcd827495592a8748692ce4bf80402f21b8d4 20-Mar-2009 Ted Kremenek <kremenek@apple.com> Fix <rdar://problem/6703892> by not warning about self-comparisons of enum
constants.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67390 91177308-0d34-0410-b5e6-96231b3b80d8
elf-comparison.c
a6457963cf7ffe71498c408dd590d9d1acb9513c 20-Mar-2009 Douglas Gregor <dgregor@apple.com> Allow flexible array initializers that are not surrounded by
braces. We now build the appropriate fully-structured initializer list
for such things. Per PR3618, verified that we're getting the right
code generation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67353 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
lexible-array-init.c
5ef122e9449a86e4a6466ea07ed7f5ba5f6a48bc 19-Mar-2009 Douglas Gregor <dgregor@apple.com> Variables marked as "extern" can actually have internal linkage if
there is a previous declaration marked "static". This fixes PR3645.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67336 91177308-0d34-0410-b5e6-96231b3b80d8
entative-decls.c
ar-redecl.c
13d7a32774c51af4c314c9d1fa6229d0e1d099da 19-Mar-2009 Douglas Gregor <dgregor@apple.com> If a function is declared as, e.g.,

F f;

where F is a typedef of a function type, then the function "f" has a
prototype. This is a slight tweak to Chris's suggested fix in
PR3817. Fixes PR3817 and PR3840.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67313 91177308-0d34-0410-b5e6-96231b3b80d8
unction-redecl.c
897cd90fef4cd5139999585f3af31d85c2d07720 18-Mar-2009 Chris Lattner <sabre@nondot.org> don't crash when sentinel attribute is used on function without a prototype,
discovered as part of PR3817


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67127 91177308-0d34-0410-b5e6-96231b3b80d8
entinel-attribute.c
f257b619059e05906c4d93f3dc134857f818f44c 16-Mar-2009 Anders Carlsson <andersca@mac.com> Check signedness of bitfield sizes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67045 91177308-0d34-0410-b5e6-96231b3b80d8
itfield.c
810f6d5d6223adaab0ccf0139f40de6484ad1bb5 13-Mar-2009 Chris Lattner <sabre@nondot.org> introduce a new -fheinous-gnu-extensions flag that enables really
really horrible extensions that are disabled by default but that can
be accepted by -fheinous-gnu-extensions (but which always emit a
warning when enabled).

As our first instance of this, implement PR3788/PR3794, which allows
non-lvalues in inline asms in contexts where lvalues are required. bleh.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66910 91177308-0d34-0410-b5e6-96231b3b80d8
einous-extensions-off.c
einous-extensions-on.c
d8eb456289a81728f9aac77ac0a4db0ea9cc231a 13-Mar-2009 Steve Naroff <snaroff@apple.com> Reimplement fix for <rdar://problem/6451399> problems with labels and blocks.

This solution is much simpler (and doesn't add any per-scope overhead, which concerned Chris).

The only downside is the LabelMap is now declared in two places (Sema and BlockSemaInfo). My original fix tried to unify the LabelMap in "Scope" (which would support nested functions in general). In any event, this fixes the bug given the current language definition. If/when we decide to support GCC style nested functions, this will need to be tweaked.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66896 91177308-0d34-0410-b5e6-96231b3b80d8
lock-labels.c
caaacecb2b64e6d2e402533baffda4cb540f4145 13-Mar-2009 Steve Naroff <snaroff@apple.com> Remove ActiveScope (revert http://llvm.org/viewvc/llvm-project?view=rev&revision=65694 and http://llvm.org/viewvc/llvm-project?view=rev&revision=66741).

Will replace with something better today...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66893 91177308-0d34-0410-b5e6-96231b3b80d8
lock-labels.c
85759278332404e96d4bb89d0e976e46158cd026 11-Mar-2009 Chris Lattner <sabre@nondot.org> fix PR3258 by rejecting invalid numeric operands.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66618 91177308-0d34-0410-b5e6-96231b3b80d8
sm.c
eab8cfbf4b2e85b66cea6e0fea3b7f8fd2685722 11-Mar-2009 Chris Lattner <sabre@nondot.org> checking for symbolic operands as well as % at end of string.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66614 91177308-0d34-0410-b5e6-96231b3b80d8
sm.c
3182db1c8e456c4cd2180fac9d77d331b2c0621f 11-Mar-2009 Chris Lattner <sabre@nondot.org> reject invalid escape characters in extended-asm strings with a nice diagnostic.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66605 91177308-0d34-0410-b5e6-96231b3b80d8
sm.c
275a369f003f25bd22c00c1c0fc0251c7208caf4 11-Mar-2009 Douglas Gregor <dgregor@apple.com> Add type checking for tentative definitions at the end of the
translation unit.

Thread the various declarations of variables via
VarDecl::getPreviousDeclaration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66601 91177308-0d34-0410-b5e6-96231b3b80d8
num.c
ncomplete-decl.c
nit.c
entative-decls.c
a03aca82de5259846d4ef38db11b8116398d2222 10-Mar-2009 Douglas Gregor <dgregor@apple.com> Partial fix for PR3310, concerning type-checking for tentative
definitions. We were rejecting tentative definitions of incomplete
(which is bad), and now we don't.

This fix is partial because we don't do the end-of-translation-unit
initialization for tentative definitions that don't ever have any
initializers specified.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66584 91177308-0d34-0410-b5e6-96231b3b80d8
itfield.c
num.c
ncomplete-decl.c
entative-decls.c
3e87209798bcc3fe39254c1b700b0c8251623b98 09-Mar-2009 Chris Lattner <sabre@nondot.org> do not warn about -=/=- confusion with macros, thanks to rdogra for a testcase.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66416 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
466a7f8aa61ca0d1df1f11ed2dfb2510a386cfa6 08-Mar-2009 Chris Lattner <sabre@nondot.org> undefined -> unspecified. Thanks Mike.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66388 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
55660a74897bf42111a8ae61c1f617645e5a9274 08-Mar-2009 Chris Lattner <sabre@nondot.org> implement PR3753, warning about comparisons with a string literal.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66387 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
399bd1bc2b801ad85e4575e2401bb43919fcbee8 08-Mar-2009 Chris Lattner <sabre@nondot.org> refine the "use of unary operator that may be intended as compound assignment (+=)"
warning to only trigger when there is whitespace or something else after the + as
suggested by Eli.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66370 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
177f708abadfca856b83f1c540c66667d167a4e8 07-Mar-2009 Douglas Gregor <dgregor@apple.com> Tweak warning text from the last commit

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66309 91177308-0d34-0410-b5e6-96231b3b80d8
truct-decl.c
e4f3e069e5e43d466954989dd7509ed371914bd0 07-Mar-2009 Douglas Gregor <dgregor@apple.com> Downgrade complaints about the use of variable-sized types within a
struct to an extension warning to match the behavior of GNU C, which
addresses the Sema part of PR3671.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66308 91177308-0d34-0410-b5e6-96231b3b80d8
truct-decl.c
e950d4bbb7c785c7a7abdd0ad98f372b8c7980b8 07-Mar-2009 Douglas Gregor <dgregor@apple.com> Clean up some error messages with anonymous structs/unions and member declaration parsing. Fixes PR3680

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66305 91177308-0d34-0410-b5e6-96231b3b80d8
nonymous-struct-union.c
a71c129fb8052a143cbf548963a8db2150b0078e 07-Mar-2009 Douglas Gregor <dgregor@apple.com> Use the 'declaration does not declare anything' error when we see an anonymous struct/union declaration outside of a struct or union in C

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66303 91177308-0d34-0410-b5e6-96231b3b80d8
nonymous-struct-union.c
c837656ca6d2a5b434923d7e2fd11d3a3c3bfa74 06-Mar-2009 Douglas Gregor <dgregor@apple.com> Implement GNU C semantics for K&R function definitions that follow a
prototype of the same function, where the promoted parameter types in
the K&R definition are not compatible with the types in the
prototype. Fixes PR2821.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66301 91177308-0d34-0410-b5e6-96231b3b80d8
unction-redecl.c
nr-def-call.c
79cd11620c6f05dbf7bb706744eba354574e8b54 06-Mar-2009 Daniel Dunbar <daniel@zuster.org> Handle #pragma pack(0). I left this out of diagnostic because users should
really use pack() instead.
- <rdar://problem/6650243> clang warns about '#pragma pack(0)'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66287 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-pack-2.c
80711a22fa06b734a68d719ac85d4e443a51cb09 06-Mar-2009 Douglas Gregor <dgregor@apple.com> Implement the GNU semantics for forward declarations of enum types in
C and C++. Fixes PR3688.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66282 91177308-0d34-0410-b5e6-96231b3b80d8
num.c
6e775dbafba2ab6634decc489eb3b4301b4b506b 06-Mar-2009 Daniel Dunbar <daniel@zuster.org> Add Parse/Sema support for weak_import attribute.
- Also, diagnose weak applied to types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66259 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-weak.c
247936605913c718f4141f845aec6cb6e169fb37 05-Mar-2009 Chris Lattner <sabre@nondot.org> fix PR3607 and a fixme, by checking bitfield constraints
more consistently.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66210 91177308-0d34-0410-b5e6-96231b3b80d8
itfield.c
7f0f5dce3adcfce88d5c9a0ad0146a33c01a1e8f 04-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Check that the return type for function definitions is complete.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66027 91177308-0d34-0410-b5e6-96231b3b80d8
unction.c
73397496fec250f565f49e27f8ba79f94f4e7427 03-Mar-2009 Eli Friedman <eli.friedman@gmail.com> PR3691: Add support for complex modes. I also tossed in support for XF
while I was at it. There are still a lot of diagnostics missing from
this code, and it isn't completely correct for anything other than x86, but
it should work correctly on x86 for valid cases.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65935 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-mode.c
592b67b480d48958c2e335dd978bb3a6380d764e 03-Mar-2009 Chris Lattner <sabre@nondot.org> fix PR#


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65906 91177308-0d34-0410-b5e6-96231b3b80d8
mplicit-int.c
7b5b5b4409a64849908f67b9e389c0ba185b64b0 02-Mar-2009 Chris Lattner <sabre@nondot.org> fix PR2639


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65869 91177308-0d34-0410-b5e6-96231b3b80d8
mplicit-int.c
6393519272ce727f4d26e71bbefb5de712274d0e 02-Mar-2009 Douglas Gregor <dgregor@apple.com> Rework the way we find locally-scoped external declarations when we
need them to evaluate redeclarations or call a function that hasn't
already been declared. We now keep a DenseMap of these locally-scoped
declarations so that they are not visible but can be quickly found,
e.g., when we're looking for previous declarations or before we go
ahead and implicitly declare a function that's being called. Fixes
PR3672.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65792 91177308-0d34-0410-b5e6-96231b3b80d8
unction-redecl.c
ar-redecl.c
1a7acfa0de7364b24599be4329d7ee2944540428 28-Feb-2009 Anders Carlsson <andersca@mac.com> Fix invalid VLAs/VMs in Sema::ActOnVariableDeclarator, so that the variable will have the right type by the time the initializer is checked. This ensures that code like

int a[(int)(1.0 / 1.0) = { 1 } will work.

Eli, please review.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65725 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
f3cf89737965352ee02026992e2dc735824e185e 28-Feb-2009 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6451399> problems with labels and blocks.

- Move the 'LabelMap' from Sema to Scope. To avoid layering problems, the second element is now a 'StmtTy *', which makes the LabelMap a bit more verbose to deal with.
- Add 'ActiveScope' to Sema. Managed by ActOnStartOfFunctionDef(), ObjCActOnStartOfMethodDef(), ActOnBlockStmtExpr().
- Changed ActOnLabelStmt(), ActOnGotoStmt(), ActOnAddrLabel(), and ActOnFinishFunctionBody() to use the new ActiveScope.
- Added FIXME to workaround in ActOnFinishFunctionBody() (for dealing with C++ nested functions).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65694 91177308-0d34-0410-b5e6-96231b3b80d8
lock-labels.c
709fa15defbc0208b33707b3da3a628df5a9b7b9 28-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Check a few more kinds of declarations that make a scope.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65680 91177308-0d34-0410-b5e6-96231b3b80d8
cope-check.c
8f17b66c8d383d458e04cada4c9e2452139b0b39 28-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Start of checking for gotos which jump to an illegal destination.
As far as I know, this catches all cases of jumping into the scope of a
variable with a variably modified type (excluding statement
expressions) in C. This is missing some stuff we probably want to check
(other kinds of variably modified declarations, statement expressions,
indirect gotos/addresses of labels in a scope, ObjC @try/@finally, cleanup
attribute), the diagnostics aren't very good, and it's not particularly
efficient, but it's a decent start.

This patch is a slightly modified version of the patch I attached to
PR3259, and it fixes that bug. I was sort of planning on improving
it, but I think it's okay as-is, especially since it looks like CodeGen
doesn't have any use for this sort of data structure. The only
significant change I can think of from the version I attached to PR3259
is that this version skips running the checking code when a function
doesn't contain any labels.

This patch doesn't cover case statements, which also need similar
checking; I'm not sure how we should deal with that. Extending the goto
checking to also check case statements wouldn't be too hard; it's just a
matter of keeping track of the scope of the closest switch and checking that
the scope of every case is the same as the scope of the switch. That said,
it would likely be a performance hit to run this check on every
function (it's an extra pass over the entire function), so we probably want
some other solution.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65678 91177308-0d34-0410-b5e6-96231b3b80d8
cope-check.c
722c717cd833e410ca6e7976d78baea16995e0c4 28-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Fix obvious shortcoming in the implementations of Evaluate for
integer __real__ and __imag__. Not sure how I missed this.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65677 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
35d276f443462249b436951c1c663820569e1768 27-Feb-2009 Chris Lattner <sabre@nondot.org> upgrade various 'implicit int' warnings from an ext-warn to warning when not
in C89 mode. This makes it enabled by default instead of only enabled with
-pedantic. Clang defaults to c99 mode, so people will see this more often
than with GCC, but they can always use -std=c89 if they really want c89.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65647 91177308-0d34-0410-b5e6-96231b3b80d8
ddress_spaces.c
lock-literal.c
mplicit-int.c
nvalid-decl.c
nvalid-struct-init.c
3d692df4b9c58895f9843b03543ec57447c93679 27-Feb-2009 Ted Kremenek <kremenek@apple.com> When checking printf-arguments for functions with '__attribute__ ((format (printf, X, Y)))'
set HasVAListArg to true when 'Y' is 0 (i.e., ignore the data arguments).

This fixes <rdar://problem/6623513>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65642 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-attribute.c
7fa649f9849269d16310b603706b93819f3ab20d 27-Feb-2009 Daniel Dunbar <daniel@zuster.org> Oops, Ted beat me to it. I'll just play angry god and remove his version!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65638 91177308-0d34-0410-b5e6-96231b3b80d8
R3675.c
c8d8fa965e3d34335959923b0079f1d23ca5767d 27-Feb-2009 Daniel Dunbar <daniel@zuster.org> Add coverage of "member of anonymous union redeclares ..." diagnostic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65637 91177308-0d34-0410-b5e6-96231b3b80d8
nonymous-struct-union.c
beba7f47d873abe0a532753556511d0dabbb41fa 27-Feb-2009 Ted Kremenek <kremenek@apple.com> Add test case for PR 3675.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65635 91177308-0d34-0410-b5e6-96231b3b80d8
R3675.c
35183aca180a2b9b2c637cd625a40a7e147d6a32 27-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Change the AST generated for offsetof a bit so that it looks like a
normal expression, and change Evaluate and IRGen to evaluate it like a
normal expression. This simplifies the code significantly, and fixes
PR3396.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65622 91177308-0d34-0410-b5e6-96231b3b80d8
ffsetof.c
f04ec6774f88d3c0d486eba04803e34a9513037f 27-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Some additional ICE tests.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65614 91177308-0d34-0410-b5e6-96231b3b80d8
-c-e.c
3cc729235221c9af79ea8f9b6c04785a08dd968f 27-Feb-2009 Chris Lattner <sabre@nondot.org> rename test


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65587 91177308-0d34-0410-b5e6-96231b3b80d8
char.c
char_size.c
19753cfa6059b237880a91f21ef58f2d8984845f 27-Feb-2009 Chris Lattner <sabre@nondot.org> ok, not as broken as I thought, just confusing. This allows
initialization of wchar_t arrays with wide strings, and generalizes
wchar_size.c to work on all targets.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65586 91177308-0d34-0410-b5e6-96231b3b80d8
char_size.c
bc592e6e56f16f5d06fc70c3931f7d9d33f7b3cd 26-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR3663/3669: use TryToFixInvalidVariablyModifiedType for
variable declarations where applicable. Also, a few fixes to
TryToFixInvalidVariablyModifiedType for issues that this exposed.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65500 91177308-0d34-0410-b5e6-96231b3b80d8
la.c
b90052a8cc4745126f7bb2e6573f07e22f24b840 25-Feb-2009 Anders Carlsson <andersca@mac.com> Use CheckAssignmentConstraints for checking the cleanup attr function. Fixes PR3656.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65461 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-cleanup.c
2224f84658fb9b3725a31f2680edb64ae73bf705 25-Feb-2009 Douglas Gregor <dgregor@apple.com> C99 DR #316 implies that the function parameter types that are known
only from a function definition (that does not have a prototype) are
only used to determine the compatible with other declarations of that
same function. In particular, when referencing the function we pretend
as if it does not have a prototype. Implement this behavior, which
fixes PR3626.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65460 91177308-0d34-0410-b5e6-96231b3b80d8
rg-duplicate.c
nr-def-call.c
d6f7e9dccd0fa8a5a15d7478324c0ae229fc5e1e 24-Feb-2009 Douglas Gregor <dgregor@apple.com> When we're declaring an object or function with linkage, teach name
lookup to skip over names without linkage. This finishes
<rdar://problem/6127293>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65386 91177308-0d34-0410-b5e6-96231b3b80d8
unction-redecl.c
ar-redecl.c
8f30105fda579f8e6db339cb88cdec2bef6350bd 24-Feb-2009 Douglas Gregor <dgregor@apple.com> Extend the implicit declaration and checking against out-of-scope
external declarations to also support external variable
declarations. Unified the code for these two cases into two new
subroutines.

Note that we fail to diagnose cases like the one Neil pointed
out, where a visible non-external declaration hides an external
declaration by the same name. That will require some reshuffling of
name lookup.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65385 91177308-0d34-0410-b5e6-96231b3b80d8
ar-redecl.c
la.c
25d944af5d8d665611e09956954f10896c1071f6 24-Feb-2009 Douglas Gregor <dgregor@apple.com> In C, when we see a function declaration within a local scope, export
that declaration to global scope so that it can be found from other
scopes. This allows us to diagnose redeclaration errors for external
declarations across scopes. We also warn when name lookup finds such
an out-of-scope declaration. This is part of <rdar://problem/6127293>;
we'll also need to do the same thing for variables.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65373 91177308-0d34-0410-b5e6-96231b3b80d8
unction-redecl.c
04495c859f81e440748a9b86baa2913461652bb0 24-Feb-2009 Douglas Gregor <dgregor@apple.com> Improve merging of function declarations. Specifically:

- When we are declaring a function in local scope, we can merge with
a visible declaration from an outer scope if that declaration
refers to an entity with linkage. This behavior now works in C++
and properly ignores entities without linkage.
- Diagnose the use of "static" on a function declaration in local
scope.
- Diagnose the declaration of a static function after a non-static
declaration of the same function.
- Propagate the storage specifier to a function declaration from a
prior declaration (PR3425)
- Don't name-mangle "main"



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65360 91177308-0d34-0410-b5e6-96231b3b80d8
unction-redecl.c
unction.c
ested-redef.c
1829a6db2ec19e08061f0bb2f4c52a8e5e4efaf0 23-Feb-2009 Chris Lattner <sabre@nondot.org> fix rdar://6611778, a redefinition of an interface was causing an
assertion when the ivars and method list was reset into the existing
interface. To fix this, mark decls as invalid when they are redefined,
and don't insert ivars/methods into invalid decls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65340 91177308-0d34-0410-b5e6-96231b3b80d8
nonymous-struct-union.c
ested-redef.c
91110ee24e3475e0a3a38938c7b98439b5cf0b0e 23-Feb-2009 Eli Friedman <eli.friedman@gmail.com> A few small improvements to Evaluate for stuff I noted in FIXMEs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65305 91177308-0d34-0410-b5e6-96231b3b80d8
nit.c
c91b7d9216e2747bc2fa8886cf1776e769539b88 22-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Fix test to be legal on 64-bit systems.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65270 91177308-0d34-0410-b5e6-96231b3b80d8
nit.c
578a97249c10eb83f25b408de1edfb70f5a4233c 22-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Throw the switch to exclusively use Evaluate (along with the small
helper isConstantInitializer) to check whether an initializer is
constant. This passes tests, but it's possible that it'll cause
regressions with real-world code.

Future work:
1. The diagnostics obtained this way are lower quality at the moment;
some work both here and in Evaluate is needed for accurate diagnostics.
2. We probably need some extra code when we're in -pedantic mode so we
can strictly enforce the rules in C99 6.6p7.
3. Dead code cleanup (this should wait until after 2, because we might
want to re-use some of the code).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65265 91177308-0d34-0410-b5e6-96231b3b80d8
onst-ptr-int-ptr-cast.c
tatic-init.c
c508203a278f6a9238fff46ae1f025b4b402b233 22-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR3433: map __alignof__ to preferred alignment. (This was
partially done in r65258.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65260 91177308-0d34-0410-b5e6-96231b3b80d8
lign-x86.c
ttr-aligned.c
dcdafb6a701aa9d81edcb088915f58933315dc05 22-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Improvements to ASTContext::getDeclAlignInBytes; fixes the testcase in
PR3254 and part of PR3433.

The isICE changes are necessary to keep the computed results
consistent with Evaluate.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65258 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-aligned.c
85c351551688a101c5ce918e5d60dea5177d72e7 22-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Sanity fix for PR3642: if we're treating a diagnostic as an error, it's
required to actually be an error for correctness. The attached testcase
now gives an error instead of mysteriously crashing.

Now, it's possible we actually want to support the given usage, but I
haven't looked at the relevant code closely.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65253 91177308-0d34-0410-b5e6-96231b3b80d8
truct-decl.c
8d7d6e9a486ad69532f9b50e75109d6ed61b0ad6 22-Feb-2009 Daniel Dunbar <daniel@zuster.org> Force arch for these test cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65252 91177308-0d34-0410-b5e6-96231b3b80d8
tatic-init.c
4fff4819a913c65ae23cfd389bc47c61919e4e1f 21-Feb-2009 Daniel Dunbar <daniel@zuster.org> Evaluation of unary deref could call integer evaluator on non-integral
expr; hilarity ensued.
- PR3640.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65234 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
540b146d013b3b6d5ab7c485b9e692a866173e15 20-Feb-2009 Anders Carlsson <andersca@mac.com> Always try to fold array sizes, and warn if we could fold something that isn't an ICE. This makes us compatible with GCC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65140 91177308-0d34-0410-b5e6-96231b3b80d8
ypedef-variable-type.c
e8761c8fe2ee6b628104a0885f49fd3c21c08a4f 20-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Add support for * (unary dereference) operator to ExprConstant.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65105 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
da153239bb6e69722fdd82914e729bb39f5821c5 20-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Suppress constant initializer checking when the declaration isn't valid.
This prevents emitting diagnostics which are almost certainly useless.

(Note that the test is checking that we emit only one diagnostic.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65101 91177308-0d34-0410-b5e6-96231b3b80d8
nvalid-init-diag.c
d0344a4a6182ad704881cbbaa21cca14913d2296 20-Feb-2009 Chris Lattner <sabre@nondot.org> Fix a long standard problem with clang retaining "too much" sugar
information about types. We often print diagnostics where we say
"foo_t" is bad, but the user doesn't know how foo_t is declared
(because it is a typedef). Fix this by expanding sugar when present
in a diagnostic (and not one of a few special cases, like vectors).

Before:
t.m:5:2: error: invalid operands to binary expression ('typeof(P)' and 'typeof(F)')
MAX(P, F);
^~~~~~~~~
t.m:1:78: note: instantiated from:
#define MAX(A,B) ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; })
^

After:
t.m:5:2: error: invalid operands to binary expression ('typeof(P)' (aka 'struct mystruct') and 'typeof(F)' (aka 'float'))
MAX(P, F);
^~~~~~~~~
t.m:1:78: note: instantiated from:
#define MAX(A,B) ({ __typeof__(A) __a = (A); __typeof__(B) __b = (B); __a < __b ? __b : __a; })
^




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65081 91177308-0d34-0410-b5e6-96231b3b80d8
eclspec.c
xprs.c
ypes.c
403bc2bd9edffe51d73776643fa87696c9417678 19-Feb-2009 Daniel Dunbar <daniel@zuster.org> Arguments to unordered comparison builtins may need implicit casts.
- <rdar://problem/6094103> sema fails to promote type arguments to __builtin_isgreater (and friends)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65059 91177308-0d34-0410-b5e6-96231b3b80d8
dr6094103-unordered-compare-promote.c
5bab788d40026ad6e932a3cd9b86bc13f8a27661 19-Feb-2009 Anders Carlsson <andersca@mac.com> Add sema support for the noinline attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65055 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-noinline.c
6beb16578ebbe56b88318a0f062cd01fcf2a459c 19-Feb-2009 Zhongxing Xu <xuzhongxing@gmail.com> fix test case

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65037 91177308-0d34-0410-b5e6-96231b3b80d8
truct-decl.c
1c17689a6703331c656ae79bb756bf606d63f71a 19-Feb-2009 Anders Carlsson <andersca@mac.com> Emit the correct diagnostics when we constant fold an array size to a negative value.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65023 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
e2f0e96e9b34ed7fb0d44f6b9288b9fcf5548ba3 19-Feb-2009 Anders Carlsson <andersca@mac.com> Make sure to check the value of the constant expression, as suggested by Daniel.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65021 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
4d4c50dd8b4db191c38782414665fb7608315a36 19-Feb-2009 Anders Carlsson <andersca@mac.com> Handle the GNU void* and function pointer arithmetic extensions for constant expressions as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65013 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
9b76143b09a601dc3990b55934f02097f093a699 19-Feb-2009 Douglas Gregor <dgregor@apple.com> Make error-message check platform-agnostic

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64985 91177308-0d34-0410-b5e6-96231b3b80d8
mplicit-builtin-redecl.c
7c53ca6e03833adab4465462b7d5c888741b715d 18-Feb-2009 Douglas Gregor <dgregor@apple.com> Downgrade the "excess elements in initializer" errors to warnings *in
C*. They're required errors in C++.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64964 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
esignated-initializers.c
lexible-array-init.c
nit.c
ector-init.c
c2b6a8239326456753cd7d636656e420feaecb40 18-Feb-2009 Douglas Gregor <dgregor@apple.com> Return true on errors, return true on errors, return true on errors

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64957 91177308-0d34-0410-b5e6-96231b3b80d8
mplicit-builtin-redecl.c
48f3bb9f780f6e64ab71ba0202ca04b07473805a 18-Feb-2009 Douglas Gregor <dgregor@apple.com> Downgrade complaints about calling unavailable functions to a warning
(as GCC does), except when we've performed overload resolution and
found an unavailable function: in this case, we actually error.

Merge the checking of unavailable functions with the checking for
deprecated functions. This unifies a bit of code, and makes sure that
we're checking for unavailable functions in the right places. Also,
this check can cause an error. We may, eventually, want an option to
make "unavailable" warnings into errors.

Implement much of the logic needed for C++0x deleted functions, which
are effectively the same as "unavailable" functions (but always cause
an error when referenced). However, we don't have the syntax to
specify deleted functions yet :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64955 91177308-0d34-0410-b5e6-96231b3b80d8
verloadable.c
7549c5589ac0d2087e55f2bdd4854adef23f29fd 18-Feb-2009 Daniel Dunbar <daniel@zuster.org> __attribute__((aligned)) was being ignored!

This knocks out another 8 gcc/compat/i386 & x86_64 failures.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64947 91177308-0d34-0410-b5e6-96231b3b80d8
truct-packed-align.c
d0d082f2eba4e3ed4eb467d76fd227c6dcd6cce7 18-Feb-2009 Chris Lattner <sabre@nondot.org> use the full spelling of a string literal token so that trigraphs
and escaped newlines don't throw off the offset computation.

On this testcase:
printf("abc\
def"
"%*d", (unsigned) 1, 1);

Before:
t.m:5:5: warning: field width should have type 'int', but argument has type 'unsigned int'
def"
^

after:
t.m:6:12: warning: field width should have type 'int', but argument has type 'unsigned int'
"%*d", (unsigned) 1, 1);
^ ~~~~~~~~~~~~



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64930 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
07f192e1d7af64d63fd80eafd724b70a18ebfbd9 18-Feb-2009 Chris Lattner <sabre@nondot.org> add c testcase for string literal diagnostic improvement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64929 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
965acbb321e94e36aa5365126eee46b97745fdbb 18-Feb-2009 Douglas Gregor <dgregor@apple.com> Allow "overloadable" functions in C to be declared as variadic without
any named parameters, e.g., this is accepted in C:

void f(...) __attribute__((overloadable));

although this would be rejected:

void f(...);

To do this, moved the checking of the "ellipsis without any named
arguments" condition from the parser into Sema (where it belongs anyway).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64902 91177308-0d34-0410-b5e6-96231b3b80d8
verloadable.c
c6666f8e9bbb7f31bf2e52f97137e738c4ca01d0 18-Feb-2009 Douglas Gregor <dgregor@apple.com> Don't allow calls to functions marked "unavailable". There's more work
to do in this area, since there are other places that reference
FunctionDecls.

Don't allow "overloadable" functions (in C) to be declared without a
prototype.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64897 91177308-0d34-0410-b5e6-96231b3b80d8
verloadable.c
edbb94cee89ba366989f0a6d05debbb5d54d4342 18-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Fix test on platforms where size_t != unsigned long.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64867 91177308-0d34-0410-b5e6-96231b3b80d8
mplicit-builtin-decl.c
2d6744ff04c1690a1485178d550d2fab84a0270b 18-Feb-2009 Daniel Dunbar <daniel@zuster.org> isICE was evaluating ?: incorrectly with missing-gcc-LHS extension.

Add assert to isICE that, on success, result must be the same as
EvaluateAsInt()... this enforces a minimum level of sanity.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64865 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
2846584793cd8ed3c02b4555c3d09d216dbdcc1c 17-Feb-2009 Douglas Gregor <dgregor@apple.com> Proof that attribute __overloadable__ works as well as overloadable

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64781 91177308-0d34-0410-b5e6-96231b3b80d8
verloadable.c
655753a757b3eae4306cf59e84a63b78ebb2b9a7 17-Feb-2009 Douglas Gregor <dgregor@apple.com> Remove the error about redefining library functions. It's causing too
much pain when compiling the Linux kernel (PR3592).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64767 91177308-0d34-0410-b5e6-96231b3b80d8
mplicit-builtin-decl.c
9add31798f621f843233dbff8bba103fca64447b 17-Feb-2009 Douglas Gregor <dgregor@apple.com> Static variables and functions won't collide with standard library
functions, so if we're declaring a static we should implicitly declare
a library function by the same name (e.g., malloc, strdup). Fixes PR3592.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64736 91177308-0d34-0410-b5e6-96231b3b80d8
mplicit-builtin-decl.c
mplicit-builtin-redecl.c
5bef8ddabfe157aa6f1f9010d3d144215b3e731a 17-Feb-2009 Chris Lattner <sabre@nondot.org> add support for -fno-math-errno, and validate that it affects sema properly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64708 91177308-0d34-0410-b5e6-96231b3b80d8
nused-expr.c
7d84c76648792cf1035bfc4d60559f5a4544edb1 17-Feb-2009 Chris Lattner <sabre@nondot.org> sema no longer explodes, yay!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64707 91177308-0d34-0410-b5e6-96231b3b80d8
nused-expr.c
396b2a22788b0134018760d6a476de1e20f81334 17-Feb-2009 Daniel Dunbar <daniel@zuster.org> Diagnose non-power-of-2 arguments to attribute aligned.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64700 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-aligned.c
22bd905673a73ccb9b5e45a7038ec060c9650ffe 16-Feb-2009 Chris Lattner <sabre@nondot.org> diagnose uses of deprecated typenames and tags.
We now pass all the deprecation tests in the objc.dg suite.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64679 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-deprecated.c
73525de7fd9bdd534382dc89a24f1f76db3e04b9 16-Feb-2009 Chris Lattner <sabre@nondot.org> enhance ExtVectorElementExpr to allow V->xxyy to work like (*V).xxyy


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64667 91177308-0d34-0410-b5e6-96231b3b80d8
xt_vector_components.c
6871981fbccba9e8a63997d58245ec0add114f49 16-Feb-2009 Douglas Gregor <dgregor@apple.com> When a function with a prototype is redeclared without a prototype,
merge the prototype into the redeclaration (and make a note in the
declaration). Fixes PR3588.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64641 91177308-0d34-0410-b5e6-96231b3b80d8
unction-redecl.c
cda9c674998aedeb9319e95a0284f4d266dcef32 16-Feb-2009 Douglas Gregor <dgregor@apple.com> Adopt a more principled approach to invalid declarations:
- If a declaration is an invalid redeclaration of an existing name,
complain about the invalid redeclaration then avoid adding it to
the AST (we can still parse the definition or initializer, if any).
- If the declaration is invalid but there is no prior declaration
with that name, introduce the invalid declaration into the AST
(for later error recovery).
- If the declaration is an invalid redeclaration of a builtin that
starts with __builtin_, we produce an error and drop the
redeclaration. If it is an invalid redeclaration of a library
builtin (e.g., malloc, printf), warn (don't error!) and drop the
redeclaration.

If a user attempts to define a builtin, produce an error and (if it's
a library builtin like malloc) suggest -ffreestanding.

This addresses <rdar://problem/6097585> and PR2892. However, PR3588 is
still going to cause some problems when builtins are redeclared
without a prototype.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64639 91177308-0d34-0410-b5e6-96231b3b80d8
mplicit-builtin-decl.c
redefined-function.c
entative-decls.c
ypedef-redef.c
553905db4c758883345efa3c4c07e1dba2c74a2f 16-Feb-2009 Chris Lattner <sabre@nondot.org> add support for deprecated objc ivars.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64637 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-deprecated.c
cfdff38e8e931c0020dff10a32221d8fedb287a6 16-Feb-2009 Chris Lattner <sabre@nondot.org> Add support for deprecated members of RecordDecls (e.g. struct fields).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64634 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-deprecated.c
b104b1f6ca76cefab25c6ecb5df3bf87a0f875d3 15-Feb-2009 Nate Begeman <natebegeman@mac.com> Don't allow taking the address of an element in an ext_vector


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64614 91177308-0d34-0410-b5e6-96231b3b80d8
xpr-address-of.c
61a0f17301f889260de739219c3e1d4c8039210e 15-Feb-2009 Chris Lattner <sabre@nondot.org> allow implementations of deprecated functions to use deprecated symbols.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64572 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-deprecated.c
f244cd7e54753caf6edb76df430dea2f43bb82a8 14-Feb-2009 Douglas Gregor <dgregor@apple.com> Add a test case for -ffreestanding that redefines malloc.

Warn that complex numbers are an extension in a freestanding C99
implementation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64568 91177308-0d34-0410-b5e6-96231b3b80d8
mplicit-builtin-freestanding.c
arn-freestanding-complex.c
3c385e5f8d9008fff18597ca302be19fa86e51f6 14-Feb-2009 Douglas Gregor <dgregor@apple.com> Add hook to add attributes to function declarations that we know
about, whether they are builtins or not. Use this to add the
appropriate "format" attribute to NSLog, NSLogv, asprintf, and
vasprintf, and to translate builtin attributes (from Builtins.def)
into actual attributes on the function declaration.

Use the "printf" format attribute on function declarations to
determine whether we should do format string checking, rather than
looking at an ad hoc list of builtins and "known" function names.

Be a bit more careful about when we consider a function a "builtin" in
C++.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64561 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
4238254b9846589e401019349badbad9aa8b6fe6 14-Feb-2009 Chris Lattner <sabre@nondot.org> new tests, it would be nice to not warn on the second one.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64549 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-deprecated.c
026dc96ac6ece60da5e1b98e2a71bd0ff0939fd8 14-Feb-2009 Chris Lattner <sabre@nondot.org> Several related changes:
1) implement parser and sema support for reading and verifying attribute(warnunusedresult).
2) rename hasLocalSideEffect to isUnusedResultAWarning, inverting the sense
of its result.
3) extend isUnusedResultAWarning to directly return the loc and range
info that should be reported to the user. Make it substantially more
precise in some cases than what was previously reported.
4) teach isUnusedResultAWarning about CallExpr to decls that are
pure/const/warnunusedresult, fixing a fixme.
5) change warn_attribute_wrong_decl_type to not pass in english strings, instead,
pass in integers and use %select.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64543 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-warn_unused_result.c
llimport-dllexport.c
370ab3f1373841d70582feac9e35c3c6b3489f63 14-Feb-2009 Douglas Gregor <dgregor@apple.com> Make it possible for builtins to expression FILE* arguments, so that
we can define builtins such as fprintf, vfprintf, and
__builtin___fprintf_chk. Give a nice error message when we need to
implicitly declare a function like fprintf.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64526 91177308-0d34-0410-b5e6-96231b3b80d8
mplicit-builtin-decl.c
a316e7b735b12ce6b34961a9dcfaae34f4b08d29 14-Feb-2009 Douglas Gregor <dgregor@apple.com> Extend builtin "attribute" syntax to include a notation for
printf-like functions, both builtin functions and those in the
C library. The function-call checker now queries this attribute do
determine if we have a printf-like function, rather than scanning
through the list of "known functions IDs". However, there are 5
functions they are not yet "builtins", so the function-call checker
handles them specifically still:

- fprintf and vfprintf: the builtins mechanism cannot (yet)
express FILE* arguments, so these can't be encoded.
- NSLog: the builtins mechanism cannot (yet) express NSString*
arguments, so this (and NSLogv) can't be encoded.
- asprintf and vasprintf: these aren't part of the C99 standard
library, so we really shouldn't be defining them as builtins in
the general case (and we don't seem to have the machinery to make
them builtins only on certain targets and depending on whether
extensions are enabled).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64512 91177308-0d34-0410-b5e6-96231b3b80d8
lock-return.c
3e41d60eb627dc227c770f1c1c87d06909cf05fd 14-Feb-2009 Douglas Gregor <dgregor@apple.com> Implicitly declare certain C library functions (malloc, strcpy, memmove,
etc.) when we perform name lookup on them. This ensures that we
produce the correct signature for these functions, which has two
practical impacts:

1) When we're supporting the "implicit function declaration" feature
of C99, these functions will be implicitly declared with the right
signature rather than as a function returning "int" with no
prototype. See PR3541 for the reason why this is important (hint:
GCC always predeclares these functions).

2) If users attempt to redeclare one of these library functions with
an incompatible signature, we produce a hard error.

This patch does a little bit of work to give reasonable error
messages. For example, when we hit case #1 we complain that we're
implicitly declaring this function with a specific signature, and then
we give a note that asks the user to include the appropriate header
(e.g., "please include <stdlib.h> or explicitly declare 'malloc'"). In
case #2, we show the type of the implicit builtin that was incorrectly
declared, so the user can see the problem. We could do better here:
for example, when displaying this latter error message we say
something like:

'strcpy' was implicitly declared here with type 'char *(char *, char
const *)'

but we should really print out a fake code line showing the
declaration, like this:

'strcpy' was implicitly declared here as:

char *strcpy(char *, char const *)

This would also be good for printing built-in candidates with C++
operator overloading.

The set of C library functions supported by this patch includes all
functions from the C99 specification's <stdlib.h> and <string.h> that
(a) are predefined by GCC and (b) have signatures that could cause
codegen issues if they are treated as functions with no prototype
returning and int. Future work could extend this set of functions to
other C library functions that we know about.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64504 91177308-0d34-0410-b5e6-96231b3b80d8
mplicit-builtin-decl.c
186204bfcf9c53d48143ec300d4c3d036fed4140 13-Feb-2009 Daniel Dunbar <daniel@zuster.org> Warn about attribute used ignored on "extern int a
__attribute__((used))".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64499 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-used.c
56cd21bd52aed7a32f3ff11b7e480f664d0b4262 13-Feb-2009 Chris Lattner <sabre@nondot.org> If x is an invalid field decl, don't construct an expression for P->x,
just silently return an error to avoid bogus diagnostics.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64491 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
b805dad4aa386aeae0f72512895bd238678d37a5 13-Feb-2009 Daniel Dunbar <daniel@zuster.org> Sema/AST support for attribute used. Patch by Anders Johnson (with small tweaks & test case)!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64478 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-used.c
b235caa53b6743fda9f749a8218760c024e4cf9e 13-Feb-2009 Anders Carlsson <andersca@mac.com> Start warning about unknown attributes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64447 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-deprecated.c
d87df37e0adaba0d5e33da7b1a14d7f1d94c5eef 13-Feb-2009 Anders Carlsson <andersca@mac.com> Add sema support for the nodebug attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64441 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-nodebug.c
f98aba35e6c3da5aae61843fc01334939e4e12ec 13-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Initial implementation of arbitrary fixed-width integer types.
Currently only used for 128-bit integers.

Note that we can't use the fixed-width integer types for other integer
modes without other changes because glibc headers redefines (u)int*_t
and friends using the mode attribute. For example, this means that uint64_t
has to be compatible with unsigned __attribute((mode(DI))), and
uint64_t is currently defined to long long. And I have a feeling we'll
run into issues if we try to define uint64_t as something which isn't
either long or long long.

This doesn't get the alignment right in most cases, including
the 128-bit integer case; I'll file a PR shortly. The gist of the issue
is that the targets don't really expose the information necessary to
figure out the alignment outside of the target description, so there's a
non-trivial amount of work involved in getting it working right. That
said, the alignment used is conservative, so the only issue with the
current implementation is ABI compatibility.

This makes it trivial to add some sort of "bitwidth" attribute to make
arbitrary-width integers; I'll do that in a followup.

We could also use this for stuff like the following for compatibility
with gcc, but I have a feeling it would be a better idea for clang to be
consistent between C and C++ modes rather than follow gcc's example for
C mode.
struct {unsigned long long x : 33;} x;
unsigned long long a(void) {return x.x+1;}



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64434 91177308-0d34-0410-b5e6-96231b3b80d8
28bitint.c
ae17094c001972a5949944a0a77ef6adf2a92c8f 13-Feb-2009 Douglas Gregor <dgregor@apple.com> Tighten checking of the "overloadable" attribute. If any function by a
given name in a given scope is marked as "overloadable", every
function declaration and definition with that same name and in that
same scope needs to have the "overloadable" attribute. Essentially,
the "overloadable" attribute is not part of attribute merging, so it
must be specified even for redeclarations. This keeps users from
trying to be too sneaky for their own good:

double sin(double) __attribute__((overloadable)); // too sneaky
#include <math.h>

Previously, this would have made "sin" overloadable, and therefore
given it a mangled name. Now, we get an error inside math.h when we
see a (re)declaration of "sin" that doesn't have the "overloadable"
attribute.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64414 91177308-0d34-0410-b5e6-96231b3b80d8
verloadable.c
4fc526d80d829b2f8c294a4c3360c820f1f6e7c2 12-Feb-2009 Douglas Gregor <dgregor@apple.com> Add missing test for the "overloadable" attribute

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64396 91177308-0d34-0410-b5e6-96231b3b80d8
verloadable.c
dfb5e597e033c8fa09c0e178bd93cfcdf060862e 12-Feb-2009 Douglas Gregor <dgregor@apple.com> Fix a bug with designated initializers where we were stepping out of a
union subobject initialization before checking whether the next
initiailizer was actually a designated initializer. This led to
spurious "excess elements in union initializer" errors. Thanks to
rdivacky for reporting the bug!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64392 91177308-0d34-0410-b5e6-96231b3b80d8
esignated-initializers.c
adadd8db2aba32f689e7057d8b7ce004be30685b 12-Feb-2009 Daniel Dunbar <daniel@zuster.org> Fix va_arg bug noticed by Eli, __builtin_va_arg is not an l-value
designating an object.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64371 91177308-0d34-0410-b5e6-96231b3b80d8
arargs.c
241540eb1c46593a93870e20efe6a694444b5f47 12-Feb-2009 Douglas Gregor <dgregor@apple.com> Add test for overloading with _Complex in C

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64347 91177308-0d34-0410-b5e6-96231b3b80d8
verloadable-complex.c
3ebc36a1c15537684a62a02a2d6c94bbb4a9e4cc 11-Feb-2009 Chris Lattner <sabre@nondot.org> testcase for rdar://6096412 which already works.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64289 91177308-0d34-0410-b5e6-96231b3b80d8
erge-decls.c
0bfe54fdc83b7b4e37c40e652d86d15aa89885b2 10-Feb-2009 Douglas Gregor <dgregor@apple.com> GNU allows structs with flexible array members to be placed inside
arrays and other structs/unions as an extension. Downgrade our error
to a warning. Fixes PR3540.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64239 91177308-0d34-0410-b5e6-96231b3b80d8
rray-constraint.c
lexible-array-init.c
fdf556936f94344d5482747403f27822cf0ae37f 09-Feb-2009 Douglas Gregor <dgregor@apple.com> When handling "the rest" of a designated array subobject, maybe sure
to tell it that it wasn't (directly) designated. This way, we unwind
back to the explicit initializer list properly rather than getting
stuck in the wrong subobject. Fixes llvm.org/PR3519



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64155 91177308-0d34-0410-b5e6-96231b3b80d8
esignated-initializers.c
89ef6e03665635d965ba6c92035a85b125e6c78c 08-Feb-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Fix redundant errors for redefinitions with multiple existing definitions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64081 91177308-0d34-0410-b5e6-96231b3b80d8
entative-decls.c
ddf7e994b55ed2f161e22dfab8db14997e22c01c 08-Feb-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Make the test cases failing due to exact diagnostic matching XFAIL.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64080 91177308-0d34-0410-b5e6-96231b3b80d8
entative-decls.c
bfa2ac06d40d9b7411287dd0155d3e47c6c15be6 08-Feb-2009 Mike Stump <mrs@apple.com> Fixup expected errors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64074 91177308-0d34-0410-b5e6-96231b3b80d8
lock-misc.c
89941c1c68d8e4eec3c8ea8ee68e34d9e3c7b083 08-Feb-2009 Anders Carlsson <andersca@mac.com> Improve Sema of the cleanup attribute somewhat.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64047 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-cleanup.c
3cb069213c8502dbb7a67860d40122d869ed8fd6 07-Feb-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Make one expected-diag directive match exactly one actual diagnostic.
This uncovers some bugs, so several test cases now fail.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64025 91177308-0d34-0410-b5e6-96231b3b80d8
rray-constraint.c
lexible-array-init.c
ncomplete-decl.c
ointer-addition.c
392cf91c7b3270a9b27baa3c5b21a836f3330d98 07-Feb-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Use our new snazzy stdint.h to make a testcase 64-bit portable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63985 91177308-0d34-0410-b5e6-96231b3b80d8
nit.c
eeb15d499f032bb89773ddaca2d17475122a37bb 04-Feb-2009 Douglas Gregor <dgregor@apple.com> 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.

Addresses PR2561: http://llvm.org/bugs/show_bug.cgi?id=2561


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63785 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
lexible-array-init.c
98eb8a7a702b95183ed015706b1f1c66f5cb27a4 04-Feb-2009 Mike Stump <mrs@apple.com> Add support for blocks with explicit return types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63784 91177308-0d34-0410-b5e6-96231b3b80d8
lock-explicit-return-type.c
lock-return.c
lock-syntax-error.c
18d76c27176dcb9f4be4eaf7768100075f180f3f 04-Feb-2009 Douglas Gregor <dgregor@apple.com> Note the Radar number that corresponds to PR3137

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63754 91177308-0d34-0410-b5e6-96231b3b80d8
unction.c
0e8aaaf67b0c172e5a55cded30b80a83d3bd477f 04-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Test for PR3137.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63749 91177308-0d34-0410-b5e6-96231b3b80d8
unction.c
1931b44da8da86979a8d7ceb48685686503f197b 03-Feb-2009 Douglas Gregor <dgregor@apple.com> Simplify the way in which we inject the names of tag definitions and
elaborated-type-specifier declarations into outer scopes while
retaining their proper lexical scope. This way is simpler and more
consistent with the way DeclContexts work, and also fixes

http://llvm.org/bugs/show_bug.cgi?id=3430


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63581 91177308-0d34-0410-b5e6-96231b3b80d8
truct-decl.c
ff77645058c5d56b4f3273e27f7492c78288825e 02-Feb-2009 Nuno Lopes <nunoplopes@sapo.pt> emit diagnostic when casting a ptr to a small int when doing static initialization (addresses Eli's comments I believe)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63562 91177308-0d34-0410-b5e6-96231b3b80d8
tatic-init.c
1dfa6e15cba39f27a438d63837435596e58af1c1 02-Feb-2009 Nuno Lopes <nunoplopes@sapo.pt> fix TryToFixInvalidVariablyModifiedType to reject negative array sizes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63557 91177308-0d34-0410-b5e6-96231b3b80d8
truct-decl.c
d863517ab7e936cbc3244a0fc431c8b672f5ece4 02-Feb-2009 Douglas Gregor <dgregor@apple.com> Add iterators to LookupResult, allowing one to iterate over the
non-ambiguous name lookup results without allocating any memory, e.g.,
for sets of overloaded functions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63549 91177308-0d34-0410-b5e6-96231b3b80d8
nit.c
839508150a7a595b6172217eeddc4d024fc201c5 02-Feb-2009 Nuno Lopes <nunoplopes@sapo.pt> allow cast from array to int to be considered as constant

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63519 91177308-0d34-0410-b5e6-96231b3b80d8
tatic-init.c
f23199847b686ca2d674274ee7271f75640c1e0e 02-Feb-2009 Nuno Lopes <nunoplopes@sapo.pt> fix PR3459: improve compatibility with gcc when checking for constant exprs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63517 91177308-0d34-0410-b5e6-96231b3b80d8
truct-decl.c
b95907d6b65ac759ac8ccd6be4f2a1f3eb389e87 31-Jan-2009 Anders Carlsson <andersca@mac.com> Forgot to add this test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63484 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-cleanup.c
ad53eff73224b29955da59f65e6b9eba1a5f6b76 31-Jan-2009 Anders Carlsson <andersca@mac.com> Fix typo noticed by Chris.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63449 91177308-0d34-0410-b5e6-96231b3b80d8
ypedef-retain.c
b0f90ccbc1079bb054071b836aa6dd265f33f3a2 31-Jan-2009 Anders Carlsson <andersca@mac.com> Turn on -flax-vector-conversions by default, issue a warning whenever one is done. Add a -fnolax-vector-conversions option. Fixes PR2862.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63447 91177308-0d34-0410-b5e6-96231b3b80d8
ypedef-retain.c
ector-assign.c
b574e5630d66629ccc8f2432e60b59ae42f1f363 30-Jan-2009 Douglas Gregor <dgregor@apple.com> Upgrade the "excess elements in array initializer" warning to an
error, since both C99 and C++ consider it an error. For reference, GCC
makes this a warning while G++ makes it an error.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63435 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
ector-init.c
d079b2d6005bdade40ae4a0f228aba2affc591cf 30-Jan-2009 Douglas Gregor <dgregor@apple.com> Closed out a few radars that were addressed by designated initializers

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63398 91177308-0d34-0410-b5e6-96231b3b80d8
nit.c
a9c878086036de36482cc21e35a33cabe9699b0a 29-Jan-2009 Douglas Gregor <dgregor@apple.com> Make CodeGen produce an error if we come across a non-constant initializer list that involves the GNU array-range designator extension

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63327 91177308-0d34-0410-b5e6-96231b3b80d8
esignated-initializers.c
58e22b19add744ff2094fbdc366a39709680c35d 29-Jan-2009 Douglas Gregor <dgregor@apple.com> Add another devilish testcase for designated initializers

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63262 91177308-0d34-0410-b5e6-96231b3b80d8
esignated-initializers.c
6fbdc6bd38cc51232223ae3539c32f23c45ea852 29-Jan-2009 Douglas Gregor <dgregor@apple.com> Eliminate infinite looping in a wacky case with designated initializers. Simplifies (somewhat) the actually checking of the initializer expression following the designators

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63257 91177308-0d34-0410-b5e6-96231b3b80d8
esignated-initializers.c
34e7946831a63f96d3ba3478c74ca8e25ee52d7e 29-Jan-2009 Douglas Gregor <dgregor@apple.com> Improvements to code-generation and semantic analysis of designated
initializers.

- We now initialize unions properly when a member other than the
first is named by a designated initializer.
- We now provide proper semantic analysis and code generation for
GNU array-range designators *except* that side effects will occur
more than once. We warn about this.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63253 91177308-0d34-0410-b5e6-96231b3b80d8
esignated-initializers.c
4c67834407ca6ab344dcf44fc599ad4938cfa96d 28-Jan-2009 Douglas Gregor <dgregor@apple.com> Code generation support for C99 designated initializers.

The approach I've taken in this patch is relatively straightforward,
although the code itself is non-trivial. Essentially, as we process
an initializer list we build up a fully-explicit representation of the
initializer list, where each of the subobject initializations occurs
in order. Designators serve to "fill in" subobject initializations in
a non-linear way. The fully-explicit representation makes initializer
lists (both with and without designators) easy to grok for codegen and
later semantic analyses. We keep the syntactic form of the initializer
list linked into the AST for those clients interested in exactly what
the user wrote.

Known limitations:
- Designating a member of a union that isn't the first member may
result in bogus initialization (we warn about this)
- GNU array-range designators are not supported (we warn about this)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63242 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
esignated-initializers.c
ector-init.c
64cfdb7da3cb744642fe8a99ad5c851ad3c930b2 28-Jan-2009 Daniel Dunbar <daniel@zuster.org> Handle complex types in ASTContext::mergeTypes


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63238 91177308-0d34-0410-b5e6-96231b3b80d8
erge-decls.c
b243b7d98e51cbbd58b71666aa6b5e0ec80de6aa 28-Jan-2009 Nuno Lopes <nunoplopes@sapo.pt> add test for PR2502, which was already fixed some time ago

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63160 91177308-0d34-0410-b5e6-96231b3b80d8
erge-decls.c
03eb543cf7ebee463b33b5802b83ac92c21770cf 27-Jan-2009 Anders Carlsson <andersca@mac.com> If an input constraint refers to an output constraint, it should have the same constraint info as the output constraint. Fixes PR3417

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63127 91177308-0d34-0410-b5e6-96231b3b80d8
sm.c
13ca96a238089fb8e622791bc0dc441eb2dd29b4 25-Jan-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR2100: merge types for variables.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62947 91177308-0d34-0410-b5e6-96231b3b80d8
ecl-type-merging.c
9804bc26b85df95dbda40772161db00824f265ea 25-Jan-2009 Eli Friedman <eli.friedman@gmail.com> Correct test; sorry for any inconvenience.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62946 91177308-0d34-0410-b5e6-96231b3b80d8
tmt_exprs.c
dca2b7314f73fbb1e897befdc4f0ddaa9905d72c 25-Jan-2009 Eli Friedman <eli.friedman@gmail.com> PR3062: statement expressions should be illegal at file scope. I don't
think this has any significant effects at the moment, but it could
matter if we start constant-folding statement expressions like gcc does.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62943 91177308-0d34-0410-b5e6-96231b3b80d8
tmt_exprs.c
da0274725667d1168867dc404417f2c68c8dc0c5 24-Jan-2009 Chris Lattner <sabre@nondot.org> Implement C99 6.5.3.4p1, rejecting sizeof(bitfield)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62936 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
31e21e05623ce9d11b1a893fecb87ad349df6c7d 24-Jan-2009 Chris Lattner <sabre@nondot.org> Fix PR3386 by handling GCC's rules for alignof, which are substantially
different than those for sizeof. Reject alignof(bitfield) like gcc does.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62928 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
8f826f0e0c90b05ab04e84c29157d2e965713288 24-Jan-2009 Daniel Dunbar <daniel@zuster.org> Fix invalid evaluation of _Complex float (real & imaginary parts had
mismatched semantics).
- Enforce this in APValue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62924 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
79bc64ceb2586246c74b2584be56ecef00a0c9c1 24-Jan-2009 Anders Carlsson <andersca@mac.com> Handle the 'e' constraint. Fixes PR3385

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62923 91177308-0d34-0410-b5e6-96231b3b80d8
sm.c
91b9f2072a20906dd34ac6cb83813debf3595328 24-Jan-2009 Anders Carlsson <andersca@mac.com> Ignore parens when determining if an expr is a string literal. Fixes PR3382.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62922 91177308-0d34-0410-b5e6-96231b3b80d8
nit.c
d6f584ff262f51b40f4c9e317b13f1f21db29755 23-Jan-2009 Douglas Gregor <dgregor@apple.com> More APSInt appeasement

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62884 91177308-0d34-0410-b5e6-96231b3b80d8
esignated-initializers.c
53d3d8e0662197f7245d8f5ff697a72a2b4b3f54 23-Jan-2009 Douglas Gregor <dgregor@apple.com> Hopefully the last of the APSInt signedness issues with initializers. Fixes PR clang/3378

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62876 91177308-0d34-0410-b5e6-96231b3b80d8
esignated-initializers.c
0804888d9162cfd422925762c161bd80f80358b9 23-Jan-2009 Douglas Gregor <dgregor@apple.com> Allow subtraction of function pointer types in C, as a GNU extension. Fixes rdar://problem/6520707

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62859 91177308-0d34-0410-b5e6-96231b3b80d8
ointer-subtract-compat.c
e3fa2de90ea1666bf4504b8fd557b09a57aac222 23-Jan-2009 Douglas Gregor <dgregor@apple.com> Make sure all of the isUnsigned flags line up when comparing initializer values, to really really fix PR clang/3377

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62858 91177308-0d34-0410-b5e6-96231b3b80d8
esignated-initializers.c
f6c717c3dca839dcd189b4a6fa46c8fe7a8bec1d 23-Jan-2009 Douglas Gregor <dgregor@apple.com> Properly manage the bit-widths of APInts/APSInts in array initialization.
Fixes PR clang/3377


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62851 91177308-0d34-0410-b5e6-96231b3b80d8
esignated-initializers.c
nit.c
be109b3e768b70f9efb106d25d6b5a2c72c5a9b8 23-Jan-2009 Douglas Gregor <dgregor@apple.com> Handle any undeclared parameters in a K&R-style function with a
special action, inside function prototype scope. This avoids confusion
when we try to inject these parameters into the scope of the function
body before the function itself has been added to the surrounding
scope. Fixes <rdar://problem/6097326>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62849 91177308-0d34-0410-b5e6-96231b3b80d8
unction.c
edefinition.c
c983b86514d14dd4b30147bf6791dde9487d2c3f 23-Jan-2009 Douglas Gregor <dgregor@apple.com> Support arithmetic on pointer-to-function types as a GNU
extension. Addresses clang PR/3371.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62823 91177308-0d34-0410-b5e6-96231b3b80d8
ointer-addition.c
87f55cf59e82f246d8605733e9300d0c5f6830a6 23-Jan-2009 Douglas Gregor <dgregor@apple.com> Reimplement the handling of the "current object" in designator
initializers, so that we are within the appropriate subobject after
we've processed a multi-designator designation. We're matching GCC and
EDG's behavior on all examples I've found thus far.

*Huge* thanks to Eli Friedman for pointing out my fundamental
misunderstanding of "current object" in the C99 spec.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62812 91177308-0d34-0410-b5e6-96231b3b80d8
esignated-initializers.c
05c13a3411782108d65aab3c77b1a231a4963bc0 22-Jan-2009 Douglas Gregor <dgregor@apple.com> Initial implementation of semantic analysis and ASTs for C99
designated initializers. This implementation should cover all of the
constraints in C99 6.7.8, including long, complex designations and
computing the size of incomplete array types initialized with a
designated initializer. Please see the new test-case and holler if you
find cases where this doesn't work.

There are still some wrinkles with GNU's anonymous structs and
anonymous unions (it isn't clear how these should work; we'll just
follow GCC's lead) and with designated initializers for the members of a
union. I'll tackle those very soon.

CodeGen is still nonexistent, and there's some leftover code in the
parser's representation of designators that I'll also need to clean up.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62737 91177308-0d34-0410-b5e6-96231b3b80d8
esignated-initializers.c
e6ea27995fb15add0de47588b4226049fa0753e5 21-Jan-2009 Anders Carlsson <andersca@mac.com> Fix an inline asm sema bug that I introduced.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62666 91177308-0d34-0410-b5e6-96231b3b80d8
sm.c
d9fca6e3950346ea503f92f27ed0f9d8edde9feb 20-Jan-2009 Anders Carlsson <andersca@mac.com> Improvements to Sema of asm statements. Fixes <rdar://problem/6156893>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62609 91177308-0d34-0410-b5e6-96231b3b80d8
sm.c
6597f985156b3a24c0a9db1e01eeec85714c4a8d 20-Jan-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR3350: add special-casing for "references" to va_lists in
builtins.

Also, a minor tweak to va_copy for consistency.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62574 91177308-0d34-0410-b5e6-96231b3b80d8
arargs.c
4ec339f43c0cae2678334850c90926bea10999c7 19-Jan-2009 Douglas Gregor <dgregor@apple.com> Centralize error reporting of improper uses of incomplete types in the
new DiagnoseIncompleteType. It provides additional information about
struct/class/union/enum types when possible, either by pointing to the
forward declaration of that type or by pointing to the definition (if
we're in the process of defining that type).
Fixes <rdar://problem/6500531>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62521 91177308-0d34-0410-b5e6-96231b3b80d8
rray-constraint.c
ompound-literal.c
num.c
ncomplete-decl.c
nit.c
ointer-addition.c
42e1ee0702d8267d632df0fdb5c479a582877c6f 18-Jan-2009 Anders Carlsson <andersca@mac.com> Add sema support for symbolic names in inline asm statements.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62441 91177308-0d34-0410-b5e6-96231b3b80d8
sm.c
353417af9d254d4fd0eb7d0a3ff71c4d8594ac58 18-Jan-2009 Nate Begeman <natebegeman@mac.com> Update support for vector component access on ExtVectors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62440 91177308-0d34-0410-b5e6-96231b3b80d8
xt_vector_components.c
8158f692571ba5eaae19e086b76d19319ac503c5 17-Jan-2009 Douglas Gregor <dgregor@apple.com> Warn about typedefs of enums without any declarator name. Fixes rdar://problem/6503878

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62397 91177308-0d34-0410-b5e6-96231b3b80d8
num.c
0b7a158d120ac8d78c114a823e17eedfec6b6658 17-Jan-2009 Douglas Gregor <dgregor@apple.com> Teach DeclContext how to find the primary declaration for any TagDecl
even when we are still defining the TagDecl. This is required so that
qualified name lookup of a class name within its definition works (see
the new bits in test/SemaCXX/qualified-id-lookup.cpp).

As part of this, move the nested redefinition checking code into
ActOnTag. This gives us diagnostics earlier (when we try to perform
the nested redefinition, rather than when we try to complete the 2nd
definition) and removes some code duplication.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62386 91177308-0d34-0410-b5e6-96231b3b80d8
num.c
6ed2ef8281e44fdd8f002d1cbe11668068d3e530 15-Jan-2009 Nuno Lopes <nunoplopes@sapo.pt> add support for initializing static vars with a cast to union (gcc extension)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62261 91177308-0d34-0410-b5e6-96231b3b80d8
ast-to-union.c
eff2cd58a897379c7fc46e83447d4619d6f6e9ca 15-Jan-2009 Seo Sanghyeon <sanxiyn@gmail.com> PR2746: Implement GCC cast to union extension

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62255 91177308-0d34-0410-b5e6-96231b3b80d8
ast-to-union.c
ff03fbb6718ff310da3c5a0cb66038666fe6b09a 14-Jan-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to keep clang honest that it does not yet support
explicit return type on block literals.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62240 91177308-0d34-0410-b5e6-96231b3b80d8
lock-syntax-error.c
53859912e4b5c4493e28c9ead8d634fdaac6adaf 13-Jan-2009 Anders Carlsson <andersca@mac.com> Use the unqualified type for GCCs struct/union cast extension

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62170 91177308-0d34-0410-b5e6-96231b3b80d8
truct-cast.c
0fdea465617caaa9e1370c82482473f25b14b734 13-Jan-2009 Ted Kremenek <kremenek@apple.com> Fix test case (incomplete "expected-warning" line)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62119 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
d30ef87f34015d18bde20b9632032d0063d761aa 13-Jan-2009 Ted Kremenek <kremenek@apple.com> Patch by Roman Divacky:

Extend string-literal checking for printf() format string to handle conditional
ternary operators where both sides are literals.

This fixes PR 3319: http://llvm.org/bugs/show_bug.cgi?id=3319


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62117 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
4920f1ffb62b13b88e579476803c093f97f3e17f 12-Jan-2009 Douglas Gregor <dgregor@apple.com> Implement support for anonymous structs and unions in C. Both C and
C++ handle anonymous structs/unions in the same way. Addresses several
bugs:

<rdar://problem/6259534>
<rdar://problem/6481130>
<rdar://problem/6483159>

The test case in PR clang/1750 now passes with -fsyntax-only, but
CodeGen for inline assembler still fails.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62112 91177308-0d34-0410-b5e6-96231b3b80d8
nonymous-struct-union.c
1a0d31a3d7f14ddc6370ba912c778aece6c12cf0 12-Jan-2009 Douglas Gregor <dgregor@apple.com> Properly set the scope of non-fields declared within a struct, union,
or enum to be outside that struct, union, or enum. Fixes several
regressions:

<rdar://problem/6487662>
<rdar://problem/6487669>
<rdar://problem/6487684>
<rdar://problem/6487702>
PR clang/3305
PR clang/3312

There is still some work to do in Objective-C++, but this requires
that each of the Objective-C entities (interfaces, implementations,
etc.) to be introduced into the context stack with
PushDeclContext/PopDeclContext. This will be a separate fix, later.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62091 91177308-0d34-0410-b5e6-96231b3b80d8
ype-spec-struct-union.c
863ea9aa73c0e7f19694ab7d618debbcde3e4157 12-Jan-2009 Chris Lattner <sabre@nondot.org> testcase that works now with r62061


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62062 91177308-0d34-0410-b5e6-96231b3b80d8
ddress_spaces.c
3218c4bb3b5d7250f12420de6db7ef3e3f805a75 09-Jan-2009 Douglas Gregor <dgregor@apple.com> When we see a reference to a struct, class, or union like "struct X"
that is neither a definition nor a forward declaration and where X has
not yet been declared as a tag, introduce a declaration
into the appropriate scope (which is likely *not* to be the current
scope). The rules for the placement of the declaration differ slightly
in C and C++, so we implement both and test the various corner
cases. This implementation isn't 100% correct due to some lingering
issues with the function prototype scope (for a function parameter
list) not being the same scope as the scope of the function
definition. Testcase is FIXME'd; this probably isn't an important issue.

Addresses <rdar://problem/6484805>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62014 91177308-0d34-0410-b5e6-96231b3b80d8
ype-spec-struct-union.c
6037fcba3431b47de1a994c9b286feac17894eff 09-Jan-2009 Douglas Gregor <dgregor@apple.com> Replace DeclContext's vector of ScopedDecl pointers with a linked list
of ScopedDecls (using the new ScopedDecl::NextDeclInScope
pointer). Performance-wise:

- It's a net win in memory utilization, since DeclContext is now one
pointer smaller than it used to be (std::vectors are typically 3
pointers; we now use 2 pointers) and
- Parsing Cocoa.h with -fsyntax-only (with a Release-Asserts Clang)
is about 1.9% faster than before, most likely because we no longer
have the memory allocations and copying associated with the
std::vector.

I'll re-enable serialization of DeclContexts once I've sorted out the
NextDeclarator/NextDeclInScope question.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62001 91177308-0d34-0410-b5e6-96231b3b80d8
ypedef-redef.c
be3f7f3fd8f6a2e71ff55039049da9f7db1e44db 09-Jan-2009 Ted Kremenek <kremenek@apple.com> Re-enable PTH testing for Cocoa.h and Carbon.h (and include testing for Objective-C++).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61965 91177308-0d34-0410-b5e6-96231b3b80d8
arbon.c
f376b48c5a6cf12473f8779fba4e9d6bc005a60f 09-Jan-2009 Ted Kremenek <kremenek@apple.com> Temporarily revert r61956 and r61957 (PTH tests failing).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61960 91177308-0d34-0410-b5e6-96231b3b80d8
arbon.c
6b614879e21596184fc0af246243d1cce880e1f7 09-Jan-2009 Ted Kremenek <kremenek@apple.com> Enhance -fsyntax-only test of Carbon.h to also include testing for PTH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61958 91177308-0d34-0410-b5e6-96231b3b80d8
arbon.c
72de6676bd30f9081ee4166bbe07b4c270258ce6 08-Jan-2009 Douglas Gregor <dgregor@apple.com> Unify the code for defining tags in C and C++, so that we always
introduce a Scope for the body of a tag. This reduces the number of
semantic differences between C and C++ structs and unions, and will
help with other features (e.g., anonymous unions) in C. Some important
points:

- Fields are now in the "member" namespace (IDNS_Member), to keep
them separate from tags and ordinary names in C. See the new test
in Sema/member-reference.c for an example of why this matters. In
C++, ordinary and member name lookup will find members in both the
ordinary and member namespace, so the difference between
IDNS_Member and IDNS_Ordinary is erased by Sema::LookupDecl (but
only in C++!).
- We always introduce a Scope and push a DeclContext when we're
defining a tag, in both C and C++. Previously, we had different
actions and different Scope/CurContext behavior for enums, C
structs/unions, and C++ structs/unions/classes. Now, it's one pair
of actions. (Yay!)

There's still some fuzziness in the handling of struct/union/enum
definitions within other struct/union/enum definitions in C. We'll
need to do some more cleanup to eliminate some reliance on CurContext
before we can solve this issue for real. What we want is for something
like this:

struct X {
struct T { int x; } t;
};

to introduce T into translation unit scope (placing it at the
appropriate point in the IdentifierResolver chain, too), but it should
still have struct X as its lexical declaration
context. PushOnScopeChains isn't smart enough to do that yet, though,
so there's a FIXME test in nested-redef.c



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61940 91177308-0d34-0410-b5e6-96231b3b80d8
ember-reference.c
ested-redef.c
a4ed0d8d75212dc01b4438829a4b0c846d99458d 28-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Diagnose declarations that don't declare anything, and fix PR3020.
Examples:
int;
typedef int;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61454 91177308-0d34-0410-b5e6-96231b3b80d8
ecl-invalid.c
3c902ced87cd3e9994116485d7f28ca7f58b68e7 28-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Fix filename typo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61453 91177308-0d34-0410-b5e6-96231b3b80d8
llimmport-dllexport.c
llimport-dllexport.c
fceeec91fa4bba9f4240e7e43eec3066b434cc6b 26-Dec-2008 Anton Korobeynikov <asl@math.spbu.ru> Complete the test after adding handling of merged attributes on decls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61438 91177308-0d34-0410-b5e6-96231b3b80d8
tdcall-fastcall.c
2f402708e62f89fb875442802e3d3f20fc909d33 26-Dec-2008 Anton Korobeynikov <asl@math.spbu.ru> Add full dllimport / dllexport support: both sema checks and codegen.
Patch by Ilya Okonsky

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61437 91177308-0d34-0410-b5e6-96231b3b80d8
llimmport-dllexport.c
7f7bb72fd0fcfc315245e811debb507f1f55456b 26-Dec-2008 Anton Korobeynikov <asl@math.spbu.ru> Testcase for stdcall/fastcall sema checks.
Patch by Ilya Okonsky!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61436 91177308-0d34-0410-b5e6-96231b3b80d8
tdcall-fastcall.c
a1fcbadf4f930c22bb171fb90ed886f5f359d010 18-Dec-2008 Chris Lattner <sabre@nondot.org> Clean up the C89/C++ warnings about C99 array features to not
emit duplicate diags (some in parser and some in sema) and to
warn about use of typequals in array sizes. This implements
PR2759.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61197 91177308-0d34-0410-b5e6-96231b3b80d8
89.c
65ce04bef06696379682410f399f37b43996d824 18-Dec-2008 Chris Lattner <sabre@nondot.org> Merge function-return.c into function.c

Fix PR2790 by making a warning an EXTWARN instead of EXTENSION.
Add a new EXTENSION warning for "return (some void expression);"


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61187 91177308-0d34-0410-b5e6-96231b3b80d8
unction-return.c
unction.c
mplicit-decl.c
777f07b6cd595bb0922e05768e5703fbc92b5695 17-Dec-2008 Chris Lattner <sabre@nondot.org> diagnose C99 6.9.1p5, C arguments in definitions that are lacking
a name. This implements PR3208.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61127 91177308-0d34-0410-b5e6-96231b3b80d8
89.c
unction.c
edefinition.c
56f20ae1010aa71defd7572f660b41288c56cdd1 15-Dec-2008 Eli Friedman <eli.friedman@gmail.com> Make error handling for va_start a bit more robust. Fixes PR3213.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61055 91177308-0d34-0410-b5e6-96231b3b80d8
arargs.c
7df7b6bb800e1987951285ea192e4f347e1b603a 15-Dec-2008 Douglas Gregor <dgregor@apple.com> Create new EnumDecl nodes for redeclarations of enums, linking them
together in the same way that we link RecordDecl/CXXRecordDecl nodes.

Unify ActOnTag and ActOnTagStruct.

Fixes PR clang/2753.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61034 91177308-0d34-0410-b5e6-96231b3b80d8
num.c
42b83dde7c700b34f9435ad746984169888ae705 12-Dec-2008 Chris Lattner <sabre@nondot.org> Implement the final (hopefully) wrinkle to i-c-e + builtin_constant_p
processing: it allows arbitrary foldable constants as the operand of ?: when
builtin_constant_p is the condition.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60954 91177308-0d34-0410-b5e6-96231b3b80d8
-c-e.c
04de9937d861105a7bb21f88b89705537f2663b7 12-Dec-2008 Chris Lattner <sabre@nondot.org> merge these testcases into one file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60936 91177308-0d34-0410-b5e6-96231b3b80d8
-c-e.c
-c-e1.c
-c-e2.c
-c-e3.c
28daa53db73341b7ee7f269924ccfca1c6d179ac 12-Dec-2008 Chris Lattner <sabre@nondot.org> implement rdar://6091492 - ?: with __builtin_constant_p as the operand is an i-c-e.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60934 91177308-0d34-0410-b5e6-96231b3b80d8
-c-e3.c
4209a3909d827efb7648a9355f2976ca656da704 12-Dec-2008 Chris Lattner <sabre@nondot.org> add expected diag


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60927 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
670a62cd1d51042ea076cda5e93f26a1d8327fb3 12-Dec-2008 Chris Lattner <sabre@nondot.org> Fix rdar://6095061 - gcc allows __builtin_choose_expr as an lvalue



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60924 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
f345accce09fe4243310d0cb6a4a0fd09caee8cf 12-Dec-2008 Chris Lattner <sabre@nondot.org> Testcase for something that already works. Clang agrees with Comeau,
and this makes sense. likely a gcc bug that it doesn't diagnose the bad
restrict.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60923 91177308-0d34-0410-b5e6-96231b3b80d8
ypes.c
b0da923653601191c4f60bdc284feae376d28cda 12-Dec-2008 Chris Lattner <sabre@nondot.org> fix rdar://6097892 - gcc incompat: clang rejects __func__, __FUNCTION__, and __PRETTY_FUNCTION__ outside func

Yeah, this is "useful".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60921 91177308-0d34-0410-b5e6-96231b3b80d8
redef.c
cd08707a960842223e4af9ab82c729ba179290c0 12-Dec-2008 Chris Lattner <sabre@nondot.org> Implement rdar://6138816 - [sema] named bitfields cannot have 0 width


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60920 91177308-0d34-0410-b5e6-96231b3b80d8
itfield.c
f62e14dae03604379434d08955bf1087e2639eff 12-Dec-2008 Chris Lattner <sabre@nondot.org> add annotation


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60907 91177308-0d34-0410-b5e6-96231b3b80d8
itfield.c
5abfe2c2363d3c9f2597664edf3810a80017759f 11-Dec-2008 Anders Carlsson <andersca@mac.com> Add another complex promotion test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60863 91177308-0d34-0410-b5e6-96231b3b80d8
omplex-promotion.c
5b1f3f0b21f1ad6999b0ae9f3fa3259737c799e5 11-Dec-2008 Anders Carlsson <andersca@mac.com> Make sure to promote expressions of the form (floating point + complex integer) correctly, to (complex floating point + complex floating point)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60862 91177308-0d34-0410-b5e6-96231b3b80d8
omplex-promotion.c
c0febd58f5cbf4a93fd12f461863564dba0af76d 10-Dec-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6418623> Bogus block type compatibility warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60842 91177308-0d34-0410-b5e6-96231b3b80d8
lock-call.c
e9a0f43927041e2bcc89140c338dfae207ad3c3b 08-Dec-2008 Eli Friedman <eli.friedman@gmail.com> Workaround for PR3173. The fix is correct in the sense that if the enum
code were working correctly, it would be a no-op, but it's not really a
proper fix. That said, I don't really want to touch the enum code at
the moment because I don't understand it very well, and this seems to
be a relatively visible regression.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60680 91177308-0d34-0410-b5e6-96231b3b80d8
num.c
211316faa26af4ce594a10bcfc204124fe363362 07-Dec-2008 Chris Lattner <sabre@nondot.org> a minor grammar fix


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60646 91177308-0d34-0410-b5e6-96231b3b80d8
rray-constraint.c
ypedef-variable-type.c
la.c
96e05bc09070aaa7c18d3dd3ff13125a43532f69 07-Dec-2008 Anders Carlsson <andersca@mac.com> Improve VLA diagnostics/sema checking. Fixes PR2361 and PR2352.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60638 91177308-0d34-0410-b5e6-96231b3b80d8
rray-constraint.c
ypedef-variable-type.c
la.c
601bae3b1d3c06e8c91f6ea77dd2b0315353ee0b 06-Dec-2008 Anders Carlsson <andersca@mac.com> Simplify test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60631 91177308-0d34-0410-b5e6-96231b3b80d8
ffsetof.c
9f1e5727e36481d830e566ff5a016fda726838e4 06-Dec-2008 Anders Carlsson <andersca@mac.com> Add diagnostics for bitfields.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60628 91177308-0d34-0410-b5e6-96231b3b80d8
itfield.c
49184b2916f2f6535ac22f8517dc1e996225d2f1 05-Dec-2008 Anders Carlsson <andersca@mac.com> Use VerifyIntegerConstantExpression instead of isIntegerConstantExpr. Fixes PR2963

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60591 91177308-0d34-0410-b5e6-96231b3b80d8
R2963-enum-constant.c
9e09f5d361c50373435b9e142da8538034d84601 05-Dec-2008 Anders Carlsson <andersca@mac.com> Make Sema::CheckForConstantInitializer use Expr::Evaluate. This fixes PR3130.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60580 91177308-0d34-0410-b5e6-96231b3b80d8
onstant-builtins.c
371f258e61e1365b951b17931a3c5ac1530fd1a0 05-Dec-2008 Chris Lattner <sabre@nondot.org> change getCurFunctionDecl to skip through Block contexts to find
the containing block. Introduce a new getCurFunctionOrMethodDecl
method to check to see if we're in a function or objc method.
Minor cleanups to other related places. This fixes rdar://6405429.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60564 91177308-0d34-0410-b5e6-96231b3b80d8
lock-misc.c
ae0ee03fd9d36446ee70e502fdaf5ed5acec269f 05-Dec-2008 Chris Lattner <sabre@nondot.org> instead of forcing blocks on by default, make them default to off, but let
specific targets default them to on. Default blocks to on on 10.6 and later.
Add a -fblocks option that allows the user to override the target's default.
Use -fblocks in the various testcases that use blocks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60563 91177308-0d34-0410-b5e6-96231b3b80d8
lock-args.c
lock-as-object.m
lock-byref-args.c
lock-call.c
lock-literal.c
lock-misc.c
lock-return.c
lock-storageclass.c
3425c99aa2324579921fadf45f4d24b8ba18c0ec 02-Dec-2008 Sebastian Redl <sebastian.redl@getdesigned.at> int-arith-convert.c makes assumptions about integer sizes, so force a specific architecture

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60420 91177308-0d34-0410-b5e6-96231b3b80d8
nt-arith-convert.c
4cfc6fe9ed05af1bfc371bd78ad6945b62419e37 01-Dec-2008 Anders Carlsson <andersca@mac.com> Fix test. (0 && (a(),1)) is a valid I-C-E according to C99.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60331 91177308-0d34-0410-b5e6-96231b3b80d8
-c-e3.c
4000ea685acfb3e827040ce0e172e13243c2edae 01-Dec-2008 Anders Carlsson <andersca@mac.com> Add Sema::isNullPointerConstant which extwarns if necessary. Use it in Sema::CheckConditionalOperands.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60319 91177308-0d34-0410-b5e6-96231b3b80d8
-c-e3.c
d3a61d5ec5357d19b7c0b6b599231e68dc5e237f 01-Dec-2008 Anders Carlsson <andersca@mac.com> Use VerifyIntegerConstantExpression for case values.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60317 91177308-0d34-0410-b5e6-96231b3b80d8
omplex-int.c
witch.c
a8a6ef82ce903de65aee554f3d6c1c175de7da2f 26-Nov-2008 Nuno Lopes <nunoplopes@sapo.pt> add missing RUN lines

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60107 91177308-0d34-0410-b5e6-96231b3b80d8
R2919-builtin-types-compat-strips-crv.c
d162584991885ab004a02573a73ce06422b921fc 24-Nov-2008 Chris Lattner <sabre@nondot.org> Change a whole lot of diagnostics to take QualType's directly
instead of converting them to strings first. This also fixes a
bunch of minor inconsistencies in the diagnostics emitted by clang
and adds a bunch of FIXME's to DiagnosticKinds.def.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59948 91177308-0d34-0410-b5e6-96231b3b80d8
ompound-literal.c
eclspec.c
ypecheck-binop.c
35873c49adad211ff466e34342a52665742794f5 24-Nov-2008 Anders Carlsson <andersca@mac.com> The address of a variable is only constant if the variable has global storage.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59939 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
4bbc0e05a714d4ee4918a92a4a7049dd6ef33ad0 24-Nov-2008 Anders Carlsson <andersca@mac.com> Fix bug in the constant evaluator. Fixes PR3115.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59938 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
0947b4e6c778ca94bbd0a56548de0b6b5ff1dfc9 24-Nov-2008 Chris Lattner <sabre@nondot.org> Rewrite FindDiagnostics to be more strict about the formatting of the
expected-foo strings. Now the only allowed characters between
expected-error and {{ is whitespace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59925 91177308-0d34-0410-b5e6-96231b3b80d8
ecl-invalid.c
la.c
b2c8c55d8161d6e8d91a8aed76b0e24a7d16984c 24-Nov-2008 Chris Lattner <sabre@nondot.org> clean up -verify mode output. If the expected-error string is
mangled, report it using the diagnostics machinery instead of printf.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59924 91177308-0d34-0410-b5e6-96231b3b80d8
la.c
28eb7e992b9a266abb300da25b6d3c1557cec361 24-Nov-2008 Chris Lattner <sabre@nondot.org> make the 'to match this' diagnostic a note.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59921 91177308-0d34-0410-b5e6-96231b3b80d8
nvalid-struct-init.c
5f4a6829dc58cab2f76e2b98492859aa3b91e3f2 24-Nov-2008 Chris Lattner <sabre@nondot.org> Make all the 'redefinition' diagnostics more consistent, and make the
"previously defined here" diagnostics all notes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59920 91177308-0d34-0410-b5e6-96231b3b80d8
rray-declared-as-incorrect-type.c
num.c
unction.c
mplicit-decl.c
erge-decls.c
redefined-function.c
edefinition.c
truct-compat.c
witch-duplicate-defaults.c
witch.c
entative-decls.c
ypedef-redef.c
9f4d86389f99c5d66664382add340a2ea19ad134 22-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Fix test cases broken by quote normalization in diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59888 91177308-0d34-0410-b5e6-96231b3b80d8
nit.c
6dde0d5dc09f45f4d9508c964703e36fef1a0198 22-Nov-2008 Anders Carlsson <andersca@mac.com> Case values must be evaluated

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59884 91177308-0d34-0410-b5e6-96231b3b80d8
witch.c
51fe996231b1d7199f76e4005ff4c943d5deeecd 22-Nov-2008 Anders Carlsson <andersca@mac.com> Use Expr::Evaluate for case statements. Fixes PR2525

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59881 91177308-0d34-0410-b5e6-96231b3b80d8
witch.c
7ca14257731eedb4cd16104cc20a6813d2deb0db 22-Nov-2008 Chris Lattner <sabre@nondot.org> add a silly testcase


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59877 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
2c21a073525cdfa68e4439b7af551385dc2796ab 21-Nov-2008 Chris Lattner <sabre@nondot.org> merge some simple call diagnostics.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59831 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.c
b1b4d337fafe30823b581cbfaa1641f37541fffe 21-Nov-2008 Chris Lattner <sabre@nondot.org> print a type in a diagnostic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59829 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
c41c1235e0d570e153150f994d28c4d2042c22ec 21-Nov-2008 Chris Lattner <sabre@nondot.org> remove expected-error from #if 0 section of code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59772 91177308-0d34-0410-b5e6-96231b3b80d8
redefined-function.c
966f099f903cdd214a2115a685735c3c24015965 21-Nov-2008 Chris Lattner <sabre@nondot.org> disable expected-errors in #if parts of the test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59771 91177308-0d34-0410-b5e6-96231b3b80d8
lock-literal.c
fa25bbb351f4fdd977f51254119cdfc2b525ce90 19-Nov-2008 Chris Lattner <sabre@nondot.org> Switch several more Sema Diag methods over. This simplifies the
__builtin_prefetch code to only emit one diagnostic per builtin_prefetch.
While this has nothing to do with the rest of the patch, the code seemed
like overkill when I was updating it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59588 91177308-0d34-0410-b5e6-96231b3b80d8
uiltin-prefetch.c
ca354faa7e9b99af17070c82b9662a5fca76422c 17-Nov-2008 Chris Lattner <sabre@nondot.org> Implement rdar://6319320: give a good diagnostic for cases where people
are trying to use the old GCC "casts as lvalue" extension. We don't and
will hopefully never support this.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59460 91177308-0d34-0410-b5e6-96231b3b80d8
lock-misc.c
xprs.c
58ace88985b920971b052de8a9a7b89de0654dc0 16-Nov-2008 Chris Lattner <sabre@nondot.org> Fix PR3075, __builtin_stdarg_start being misprototyped. This affects netbsd headers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59419 91177308-0d34-0410-b5e6-96231b3b80d8
arargs.c
a6afa768aa7bd3102a2807aa720917e4a1771e4e 13-Nov-2008 Eli Friedman <eli.friedman@gmail.com> Fix for crash issues with comma operators with a void first operand, and
some more bullet-proofing/enhancements for tryEvaluate. This shouldn't
cause any behavior changes except for handling cases where we were
crashing before and being able to evaluate a few more cases in tryEvaluate.

This should settle the minor mess surrounding r59196.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59224 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
b11e77836dd0867955c5abf32baf1c3e6c7f81e1 13-Nov-2008 Eli Friedman <eli.friedman@gmail.com> Backout of r59196, plus a new ICE test. Sorry if this is a
little rude; I figure it's cleaner to just back this out now so
it doesn't get forgotten or mixed up with other checkins.

The modification to isICE is simply wrong; I've added a test that the
change to isICE breaks.

I'm pretty sure the modification to tryEvaluate is also wrong.
At the very least, there's some serious miscommunication going on here,
as this is going in exactly the opposite direction of r59105. My
understanding is that tryEvaluate is not supposed to care about side
effects. That said, a lot of the clients to tryEvaluate are
expecting it to enforce a no-side-effects policy, so we probably need
another method that provides that guarantee.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59212 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
-c-e3.c
dd2b12a0329fee69ac2c26c2a3a355fb722e1e54 13-Nov-2008 Daniel Dunbar <daniel@zuster.org> Fix bug in constant evaluation exposed by 176.gcc.
- Evaluation of , operator used bogus assumption that LHS could be
evaluated as an integral expression even though its type is
unspecified.

This change is making isICE very permissive of the LHS in non-evaluated
contexts because it is not clear what predicate we would use to reject
code here. The standard didn't offer me any guidance; opinions?


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59196 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
67027a7bc35671bc3f6d5c109720060f06303391 12-Nov-2008 Chris Lattner <sabre@nondot.org> Fix a FIXME by improving a diagnostic, add a testcase for PR3048



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59167 91177308-0d34-0410-b5e6-96231b3b80d8
la.c
1367eded0ded01eacfdeaa92670d75ef8816d4d3 12-Nov-2008 Sebastian Redl <sebastian.redl@getdesigned.at> 64-bit test fixes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59165 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
ompound-literal.c
4efaa276bc0ce8f7baf6138ead11915f3e3e58d9 12-Nov-2008 Eli Friedman <eli.friedman@gmail.com> Some additions to tryEvaluate I've had sitting around for a while.
This pushes it a lot closer to being able to deal with most of the stuff
CodeGen's constant expression evaluator knows how to deal with. This
also fixes PR3003.

The test could possibly use some improvement, but this'll work for now.
Test 6 is inspired by PR3003; the other tests are mostly just designed
to exercise the new code. The reason for the funny structure of the
tests is that type fixing for arrays inside of structs is the only place
in Sema that calls tryEvaluate, at least for the moment.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59125 91177308-0d34-0410-b5e6-96231b3b80d8
onst-eval.c
1f6f54be86a514d531ec231fd837858a43cfe72e 11-Nov-2008 Chris Lattner <sabre@nondot.org> Fix PR3031 by silencing follow-on errors in invalid declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59027 91177308-0d34-0410-b5e6-96231b3b80d8
nit.c
nvalid-decl.c
48c2e909741a7b67ead01143edabd7b3fe42ee50 07-Nov-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix crash caused by this:

void f() {
int +; // crash here
}


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58846 91177308-0d34-0410-b5e6-96231b3b80d8
nit.c
e2f56196e916e4d2f9eeec5c8978490cdedb3f64 03-Nov-2008 Chris Lattner <sabre@nondot.org> Fix PR3001: if we have an error parsing an initializer, make sure to remove
the designator corresponding to it, otherwise Sema and later parsing will
get confused.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58603 91177308-0d34-0410-b5e6-96231b3b80d8
nit.c
a5a35e149d204d6b0b3eda5f186e1dc4f66e443d 29-Oct-2008 Sebastian Redl <sebastian.redl@getdesigned.at> Fix missing %s in run string causing hang during tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58394 91177308-0d34-0410-b5e6-96231b3b80d8
R2923.c
4f03fd61ee45245dd3a1552a023e730d56c2e697 29-Oct-2008 Ted Kremenek <kremenek@apple.com> Fix crash reported in PR2923 where a function declared using typeof(another_function) would have FunctionDecl::getNumParams() return the number of parameters in the original function type and not the number of parameters in the actual FunctionDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58392 91177308-0d34-0410-b5e6-96231b3b80d8
R2923.c
ac620decb68aad1a2cf6c0c191b56d78981d9aaa 24-Oct-2008 Daniel Dunbar <daniel@zuster.org> PR2919: __builtin_types_compatible_p strips CRV qualifiers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58079 91177308-0d34-0410-b5e6-96231b3b80d8
R2919-builtin-types-compat-strips-crv.c
639e2d35d9881cefe167efa933e82ced3b0ed681 20-Oct-2008 Chris Lattner <sabre@nondot.org> Fix rdar://6257721 by tightening up the block "snapshot" check, and
move it to its own predicate to make it more clear.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57796 91177308-0d34-0410-b5e6-96231b3b80d8
lock-misc.c
d3f2c10f881311831a84114179342ff4db55e0c3 19-Oct-2008 Daniel Dunbar <daniel@zuster.org> Improve attribute parsing & tests.
- Support noreturn on function-typed variables.

- Extend isFunctionOrMethod to return true for K&R functions and
provide hasFunctionProto to check if a decl has information about
its arguments. This code needs some serious cleaning, but works.

- Add/improve test cases for noreturn and unused.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57778 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-noreturn.c
ttr-unused.c
e5fd2d92cf8e5549f2ee7b2253b6730ee4aaa2db 17-Oct-2008 Daniel Dunbar <daniel@zuster.org> Exercise #pragma pack(pop, <width>) in test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57683 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-pack.c
5db4b3f3ed9f769d5b02c1d1ccc52bfd71fb9afb 16-Oct-2008 Daniel Dunbar <daniel@zuster.org> Teach tryEvaluate that fabs, copysign, and unary +/- are constants for
floats.
- With testcase, which also has some other things GCC folds but we
don't commented out in it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57624 91177308-0d34-0410-b5e6-96231b3b80d8
onstant-builtins-2.c
3b0db908ebd07eaa26bc90deba5e826de00fe515 16-Oct-2008 Daniel Dunbar <daniel@zuster.org> Implement #pragma pack use in structure packing. The general approach
is to encode the state of the #pragma pack stack as an attribute when
the structure is declared.

- Extend PackedAttr to take an alignment (in bits), and reuse for
both __attribute__((packed)) (which takes no argument, instead
packing tightly (to "minimize the memory required") and for #pragma
pack (which allows specification of the maximum alignment in
bytes). __attribute__((packed)) is just encoded as Alignment=1.

This conflates two related but different mechanisms, but it didn't
seem worth another attribute.

- I have attempted to follow the MSVC semantics as opposed to the gcc
ones, since if I understand correctly #pragma pack originated with
MSVC. The semantics are generally equivalent except when the stack
is altered during the definition of a structure; its not clear if
anyone does this in practice. See testcase if curious.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57623 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-pack-2.c
b8b10e3fef0045d8db3348bc5fffc10cdf934eb7 14-Oct-2008 Daniel Dunbar <daniel@zuster.org> Fix typo in testcase.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57499 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-pack.c
94dcecba32edf1c1c8e765dc2326eac6bc3ee963 14-Oct-2008 Chris Lattner <sabre@nondot.org> add a testcase.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57479 91177308-0d34-0410-b5e6-96231b3b80d8
-c-e2.c
4cde927072a70f3156d72c6431e7a5d95bf62366 14-Oct-2008 Daniel Dunbar <daniel@zuster.org> Add Sema implementation of #pragma pack stack.
- Follows the MSVC (original) implementation, including support of
pack(show) (useful for testing).
- Implements support for named pack records which gcc seems to
ignore (or implements incorrectly).
- Not currently wired to anything, only functionality change is the
type checking of the pragma.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57476 91177308-0d34-0410-b5e6-96231b3b80d8
ragma-pack.c
8f0fd62d828ab7b443e0f25aff531a185de5218e 10-Oct-2008 Seo Sanghyeon <sanxiyn@gmail.com> Tests for return statement checks

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57341 91177308-0d34-0410-b5e6-96231b3b80d8
unction-return.c
46cfefa8a4e486ee6a9b8960f232237bf7a4b1f9 06-Oct-2008 Chris Lattner <sabre@nondot.org> "Enhance" CheckArithmeticConstantExpression to accept ?: with a constant
condition as a constant even if the unevaluated side is a not a constant.
We don't do this when extensions are off, and we emit a warning when this
happens:

t.c:22:11: warning: expression is not a constant, but is accepted as one by GNU extensions
short t = __builtin_constant_p(5353) ? 42 : somefunc();
^ ~~~~~~~~~~

suggestions for improvement are welcome. This is obviously horrible, but
is required for real-world code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57153 91177308-0d34-0410-b5e6-96231b3b80d8
onstant-builtins.c
770918281c5bdc7b5b3942285c407e3d62270053 05-Oct-2008 Anders Carlsson <andersca@mac.com> Add parsing of the sentinel attribute. Still need to create the attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57121 91177308-0d34-0410-b5e6-96231b3b80d8
entinel-attribute.c
9173e91787fdce959346fd338c1e668f6d11e18f 05-Oct-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Append the test runs with '&&'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57085 91177308-0d34-0410-b5e6-96231b3b80d8
uiltin-object-size.c
7d076643e77a941cd1e53ed4a328df64c88140a5 03-Oct-2008 Daniel Dunbar <daniel@zuster.org> Merge postfix attributes on record decls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57019 91177308-0d34-0410-b5e6-96231b3b80d8
truct-packed-align.c
ae3f4919e4805f59c554d39cb9cd3a601809b2cb 03-Oct-2008 Daniel Dunbar <daniel@zuster.org> Add Builtins.def attribute for "can be a constant expression".
- Enabled for builtins which are always constant expressions
(__builtin_huge_val*, __builtin_inf*, __builtin_constant_p,
__builtin_classify_type, __builtin___CFStringMakeConstantString).

Added Builtin::Context::isConstantExpr.
- Currently overly simply interface which only works for builtins
whose constantexprness does not depend on their arguments.

CallExpr::isBuiltinConstantExpr now takes an ASTContext argument.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56983 91177308-0d34-0410-b5e6-96231b3b80d8
onstant-builtins.c
de45428f923b38d80407dbb9ede0df504256f9f6 02-Oct-2008 Daniel Dunbar <daniel@zuster.org> Add support for format string checking of object-size checking
versions of sprintf and friends.
- Added FIXME that this mechanism should be generalized.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56962 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
8af6a451ea075de1c9ec7cea0cd59f13cfc53adf 02-Oct-2008 Steve Naroff <snaroff@apple.com> Changed Sema::CheckForConstantInitializer to allow global block literals.
This commit also includes some name changes in the blocks rewriter (no functionality change).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56955 91177308-0d34-0410-b5e6-96231b3b80d8
lock-literal.c
f77d545fe923d4c465fb07476254798135a8ed25 30-Sep-2008 Chris Lattner <sabre@nondot.org> Fix va_arg handling to do argument decaying at the correct place. This
fixes problems handling references of va_list, which happens on x86_64.
This fixes PR2841 and rdar://6252231


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56809 91177308-0d34-0410-b5e6-96231b3b80d8
arargs.c
b440686eeed95c618ead89011d3814671b13ff6e 29-Sep-2008 Steve Naroff <snaroff@apple.com> Teach Sema::CheckAssignmentConstraints() to allow assignments between id and block pointer types (^{}).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56793 91177308-0d34-0410-b5e6-96231b3b80d8
lock-as-object.m
6c4088e5fc0ce98bf3213d47f6f38bfbfa20c813 29-Sep-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6251012> clang: Blocks are objects too.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56791 91177308-0d34-0410-b5e6-96231b3b80d8
lock-as-object.m
ae530cfaf65e36fdcecb16d072422eb3d2a4518e 28-Sep-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6252108> assigning to argument passed to block should not require __block.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56770 91177308-0d34-0410-b5e6-96231b3b80d8
lock-args.c
891ed9aa87e14ce4c13155a77c09cde4555f7dd1 28-Sep-2008 Chris Lattner <sabre@nondot.org> Fix rdar://6252231 - cannot call vsnprintf with va_list on x86_64,
by decaying __builtin_va_list's type when forming builtins. On
x86-64 (and other targets) __builtin_va_list is a typedef for
an array.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56768 91177308-0d34-0410-b5e6-96231b3b80d8
uiltin-object-size.c
f7037b1c3be02fdc901862641d93118ea812e5f8 28-Sep-2008 Chris Lattner <sabre@nondot.org> Fix rdar://6251437, references to enum constant decls in a block
don't need a BlockDeclRefExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56766 91177308-0d34-0410-b5e6-96231b3b80d8
lock-misc.c
59f5394648e1d86f3df09ce900658199e8bfcb96 28-Sep-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6252216> compare block to NULL.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56764 91177308-0d34-0410-b5e6-96231b3b80d8
lock-return.c
538afe30e4f9bfb338171be859d584e201dca2df 28-Sep-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6252226> parser thinks block argument is undefined identifier in NSServices.m


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56761 91177308-0d34-0410-b5e6-96231b3b80d8
lock-return.c
3527b59f246cde170e6877e3e62f78a95dbcdfce 26-Sep-2008 Ted Kremenek <kremenek@apple.com> Enter a new scope for a @try block.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56668 91177308-0d34-0410-b5e6-96231b3b80d8
dar6248119.m
4f6a7d7ead09b439216c32f2de806a998aeb222a 26-Sep-2008 Steve Naroff <snaroff@apple.com> Tweak Expr::isModifiableLvalue() and Expr::isLvalue() to better deal with BlockDeclRef exprs.

This fixes <rdar://problem/6248392> clang: Error when using address of stack variable inside block.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56652 91177308-0d34-0410-b5e6-96231b3b80d8
lock-literal.c
aefc36656d3113ef32a50cea9ae0621e07c8b26c 26-Sep-2008 Ted Kremenek <kremenek@apple.com> Have @finally introduce a new scope.
Fixes: <rdar://problem/6248119> @finally doesn't introduce a new scope


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56629 91177308-0d34-0410-b5e6-96231b3b80d8
dar6248119.m
ba80c9abccd97d9771c1dfa1a862e66ddd4daedd 25-Sep-2008 Steve Naroff <snaroff@apple.com> Downgrade incompatible block pointer error to a warning (to be consistent with incompatible pointer warnings in general).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56595 91177308-0d34-0410-b5e6-96231b3b80d8
lock-call.c
lock-return.c
16564420ffe679b0e3cf310c418be6ef98d8e658 25-Sep-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/6243788> clang: Incorrect return statement for Blocks?


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56590 91177308-0d34-0410-b5e6-96231b3b80d8
lock-return.c
9eae5761c0691c0f11d7a823b8ee54f05786cbbe 18-Sep-2008 Steve Naroff <snaroff@apple.com> Finish pushing blocks attribute through the clang attribute machinery.
Also added a couple simple tests from the "gcc.apple" test suite.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56309 91177308-0d34-0410-b5e6-96231b3b80d8
lock-byref-args.c
lock-storageclass.c
094cefbcc48c6b29062fef343fa8ff78ad368713 17-Sep-2008 Steve Naroff <snaroff@apple.com> Fix http://llvm.org/bugs/show_bug.cgi?id=2760.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56280 91177308-0d34-0410-b5e6-96231b3b80d8
entative-decls.c
17dab4f616db7be6800c1f0505f4888d2e8ad7a2 17-Sep-2008 Steve Naroff <snaroff@apple.com> Remove support for BlockExprExpr. For example...
^(expression) or ^(int arg1, float arg2)(expression)
...is no longer supported.
All block literals now require a compound statement.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56257 91177308-0d34-0410-b5e6-96231b3b80d8
lock-literal.c
c50a4a5f2eac14ac4c631d50b0a55cadc87700ce 17-Sep-2008 Steve Naroff <snaroff@apple.com> Sema::ActOnBlockReturnStmt(): Need to perform the UsualUnaryConversions on the return type.
Sema::CheckReturnStackAddr(): Make sure we skip over implicit casts.
Added some more test cases...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56254 91177308-0d34-0410-b5e6-96231b3b80d8
lock-return.c
61f40a2b67fc2046768e14f66b617e564cbcc3d8 10-Sep-2008 Steve Naroff <snaroff@apple.com> More semantic analysis for blocks...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56064 91177308-0d34-0410-b5e6-96231b3b80d8
lock-literal.c
1f3b0d5ccabbc47aef525baec10c15d9fd1c6236 10-Sep-2008 Steve Naroff <snaroff@apple.com> Sema::ActOnIdentifierExpr(): Lookup block arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56063 91177308-0d34-0410-b5e6-96231b3b80d8
lock-args.c
dd972f20dc2bd3609d833893e5c6544ac09b59a9 06-Sep-2008 Steve Naroff <snaroff@apple.com> More type checking for blocks. Still incomplete (will hopefully finish up this weekend).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55862 91177308-0d34-0410-b5e6-96231b3b80d8
lock-call.c
lock-misc.c
33ad0120264da35db85ff8cccee5f08da6a7fbeb 03-Sep-2008 Daniel Dunbar <daniel@zuster.org> Set register storage class correctly for function parameters.
- PR2730


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55739 91177308-0d34-0410-b5e6-96231b3b80d8
xpr-address-of.c
d417d96037c5beb297ff4ac780f907bf3fa0a599 03-Sep-2008 Daniel Dunbar <daniel@zuster.org> Add two test cases for builtins (mostly related to object size
builtins).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55736 91177308-0d34-0410-b5e6-96231b3b80d8
uiltin-object-size.c
67c8601677a6a4b01a77855b8b51240ef44acfb3 02-Sep-2008 Nuno Lopes <nunoplopes@sapo.pt> add the other test case for completeness and to avoid regressions in the future

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55629 91177308-0d34-0410-b5e6-96231b3b80d8
nit.c
b529d830b3b1667157da92ab0b5c32e1acfafbab 02-Sep-2008 Eli Friedman <eli.friedman@gmail.com> Fix for PR2747: allow pointer->int casts with a null base; these are
offset-of-like expressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55627 91177308-0d34-0410-b5e6-96231b3b80d8
nit.c
bc88745b43f440341e60ed93b0d27bac7c418029 02-Sep-2008 Eli Friedman <eli.friedman@gmail.com> An extremely hacky version of transparent_union support; it isn't
anywhere near correct in terms of missing cases and missing
diagnostics, but it's good enough to handle the uses in the
Linux system headers, which are currently a constant pain for compiling
applications on Linux.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55621 91177308-0d34-0410-b5e6-96231b3b80d8
ransparent-union-pointer.c
f1c7b48638a3ec78129fee9672ed8e2616e63c9c 02-Sep-2008 Eli Friedman <eli.friedman@gmail.com> Make sure to take the unqualified versions of the canonical types for
type-checking pointer subtraction; if the canonical types aren't used,
the qualifiers won't always get stripped off correctly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55620 91177308-0d34-0410-b5e6-96231b3b80d8
ointer-subtract-compat.c
62b6a65f0bef3ada0d8bac1a98f7e0769e6e8ffb 02-Sep-2008 Nuno Lopes <nunoplopes@sapo.pt> readd test as it passes correctly. nice, but weird

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55615 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
6d4abe1eee550411524ca002025fdf0490eefd26 02-Sep-2008 Eli Friedman <eli.friedman@gmail.com> Backing out r55607 due to logic errors and test regression.

I'll try to come up with a correct fix for the testcase sometime soon.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55614 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
7fb43c17eb2b4102f40a80a355629aacd70589ad 01-Sep-2008 Ted Kremenek <kremenek@apple.com> Tidy up sema processing of attribute "nonull":
- warn about nonnull being applied to functions with no pointer arguments
- continue processing argument list in the attribute when we encounter a non-pointer parameter being marked as nonnull
- when no argument list is specified, only mark pointers as nonnull. This fixes PR 2732 and radar 6188814.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55610 91177308-0d34-0410-b5e6-96231b3b80d8
onnull.c
73419bf6cbf8e5f7a0f9b8855d6531db264ae899 01-Sep-2008 Nuno Lopes <nunoplopes@sapo.pt> fix one more this-is-not-a-constant error. test included

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55609 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
f7e37ce8400d5ba3b0613116034aaa30e6a70b3e 01-Sep-2008 Nuno Lopes <nunoplopes@sapo.pt> make CheckArithmeticConstantExpression() aware of &foo and pointers

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55607 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
aa1f9f1d50adf294674b74510b62e863b68572bc 28-Aug-2008 Daniel Dunbar <daniel@zuster.org> Fix isIntegerConstantExpr eval of __builtin_offsetof to return result
with correct width.
- PR2728.

Also, fix PR2727 test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55493 91177308-0d34-0410-b5e6-96231b3b80d8
R2727.c
R2728.c
9048891ff983d0681c116c6e8f1073aa31bdd6e8 28-Aug-2008 Daniel Dunbar <daniel@zuster.org> Fix double-free error with sizeof applied to VLA types.
- PR2727.

Also, fix warning in CodeGenTypes for new BlockPointer type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55479 91177308-0d34-0410-b5e6-96231b3b80d8
R2727.c
c3f07644a7846ac6fa8d952afcec7649a48213c4 25-Aug-2008 Eli Friedman <eli.friedman@gmail.com> Fix for PR2720; be a little bit more permissive in initializers for
casting pointers to integers.

Eventually, we should check whether we can evaluate an expression
using Expr::tryEvaluate, and this codepath should be tightened to only
handle standard-compliant cases.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55331 91177308-0d34-0410-b5e6-96231b3b80d8
onst-ptr-int-ptr-cast.c
1e465df22f312a3661d70fc15b1a55dc97ebfce8 25-Aug-2008 Daniel Dunbar <daniel@zuster.org> Add test case for function-pointer-cast-of-global as constant
expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55323 91177308-0d34-0410-b5e6-96231b3b80d8
nit.c
4bd8217d94d42e0f1439defe2001292988dc5288 22-Aug-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Move the rest of the Sema C++ tests into the SemaCXX test directory.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55178 91177308-0d34-0410-b5e6-96231b3b80d8
lass-names.cpp
efault1.cpp
efault2.cpp
nherit.cpp
eturn-stack-addr.cpp
2c15647dce6de66f673cc64236913732d6289317 21-Aug-2008 Chris Lattner <sabre@nondot.org> add a simple check to warn people who type "=+" when they probably meant
"+=".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55131 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
efbe85c8ef4090147b371f616044c72d9b254095 21-Aug-2008 Eli Friedman <eli.friedman@gmail.com> Fix a regression from my fix to PR2631. Fixes PR2692.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55083 91177308-0d34-0410-b5e6-96231b3b80d8
a_arg_x86_64.c
50ff6f3fb567353ac84aa489bedcfdbfb93da458 20-Aug-2008 Eli Friedman <eli.friedman@gmail.com> Fix test failure on Linux.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55032 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
d5bac5704768606c3182dcc1386de12b3944601b 19-Aug-2008 Chris Lattner <sabre@nondot.org> add testcase we already handle.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54967 91177308-0d34-0410-b5e6-96231b3b80d8
nit.c
396f0bfd4b2189452914893ce69f5fb068d0ec22 18-Aug-2008 Daniel Dunbar <daniel@zuster.org> Support initialization of incomplete array with zero size (as
extension).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54946 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
5e8840c7a6840c9dd67dc3b8ca0ab965db439e32 16-Aug-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Move the C++ Sema tests into a separate SemaCXX directory.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54853 91177308-0d34-0410-b5e6-96231b3b80d8
xx-class.cpp
xx-namespace.cpp
xx-references.cpp
xx-this.cpp
xx-wchar_t.cpp
613535273b90dc5cbd0f9fa056dedc93801ea35a 10-Aug-2008 Steve Naroff <snaroff@apple.com> InitListChecker::CheckListElementTypes(): Check for function types and issue an appropriate diagnostic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54614 91177308-0d34-0410-b5e6-96231b3b80d8
ompound-literal.c
f855e6fbebb718a1cca75ec2efba12f3583fe614 10-Aug-2008 Steve Naroff <snaroff@apple.com> Sema::CheckForFileScopedRedefinitions(): Make sure tentative decls of incomplete array types are completed (and diagnosed properly).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54612 91177308-0d34-0410-b5e6-96231b3b80d8
entative-decls.c
d8803632d248a360a040ff03eff1162988058036 10-Aug-2008 Chris Lattner <sabre@nondot.org> wrap some long diagnostics, make 'initializer is not a constant' diagnostic
a bit more clear (rdar://5646070)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54606 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
ompound-literal.c
xx-class.cpp
nit.c
tatic-init.c
la.c
1bb516c8615714317c72ec8065cc3177714d336e 10-Aug-2008 Eli Friedman <eli.friedman@gmail.com> Make sure to count the struct elements correctly; here, we want the
member count. The count returned by numStructUnionElements is the
number of initializers that will be consumed, not the number of members
to iterate through. Fixes PR2534.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54601 91177308-0d34-0410-b5e6-96231b3b80d8
nnamed-bitfield-init.c
c34bcde8d2aa7430cb2f3abb003d9248842748b8 10-Aug-2008 Eli Friedman <eli.friedman@gmail.com> Fix for PR2631; make va_arg work correctly on x86-64.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54600 91177308-0d34-0410-b5e6-96231b3b80d8
a_arg_x86_64.c
8389eab190afef3462f6418b8d8fb70fb01c4005 09-Aug-2008 Chris Lattner <sabre@nondot.org> Fix PR2400 by more graceful handling of invalid decls. Don't try to layout
an invalid struct decl. Thanks to Martin Doucha for the
isIncompleteArrayType part of this patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54592 91177308-0d34-0410-b5e6-96231b3b80d8
nvalid-decl.c
64c438a4be2a871fa43c78264663ba1e9788b94d 09-Aug-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Implement support for the 'wchar_t' C++ type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54585 91177308-0d34-0410-b5e6-96231b3b80d8
xx-wchar_t.cpp
907747b3a67a41420ead8ef1fc5e6bd9dc9e0ad9 09-Aug-2008 Steve Naroff <snaroff@apple.com> Fix Sema::MergeVarDecl() to better handle type compatibility. The previous code was trying to handle arrays specially (which didn't work for pointers to array). Removed local helper function areEquivalentArrayTypes(), replacing it's use with the more general ASTContext::typesAreCompatible() predicate.

Even though the test case this fixes is in "tentative-decls.c", this bug didn't have anything to do with our handling of tentative definitions (which is what I first expected). In any event, this is a tricky area of the spec.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54583 91177308-0d34-0410-b5e6-96231b3b80d8
entative-decls.c
ff9eb1fe0a16a34c355db0d1bc4a9d0f7a276c73 08-Aug-2008 Steve Naroff <snaroff@apple.com> Fix issues with C "tentative" definitions.

- Move checking from MergeVarDecl->FinializeDeclaratorGroup. Since MergeVarDecl is called before the initializer is attacted, it can't be done there (this removes a long standing FIXME).
- Add Sema::isTentativeDefinition() and Sema::CheckForFileScopedRedefinitions().
- Remove FIXME's and touch-up test case.

Still some more work to do (forthcoming)...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54533 91177308-0d34-0410-b5e6-96231b3b80d8
entative-decls.c
45e52e137702abbfa44852979a5717dfdc09c9bc 07-Aug-2008 Daniel Dunbar <daniel@zuster.org> Add test for nested enum redefinition.
- <rdar://problem/6093889>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54470 91177308-0d34-0410-b5e6-96231b3b80d8
num.c
db82568300e710b7646a4a0e26c12f61d3750dde 05-Aug-2008 Nuno Lopes <nunoplopes@sapo.pt> fix crash when printing diagnostics with tokens that span through more than one line

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54365 91177308-0d34-0410-b5e6-96231b3b80d8
ext-diag.c
4489fe10fa073eb326e2c8906db170f009050911 05-Aug-2008 Daniel Dunbar <daniel@zuster.org> Add EXTWARN Diagnostic class.
- Like EXTENSION but always generates a warning (even without
-pedantic).
- Updated ptr -> int, int -> ptr, and incompatible cast warnings to
be EXTWARN.
- Other EXTENSION level diagnostics should be audited for upgrade.
- Updated several test cases to fix code which produced unanticipated
warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54335 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
1e76ce6e5f892c89c9958657d44c323fb70f748c 04-Aug-2008 Daniel Dunbar <daniel@zuster.org> Fix several issues in checking of address-of expressions.
- clang was erroneously accepting address-of applied to lvalue
expressions involving pointer arithmetic.
- clang was erroneously rejecting address-of applied to deref
expressions of pointer-typed variables.
- Improved existing test case.
- Fixes: <rdar://problem/6113867>, <rdar://problem/6080158>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54326 91177308-0d34-0410-b5e6-96231b3b80d8
xpr-address-of.c
c63a1f276f7b324fd9a4be82098b1c8f7bf30733 04-Aug-2008 Chris Lattner <sabre@nondot.org> Finally fix PR2189. This makes a fairly invasive but important change to
move getAsArrayType into ASTContext instead of being a method on type.
This is required because getAsArrayType(const AT), where AT is a typedef
for "int[10]" needs to return ArrayType(const int, 10).

Fixing this greatly simplifies getArrayDecayedType, which is a good sign.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54317 91177308-0d34-0410-b5e6-96231b3b80d8
ypedef-retain.c
3068ae0feb5d477477f45045f7ec9d0414fe57f3 01-Aug-2008 Daniel Dunbar <daniel@zuster.org> Support __attribute__(({con,de}structor)) in Parse & Sema
- Including possible priority argument
- In other news, the attribute parsing code really needs a cleanup


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54257 91177308-0d34-0410-b5e6-96231b3b80d8
onstructor-attribute.c
611b2eccaf3869f32de51ecc02985426d1c0aaef 26-Jul-2008 Chris Lattner <sabre@nondot.org> fix some problems handling stmtexprs with labels (PR2374), and
improve 'expression unused' diagnostics for stmtexprs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54098 91177308-0d34-0410-b5e6-96231b3b80d8
tmt_exprs.c
be89909f3b789a48071e5b04ffbefdb5e069d8d3 26-Jul-2008 Chris Lattner <sabre@nondot.org> testcase for PR2416, which we already handle correctly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54096 91177308-0d34-0410-b5e6-96231b3b80d8
num.c
6ac6ddc861ccc42f3025c4209b7c031bcd8f43f9 26-Jul-2008 Chris Lattner <sabre@nondot.org> move all objc sema tests into a new SemaObjC directory. Next step is to
remove the objc- prefix from the tests that use it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54084 91177308-0d34-0410-b5e6-96231b3b80d8
oubleMethod.m
lias-test-1.m
lias-test-2.m
rgument-checking.m
ategory-1.m
heck-dup-decl-methods-1.m
heck-dup-objc-decls-1.m
lass-conforming-protocol-1.m
lass-def-test-1.m
lass-impl-1.m
lass-proto-1.m
ocoa.m
ompatible-protocol-qualified-types.m
onditional-expr.m
onflicting-ivar-test-1.m
onst-id.m
nhanced-proto-2.m
ormat-strings-objc.m
orward-class-1.m
cc-cast-ext.m
d_builtin.m
ncompatible-protocol-qualified-types.m
nvalid-objc-decls-1.m
var-sem-check-1.m
essage.m
ethod-def-1.m
ethod-def-2.m
ethod-encoding-2.m
ethod-lookup.m
ethod-not-defined.m
ethod-undef-category-warn-1.m
ethod-undefined-warn-1.m
issing-method-context.m
bjc-at-defs.m
bjc-bad-receiver-1.m
bjc-comptypes-1.m
bjc-comptypes-2.m
bjc-comptypes-3.m
bjc-comptypes-4.m
bjc-comptypes-5.m
bjc-comptypes-6.m
bjc-comptypes-7.m
bjc-comptypes-8.m
bjc-comptypes-9.m
bjc-interface-1.m
bjc-interface-layout.m
bjc-ivar-lookup.m
bjc-legacy-implementation-1.m
bjc-method-lookup.m
bjc-property-1.m
bjc-property-2.m
bjc-property-3.m
bjc-property-4.m
bjc-property-5.m
bjc-property-6.m
bjc-property-7.m
bjc-property-8.m
bjc-property-9-impl-method.m
bjc-props-on-prots.m
bjc-protocol-1.m
bjc-string.m
bjc-synchronized.m
bjc-try-catch.m
bjc-typedef-class.m
bjc-types-compatible.m
bjc-unused.m
rotocol-expr-1.m
rotocol-expr-neg-1.m
rotocol-id-test-1.m
rotocol-id-test-2.m
rotocol-id-test-3.m
rotocol-test-1.m
rotocol-test-2.m
elector-1.m
elector-overload.m
tatic-ivar-ref-1.m
ndef-protocol-methods-1.m
ndef-superclass-1.m
ndefined-protocol-type-1.m
a-method-1.m
62f5f7ffad57e0c2af2b308af3735351505937cb 26-Jul-2008 Chris Lattner <sabre@nondot.org> fix several problems with the protocol qualified id handling where id was implicit.

First, fix canonical type handling of these, since protocol qualified id's are always
canonical. Next, enhance SemaType to actually make these when used (instead of int)
allowing them to actually be used when appropriate. Finally remove a bunch of logic
relating to the mishandling of canonical types with protocol-qual id's. This fixes
rdar://5986251


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54083 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-protocol-1.m
bce6135441fd489527a9ad1776d0472335be596d 26-Jul-2008 Chris Lattner <sabre@nondot.org> improve handling of the horrible GCC objc extension that treats "<foo>"
like "id<foo>". This 1) fixes an infinite loop in the parser on things
like "short<foo>" 2) emits a warning about this bogus construct and 3)
changes the testcase to be substantially reduced.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54082 91177308-0d34-0410-b5e6-96231b3b80d8
ogus-gcc-protocol-extension.m
bjc-protocol-1.m
02a65146aaa1f209013415e9247771805ca2ad5d 26-Jul-2008 Chris Lattner <sabre@nondot.org> GCC supports the complex conjugate operator (an extension) on complex int
as well as complex float. rdar://6097730


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54080 91177308-0d34-0410-b5e6-96231b3b80d8
omplex-int.c
d67cd9ef4c79a62cc6955aa7c753461094c427f7 26-Jul-2008 Chris Lattner <sabre@nondot.org> fix diagnostics.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54079 91177308-0d34-0410-b5e6-96231b3b80d8
num.c
834a72ac74cf4ff07ba6215545dba3db578f8a07 26-Jul-2008 Chris Lattner <sabre@nondot.org> Fix rdar://6095136, various crashes with incomplete enum types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54074 91177308-0d34-0410-b5e6-96231b3b80d8
num.c
67d33d8535b53046760ec6c4aa440e4f91df00dd 25-Jul-2008 Chris Lattner <sabre@nondot.org> c89 does not perform array -> pointer promotion unless the array is an lvalue. This
is different than C99. This fixes the rest of rdar://6095180.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54064 91177308-0d34-0410-b5e6-96231b3b80d8
xpr-comma-c89.c
xpr-comma.c
53fcaa9409734b8a41c10894d40267e52175b30a 25-Jul-2008 Chris Lattner <sabre@nondot.org> In c99 mode, comma does do function/array promotion even though
it does not do unary promotions (like short->int).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54058 91177308-0d34-0410-b5e6-96231b3b80d8
xpr-comma.c
080b332959f0a1886c8d0a515f656fe6215a9ce3 25-Jul-2008 Chris Lattner <sabre@nondot.org> Comma does not perform unary promotions, rdar://6095180


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54045 91177308-0d34-0410-b5e6-96231b3b80d8
xpr-comma.c
3872b5cadd63649c12dd41bca786b67327618462 25-Jul-2008 Chris Lattner <sabre@nondot.org> gcc requires a semicolon at the end of an interface, unlike its extension for structs.
rdar://6095245.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54044 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-interface-1.m
7c778f1c549a8ae95d50a819fd537df78da16426 25-Jul-2008 Steve Naroff <snaroff@apple.com> Cleaunup Sema::ActOnClassMessage(). This commit:
(a) removes a bogus warning.
(b) removes an undesirable usage of the ObjCMessageExpr constructor that takes an IdentifierInfo * (which I will abolish).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54042 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-typedef-class.m
99cb9976efe84f44b3b1957c4fe042dae366b989 25-Jul-2008 Chris Lattner <sabre@nondot.org> Reject typedef redefinitions when the underlying types are not identical,
even if in a system header etc. rdar://6079937



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54038 91177308-0d34-0410-b5e6-96231b3b80d8
ypedef-redef.c
baf0d6678418e0dd9309438c3e50274253cfc7b2 25-Jul-2008 Chris Lattner <sabre@nondot.org> Add support for __extension__ as an lvalue. rdar://6097308



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54033 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
6bc52112dbc54551bd8e215d95bba4791b2275f7 23-Jul-2008 Chris Lattner <sabre@nondot.org> Fix rdar://6094010 various asserts happening with wide strings in inline asm.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53947 91177308-0d34-0410-b5e6-96231b3b80d8
sm.c
4493f79fce48cd9cbd9f55fa9d452cde736747a0 22-Jul-2008 Daniel Dunbar <daniel@zuster.org> Implement nans, prefetch, and trap builtins.

This closes <rdar://problem/6080720>, support for __builtin_constant_p
has been filed separately.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53885 91177308-0d34-0410-b5e6-96231b3b80d8
uiltin-prefetch.c
465172f304248a9aab6f2c398a836ce4e25efbbf 22-Jul-2008 Ted Kremenek <kremenek@apple.com> Add test case for nonnull attribute.
Fix indexing bug.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53882 91177308-0d34-0410-b5e6-96231b3b80d8
onnull.c
b752f289026ad8e5f44851b20e009a27ed61eefc 21-Jul-2008 Chris Lattner <sabre@nondot.org> Switch initialization of the protocol list for an interface decl to use
the standard "set these as the list of protocols" interface instead of a
strange "set this as the size and then set each one to the value" interface.
The problem with the later is that it a) is completely different from
everything else, b) is awkward, and c) doesn't handle the case when a
referenced protocol is invalid: it set it to null.

This meant that all clients downstream would have to handle null protocols
in the protocol list, and empirically they didn't. Fix this by not setting
invalid protocols in the referenced protocol list, fixing the crash on
test/Sema/objc-interface-1.m

While I'm at it, clean up some locations so that we produce:

t.m:1:25: error: cannot find interface declaration for 'NSObject', superclass of 'NSWhatever'
@interface NSWhatever : NSObject <NSCopying>
~~~~~~~~~~~~~~~~~~~~~ ^

instead of:

t.m:1:1: error: cannot find interface declaration for 'NSObject', superclass of 'NSWhatever'
@interface NSWhatever : NSObject <NSCopying>
^




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53846 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-interface-1.m
6562fdad21432377f0cc5e0c627c28f0c85df4dd 21-Jul-2008 Chris Lattner <sabre@nondot.org> when in the context of an @implementation, look for private methods in the
@implementation to resolve nullary selector references.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53845 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-property-9-impl-method.m
0ff12f078c70acad7ef18cb4906d17a203d2267a 16-Jul-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> When in C++, make EnumConstant names hide tag names in the same scope, instead of colliding with them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53702 91177308-0d34-0410-b5e6-96231b3b80d8
lass-names.cpp
b02ef242c76f718a33ec3d9e42f9dbabaf5856b9 16-Jul-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> When checking for name collision between a tag and a previously defined namespace, the collision occured even when the tag was in a different nested scope.
Fix it by taking into account the scope when checking for namespace-tag name collisions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53667 91177308-0d34-0410-b5e6-96231b3b80d8
xx-namespace.cpp
be2341d3b8bd34a14e921c58b53abaf79b0b0cb2 14-Jul-2008 Nate Begeman <natebegeman@mac.com> http://llvm.org/bugs/show_bug.cgi?id=2523

Add some code to handle vector comparisons, which is the language side
of the llvm vicmp/vfcmp instructions. Also make the vector-vector and
vector-scalar asign checks a bit more sane under the presence of lax vector
conversions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53565 91177308-0d34-0410-b5e6-96231b3b80d8
ector-assign.c
9a979c327c442597c6a9cee961336530460fed04 07-Jul-2008 Nuno Lopes <nunoplopes@sapo.pt> fix CheckForConstantInitializer() for Compound Literals
also fix the correspondent test (it was expecting more errors than it should. please confirm my fix is correct (at least gcc agrees with me)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53174 91177308-0d34-0410-b5e6-96231b3b80d8
ompound-literal.c
560624a84ee2227bc6a41194513921af5d79e742 04-Jul-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> '&&' commands together so that the test status reflects the results of all the commands, otherwise the test status will be the result of only the last command.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53135 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-string.m
e60cff1089afa6368c57d716e4a295c5f1224e04 03-Jul-2008 Chris Lattner <sabre@nondot.org> new testcase


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53071 91177308-0d34-0410-b5e6-96231b3b80d8
ncomplete-decl.c
14943b90d99d6f695a4aee70c5d26086639261c5 03-Jul-2008 Chris Lattner <sabre@nondot.org> Fix PR2020 by recovering by defining an anonymous enum, instead of recovering
by filling in the body of a union with enum constants.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53069 91177308-0d34-0410-b5e6-96231b3b80d8
num.c
07952324dda0e758c17f8bc3015793c65c51c48c 01-Jul-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add Sema support for C++ classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52956 91177308-0d34-0410-b5e6-96231b3b80d8
xx-class.cpp
xx-this.cpp
e5c5ee1cff9ec084f176fa252774262677857ad2 29-Jun-2008 Chris Lattner <sabre@nondot.org> Make ProcessDeclAttributes walk the declarator structure pulling
decl attributes out of the various places they can hide. This makes
us correctly reject things like this:

t.c:2:22: error: mode attribute only supported for integer and floating-point types
int **__attribute((mode(HI)))* i32;
^

because you can't make a pointer be HImode.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52876 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-mode.c
ad74a758189180b8ab8faea648e4766c3bfd7fcb 28-Jun-2008 Eli Friedman <eli.friedman@gmail.com> Fix for PR2501; this patch makes usual arithmetic conversions for
integers which have the same width and different signedness work
correctly. (The testcase in PR2501 uses a comparison between long and
unsigned int).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52853 91177308-0d34-0410-b5e6-96231b3b80d8
nt-arith-convert.c
f37da0ea0e25f66b122fe2e73c2ea04dcb2cd253 26-Jun-2008 Chris Lattner <sabre@nondot.org> rename some attr tests for consistency.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52770 91177308-0d34-0410-b5e6-96231b3b80d8
ttr-deprecated.c
ttr-mode.c
ttributes.c
ode-attr-test.c
13fd7e5111032f54b538dd66d035b0ccc1f82467 21-Jun-2008 Chris Lattner <sabre@nondot.org> "this patch adds code generation hooks for Objective-C constant strings. It also modifies Sema so that Objective-C constant strings are treated as untyped objects if the interface for the constant string class can not be found. This is consistent with Apple GCC. I thought it was consistent with GNU GCC, since this was causing failures when trying to compile GNUstep with (GNU) GCC, but it appears that this is not the case when attempting to produce a simple test case to demonstrate it. Possibly there is a way of making the error go away, but I haven't found out what it is yet."

Patch by David Chisnall!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52599 91177308-0d34-0410-b5e6-96231b3b80d8
issing-string-interface.m
bjc-property-8.m
6ee1f9c0142e0c374f32fc86312630cd901247cf 21-Jun-2008 Chris Lattner <sabre@nondot.org> "This moves built-in Objective-C types up the scope chains to where they can be replaced by versions included from the runtime library's headers."

This makes it ok to use @"foo" without a declaration for NSConstantString.

Patch by David Chisnall!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52593 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-string.m
5a6ddbf295d2ea1c28cfb67d82db22f3893ede6f 21-Jun-2008 Chris Lattner <sabre@nondot.org> add parser and sema support for the funny ObjC '@defs' thing.
Patch by David Chisnall!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52586 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-at-defs.m
df220837ced054c012d8e64d07bb7d86dcafdf99 16-Jun-2008 Ted Kremenek <kremenek@apple.com> Add test case for NSString format-string checking.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52337 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings-objc.m
54ecfce94bc96947ec2059d35920a9eea3ca8569 11-Jun-2008 Eli Friedman <eli.friedman@gmail.com> Don't crash if we can't find FileEntry info for a typedef, since one
isn't guaranteed to exist. This fixes a crash with conflicting typedefs
coming from stdin.

This also fixes the crash in PR2406, but doesn't completely fix the
issue; it appears there's something strange about the physical location
for the definition of int64_t in stdlib.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52209 91177308-0d34-0410-b5e6-96231b3b80d8
ypedef-redef.c
c92e5e4e4d632343b1f5b34cbd1d583666b1f4f8 09-Jun-2008 Eli Friedman <eli.friedman@gmail.com> For struct initialization, check compatibility with the unqualified
type; this isn't explicitly stated in the standard, but it doesn't
really make sense for them to have an effect here. Fixes the included
testcase, sent to me by Steve Naroff.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52113 91177308-0d34-0410-b5e6-96231b3b80d8
nit-struct-qualified.c
c7333881dcd00be87814d03c349dd96c815f2f05 06-Jun-2008 Steve Naroff <snaroff@apple.com> Second half of "fix" for <rdar://problem/5986085> clang on xcode: error: redefinition of 'XCElementToggler' as different kind of symbol


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52024 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-typedef-class.m
e2af8b16cb66b59ac3570c5561289469bd852699 05-Jun-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/5986833> clang on xcode: incompatible type returning 'void', expected 'int'.

- Changed Sema::ObjCActOnStartOfMethodDef() to more accurately type "self" in factory methods.
- Changed Sema::ActOnInstanceMessage() to use the new type to restrict the lookup.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52005 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-method-lookup.m
3d2c22b1d334fa74d26a5f21841cb55df5dfdd1a 05-Jun-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/5987482> clang on xcode: null dereference in Sema::ActOnMemberReferenceExpr.

In addition to fixing the crasher, this commit fixes further improves property lookup (by searching protocols of qualified interfaces..."NSObject <prot>").


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52001 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-props-on-prots.m
74199b6507ff0094b74841620063d88c9669e2d7 05-Jun-2008 Steve Naroff <snaroff@apple.com> Fix trivial crasher and downgrade an error to warning (to match GCC).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51976 91177308-0d34-0410-b5e6-96231b3b80d8
ategory-1.m
d3ded1ffacf1a47ffae151e10c7f74b19c2ef57d 05-Jun-2008 Steve Naroff <snaroff@apple.com> Support "<p>" as a short-hand for "id<p>". Here's a comment from GCC (the only documentation I could find on it).

/* Make "<SomeProtocol>" equivalent to "id <SomeProtocol>" - nisse@lysator.liu.se. */

This commit adds the parser magic. The type associated with <p> is still incorrect. Will discuss with Chris.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51972 91177308-0d34-0410-b5e6-96231b3b80d8
ogus-gcc-protocol-extension.m
cb28be6e82809f9f514585ac2692fa04bb56978a 05-Jun-2008 Steve Naroff <snaroff@apple.com> Fix crash identified by <rdar://problem/5986085>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51969 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-typedef-class.m
44a3dded8080c5c9cfdad208ade8f8f7850d9a4f 04-Jun-2008 Devang Patel <dpatel@apple.com> Add ObjCInterface layout support.
Reuse RecordLayout.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51968 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-interface-layout.m
9dc22e6df050b02e035b4390c70697fe45e9d010 04-Jun-2008 Steve Naroff <snaroff@apple.com> Update a test and add a FIXME.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51967 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-types-compatible.m
fd5b2ce150185d8d8fc3d7789983bbd2b0b8103f 04-Jun-2008 Ted Kremenek <kremenek@apple.com> Added fixmes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51964 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-comptypes-9.m
3ac438c383a4a9a73c76a05c76ec5d02f10a3c52 04-Jun-2008 Steve Naroff <snaroff@apple.com> Parser::ParseObjCSynchronizedStmt() needs to Enter/Exit a decl scope.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51963 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-synchronized.m
d8de725d95cb29db175f6430c5911ff092271f2e 04-Jun-2008 Nuno Lopes <nunoplopes@sapo.pt> fix type of ?: operator. If one of the operator is void, the type should be void as well.
Please confirm this is safe

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51957 91177308-0d34-0410-b5e6-96231b3b80d8
onditional.c
26631704d15e2fe19bae8a22939e0a473407c20d 04-Jun-2008 Fariborz Jahanian <fjahanian@apple.com> Fix a gcc compatibility issue which allows more protocol-qualified id on RHS to be
assigned to less protocol qualified object on LHS.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51956 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-comptypes-9.m
97341620065b89f5197b846be94c4cfad5df2af4 04-Jun-2008 Steve Naroff <snaroff@apple.com> ASTContext::typesAreCompatible(): id is compatible with all qualified id types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51939 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-types-compatible.m
9ad23d6f454e64b2ff960721becc5b90dea4d353 04-Jun-2008 Steve Naroff <snaroff@apple.com> Sema::ActOnClassMessage() needs to look through it's local implementation for private class methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51938 91177308-0d34-0410-b5e6-96231b3b80d8
ethod-lookup.m
6c930f2ac0af05a120a39cb780b50d4a293abdfc 04-Jun-2008 Steve Naroff <snaroff@apple.com> Make sure we look through categories when searching for a classes property.

Fixes <rdar://problem/5984338> clang on xcode: property implementation must have its declaration in interface 'PBXOpenQuicklyModule'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51925 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-property-8.m
c793808539b2ed6ec3324ff9ba0f57aa54e027ca 04-Jun-2008 Steve Naroff <snaroff@apple.com> Put back my temporary hack until Eli addresses this in a more complete fashion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51920 91177308-0d34-0410-b5e6-96231b3b80d8
arwin-align-cast.c
a2ac06e9647bbac5e910201a570ed623e61b00e2 03-Jun-2008 Steve Naroff <snaroff@apple.com> Change Expr::isIntegerConstantExpr() to allow for pointer types (for GCC compatibility). Note FIXME.

Fix <rdar://problem/5977870> clang on xcode: error: arrays with static storage duration must have constant integer length


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51907 91177308-0d34-0410-b5e6-96231b3b80d8
cc-cast-ext.m
20373221ce82022b7a0d31858af51bebf87e4af1 03-Jun-2008 Steve Naroff <snaroff@apple.com> Allow implicit pointer/int conversions on ObjCQualifiedIdTypes in Sema::CheckCompareOperands() and Sema::CheckAssignmentConstraints().

Fixes <rdar://problem/5980804> clang on xcode: error: incompatible type sending 'id<XDUMLType>', expected 'NSCellType'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51902 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-comptypes-7.m
0326e045fe143856d1b2fb75ae54689e891bbc0d 03-Jun-2008 Steve Naroff <snaroff@apple.com> Finish up r51900.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51901 91177308-0d34-0410-b5e6-96231b3b80d8
cc-cast-ext.m
459a1e2212115f4ff89db7f444df5af41792b18a 03-Jun-2008 Steve Naroff <snaroff@apple.com> Fix parser bug/FIXME with @catch.

<rdar://problem/5980846> clang on xcode: error: declarator requires an identifier (for @catch)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51895 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-try-catch.m
e3e9add4fd788927df6f545570e7838db59c01d7 03-Jun-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/5979875> clang on xcode: error: use of undeclared identifier 'super'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51888 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-property-7.m
289d9f243d9074513368d27eef3b647f72a38324 01-Jun-2008 Steve Naroff <snaroff@apple.com> Tweak Sema::ObjCQualifiedIdTypesAreCompatible() to handle qualified interface types on the RHS.

This eliminates a bogus warning identified in the test below.

This fixes <rdar://problem/5968256> clang on xcode: error: incompatible type initializing 'NSObject<XCSelectionSource> *', expected 'id<NSObject,XCSelectionSource>'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51832 91177308-0d34-0410-b5e6-96231b3b80d8
ompatible-protocol-qualified-types.m
19b87d28317f260192d91d723b80b079711d7356 01-Jun-2008 Steve Naroff <snaroff@apple.com> Add some more test cases that demonstrate clang is a bit stricter than GCC. These can be fixed lazily if they become a problem.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51830 91177308-0d34-0410-b5e6-96231b3b80d8
onditional-expr.m
aa73eec076a2545671f78cb4e82536ec39f040eb 01-Jun-2008 Steve Naroff <snaroff@apple.com> Teach Sema::CheckConditionalOperands() to check for ObjCQualifiedIdType's. This fixes a bogus error.

<rdar://problem/5967036> clang on xcode: error: incompatible operand types ('id<DTOutputStreams>' and 'DTFilterOutputStream *')


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51828 91177308-0d34-0410-b5e6-96231b3b80d8
onditional-expr.m
94a82c930278809a04976ee13013e6e980b18345 31-May-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/5965704> clang: bad receiver type 'id const'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51809 91177308-0d34-0410-b5e6-96231b3b80d8
onst-id.m
799a6a6850af625946bb8d88ca960bb6604e3858 31-May-2008 Steve Naroff <snaroff@apple.com> Teach Expr::isLvalue() about ObjC properties. For now, all properties are writable. Added a FIXME for another day.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51800 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-property-6.m
c1cc6dccd42b91a2ebb397415940da91dbf36103 30-May-2008 Eli Friedman <eli.friedman@gmail.com> Allow a pointer implicitly cast to a bool as a constant expression, as
required by the standard (the standard doesn't know anything about
implicit casts).

Disallow pointers cast to non-integral arithmetic types as constant
expressions. This was previously allowed by accident.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51779 91177308-0d34-0410-b5e6-96231b3b80d8
tatic-init.c
f8f873deef78de611dd793a1e1201bef0d5a54a3 30-May-2008 Eli Friedman <eli.friedman@gmail.com> Make sure to allow assigning a pointer to a bool.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51778 91177308-0d34-0410-b5e6-96231b3b80d8
nit.c
4bd998bbc228915d2b9cae5b67879de48940d05e 30-May-2008 Eli Friedman <eli.friedman@gmail.com> Cleanup/refactoring of Sema struct layout. This patch unifies the struct
and union codepaths and fixes some minor bugs.

I'm reasonably confident this is accurate, at least for X86. I'll
correct any bugs as I find them; I haven't found any for a while,
though.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51762 91177308-0d34-0410-b5e6-96231b3b80d8
itfield-layout.c
truct-packed-align.c
8ef1f26775cae95d202d8d90d92d39add685af3e 27-May-2008 Eli Friedman <eli.friedman@gmail.com> Get the type right for wide string literals; it's wchar_t, not char.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51586 91177308-0d34-0410-b5e6-96231b3b80d8
char_size.c
3c0eb160ca1361a82b9f15b3b40a2425adc14d0f 27-May-2008 Eli Friedman <eli.friedman@gmail.com> Implementation of gcc mode attribute; this is significant because
it fixes PR2204. Not too much to say about the implementation; it works
in a similar way to the vector size attribute.

At some point, we need to modify the targets to provide information
about the appropriate types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51577 91177308-0d34-0410-b5e6-96231b3b80d8
ode-attr-test.c
1f3105e1eeece9ffdc14d7262c7af486ac76600a 27-May-2008 Eli Friedman <eli.friedman@gmail.com> Change diagnostic per suggestion, to make it a bit clearer what is
happening.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51574 91177308-0d34-0410-b5e6-96231b3b80d8
rray-constraint.c
ypedef-variable-type.c
f84eda37251c679e2f20343c47a4a3586d9a8e21 25-May-2008 Eli Friedman <eli.friedman@gmail.com> Count the number of initializable members correctly in structs/unions
with unnamed members.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51557 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
402256fc665ba179873ffcb4d630e28cbea42f27 25-May-2008 Eli Friedman <eli.friedman@gmail.com> Diagnose implicit init list for empty aggregate, like struct {}. Fixes
PR2151 (by not creating the empty implicit init list).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51556 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
638e14413a4557c399fa2b7da2be5e4e9c1330a2 25-May-2008 Eli Friedman <eli.friedman@gmail.com> Move the error checking for variable-sized objects so we don't
double-report errors; fixes PR2362.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51555 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
143520261eb41411beb3e2a8cf6d8dc822db7d50 25-May-2008 Eli Friedman <eli.friedman@gmail.com> Fix this test on non-X86 platforms.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51552 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.c
6d1e4b5e7e80228a1f892824c405ba6a1c3c89b6 22-May-2008 Eli Friedman <eli.friedman@gmail.com> Patch for PR2350; the issue was tnat we were allowing (with an error)
void f(const void) in one place and rejecting it in another.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51424 91177308-0d34-0410-b5e6-96231b3b80d8
oid_arg.c
6b2564c5d968657a35025239ee681f288d83be41 21-May-2008 Eli Friedman <eli.friedman@gmail.com> Fix this test so that it's valid; the point is to test for the crash,
not the missing diagnostic.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51365 91177308-0d34-0410-b5e6-96231b3b80d8
la.c
b0c0554bd62689f48a1c42fc46c78c531cdb3cbf 21-May-2008 Eli Friedman <eli.friedman@gmail.com> PR2347: Fix crash iterating over VLAs; this started triggering because
we now iterate over the whole AST when we destroy it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51363 91177308-0d34-0410-b5e6-96231b3b80d8
la.c
97c0a391138d20e1066174a9cfa92860fb06e5a1 21-May-2008 Eli Friedman <eli.friedman@gmail.com> Fix a couple of bugs found by Neil Booth in the const-ness checking.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51361 91177308-0d34-0410-b5e6-96231b3b80d8
nit.c
e590a84c6ee3d6220d435ba9137012a4a631376c 20-May-2008 Eli Friedman <eli.friedman@gmail.com> Fix typo in test.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51308 91177308-0d34-0410-b5e6-96231b3b80d8
uiltin-stackaddress.c
6cfda23b3768f93a6eb0b2a9135c8334a20125bb 20-May-2008 Eli Friedman <eli.friedman@gmail.com> Add __builtin_frame_address and __builtin_return_address gcc builtins to
Sema. No codegen yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51307 91177308-0d34-0410-b5e6-96231b3b80d8
uiltin-stackaddress.c
d8dc2100487640d8f5ce53201fdcfac7b5ca32b2 20-May-2008 Eli Friedman <eli.friedman@gmail.com> Be a bit more defensive in SemaInit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51301 91177308-0d34-0410-b5e6-96231b3b80d8
ompound-literal.c
6223c2237052dc99cc5263d4cf20cb0bff7650cd 20-May-2008 Eli Friedman <eli.friedman@gmail.com> Add some more checking for compound literals.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51300 91177308-0d34-0410-b5e6-96231b3b80d8
ompound-literal.c
4be1f47de20525ad90f02ba8682a7e2cbd3205d1 19-May-2008 Eli Friedman <eli.friedman@gmail.com> Make the unused expression warning a bit less aggressive (found in PHP
code).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51276 91177308-0d34-0410-b5e6-96231b3b80d8
nused-expr.c
c56c977f44d0bd8422a6f0fe87f361cbb728c06b 19-May-2008 Eli Friedman <eli.friedman@gmail.com> Switch on SemaInit; this makes some code in SemaDecl dead, but I'll give
it a few days to make sure there aren't any significant regressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51273 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
d72d16e6f105deb6fe890225a6251dd0e9001ce7 18-May-2008 Eli Friedman <eli.friedman@gmail.com> Add proper type-checking for pointer additiion; before, we were accepting
addition with a pointer and an integer even when it didn't make sense.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51228 91177308-0d34-0410-b5e6-96231b3b80d8
ointer-addition.c
5773a6c4ab5a3a7aa9f089bfde3ca1c99ea674ac 13-May-2008 Eli Friedman <eli.friedman@gmail.com> Both operands to && have to be scalars, not just one.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51065 91177308-0d34-0410-b5e6-96231b3b80d8
ypecheck-binop.c
235549c7bda856c26cff68190860f69760fa576d 13-May-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/5924576> clang -fsyntax-only generates "redefinition" errors when parsing AppKit that gcc does not.

Teach Sema::MergeVarDecl() about __private_extern__.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51005 91177308-0d34-0410-b5e6-96231b3b80d8
entative-decls.c
e701c0a953d05c3403a74fdb449a8f4a1e4e6594 12-May-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/5928590> clang -fsyntax-only: "incompatible operand types ('int' and 'void')" on input that 'gcc -fsyntax-only' eats


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51002 91177308-0d34-0410-b5e6-96231b3b80d8
onditional-expr.c
a989def422d0dc8a13c705766202ee738fce237a 12-May-2008 Chris Lattner <sabre@nondot.org> testcase for PR2263, fixed by Nate's r50903 patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50983 91177308-0d34-0410-b5e6-96231b3b80d8
ector-assign.c
00bc645d154f8f30bfbfb2fe508caf087793157c 10-May-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> -Implement proper name lookup for namespaces.
-identifierResolver exposes an iterator interface to get all decls through the scope chain.
-The semantic staff (checking IdentifierNamespace and Doug's checking for shadowed tags were moved out of IdentifierResolver and back into Sema. IdentifierResolver just gives an iterator for all reachable decls of an identifier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50923 91177308-0d34-0410-b5e6-96231b3b80d8
xx-namespace.cpp
72786e009bd0519882ceac874e618134d2200d95 09-May-2008 Ted Kremenek <kremenek@apple.com> Add attribute "format" support for typedefs of function pointers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50906 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-attribute.c
abb575866059c9bb74fe4aa32372f002143fa87c 09-May-2008 Chris Lattner <sabre@nondot.org> Fix rdar://5921025 a crash on the included testcase.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50885 91177308-0d34-0410-b5e6-96231b3b80d8
truct-packed-align.c
6d6eb57225b53fb627c565861d1d0e90645400d1 07-May-2008 Douglas Gregor <dgregor@apple.com> Diagnose attempts to use C++ default arguments outside of a function declaration

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50799 91177308-0d34-0410-b5e6-96231b3b80d8
efault2.cpp
daa03115d6d381c0fb1949fb176b4ac50b36dbbb 06-May-2008 Fariborz Jahanian <fjahanian@apple.com> Test was accidently nullified in previous check-in.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50758 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-property-3.m
5251e130a23d997f7c0dfdc250cdc41f179e5bed 06-May-2008 Fariborz Jahanian <fjahanian@apple.com> Patch to refactor setter/getter names of property attributes into Selector
(was IdentifierInfo * before). This will make method declartations whole
lot easier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50747 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-property-3.m
95e2c71181c7ec1ffea0066bbae49e8742bd0687 06-May-2008 Chris Lattner <sabre@nondot.org> Fix rdar://5905347 a crash on invalid builtin, due to the
params not getting installed for builtins when synthesized.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50676 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.c
be34ac67225fc4af6134c7f3507c777cceeec867 04-May-2008 Chris Lattner <sabre@nondot.org> add testcase for pr2050 which is now fixed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50610 91177308-0d34-0410-b5e6-96231b3b80d8
nit.c
57c99347c56b786a67291146e9c1ff992386c9dc 02-May-2008 Fariborz Jahanian <fjahanian@apple.com> Another test case for properties in protocols.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50589 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-property-5.m
aebf0cba02c014ac8b19d615c654248e0e93779f 02-May-2008 Fariborz Jahanian <fjahanian@apple.com> This patch is about merging ObjC2's properties declared in class
protocols into class's property list and performing semantics
on them for while doing so.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50587 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-property-3.m
bjc-property-4.m
3435096781465f6b8e69de4b35d9dd3a94a76468 01-May-2008 Fariborz Jahanian <fjahanian@apple.com> Patch to match and issue diagnostics on property type mismatch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50532 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-property-3.m
dd6cec16e91983651a73ec8a4aadfcfb5bf23fc1 29-Apr-2008 Ted Kremenek <kremenek@apple.com> Convert CFLF to LF. CRLF was causing this test to fail under Mac OS X.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50388 91177308-0d34-0410-b5e6-96231b3b80d8
xx-namespace.cpp
2d1c5d313cd0c229cc614e74baa4c5756a4b46f4 27-Apr-2008 Argyrios Kyrtzidis <akyrtzi@gmail.com> Parsing of namespaces:

-NamespaceDecl for the AST
-Checks for name clashes between namespaces and tag/normal declarations.

This commit doesn't implement proper name lookup for namespaces.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50321 91177308-0d34-0410-b5e6-96231b3b80d8
xx-namespace.cpp
c70bee863b6f800d7c88f409e89dc85ed867ef64 22-Apr-2008 Fariborz Jahanian <fjahanian@apple.com> Allow property in base class to be implemented in a
derived class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50074 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-property-2.m
6cdf16d61de193e0596c3c2cec02e4227212986a 21-Apr-2008 Fariborz Jahanian <fjahanian@apple.com> More semantics checks of properties. Property implementation can implicitly use
ivar of same name.
Better diagnostics to bring home this point.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50065 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-property-1.m
c35b9e4e2efad727538c848cf30d4b0eb1031dc9 21-Apr-2008 Fariborz Jahanian <fjahanian@apple.com> Support for @dynamic AST build.
More property semantics checking.
First test case for ObjC2's property implementation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50057 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-property-1.m
f009795057dc8ca254f5618c80a0a90f07cd44b4 21-Apr-2008 Douglas Gregor <dgregor@apple.com> Clean up handling of function redeclarations

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50021 91177308-0d34-0410-b5e6-96231b3b80d8
edefinition.c
213541a68a3e137d11d2cefb612c6cdb410d7e8e 19-Apr-2008 Nate Begeman <natebegeman@mac.com> OCUVector -> ExtVector, shorthand for extended vector, per feedback from Chris.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49942 91177308-0d34-0410-b5e6-96231b3b80d8
ector-init.c
59b6d5ae1c42515340a48040f6ff576a6f48a9c3 19-Apr-2008 Nuno Lopes <nunoplopes@sapo.pt> fix __attribute__(format) for struct function pointer fields

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49938 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-attribute.c
e37ac4ff1620ed2d7026f52baccbfa022d79ced1 13-Apr-2008 Douglas Gregor <dgregor@apple.com> This patch adds very basic support for parsing and type-checking class
inheritance in C++. It'll parse the base-specifier list, e.g.,

class D : public B1, virtual public B2 { };

and do some of the simpler semantic checks (B1 and B2 are classes;
they aren't unions or incomplete types, etc).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49623 91177308-0d34-0410-b5e6-96231b3b80d8
ecl-invalid.c
nherit.cpp
2ce52f3fb95bf544db6bd3d91a72bce7d9cceb6c 13-Apr-2008 Douglas Gregor <dgregor@apple.com> Introduce support for finding class and enum names via ordinary name lookup in C++

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49621 91177308-0d34-0410-b5e6-96231b3b80d8
lass-names.cpp
9e979557eea3875c9e3d100c68188233dd7f46c0 13-Apr-2008 Chris Lattner <sabre@nondot.org> Default argument cleanups and minor improvements, patch by
Doug Gregor!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49598 91177308-0d34-0410-b5e6-96231b3b80d8
efault2.cpp
def026a193b8218a58d112414515cb87fdf89c15 10-Apr-2008 Chris Lattner <sabre@nondot.org> typedef void T;
void f(T);

is only invalid in C++ mode, not C89 mode.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49460 91177308-0d34-0410-b5e6-96231b3b80d8
89.c
8123a95c33b792d35c2e4992ba6e27882748fb0d 10-Apr-2008 Chris Lattner <sabre@nondot.org> Several improvements from Doug Gregor related to default
argument handling. I'll fix up the c89 (void) thing next.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49459 91177308-0d34-0410-b5e6-96231b3b80d8
rg-invalid.c
89.c
efault2.cpp
04421087832a031c90bd58f128c7c0e741db8dd2 08-Apr-2008 Chris Lattner <sabre@nondot.org> Add support for C++ default arguments, and rework Parse-Sema
interaction for function parameters, fixing PR2046.

Patch by Doug Gregor!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49369 91177308-0d34-0410-b5e6-96231b3b80d8
rg-scope-c99.c
rg-scope.c
efault1.c
efault1.cpp
efault2.cpp
b0489814dcb3cb801eeb0784cc6b6fcf575ff71d 07-Apr-2008 Chris Lattner <sabre@nondot.org> merge compatibility testing of qualified/unqualified interfaces together
and fix a bug.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49322 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-comptypes-5.m
42a997c93b2166facfd3c93ffd5027e4930545dd 07-Apr-2008 Chris Lattner <sabre@nondot.org> MyOtherClass<MyProtocol>* is compatible with MyClass*
if MyClass is a superclass of MyOtherClass, there is no need for
an exact interface match.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49320 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-comptypes-5.m
aaf9ddbeab08a43203cf6b9ca4986c8c6fe6fdc6 06-Apr-2008 Chris Lattner <sabre@nondot.org> reject 'typedef int y; int test(x, y)'.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49270 91177308-0d34-0410-b5e6-96231b3b80d8
rg-duplicate.c
d658b562e80d6ef7a1118e34ff12802c6e2fcced 05-Apr-2008 Chris Lattner <sabre@nondot.org> Fix handling of implicit int, resolving PR2012 and reverting (and
subsuming) my patch for PR1999.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49251 91177308-0d34-0410-b5e6-96231b3b80d8
89.c
unction.c
a798ebc82627ea9cb7a00da07d2b60f9f2114f69 05-Apr-2008 Chris Lattner <sabre@nondot.org> Step #1 to fixing PR2012: c89 allows declspecs to be completely
missing from function definitions only. If we see a function
definiton with missing declspecs, just fudge in an int.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49250 91177308-0d34-0410-b5e6-96231b3b80d8
89.c
e2ef815de1da36c1ad1494cb58ce37adac1efa26 04-Apr-2008 Steve Naroff <snaroff@apple.com> Add explicit support for diagnosing implicit function decls.
Without this, the diagnostic is very confusing. The diag is now consistent with gcc as well.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49214 91177308-0d34-0410-b5e6-96231b3b80d8
mplicit-decl.c
63f067f5a75ae97b53dc7a6a6530e2c72c8bb7f8 04-Apr-2008 Seo Sanghyeon <sanxiyn@gmail.com> PR1963: Address of function is a constant expression

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49212 91177308-0d34-0410-b5e6-96231b3b80d8
ddress-constant.c
3110251f13981689f384eb3c0aba2afffea18d9d 02-Apr-2008 Steve Naroff <snaroff@apple.com> Change ObjCInterfaceDecl to inherit from NamedDecl (not TypeDecl). While ObjCInterfaceDecl is arguably a TypeDecl, it isn't a ScopedDecl. Since TypeDecl's are scoped, it makes sense to simply treat them as NamedDecl's. I could have fiddled a bit more with the hierarchy (in terms of creating a non-scoped TypeDecl), however this probably isn't worth the effort.

I also finished unifying access to scope decl change by converting Sema::getObjCInterfaceDecl() to use Sema::LookupDecl(). This is much cleaner now:-)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49107 91177308-0d34-0410-b5e6-96231b3b80d8
heck-dup-objc-decls-1.m
26b7661b1db92ed611f5c02d61e40e4071aa2058 02-Apr-2008 Chris Lattner <sabre@nondot.org> improve error to be something end users will actually understand :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49097 91177308-0d34-0410-b5e6-96231b3b80d8
eclspec.c
96b77fc05ed4a052a9e614f72b0e83572408ce48 02-Apr-2008 Chris Lattner <sabre@nondot.org> 1) Enforce C99 6.7.3p2: "Types other than pointer types derived from
object or incomplete types shall not be restrict-qualified."

2) Warn about qualifiers on function types: C99 6.7.3p8: "If the
specification of a function type includes any type qualifiers, the
behavior is undefined."

3) Implement restrict on C++ references.

4) fix some locations for various C++ reference diagnostics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49081 91177308-0d34-0410-b5e6-96231b3b80d8
eclspec.c
e6327747b72bb687c948270f702ff53c30f411a6 02-Apr-2008 Chris Lattner <sabre@nondot.org> Fix several bugs in array -> pointer decomposition.

First, we got several CVR propagation cases wrong, which Eli pointed
out in PR2039.

Second, we didn't propagate address space qualifiers correctly, leading
to incorrect lowering of code in CodeGen/address-space.c.

Third, we didn't uniformly propagate the specifier in the array to the
pointer ("int[restrict 4]" -> "int *restrict").

This adds an ASTContext::getArrayDecayedType member that handles the
non-trivial logic for this seemingly simple operation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49078 91177308-0d34-0410-b5e6-96231b3b80d8
ypedef-retain.c
fd89bc825026e44c68a68db72d4012fd6752e70f 02-Apr-2008 Chris Lattner <sabre@nondot.org> Fix PR2017 and silence some bogus errors.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49068 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
ecl-invalid.c
e8043c39176e7f253fbd92982b077eca6bf2fd59 02-Apr-2008 Steve Naroff <snaroff@apple.com> Fairly large "cleaup" related to changing ObjCCompatibleAliasDecl superclass (to inherit from NamedDecl, instead of ScopedDecl).

- Added a DenseMap to associate an IdentifierInfo with the ObjCCompatibleAliasDecl.
- Renamed LookupScopedDecl->LookupDecl and changed it's return type to Decl. Also added lookup for ObjCCompatibleAliasDecl's.
- Removed Sema::LookupInterfaceDecl(). Converted clients to used LookupDecl().
- Some minor indentation changes.

Will deal with ObjCInterfaceDecl and getObjCInterfaceDecl() in a separate commit...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49058 91177308-0d34-0410-b5e6-96231b3b80d8
lias-test-1.m
8a934233d1582b5bde9d270bc0705aa81e471a79 31-Mar-2008 Chris Lattner <sabre@nondot.org> rename Decl::CompatibleAlias -> ObjCCompatibleAlias.

Fix objc ivar lookup. Ivar lookup should occur between lookup
of method-local values and lookup of globals. Emulate this with
some logic in the handling of Sema::ActOnIdentifierExpr.

Two todo's left:
1) sema shouldn't turn a bare reference to an ivar into "self->ivar"
in the AST. This is a hack.
2) The new ScopedDecl::isDefinedOutsideFunctionOrMethod method does
not correctly handle typedefs and enum constants yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48972 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-ivar-lookup.m
95110968dcd6ba2baef2a23549cd5592f01eca59 28-Mar-2008 Steve Naroff <snaroff@apple.com> Make sure Sema::ActOnClassMessage() correctly diagnoses "super".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48924 91177308-0d34-0410-b5e6-96231b3b80d8
ndef-superclass-1.m
8c1a9a80ba2e200f9180867e133563b15223dca2 26-Mar-2008 Nuno Lopes <nunoplopes@sapo.pt> allow the format attribute to be specified in function pointer prototypes
# this is my first commit here, so please be gentle :)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48807 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-attribute.c
8e7dafec4b70303dfaff95151cd06bfc5532720c 25-Mar-2008 Nate Begeman <natebegeman@mac.com> Extend QualType::getAddressSpace to do the right thing for array types, and in
the future, RecordTypes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48784 91177308-0d34-0410-b5e6-96231b3b80d8
ddress_spaces.c
c8e89a8ce5057750c338854085dca26f8d3136ac 14-Mar-2008 Nate Begeman <natebegeman@mac.com> Correctly error on arrays with automatic storage full of objects with
non-default address space, and fix comment.
Add a test for this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48366 91177308-0d34-0410-b5e6-96231b3b80d8
ddress_spaces.c
5af27e02917089dd107c58c1cfdb064544010773 14-Mar-2008 Nate Begeman <natebegeman@mac.com> ISO/IEC TR 18037
An address space name cannot be used to qualify an object that has automatic
storage duration. Still not catching ASQual'd allocas of array type, just
scalars at the moment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48350 91177308-0d34-0410-b5e6-96231b3b80d8
ddress_spaces.c
b6789ca9ca0f43551edd2cdf4b9ebc35ea4c7247 07-Mar-2008 Nate Begeman <natebegeman@mac.com> Add new test


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48018 91177308-0d34-0410-b5e6-96231b3b80d8
allingconv.c
aa8f976111e75427fa41e0f84b78fe086ce0f4e6 07-Mar-2008 Ted Kremenek <kremenek@apple.com> Patch by Nuno Lopes:

Added more comments for code processing attribute "format".
Added more checks for corner cases, test cases, and warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48011 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-attribute.c
69153db02015f6da287853d5a1a700685450a3e9 03-Mar-2008 Chris Lattner <sabre@nondot.org> move deprecated -> attributes.c


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47856 91177308-0d34-0410-b5e6-96231b3b80d8
eprecated.c
7a03452889efc0e4cb7e2d474a2cc5881c6c571a 03-Mar-2008 Gabor Greif <ggreif@gmail.com> Chris added this testcase with r47837. The mail only shows one todo-warning but I see 3. Strangeness. Correcting lines 16 and 24.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47840 91177308-0d34-0410-b5e6-96231b3b80d8
eprecated.c
ddee4231e9bdfbac1e1f5385ff1a17fd0e0b0e39 03-Mar-2008 Chris Lattner <sabre@nondot.org> Add a bunch of attributes, patch by Nuno Lopes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47837 91177308-0d34-0410-b5e6-96231b3b80d8
ttributes.c
bcb2b6112072b071aafb0a7a28f16239c6a006a5 01-Mar-2008 Steve Naroff <snaroff@apple.com> Fix http://llvm.org/bugs/show_bug.cgi?id=2103.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47775 91177308-0d34-0410-b5e6-96231b3b80d8
xpr-address-of.c
da323adbb99cee19a203ead852d5d9bfebb23fb7 29-Feb-2008 Steve Naroff <snaroff@apple.com> Fix http://llvm.org/bugs/show_bug.cgi?id=2106.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47768 91177308-0d34-0410-b5e6-96231b3b80d8
issing-method-context.m
fce90e324bfc0608ed9f0a778dde915c7291ad0c 29-Feb-2008 Chris Lattner <sabre@nondot.org> testcase for attr deprecated, by Nuno Lopes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47757 91177308-0d34-0410-b5e6-96231b3b80d8
eprecated.c
86e07b6c2588ed18f34b19752cd48a9dbf3a0171 21-Feb-2008 Nate Begeman <natebegeman@mac.com> add a test case


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47455 91177308-0d34-0410-b5e6-96231b3b80d8
nnotate.c
7380466f2e9a5c835344454444cd3ad89ccca6e6 21-Feb-2008 Chris Lattner <sabre@nondot.org> add some semantic checks for address spaces.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47423 91177308-0d34-0410-b5e6-96231b3b80d8
ddress_spaces.c
49581f4dc324d6a183419168b01cb04e73342c07 19-Feb-2008 Chris Lattner <sabre@nondot.org> fix the second half of PR2041: __restrict is ok in c90 mode, even if
restrict isn't.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47316 91177308-0d34-0410-b5e6-96231b3b80d8
89.c
a0992b63c9c938699da526dd6032ad30b6011656 18-Feb-2008 Steve Naroff <snaroff@apple.com> Tweak fix for http://llvm.org/bugs/show_bug.cgi?id=2000 to work across typedefs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47269 91177308-0d34-0410-b5e6-96231b3b80d8
eref.c
5280408ab323a213ac63d5b557475ea5037aa553 17-Feb-2008 Chris Lattner <sabre@nondot.org> Fix PR2042. One remaining issue: we don't currently diagnose

int foobar(int);
int foobar() {}

which requires ifdef'ing out a testcase in predefined-function.c.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47236 91177308-0d34-0410-b5e6-96231b3b80d8
unction.c
redefined-function.c
d3f2f79fedfef7cae818c55a1f3d7a8f5992e5a0 17-Feb-2008 Eli Friedman <eli.friedman@gmail.com> Implemnt isVariablyModifiedType correctly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47233 91177308-0d34-0410-b5e6-96231b3b80d8
ypedef-variable-type.c
5a1b0c4d91bd2d846f91121ffd71508b7bb7ddf6 16-Feb-2008 Anders Carlsson <andersca@mac.com> Add more tests

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47217 91177308-0d34-0410-b5e6-96231b3b80d8
truct-packed-align.c
6a24acbb3dbb3bea9426716bee6ad6023ad15f3f 16-Feb-2008 Anders Carlsson <andersca@mac.com> Make sizeof and __alignof work correctly with packed structs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47202 91177308-0d34-0410-b5e6-96231b3b80d8
truct-packed-align.c
3e5849ecfc02e362beb195d35100f868b1699176 15-Feb-2008 Chris Lattner <sabre@nondot.org> Fix PR2041: restrict is not a keyword in c90.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47160 91177308-0d34-0410-b5e6-96231b3b80d8
89.c
f963339f63e37057c7f397b3ecf5bfb49f6b48b9 15-Feb-2008 Eli Friedman <eli.friedman@gmail.com> Get rid of outdated code that masks type errors. Fixes PR2036.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47154 91177308-0d34-0410-b5e6-96231b3b80d8
unction.c
708eed500a73a2b85a9f5435efbf57b882339f3d 15-Feb-2008 Eli Friedman <eli.friedman@gmail.com> Nevermind, these tests work... I messed up my testing.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47153 91177308-0d34-0410-b5e6-96231b3b80d8
truct-compat.c
d57405250498a1b5f23c97c6e089318f6f3eefd7 15-Feb-2008 Eli Friedman <eli.friedman@gmail.com> Partial fix for struct compatibility; there's still something messy
going on with mixing scopes, though.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47152 91177308-0d34-0410-b5e6-96231b3b80d8
truct-compat.c
e39bfd0c52975dfb038413aa55147df2fc709ce2 14-Feb-2008 Steve Naroff <snaroff@apple.com> A much better fix for http://llvm.org/bugs/show_bug.cgi?id=1987.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47103 91177308-0d34-0410-b5e6-96231b3b80d8
eclspec.c
4b3f9b367c16e494c181d6f03d53497ae1275fbe 13-Feb-2008 Eli Friedman <eli.friedman@gmail.com> Fix a minor bug in isNullPointerConstant triggered by the linux
tgmath.h.

Note that there is another issue with tgmath.h, so mandel.c still
doesn't work.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47069 91177308-0d34-0410-b5e6-96231b3b80d8
onditional-expr.c
bab96968886f4b77083f4e26a28986ddb1e42d67 12-Feb-2008 Eli Friedman <eli.friedman@gmail.com> Make typechecking for enum+int compatibility stricter.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47005 91177308-0d34-0410-b5e6-96231b3b80d8
onditional-expr.c
4c721d381fb279899337d120edd4a24d405e56b2 12-Feb-2008 Eli Friedman <eli.friedman@gmail.com> Fix type compatibility between constant and variable arrays.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47003 91177308-0d34-0410-b5e6-96231b3b80d8
onditional-expr.c
9532414c45a7114d9e94a733121655a5b5d5b473 12-Feb-2008 Steve Naroff <snaroff@apple.com> Allow the parser to detect invalid DeclSpec's. This fixes http://llvm.org/bugs/show_bug.cgi?id=1987.

This commit only "guards" the call to ParseDeclarationSpecifiers() in ParseDeclarationOrFunctionDefinition().

We could consider guarding all calls, however this is a bit radical (since it effectively stops parsing the declaration once we have a bad declspec). Will discuss with Chris tomorrow.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46984 91177308-0d34-0410-b5e6-96231b3b80d8
eclspec.c
88cf226caee50956ef47edd4d44cf7b80703a26c 11-Feb-2008 Anders Carlsson <andersca@mac.com> Get rid of bogus warnings when the second argument in va_start is either an implicit cast expr or a paren expr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46950 91177308-0d34-0410-b5e6-96231b3b80d8
arargs.c
3a15485c28ff427876357e23c53c88403a9c26ab 11-Feb-2008 Steve Naroff <snaroff@apple.com> Tweak test...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46946 91177308-0d34-0410-b5e6-96231b3b80d8
nvalid-struct-init.c
b43eaa5fa678d108ee804455f805a8e6cf30ca34 11-Feb-2008 Steve Naroff <snaroff@apple.com> Fix http://llvm.org/bugs/show_bug.cgi?id=1988.

Sema::CheckInitializerListTypes() needs to ignore invalid structures.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46942 91177308-0d34-0410-b5e6-96231b3b80d8
nvalid-struct-init.c
a7ad98ff0919d6a24ea7c46634ea29bea551c1a0 11-Feb-2008 Chris Lattner <sabre@nondot.org> Fix PR1992 by computing the right type for string literals, which
is an array type not a pointer type. This requires updating some
diags that change and updating the code generator to handle the
proper form of strings.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46941 91177308-0d34-0410-b5e6-96231b3b80d8
rgument-checking.m
rray-init.c
ompound-literal.c
-c-e2.c
f76f5ed0505bc4b9c3c7d6003335b34cdf9afe47 11-Feb-2008 Eli Friedman <eli.friedman@gmail.com> Add a couple of sema tests for qualifiers with conditionals containing
void*.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46939 91177308-0d34-0410-b5e6-96231b3b80d8
onditional-expr.c
99d724f6a31b5521ded95adf10ef7f3c62a0b18e 11-Feb-2008 Chris Lattner <sabre@nondot.org> Fix PR1999, by emitting a hard error only if an argument declarator is completely
missing. Otherwise, it is an implicit int case, which is valid in c90 and invalid
elsewhere, but accepted as an extension.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46938 91177308-0d34-0410-b5e6-96231b3b80d8
89.c
unction.c
acb818a4f7d9b608826171094d6b5a555a8fe694 10-Feb-2008 Steve Naroff <snaroff@apple.com> Refine bug fix to Expr::isLvalue (commit r46917).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46919 91177308-0d34-0410-b5e6-96231b3b80d8
eref.c
75ceedf377727cb39a4fbeb36f11462713b093f5 10-Feb-2008 Steve Naroff <snaroff@apple.com> Change Expr::isLvalue() to allow the "void" type. This fixes bz2000 submitted by Neil Booth.

Neil, can you point me to the place in the C99 spec that says this is allowed? I thought Expr::isLvalue() conformed to the spec, which says "C99 6.3.2.1: an lvalue is an expression with an object type or an incomplete type other than void.". Please advise.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46917 91177308-0d34-0410-b5e6-96231b3b80d8
eref.c
336ed0b79b8abd0a25ac0083a2d43049e450dab0 09-Feb-2008 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/5733511> clang doesn't emit error for const array.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46905 91177308-0d34-0410-b5e6-96231b3b80d8
ssign.c
efe7f36f4d87b6e64b87128a81018350b2f21987 08-Feb-2008 Steve Naroff <snaroff@apple.com> A bunch-o changes to fix <rdar://problem/5716046> incomplete implementation of ObjC class warning is incomplete

As part of this fix, I made a low-level change to the text diagnostics machinery (to basically avoid printing duplicate source lines/carets when you have multiple diagnostics that refer to the same exact place). For now, this only happens with we don't have a source range (could be extended to support source ranges as well).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46897 91177308-0d34-0410-b5e6-96231b3b80d8
ethod-undef-category-warn-1.m
ethod-undefined-warn-1.m
ndef-protocol-methods-1.m
362809751711f7dc4ab01653ec7964a2e95f999b 08-Feb-2008 Steve Naroff <snaroff@apple.com> Use getLogicalLineNumber() in FuzzyParseMicrosoftAsmStatement(), it's more general and simplifies the code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46885 91177308-0d34-0410-b5e6-96231b3b80d8
s-fuzzy-asm.c
03d6bc6734eb79dc27628d9ea1126c299c80b4b6 08-Feb-2008 Steve Naroff <snaroff@apple.com> Support fuzzy parsing MS line-oriented __asm's that originate from a macro (a case where we can't obtain source line info). As the test case indicates, we don't currently support line-oriented asm statements that mix file/macro body tokens.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46878 91177308-0d34-0410-b5e6-96231b3b80d8
s-fuzzy-asm.c
a312ce2bdaaff62f21d560bad6cb0519f613d334 08-Feb-2008 Eli Friedman <eli.friedman@gmail.com> Improve diagnostic for illegal array initialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46869 91177308-0d34-0410-b5e6-96231b3b80d8
nit.c
510190777c4bd53e960eea4665b204778fec1b64 06-Feb-2008 Eli Friedman <eli.friedman@gmail.com> Make sure to propagate qualifiers through the member operator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46830 91177308-0d34-0410-b5e6-96231b3b80d8
ssign.c
4e92acf3b747b994e50fbf7bfe8ef71cdda20c50 06-Feb-2008 Eli Friedman <eli.friedman@gmail.com> Be a bit stricter about array type compatibility.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46799 91177308-0d34-0410-b5e6-96231b3b80d8
ompare.c
35080844d3e634c7c1b2875f476ab5f697eece61 02-Feb-2008 Chris Lattner <sabre@nondot.org> Implement support for __extension__ which silences extwarnings in its
scope. This is part of the fix for PR1966


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46669 91177308-0d34-0410-b5e6-96231b3b80d8
xprs.c
5f0ad3f34c328f71aa53a68f3d4b788ae0541924 01-Feb-2008 Ted Kremenek <kremenek@apple.com> Moved "Rewriter" tests from test/Sema to test/Rewriter.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46640 91177308-0d34-0410-b5e6-96231b3b80d8
d-test-3.m
var-encoding-1.m
var-encoding-2.m
etadata-test-1.m
etadata-test-2.m
ethod-encoding-1.m
bjc-encoding-bug-1.m
bjc-ivar-receiver-1.m
bjc-string-concat-1.m
bjc-super-test.m
bjc-synchronized-1.m
rotocol-rewrite-1.m
ewrite-api-bug.m
ewrite-foreach-1.m
ewrite-foreach-2.m
ewrite-foreach-3.m
ewrite-foreach-4.m
ewrite-foreach-5.m
ewrite-foreach-6.m
ewrite-protocol-type-1.m
ewrite-try-catch.m
tatic-type-protocol-1.m
ndecl-objc-h.m
ndeclared-method-1.m
ndef-field-reference-1.m
a-method.m
369dee454fe7e77720d0d0012a23b75e17bee101 01-Feb-2008 Anders Carlsson <andersca@mac.com> It is allowed to get the address of an array subscript, even if the array has the register qualifier, if the array is really a pointer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46634 91177308-0d34-0410-b5e6-96231b3b80d8
xpr-address-of.c
6e10a08fe0427ab34c463dd59d9c0997d4f72170 01-Feb-2008 Chris Lattner <sabre@nondot.org> make some diagnostics more terse, update testcases.

Fix Sema::ActOnInstanceMessage to correctly do things in terms of canonical
types, fixing bogus errors like:

NSDistantObject.m:10383:120: error: bad receiver type 'typeof((id<NSMutableCopying>)self)'
id mess = ({ id __inv__ = ((void *)0); id __mb__ = _NSMessageBuilder((id <NSMutableCopying>)self, &__inv__); (void)[(__typeof__((id <NSMutableCopying>)self))__mb__ mutableCopyWithZone:((void *)0)]; if (!objc_collecting_enabled()) object_dispose(__mb__); __inv__; });



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46633 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-bad-receiver-1.m
868d08f9e97eb013600199594745b9997150be8f 31-Jan-2008 Chris Lattner <sabre@nondot.org> Fix a bogus test


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46602 91177308-0d34-0410-b5e6-96231b3b80d8
unction.c
eturn-stack-addr.cpp
338d1e2ced8037b71d91fb319631846917d0ceda 31-Jan-2008 Chris Lattner <sabre@nondot.org> Fix a rewriter crash when the whole body of a foreach is itself
rewritten, as in Sema/rewrite-foreach-6.m. Fariborz/Steve,
please review this to see if it is sane.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46600 91177308-0d34-0410-b5e6-96231b3b80d8
ewrite-foreach-6.m
890d93eec45f2ba720dce98e34a1a904697ae842 30-Jan-2008 Steve Naroff <snaroff@apple.com> Fix test case and add a FIXME.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46577 91177308-0d34-0410-b5e6-96231b3b80d8
onditional-expr.c
e0c5414f0514a23a5c8c434c81b9f0a35517ab63 30-Jan-2008 Chris Lattner <sabre@nondot.org> make this pass by adding an expected error, add some tests.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46551 91177308-0d34-0410-b5e6-96231b3b80d8
ffsetof.c
b7b032ecb23e5a2ebff89d62478f93313c04d367 30-Jan-2008 Steve Naroff <snaroff@apple.com> Many refinements to Sema::MergeVarDecl(). This routine still needs some re-work to fully handle tentative decls.

This includes a fix to bz1908.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46540 91177308-0d34-0410-b5e6-96231b3b80d8
entative-decls.c
a0f55792409289d1d343023fa8292cff6355e538 29-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Rewriting of @synchronized. This has one FIXME in it. But this should allow @sychronized to be rewritten.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46533 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-synchronized-1.m
2565eeff7b0d2310fb2924ce96a54302b0dfa5af 29-Jan-2008 Steve Naroff <snaroff@apple.com> Tighten up ASTContext::typesAreCompatible()...it needs to make sure the qualifiers match. The comment and C99 citation for this routine were correct...the code needed to conform to the comment/spec. This fixes the test added below.

Tightening up this routine forced tweaks to Sema::CheckSubtractionOperands() and Sema::CheckCompareOperands(). For example, they both need to operate on the unqualified pointee...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46522 91177308-0d34-0410-b5e6-96231b3b80d8
unction.c
5a1deb8d9c0722beae28d693fa137bbb942bd11f 29-Jan-2008 Anders Carlsson <andersca@mac.com> Implement __builtin_offsetof.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46515 91177308-0d34-0410-b5e6-96231b3b80d8
ffsetof.c
ba03eda1599dd89da935a2b46da10659afe46add 29-Jan-2008 Steve Naroff <snaroff@apple.com> Fix bz1950. ASTContext::functionTypesAreCompatible() needs to operate on the unqualified parameter types (per C99 6.7.5.3p15).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46472 91177308-0d34-0410-b5e6-96231b3b80d8
unction.c
578edc6614236b224f63ac707acecaeb2a74d6b4 28-Jan-2008 Steve Naroff <snaroff@apple.com> Fix a bug with struct initializers (in Sema::CheckInitializerListTypes()).
Test case included from bz1948 (thanks Neil!).
Also fixed an 80 column violation...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46430 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
1dad5b2f0e5737afe6847b97a18492bab93517d5 25-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Diagnose bad receiver type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46358 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-bad-receiver-1.m
d47d4f518e43eaa716e2d18359bd725a03b87f58 25-Jan-2008 Nate Begeman <natebegeman@mac.com> Support checking and codegen of constant vector globals



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46343 91177308-0d34-0410-b5e6-96231b3b80d8
ector-init.c
a99603333fffb57cf9ac37eabb190c8f5afc914b 25-Jan-2008 Steve Naroff <snaroff@apple.com> Replace Sema::CheckVariableInitList, CheckConstantInitList, and CheckForCharArrayInitializer with CheckInitializerListTypes. The new routine now supports struct/union initializers.

This is a modified version of a patch by Eli Friedman. This version passes all of the clang tests and supports vectors:-)

Note that Eli and I are still unsatisfied the implementation of CheckInitializerListTypes(). We'd like to find a more elegant implementation. Nevertheless, this is a complex part of the standard (and may be hard to simplify). Since the complexity is localized to this routine, we can iterate without too much disruption:-)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46339 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
0cbc215ccd01ba7ce8e46cac5be147746cf0af4e 25-Jan-2008 Chris Lattner <sabre@nondot.org> Fix a bug recovering from broken code with a goto that Eli reported.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46336 91177308-0d34-0410-b5e6-96231b3b80d8
ecover-goto.c
7da8d94cb79f311c5b126483b8edfe5dc70d6c8f 23-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Fixed a nasty bug which took a while to come up with a test case,
diagnose, and took even longer to fix. It has to do with rewriting of a message
receiver which is an 'ivar' reference. Fix, however, is to remove a code which
was not doing the right thing and no longer needed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46279 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-ivar-receiver-1.m
7d6b46d9a9d75dea8ef9f6973dd50633c1f37963 22-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Problem with ObjC's type-encoding of nested structs causing infinit recursion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46260 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-encoding-bug-1.m
ca107309ffbcacae31d1685ab133f75ca0d7271a 22-Jan-2008 Steve Naroff <snaroff@apple.com> Sema::CheckInitializerTypes(). Start simpliying and cleaning up...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46234 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
2338d58a905191c4205d4f73affd0bdaa13493b4 21-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Elimate bogus warning when va_start is correctly used in
a method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46232 91177308-0d34-0410-b5e6-96231b3b80d8
a-method-1.m
a-method.m
7c39ff7eb3dd7ae9b2b81cb66a139c9b52f47f1d 21-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Synthesize methods with va-arg list correctly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46212 91177308-0d34-0410-b5e6-96231b3b80d8
a-method.m
20ebf8f15df48f27ce2bf7c1b3ae87565235600f 19-Jan-2008 Steve Naroff <snaroff@apple.com> Fix two bugs with an @throw that doesn't have a statement.
- ObjCAtThrowStmt::getSourceRange() needs to check if it has a statement (and not go "boom":-)
- RewriteTest::RewriteObjCThrowStmt() needs to generate refer to the current exception.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46184 91177308-0d34-0410-b5e6-96231b3b80d8
ewrite-try-catch.m
9a75f8ae17e7f917f491c2e8757bafbf57254c24 18-Jan-2008 Steve Naroff <snaroff@apple.com> Sema::FinalizeDeclaratorGroup(): Tighten up the tentative definition rule when dealing with arrays.

Bug submitted by Eli.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46179 91177308-0d34-0410-b5e6-96231b3b80d8
rray-constraint.c
ncomplete-decl.c
d3cd1e56d19474ac785e54c3915d82d2ad7f7fa9 18-Jan-2008 Steve Naroff <snaroff@apple.com> Sema::FinalizeDeclaratorGroup()...make sure we emit an diagnostic for tentative definitions with incomplete types. Touch up all test cases that are effected.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46152 91177308-0d34-0410-b5e6-96231b3b80d8
rray-constraint.c
eref.c
num.c
ncomplete-decl.c
1b4a6227f3ee6fca074d0f521757d1ed4f95ef38 17-Jan-2008 Steve Naroff <snaroff@apple.com> Declarator::clear(): Null out variable after it's been deleted.

This avoids a double free (which is good:-)

Bug submitted by Eli.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46105 91177308-0d34-0410-b5e6-96231b3b80d8
eclspec.c
67c49e892b50a9ccb64f7296e00c23c61a8b7186 17-Jan-2008 Steve Naroff <snaroff@apple.com> Type::isArithmeticType(): disallow incomplete enum decls.

Bug submitted by Eli.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46102 91177308-0d34-0410-b5e6-96231b3b80d8
num.c
837618c0945e1f67ec1e39000c568a1fa857a5a9 16-Jan-2008 Steve Naroff <snaroff@apple.com> Sema::MergeFunctionDecl()...make sure diagnostic is accurate (wrt function declarations/definitions). Patch by Carl Lewis!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46070 91177308-0d34-0410-b5e6-96231b3b80d8
erge-decls.c
redefined-function.c
e8d1c0579404442a87818506bb0e742d0f52d5bf 16-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Added support for rewriting of continue/break statements inside ObjC2's foreach-stmt.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46037 91177308-0d34-0410-b5e6-96231b3b80d8
ewrite-foreach-5.m
dfb9bbbb7cb9608fa46e94c39efbd168a33209f1 15-Jan-2008 Steve Naroff <snaroff@apple.com> Finish up handling all permutations of "complex int" (in Sema::UsualArithmeticConversions()).
A FIXME remains to verify the conversion rules are consistent with GCC.

Thanks to Eli for the new/improved test case...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46022 91177308-0d34-0410-b5e6-96231b3b80d8
omplex-int.c
02f62a9fedbc370fba081303399410a3afdde29f 15-Jan-2008 Steve Naroff <snaroff@apple.com> - Change Type::isComplexType() to exlude GCC's complex integer extension. In general, we will keep the lowest level Type predicates "pure" (i.e. true to the C99 spec).
- Modify Sema::UsualArithmeticConversions() to work with the new definition of Type::isComplexType().

This is a nice cleanup and also fixes a bug submitted by Eli (which I've added to the test suite).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46005 91177308-0d34-0410-b5e6-96231b3b80d8
omplex-int.c
4cdec1c3ca80124024a787ce32833fd5b20cbb15 15-Jan-2008 Steve Naroff <snaroff@apple.com> Rework commit r45976, which was incorrect.

- Add Type::isComplexIntegerType(), Type::getAsComplexIntegerType().
- Don't inlude complex types with Type::isIntegerType(), which is too general.
- Use the new predicates in Sema::UsualArithmeticConversions() to recognize/convert the types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45992 91177308-0d34-0410-b5e6-96231b3b80d8
omplex-int.c
14f3f1b80ec61e50e61a4353bd647ce37ee2dd06 15-Jan-2008 Steve Naroff <snaroff@apple.com> Make sure Sema::GetTypeForDeclarator() deals with abstract declarators when diagnosing incorrect code.

Bug submitted by Eli.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45989 91177308-0d34-0410-b5e6-96231b3b80d8
omplex-int.c
llegal-types.c
3f0c5adc2f488f40aa0f7b88c27b347f80b104bb 14-Jan-2008 Steve Naroff <snaroff@apple.com> Teach Type::isIntegerType() about GCC's __complex__ integer extensions...

Bug submitted by Eli.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45976 91177308-0d34-0410-b5e6-96231b3b80d8
omplex-int.c
adbbd0c625806b9d6183920d33eb78566a8f3366 14-Jan-2008 Steve Naroff <snaroff@apple.com> Fix crasher when redefining functions. Not 100% pleased with this solution, but it is clearly an improvement. Will discuss with Chris later.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45975 91177308-0d34-0410-b5e6-96231b3b80d8
erge-decls.c
e9b12198c4cc7f5687960100351b4af006c14469 14-Jan-2008 Steve Naroff <snaroff@apple.com> Record if a compound literal expression is @ file scope. This allows us to implement C99 6.5.2.5p6. This could have been done without modifying the AST (by checking the decl type and passing the info down to isContextExpr), however we concluded this is more desirable.

Bug/patch by Eli Friedman!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45966 91177308-0d34-0410-b5e6-96231b3b80d8
ompound-literal.c
aa58f00ebba5f14955001736b7aea20bb5bd91e6 14-Jan-2008 Steve Naroff <snaroff@apple.com> Revert r45951, Chris says it violates the C99 spec.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45961 91177308-0d34-0410-b5e6-96231b3b80d8
onditional-expr.c
1adb88370beab45af2f065afe86b51ccd59ec50d 14-Jan-2008 Chris Lattner <sabre@nondot.org> Fix ASTContext::typesAreCompatible when analyzing a function type with
proto and function type without proto. It would never call
'functionTypesAreCompatible' because they have different type classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45952 91177308-0d34-0410-b5e6-96231b3b80d8
unction.c
aaffbf7c790a324ed114184db771aae2d2e9151c 14-Jan-2008 Steve Naroff <snaroff@apple.com> Rewrite Expr::isNullPointerConstant() to deal with multiple levels of explicit casts.

Now, isNullPointerConstant() will return true for the following: "(void*)(double*)0"



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45951 91177308-0d34-0410-b5e6-96231b3b80d8
onditional-expr.c
08f196716775e3b5a5406b588f5f01a0169a8a5b 13-Jan-2008 Steve Naroff <snaroff@apple.com> Change Sema::CheckAddressOfOperation() to respect C99-only addressof rules.
Remove diagnostics from Sema::CheckIndirectionOperand(). C89/C99 allow dereferencing an incomplete type. clang appears to be emulating some incorrect gcc behavior (see below).

void
foo (void)
{
struct b;
struct b* x = 0;
struct b* y = &*x; // gcc produces an error ("dereferencing pointer to incomplete type")
}

With this patch, the above is now allowed.

Bug/Patch by Eli Friedman!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45933 91177308-0d34-0410-b5e6-96231b3b80d8
onditional-expr.c
eref.c
1423ea4146f0f71e027adbcd04c9e715711d8063 12-Jan-2008 Chris Lattner <sabre@nondot.org> Tighten up handling of __func__ and friends: it should be an array
of const char, and it should error if it occurs outside a function.

Is it valid in an objc method? If so we should handle that too.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45910 91177308-0d34-0410-b5e6-96231b3b80d8
redef.c
fa28b30d5a1e93e5263be33e343532b900d2c643 12-Jan-2008 Chris Lattner <sabre@nondot.org> Fix the type of predefined identifiers like __func__. Patch by
Eli Friedman!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45906 91177308-0d34-0410-b5e6-96231b3b80d8
redef.c
d577b5e4a563e8b6f041fa5a1df103c52be31b32 10-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Pass rewritten output to 'clang' for verification.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45794 91177308-0d34-0410-b5e6-96231b3b80d8
ewrite-foreach-1.m
ewrite-foreach-2.m
ewrite-foreach-3.m
ewrite-foreach-4.m
7571228ec9b31de7733ae96352ee4eaa8afcf2b5 10-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Allow messaging expression as foreach's collection expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45793 91177308-0d34-0410-b5e6-96231b3b80d8
ewrite-foreach-4.m
ffce4d572df79a95d21138fc28bb78f753fb2653 10-Jan-2008 Steve Naroff <snaroff@apple.com> Fix Sema::ActOnDeclarator() to call MergeFunctionDecl for function decls that aren't in scope. Since C functions are in a flat namespace, we need to give them special treatment (when compared with variables and typedefs).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45789 91177308-0d34-0410-b5e6-96231b3b80d8
redefined-function.c
4a74678ed6c3dedac05d02b1ee341f1db869f049 09-Jan-2008 Steve Naroff <snaroff@apple.com> Fix ASTContext::typesAreCompatible to allow for int/enum compatibility (C99 6.7.2.2p4).
Fix Sema::MergeFunctionDecl to allow for function type compatibility (by using the predicate on ASTContext). Function types don't have to be identical to be compatible...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45784 91177308-0d34-0410-b5e6-96231b3b80d8
redefined-function.c
58d1821279b0ffd002e675d211faca3b5de067e2 09-Jan-2008 Steve Naroff <snaroff@apple.com> Teach Sema::ActOnCompoundLiteral about constraint C99 6.5.2.5p3.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45782 91177308-0d34-0410-b5e6-96231b3b80d8
ompound-literal.c
88f50f31d84185827a8f765dd611134bcaface7b 09-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Type-cast RHS of assignment to prevent warning compiling rewritten foreach code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45777 91177308-0d34-0410-b5e6-96231b3b80d8
ewrite-foreach-3.m
3f76f2aa6e479bc6ec73aa449975804751da8109 09-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Fixed a bug whereby a parethesized collection expression was not being rewritten correctly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45776 91177308-0d34-0410-b5e6-96231b3b80d8
ewrite-foreach-1.m
7f93ce9e30bfa9be44d09ce0321db5e8472d86ef 09-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Another test case for testing rewriteing of nested foreach-statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45769 91177308-0d34-0410-b5e6-96231b3b80d8
ewrite-foreach-2.m
388601228dd19038fe5860d1e07de4d4f96b2ba8 09-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Remove dependency on objc.h


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45767 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-comptypes-1.m
bjc-comptypes-2.m
bjc-comptypes-3.m
bjc-comptypes-5.m
bjc-comptypes-6.m
bjc-comptypes-7.m
bjc-super-test.m
ewrite-api-bug.m
ndef-field-reference-1.m
b8f13a8baff3df080fe024fec47746e9a79fe649 09-Jan-2008 Steve Naroff <snaroff@apple.com> Teach Expr::isConstantExpr() about CompoundLiterals.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45764 91177308-0d34-0410-b5e6-96231b3b80d8
ompound-literal.c
33b9c4e4c6f1b055d94c8b57cd16883125701ac7 08-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Patch to rewrite ObjC2's foreach-stmt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45760 91177308-0d34-0410-b5e6-96231b3b80d8
ewrite-foreach-1.m
b6d54e56a5c65c2728080578b84374c3c594daec 08-Jan-2008 Steve Naroff <snaroff@apple.com> Fix Sema::CheckConditionalOperands(). The null pointer constant checks need to precede the check for two pointer operands.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45732 91177308-0d34-0410-b5e6-96231b3b80d8
onditional-expr.c
b7b61159325e002998ff950fdc70a6425a6b13b3 04-Jan-2008 Chris Lattner <sabre@nondot.org> add comments for the various AssignConvertType's, and split int->pointer from pointer->int.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45591 91177308-0d34-0410-b5e6-96231b3b80d8
rgument-checking.m
rray-init.c
uiltins.c
bjc-comptypes-7.m
5cf216b7fa64b933b60743b0b26053e8e7aa87be 04-Jan-2008 Chris Lattner <sabre@nondot.org> Merge all the 'assignment' diagnostic code into one routine, decloning
it from several places. This merges the diagnostics, making them more
uniform and fewer in number. This also simplifies and cleans up the code.

Some highlights:
1. This removes a bunch of very-similar diagnostics.
2. This renames AssignmentCheckResult -> AssignConvertType
3. This merges PointerFromInt + IntFromPointer which were always treated the same.
4. This updates a bunch of test cases that have minor changes to the produced diagnostics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45589 91177308-0d34-0410-b5e6-96231b3b80d8
rgument-checking.m
rray-constraint.c
rray-init.c
uiltins.c
ncompatible-protocol-qualified-types.m
bjc-comptypes-1.m
bjc-comptypes-3.m
bjc-comptypes-5.m
bjc-comptypes-6.m
bjc-comptypes-7.m
rotocol-id-test-3.m
ypedef-retain.c
ector-assign.c
4667ac39be4a96725373c0317ad6827e1bb71502 04-Jan-2008 Chris Lattner <sabre@nondot.org> generalize some of the conversion warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45560 91177308-0d34-0410-b5e6-96231b3b80d8
rgument-checking.m
c992b4aff53546f4fcc926c28839c7011c8084a8 04-Jan-2008 Chris Lattner <sabre@nondot.org> update for changes in diagnostic strings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45559 91177308-0d34-0410-b5e6-96231b3b80d8
ncompatible-protocol-qualified-types.m
bfe639e4d39b1afa05d66aaea0378d6c10df4ffc 03-Jan-2008 Chris Lattner <sabre@nondot.org> give better diagnostics for converting between function pointer and void*.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45556 91177308-0d34-0410-b5e6-96231b3b80d8
unction-ptr.c
9d3185e84050faf126edf08afbe6415db7271c7a 03-Jan-2008 Fariborz Jahanian <fjahanian@apple.com> Fixed a bug reported by Chris, involving assiging 0 to a qualified object type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45542 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-comptypes-8.m
529bd02affa96a311dd9ab131f2ab4d833017fb7 02-Jan-2008 Chris Lattner <sabre@nondot.org> When promoting array to pointer for argument, don't lose type qualifiers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45510 91177308-0d34-0410-b5e6-96231b3b80d8
unction.c
aabbb12dcb8a7f4ea7dae0ce53a2c84a332844a8 30-Dec-2007 Nate Begeman <natebegeman@mac.com> Rename stats to print-stats to avoid conflicting with llvm's
stats statistic when clang is built as a dylib.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45441 91177308-0d34-0410-b5e6-96231b3b80d8
arbon.c
ocoa.m
dc5c01b2195574e856a0b107f0e9bc2c96de98e2 22-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Another test case, testing a variety of objective-c type comparisons.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45302 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-comptypes-7.m
7b5e1b839edda1aaf259a44de96f5a27270ff4ef 22-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Another test for objective-c's type comparison.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45301 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-comptypes-6.m
4c71f1a58e8892fc9f1fe6bdf10bfbe16f592b2d 21-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> This patch implements some of the more obscure type-checking involving
'id' quallified with protocols and static types which have categories and
inheritance which implement these protocols.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45294 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-comptypes-5.m
b145e7dedebe2ac3c6e8233bece6ffc3f67b3a66 21-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to compare to objective-c static types where one or the other
(but not both) may be a protocol qualified static type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45283 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-comptypes-4.m
88d752103b5f46ee47d9af48c2c6b8ff013aaf5e 21-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Test case for my last patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45277 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-comptypes-3.m
cfc8738b8a7aee250ed42794b65aefdf65a1e9b4 20-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Another test for objective-c type comparison.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45271 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-comptypes-2.m
0f01debd47b43c287f8f1135cd3f9679a5a3ab2e 20-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> More objective-c type checking. This time comparing objective-c known objects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45269 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-comptypes-1.m
bjc-string.m
c395bda57a0b2f6d8433a462caa780a7dcb7307b 20-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to do type-checking for objctive-c's object types.
More is yet to come.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45263 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-comptypes-1.m
1b9a0793955070738cac6f04b5abe9496be9b317 20-Dec-2007 Chris Lattner <sabre@nondot.org> implement semantic analysis for __builtin_islessequal and friends.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45239 91177308-0d34-0410-b5e6-96231b3b80d8
uiltins.c
fstring.c
cf5f931a5b013e905b9d874145d9a423810cd962 19-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Minor test twik.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45208 91177308-0d34-0410-b5e6-96231b3b80d8
rotocol-rewrite-1.m
411f373abf5692a1bd90d35a139d955fa67ae82d 19-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> This patch concludes implementation of dynamic objective-c type qualified by
protocol list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45203 91177308-0d34-0410-b5e6-96231b3b80d8
rotocol-id-test-3.m
cd8812948bc8a65dcf10c541c1775e5ba44def6c 19-Dec-2007 Chris Lattner <sabre@nondot.org> Implement C99 6.7.5.3p1


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45188 91177308-0d34-0410-b5e6-96231b3b80d8
eclspec.c
d58fabf7ed279be18a5e82617f809c9deff9be67 18-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Refactoring work. ObjcQualifiedIdType is now derived from 'Type'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45174 91177308-0d34-0410-b5e6-96231b3b80d8
d-test-3.m
65383479cb2caf0f136f58fecdbdbaf9c497b7a1 18-Dec-2007 Chris Lattner <sabre@nondot.org> Fix the location we emit the "not a constant" error for this:

int foo() {
typedef int x[foo()];
static int y = sizeof(x);
}

previously we'd emit it on the typedef, which made not sense at all.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45154 91177308-0d34-0410-b5e6-96231b3b80d8
la.c
d7d860d97acf25b683756c0c5c3ee33b0f0a731d 18-Dec-2007 Chris Lattner <sabre@nondot.org> Fix an nice and subtle parser bug reported by Nico Weber.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45149 91177308-0d34-0410-b5e6-96231b3b80d8
onditional.c
b99a4a3630478946ca963d654e40a8d100890d64 18-Dec-2007 Steve Naroff <snaroff@apple.com> Fixe bogus error for variable argument methods. Sema::ObjcGetTypeForMethodDefinition() wasn't preserving the isVariadic boolean. Another fix is to avoid synthsizing the function decl entirely, however this is a separate issue that I don't want to deal with now. Also added a FIXME to Sema::CheckFunctionCall(), which is currently emitting a bogus warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45146 91177308-0d34-0410-b5e6-96231b3b80d8
a-method.m
a56f616744b929aa7115034e7e2f9a0b8df545f6 18-Dec-2007 Steve Naroff <snaroff@apple.com> Improve how we find private method decls. This involved:

- Changed Sema::ObjcActOnStartOfMethodDef() to register the methods with the global pools.
- Changed Sema::ActOnInstanceMessage() to look in global pools (should be much less error prone).
- Added a test case to message.m (for lookup that was broken).

Misc changes while I was investigating this...

- Changed Sema::ActOnAtEnd() to call AddFactoryMethodToGlobalPool (this looked like a cut/paste error).
- Added a comment and tweaked another where I was using the first person.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45142 91177308-0d34-0410-b5e6-96231b3b80d8
essage.m
c569249ca0ab755ac79d8cbbfcb2bcae19743624 17-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to implemented objective-c's dynamic object pointer qualified with
the protocol list (id<P,...> types).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45121 91177308-0d34-0410-b5e6-96231b3b80d8
d-test-3.m
rotocol-id-test-1.m
rotocol-id-test-2.m
4a33646560c4faf8fb82a681360eb2dc0573d558 17-Dec-2007 Ted Kremenek <kremenek@apple.com> Modified format-string checking to not emit a warning when all of the
following hold:

(1) A vprintf-like function is called that takes the argument list via a
via_list argument.

(2) The format string is a non-literal that is the parameter value of
the enclosing function, e.g:

void logmessage(const char *fmt,...) {
va_list ap;
va_start(ap,fmt);
fprintf(fmt,ap); // Do not emit a warning.
}

In the future this special case will be enhanced to consult the "format"
attribute attached to a function declaration instead of just allowing a blank
check for all function parameters to be used as format strings to vprintf-like
functions. This will happen when more support for attributes becomes
available.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45114 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
3cc4af80188b9fd7a49e96d57254faae1635720d 16-Dec-2007 Steve Naroff <snaroff@apple.com> Sema::ActOnMemberReferenceExpr() needs to perform the default conversions.

Bug and test case provided by Carl Lewis.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45078 91177308-0d34-0410-b5e6-96231b3b80d8
ember-reference.c
1dcf2c8c3bd00c3b10ea8f0b9f3f0ac6714d1b09 13-Dec-2007 Chris Lattner <sabre@nondot.org> Don't do integer promotions of LHS for compound shift assignment. The LHS has to be a modifiable lvalue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44993 91177308-0d34-0410-b5e6-96231b3b80d8
hift.c
4319b8437d3262981ba784486e37a768eaa643d7 13-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Fixed test to match the new diagnostic text.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44966 91177308-0d34-0410-b5e6-96231b3b80d8
onflicting-ivar-test-1.m
79a99f2c063ce7cd9b18852a39bf4c937fc1faf8 13-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Concatenation of objc strings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44964 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-string-concat-1.m
beb663677aa20db59da4e5ab7d535804ec6f963c 12-Dec-2007 Chris Lattner <sabre@nondot.org> Unbreak -stats on cocoa.h


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44919 91177308-0d34-0410-b5e6-96231b3b80d8
arbon.c
ocoa.m
a027b86f70f15419da0a8de505e6230d40317e7c 12-Dec-2007 Chris Lattner <sabre@nondot.org> add run lines.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44918 91177308-0d34-0410-b5e6-96231b3b80d8
nvalid-decl.c
ethod-def-1.m
4619366f8ebbbf4b77aa84137b427287c056b9db 12-Dec-2007 Chris Lattner <sabre@nondot.org> fix expected errors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44901 91177308-0d34-0410-b5e6-96231b3b80d8
nvalid-objc-decls-1.m
2d6410dc91d1a44ffc5d1cfd1fca386453091d07 12-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Add -pedantic so test passes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44900 91177308-0d34-0410-b5e6-96231b3b80d8
ncompatible-protocol-qualified-types.m
b3a99cd5bcaeff0c5ff6a60788b5eb68e52a3953 12-Dec-2007 Chris Lattner <sabre@nondot.org> Add ObjC parser support for concatenated ObjC strings. Note that
this is passed to sema and ignored there, so the second part of the
string will not make it into the AST. Passing to Fariborz to finish
Sema + AST construction.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44898 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-string.m
4ffc54111fdc0baa45bb287f59774e06dea8caa4 12-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Implemented type checking for pointer of objects of protocol-qualified types.
Note that incompatible-protocol-qualified-types.m is currently failing. This is
unrelated to this patch and Steve is looking at the general problem of not reporting
incompitible pointer types in return stetement..


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44897 91177308-0d34-0410-b5e6-96231b3b80d8
ncompatible-protocol-qualified-types.m
61477f7a4ccd3ac785afd9708d77a53869a53a76 11-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Implemented rewriting of protocol-qualified global variable types.
Re-implemented some of rewriting of protocol-qualified function
argument types to support it in its generality.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44886 91177308-0d34-0410-b5e6-96231b3b80d8
ewrite-protocol-type-1.m
0105556097a3e381662137fc35e7da7766cbb7d8 11-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> For @optional unimplemented methods do not issue the warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44872 91177308-0d34-0410-b5e6-96231b3b80d8
nhanced-proto-2.m
a924e7c06d4618046a65cc1a584c625e68030934 11-Dec-2007 Steve Naroff <snaroff@apple.com> - Tweak several tests to be compatible with my last commit.
- Add a test to message.m for an unusual case for GCC compat (as suggested by Chris).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44842 91177308-0d34-0410-b5e6-96231b3b80d8
ategory-1.m
lass-def-test-1.m
lass-proto-1.m
essage.m
rotocol-test-2.m
2fdc3749097a581567dbd9fe66c48c0458bd3e34 10-Dec-2007 Steve Naroff <snaroff@apple.com> Add support for initializing char arrays from string literals.

Adapted from a patch by Anders Carlsson.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44816 91177308-0d34-0410-b5e6-96231b3b80d8
rray-constraint.c
rray-init.c
6e4ab61300e77f3cc303046c0107b8a961d7dc66 09-Dec-2007 Chris Lattner <sabre@nondot.org> Implement correct semantic analysis of subtractions, implementing
C99 6.5.6.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44746 91177308-0d34-0410-b5e6-96231b3b80d8
ypecheck-binop.c
c92942c5fe8330c8c090c84ecde31ee8240c95bb 08-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Test case for my last patch for implementation of static protocoled type
used as reciver type of a message expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44693 91177308-0d34-0410-b5e6-96231b3b80d8
tatic-type-protocol-1.m
36ee2cb3247a662b6049f9cc097ba5cf9c0bb2b5 07-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Patch for rewriting of @protocol.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44681 91177308-0d34-0410-b5e6-96231b3b80d8
rotocol-rewrite-1.m
66c5dfc193c4090b67c5effb0e80e287b94de17e 07-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to implement "Protocol" as a built-in type declared as
"@class Protocol;"


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44670 91177308-0d34-0410-b5e6-96231b3b80d8
rotocol-expr-1.m
rotocol-expr-neg-1.m
d20f1768aca3e80c772b14735dfc092423eb2390 06-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> test case for my very last patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44662 91177308-0d34-0410-b5e6-96231b3b80d8
ndeclared-method-1.m
ec584d6f64f1f40a57fafc94ddf161a6735c30a9 06-Dec-2007 Chris Lattner <sabre@nondot.org> Fix a bug handling typedefs of functions, patch by Nuno Lopes!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44661 91177308-0d34-0410-b5e6-96231b3b80d8
st-print.c
7127431a1d1337bdf4a96cb22b4743b94f25bf61 05-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Changed type-cast of "struct objc_super"'s 2nd initializer to match definition of
"struct objc_super".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44616 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-super-test.m
e6386394677ed4f77b20e2e3d5446a3a2f628e53 05-Dec-2007 Steve Naroff <snaroff@apple.com> Recognize CompoundLiteralExpr's as valid lvalue's.

Also updated a FIXME in Sema::CheckInitializer()...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44602 91177308-0d34-0410-b5e6-96231b3b80d8
ompound-literal.c
e2c4cd899844a22b77d596b3928fc9ec9ea6fce4 04-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Test case for my last patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44581 91177308-0d34-0410-b5e6-96231b3b80d8
ndecl-objc-h.m
87ce5d1cb99094fc7ffb42e0522da4e7bab403f8 03-Dec-2007 Fariborz Jahanian <fjahanian@apple.com> Fixed a bug exposed by referencing an ivar field using component reference syntax.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44553 91177308-0d34-0410-b5e6-96231b3b80d8
ndef-field-reference-1.m
0d6ca11db071e4d4e1cd8fe89c3d6d6b4988d8d5 03-Dec-2007 Chris Lattner <sabre@nondot.org> Fix an ast-print/ast-dump bug.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44550 91177308-0d34-0410-b5e6-96231b3b80d8
st-print.c
43d69750e7f7b26076e7474dec8839bb777b260f 03-Dec-2007 Bill Wendling <isanbard@gmail.com> Fix for testcase that assigns a dereferenced reference to a pointer. The
standard says that we should adjust the "reference to T" type to "T"
before analysis.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44530 91177308-0d34-0410-b5e6-96231b3b80d8
xx-references.cpp
d411e04db18f7d07a889d51086861b23cbe05518 02-Dec-2007 Chris Lattner <sabre@nondot.org> all filevar's have static storage. Previously a global with
extern storage class was returning false from hasStaticStorage.
Ted, please review this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44515 91177308-0d34-0410-b5e6-96231b3b80d8
nit.c
695dbb697d78d4c507e12b0acc6129b9650d4c3e 30-Nov-2007 Anders Carlsson <andersca@mac.com> Support lax vector conversions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44449 91177308-0d34-0410-b5e6-96231b3b80d8
ector-assign.c
b594a4058941d6c71c9deeef60a1d8a68c56335a 29-Nov-2007 Ted Kremenek <kremenek@apple.com> Fixed test case to not expect a warning when one should not be emitted.
Removed redundant test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44426 91177308-0d34-0410-b5e6-96231b3b80d8
loating-point-compare.c
9e7f0ecab98c1cec6e7a1600324780122b0c0347 29-Nov-2007 Ted Kremenek <kremenek@apple.com> Added test cases for -Wfloat-equal to test comparisons against literals that can be
represented exactly and inexactly by APFloats. For the former, we do not emit a
warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44425 91177308-0d34-0410-b5e6-96231b3b80d8
loating-point-compare.c
83c903f1abb41b661c9d04287613b663dad4fcfd 28-Nov-2007 Ted Kremenek <kremenek@apple.com> Added missing "RUN:" to comment for test case file. This fixed a bug where the test
case testing the frontend's support of statement expressions was not being
executed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44409 91177308-0d34-0410-b5e6-96231b3b80d8
tmt_exprs.c
b751c28a1afc24b3fb8e2ff9a29005100a8685ab 28-Nov-2007 Chris Lattner <sabre@nondot.org> Fix a bug checking for 'int foo(void)' that didn't look through typedefs of void.
Bug pointed out by Michael Zolda, thanks!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44408 91177308-0d34-0410-b5e6-96231b3b80d8
oid_arg.c
dd1b516f2f5ed5953de1875afc2d04aa5a14d137 28-Nov-2007 Anders Carlsson <andersca@mac.com> Add more intrinsics. We can now correctly parse both Carbon.h and Cocoa.h without having to do -arch ppc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44392 91177308-0d34-0410-b5e6-96231b3b80d8
arbon.c
ocoa.m
4cc627111453b75519d5130b57e06256da7b00e8 27-Nov-2007 Chris Lattner <sabre@nondot.org> add several cases that Expr::hasStaticStorage missed, pointed out by Oliver Hunt


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44376 91177308-0d34-0410-b5e6-96231b3b80d8
nit.c
529a4ad63bc82474d7d78fc189c340a3773da8bc 27-Nov-2007 Steve Naroff <snaroff@apple.com> Move the null pointer constant check from Sema::CheckSingleInitializer/ActOnCallExpr/CheckMessageArgumentTypes/ActOnReturnStmt to Sema::CheckSingleAssignmentConstraints. This makes sure all null pointer assignments are considered compatible.

Thanks to Seo Sanghyeon for the bug, follow-through, and patch!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44366 91177308-0d34-0410-b5e6-96231b3b80d8
ssign-null.c
a64db8fa2a7b4e24d0aeef7c22046fa37d8f1f3b 27-Nov-2007 Anders Carlsson <andersca@mac.com> Report errors for invalid casts from/to vectors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44350 91177308-0d34-0410-b5e6-96231b3b80d8
ector-cast.c
3f35148aa8f0a418d4e2277a28f2214188d92700 26-Nov-2007 Ted Kremenek <kremenek@apple.com> Fixed #include of objc/objc.h so that it works on case-sensitive filesystems.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44337 91177308-0d34-0410-b5e6-96231b3b80d8
ewrite-api-bug.m
2c7038b298c61e531ee4e79b9ff014ffb97b6ccc 26-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to fix a regression caused by recent rewrite changes.
A potential API bug in ReplaceText pending (A FIXME is added).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44333 91177308-0d34-0410-b5e6-96231b3b80d8
ewrite-api-bug.m
f5f20bdf918cedb47fdd33f5b634f4908cdd3f15 26-Nov-2007 Bill Wendling <isanbard@gmail.com> The checking for the delimiters of expected error/warning messages was
looking only for { and } instead of {{ and }}. Changed it to check for
this explicitly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44326 91177308-0d34-0410-b5e6-96231b3b80d8
fstring.c
lass-def-test-1.m
6fa9086043b0338d895a4cdb0ec8542530af90d7 25-Nov-2007 Anders Carlsson <andersca@mac.com> Check that the clobber registers are valid.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44311 91177308-0d34-0410-b5e6-96231b3b80d8
sm.c
bfc5e500bfb2febcf2e85588f2f839601b9fc1e0 24-Nov-2007 Ted Kremenek <kremenek@apple.com> Moved dead-stores test cast to a new test suite subdirectory: Analysis.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44305 91177308-0d34-0410-b5e6-96231b3b80d8
ead-stores.c
04728b7ea928b029f165fc67d32ced40e6868b31 23-Nov-2007 Anders Carlsson <andersca@mac.com> Check asm input and output expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44289 91177308-0d34-0410-b5e6-96231b3b80d8
sm.c
5519644892c1bcc9111418134601a287b223dcc2 20-Nov-2007 Chris Lattner <sabre@nondot.org> Improve function decl merging, patch by Oliver Hunt!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44253 91177308-0d34-0410-b5e6-96231b3b80d8
redefined-function.c
74c43a0967d07572dd6907776d91cdb2b2e7179a 20-Nov-2007 Ted Kremenek <kremenek@apple.com> Added another test case for the Dead Stores checker that tests that
block-level expressions are evaluated the same as regular expressions. Test
case provided by Nuno Lopes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44247 91177308-0d34-0410-b5e6-96231b3b80d8
ead-stores.c
8aefcbfd3c0409c26ca44c123a41edd631eab9bc 19-Nov-2007 Ted Kremenek <kremenek@apple.com> Added test case for dead stores checker (live variables analysis) that tests
for correct propagation/update of liveness information within subexpressions
of Block-Level expressions. Test case provided by Nuno Lopes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44225 91177308-0d34-0410-b5e6-96231b3b80d8
ead-stores.c
aa395ba050c558b1ebf66c7868165938d98b6a5b 18-Nov-2007 Ted Kremenek <kremenek@apple.com> Added test case for dead-stores checker. Test case provided by Nuno Lopes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44221 91177308-0d34-0410-b5e6-96231b3b80d8
ead-stores.c
f82228f6ed2b4bb195a519afa777ba521b5c62df 16-Nov-2007 Chris Lattner <sabre@nondot.org> Tighten up address-of checking, implementing test/Sema/expr-address-of.c.
This fixes a bug reported by Seo Sanghyeon.

This was meant to be committed yesterday, but the commit failed. doh.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44190 91177308-0d34-0410-b5e6-96231b3b80d8
xpr-address-of.c
41af093ee62a4aea948ffef4482c9e2a496d710e 14-Nov-2007 Chris Lattner <sabre@nondot.org> implement test/Sema/typedef-prototype.c, allowing code
to declare a function with a typedef:

typedef int unary_int_func(int arg);
unary_int_func add_one;

This patch contributed by Seo Sanghyeon!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44100 91177308-0d34-0410-b5e6-96231b3b80d8
ypedef-prototype.c
6de88a873a4cbe06d72602eef57d68006730a80b 14-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> Type encoding for structs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44087 91177308-0d34-0410-b5e6-96231b3b80d8
etadata-test-2.m
bac97d43c9552ac0e084bb81fb7404908f1e9970 13-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> Fixed a rewrite of metadata bug when category implementation has no matching interface.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44072 91177308-0d34-0410-b5e6-96231b3b80d8
etadata-test-1.m
1b2c54baed052f8a933e62dfef51a41f41396a87 13-Nov-2007 Ted Kremenek <kremenek@apple.com> Updated test case to flag about comparisons against constants. We may
invert this case (i.e., not flag a warning) in the future.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44059 91177308-0d34-0410-b5e6-96231b3b80d8
loating-point-compare.c
c8f488d1c851fddeb7754d0c9cf98045b17da535 13-Nov-2007 Ted Kremenek <kremenek@apple.com> Modified -Wfloat-equal logic to suppress warnings where floating point values
are compared against builtins such as __builtin_inf.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44058 91177308-0d34-0410-b5e6-96231b3b80d8
loating-point-compare.c
db87bca211deed14f8d5bb9ef25b8e9ee5c8e139 13-Nov-2007 Ted Kremenek <kremenek@apple.com> Added -Wfloat-equal option to the driver. This makes warnings about
floating point comparisons using == or != an opt-in rather than a default
warning.

Updated test case to use -Wfloat-equal.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44053 91177308-0d34-0410-b5e6-96231b3b80d8
loating-point-compare.c
1d09ecca892185ba067e47ba879f424de59950ef 13-Nov-2007 Chris Lattner <sabre@nondot.org> improve handling of address of global when checking for
constants and initializers. Patch by Sanghyeon Seo, thanks!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44049 91177308-0d34-0410-b5e6-96231b3b80d8
ddress-constant.c
232220c6982e3a70d8f7fc06a011ead490a2f516 12-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to do statically typed ivar references.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44028 91177308-0d34-0410-b5e6-96231b3b80d8
tatic-ivar-ref-1.m
0416fb9f379b49abb3eb0c1cb2ca75107e5a71d1 11-Nov-2007 Steve Naroff <snaroff@apple.com> This is the last 5% of the solution to teaching Sema::ActOnInstanceMessage() about private methods (r43989).

While the diff is large, the idea is very simple. When we parse method definitions (in an @implementation), we need to add them incrementally (rather than wait until the @end).

Other details...

- Renamed Sema::ActOnAddMethodsToObjcDecl() to Sema::ActOnAtEnd(). The methods are now optional arguments.
- Removed Parser::AllImplMethods (a nice cleanup).
- Added location info to ObjcImplementationDecl (since we will need it very soon:-)
- Modified message.m test to no longer allow the bogus diagnostic.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43995 91177308-0d34-0410-b5e6-96231b3b80d8
essage.m
d848a3867794f4a9297bced70178834936e59d3d 11-Nov-2007 Steve Naroff <snaroff@apple.com> Make sure Sema::CheckIncrementDecrementOperand() removes typedefs when doing it's analysis.

Thanks to Seo Sanghyeon for his excellent (first) bug fix!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43994 91177308-0d34-0410-b5e6-96231b3b80d8
heck-increment.c
c43d868355374d48296ad3be2c9c536698a5e9a8 11-Nov-2007 Steve Naroff <snaroff@apple.com> Teach Sema::ActOnInstanceMessage() about private methods. That is, methods declared in an implementation (but not listed in the interface).

This commit is only 95% of the bug fix. The last piece to this puzzle is to add the method decls to the implementation incrementally (as we encounter them). At the moment, the methods aren't added until we see an @end (which is too late).

I will complete this later...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43989 91177308-0d34-0410-b5e6-96231b3b80d8
essage.m
db8f3d3bb96c75440f513c43ac73adace2aae5ff 10-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> pretty priting for method definitions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43986 91177308-0d34-0410-b5e6-96231b3b80d8
ethod-def-2.m
f68a63f9cf4d31bc009cc2831b4857fb13ee1a30 10-Nov-2007 Steve Naroff <snaroff@apple.com> Fix a basic bug (having to do with typedefs) in Sema::UsualArithmeticConversions().

This resuled in the following crash below.

Also modified the usual-float.c test case to capture this case.

[steve-naroffs-imac:clang/test/Sema] snaroff% ../../../../Debug/bin/clang usual-float.c
Assertion failed: (0 && "Sema::UsualArithmeticConversions(): illegal float comparison"), function UsualArithmeticConversions, file SemaExpr.cpp, line 960.
0 clang 0x001ef9b9 _ZN40_GLOBAL__N_Signals.cpp_00000000_4E6DAF8315PrintStackTraceEv + 45
1 clang 0x001efd5f _ZN40_GLOBAL__N_Signals.cpp_00000000_4E6DAF8313SignalHandlerEi + 323
2 libSystem.B.dylib 0x90c6297b _sigtramp + 43
3 ??? 0xffffffff 0x0 + 4294967295
4 libSystem.B.dylib 0x90cdb782 raise + 26
5 libSystem.B.dylib 0x90cead3f abort + 73
6 libSystem.B.dylib 0x90cdc923 __assert_rtn + 101
7 clang 0x00077316 _ZN5clang4Sema26UsualArithmeticConversionsERPNS_4ExprES3_b + 1004
8 clang 0x000803cf _ZN5clang4Sema27CheckMultiplyDivideOperandsERPNS_4ExprES3_NS_14SourceLocationEb + 181
9 clang 0x0007a8e8 _ZN5clang4Sema10ActOnBinOpENS_14SourceLocationENS_3tok9TokenKindEPvS4_ + 472
10 clang 0x000cf058 _ZN5clang6Parser26ParseRHSOfBinaryExpressionENS_6Action12ActionResultILj0EEEj + 1286
11 clang 0x000cf2de _ZN5clang6Parser25ParseAssignmentExpressionEv + 86



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43985 91177308-0d34-0410-b5e6-96231b3b80d8
sual-float.c
1f7b6f88f18d7f6b10265acec5d41c4ed1897487 09-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> Added class context to method declarations. Provide "interface *" type
to 'self' method of instance methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43957 91177308-0d34-0410-b5e6-96231b3b80d8
ethod-def-1.m
3560002bed2be6b428f1a909c489a8857b4417c7 09-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> Insert invisble arguments to method definition header.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43948 91177308-0d34-0410-b5e6-96231b3b80d8
ethod-encoding-2.m
e3995fe63cc01668bebed82339479fbc1140768c 06-Nov-2007 Chris Lattner <sabre@nondot.org> improve decl merging logic to be more correct with
functions. Patch contributed by Nuno Lopes, thanks!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43757 91177308-0d34-0410-b5e6-96231b3b80d8
erge-decls.c
fcc2d26e73192634dd05fb1b6800b5a063432feb 06-Nov-2007 Chris Lattner <sabre@nondot.org> Add better validation for array types when merging decls. Patch
contributed by Oliver Hunt, thanks!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43750 91177308-0d34-0410-b5e6-96231b3b80d8
rray-declared-as-incorrect-type.c
ecb01e666665efabd2aa76a76f6080e2a78965fa 01-Nov-2007 Fariborz Jahanian <fjahanian@apple.com> Remaining work to collect objective-c's type qualifiers and use them to encode
method types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43617 91177308-0d34-0410-b5e6-96231b3b80d8
ethod-encoding-2.m
4ef8dd6e8736097bf9e3c387139c668565d89dca 01-Nov-2007 Chris Lattner <sabre@nondot.org> Implement test/Sema/init.c by treating functions as constants.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43599 91177308-0d34-0410-b5e6-96231b3b80d8
nit.c
3a3ca1b35a7121aea0bf465a192dce748465e10f 31-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Fixed problem with rewriting stand-alone @implementation (with no matching @interface).
A new test case added.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43568 91177308-0d34-0410-b5e6-96231b3b80d8
var-encoding-2.m
ca4e19e3d77c4c8c98f801e249b1d05448fadf4b 30-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Fixed tests.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43513 91177308-0d34-0410-b5e6-96231b3b80d8
var-encoding-1.m
ethod-encoding-1.m
bb60846268636b994caa609db2352d6142b4780a 30-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Revisited my last patch to be able to do encoding of ivar types with 'id'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43507 91177308-0d34-0410-b5e6-96231b3b80d8
var-encoding-1.m
c2939bc82ce177c0413feb0cd9ce70aefd6235fb 30-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Added type encoding for 'id' type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43504 91177308-0d34-0410-b5e6-96231b3b80d8
ethod-encoding-1.m
a8335a9c35a52ba174d4d31badfe4806312f866c 29-Oct-2007 Ted Kremenek <kremenek@apple.com> Added to test case for "self-comparison check" uses of relation operators: x < x and x > x
should emit warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43451 91177308-0d34-0410-b5e6-96231b3b80d8
elf-comparison.c
3ca0bf2a0ac27b1644ed73b8fc61077d2b9c6995 29-Oct-2007 Ted Kremenek <kremenek@apple.com> For non-floating point types, added check for expressions of the form
"x == x" and "x != x". We emit a warning for these since they always evaluate
to a constant value and often indicate a logical error.

Added test case for this check.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43450 91177308-0d34-0410-b5e6-96231b3b80d8
elf-comparison.c
6a261551023f8eebc6abd64054e1b9d16615f3d4 29-Oct-2007 Ted Kremenek <kremenek@apple.com> For checking for floating point comparison using == or !=, we now suppress
errors for cases such as "x == x".

Added test case to test this feature.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43447 91177308-0d34-0410-b5e6-96231b3b80d8
loating-point-compare.c
b96728d90abc35a520798066d2a75ca36400a617 29-Oct-2007 Chris Lattner <sabre@nondot.org> improve error recovery handling broken 'then' or 'else' stmts in
if statements. This implements Sema/if-empty-body.c:f3, silencing
a bogus secondary warning. It also improve the location info for
the nullstmts created for recovery purposes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43440 91177308-0d34-0410-b5e6-96231b3b80d8
f-empty-body.c
3da2db468d9a694535d62e7b96a010ce95c26fb6 29-Oct-2007 Chris Lattner <sabre@nondot.org> casting to void is ok for structs (C99 6.5.4p2), this fixes
one bogus error on PR1750.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43436 91177308-0d34-0410-b5e6-96231b3b80d8
ast.c
9a11b9abb9daa9d7c02e13bb4d62caaadb22477d 19-Oct-2007 Chris Lattner <sabre@nondot.org> Fix a crash on test/Sema/invalid-decl.c



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43188 91177308-0d34-0410-b5e6-96231b3b80d8
nvalid-decl.c
54d02e9a913af2945ea063edfda3070381956df5 19-Oct-2007 Steve Naroff <snaroff@apple.com> Include a simple test case for the previous commit...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43158 91177308-0d34-0410-b5e6-96231b3b80d8
issing-string-interface.m
d4dd30ff212acdc11c79b026c97cc72d7d89f565 18-Oct-2007 Steve Naroff <snaroff@apple.com> Fix a bug in Sema::CheckConditionalOperands(). When mixing pointers and null pointer constants, we need to promote the null pointer constant (which is an integer) to the pointer type. Test case is self explanatory.

This surfaced yesterday, when compiling test/Sema/cocoa.m on Leopard. Since this has nothing to do with ObjC, it's kind of bizarre this hasn't shown up before. I imagine Cocoa.h on Leopard may have changed recently?

Thanks to Ted for localizing the bug and giving me a useful AST dump...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43114 91177308-0d34-0410-b5e6-96231b3b80d8
mplicit-cast.c
27b837c3b884b27279f7550361ef73b9896c7510 18-Oct-2007 Chris Lattner <sabre@nondot.org> UsualArithmeticConversions is crashing with an assert
when comparing "float" and "const float". This "fixes" the
issue, but may not be the right fix. Steve, please review.

Testcase here: test/Sema/usual-float.c


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43113 91177308-0d34-0410-b5e6-96231b3b80d8
sual-float.c
fd8b4a4b29a2b9d662d0c9a92c1eebd83160b10b 18-Oct-2007 Steve Naroff <snaroff@apple.com> Fix the following bug...

unsigned char asso_values[] = { 34 };
int legal2() {
return asso_values[0];
}

The code that creates the new constant array type was operating on the original type.

As a result, the constant type being generated was "unsigned char [1][]" (which is wrong).

The fix is to operate on the element type - in this case, the correct type is "unsigned char [1]"

I added this case to array-init.c, which clearly didn't catch this bogosity...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43112 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
417c909e631c44813838fc9ec8214ec013d64b91 17-Oct-2007 Steve Naroff <snaroff@apple.com> rename test file for builtin "id"...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43082 91177308-0d34-0410-b5e6-96231b3b80d8
d_builtin.m
d_not_builtin.m
3b8e891be648481b68439c01eff509775214067c 17-Oct-2007 Steve Naroff <snaroff@apple.com> Predefine all the ObjC goodies from <objc/objc.h>. Removed all the ObjC goodies from the respective test files. Moving forward, it will be very nice to assume these builtin!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43077 91177308-0d34-0410-b5e6-96231b3b80d8
rgument-checking.m
d_not_builtin.m
ethod-not-defined.m
elector-1.m
elector-overload.m
390d50a725497e99247dc104a7d2c2a255d3af14 17-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Implementation of AST for @protocol expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43075 91177308-0d34-0410-b5e6-96231b3b80d8
rotocol-expr-1.m
rotocol-expr-neg-1.m
1a86b33c1870fee08d281c9f07ac1280195a7fae 17-Oct-2007 Anders Carlsson <andersca@mac.com> Generate code for static variables that don't have initializers. Also, report an error if a static initializer is not constant.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43058 91177308-0d34-0410-b5e6-96231b3b80d8
tatic-init.c
81bfde990c327ba6e5225cf207d71431937730f3 17-Oct-2007 Steve Naroff <snaroff@apple.com> Add Sema::CheckMessageArgumentTypes()...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43050 91177308-0d34-0410-b5e6-96231b3b80d8
rgument-checking.m
3e7fd152aa8f13da75cd91a96ef78cc823c5f32d 16-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to diagnose duplicate method implementations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43046 91177308-0d34-0410-b5e6-96231b3b80d8
oubleMethod.m
b62f6813406a03bf8a371c4e46c9fad51d102121 16-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to implement AST generation for objective-c's @selector expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43038 91177308-0d34-0410-b5e6-96231b3b80d8
elector-1.m
983df5b2280980e59b0b062bcc2882230465a61e 16-Oct-2007 Steve Naroff <snaroff@apple.com> Emit diagnostics for methods not found.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43037 91177308-0d34-0410-b5e6-96231b3b80d8
ethod-not-defined.m
943140ee64e979325d25084bf4d768896601a7ce 16-Oct-2007 Chris Lattner <sabre@nondot.org> initialization of references should not do default fn/array promotions.
This fixes a bug Anders noticed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43024 91177308-0d34-0410-b5e6-96231b3b80d8
xx-references.cpp
be127ba477ce959f802d167498fa742f732d6b5d 15-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Several name lookup conflict detection fixes involving objective-c names.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43000 91177308-0d34-0410-b5e6-96231b3b80d8
heck-dup-objc-decls-1.m
lass-def-test-1.m
1ff8b58fa0fda7dd3a0a715637c2db2f9573539f 15-Oct-2007 Anders Carlsson <andersca@mac.com> Fix a warning

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42973 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
1109b42c036029c6ac49500af06efc15a627f5e8 13-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to check for duplicate method decls in protocols.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42938 91177308-0d34-0410-b5e6-96231b3b80d8
heck-dup-decl-methods-1.m
e7f64cc250245aa6c0e1ef6da7e9b6f62d5fedde 13-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Check and diagnose that objective-c objects may not be statically allocated.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42936 91177308-0d34-0410-b5e6-96231b3b80d8
nvalid-objc-decls-1.m
580b664e9c2acd3bffddfea79b1ce2863cfd9dd0 12-Oct-2007 Ted Kremenek <kremenek@apple.com> Added notion of '*' specified format width/specifiers when checking
printf format strings. Added type checking to see if the matching
width/precision argument was of type 'int'.

Thanks to Anders Carlsson for reporting this missing feature.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42933 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
4cabdfc51cbe183e36465713e7ba45e380f1087c 12-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Fixed a @compatible_alias bug. In the process, discovered unnecessary 2ndry lookup
ok class names and streamlined this logic to do the lookup once.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42926 91177308-0d34-0410-b5e6-96231b3b80d8
lias-test-2.m
8f744764137f3c47b2e1fde84447e9c90720b900 12-Oct-2007 Steve Naroff <snaroff@apple.com> Replace one FIXME with another. We handle protocols just fine now. The ObjC decl will only be 0 when we have an error on the ObjC decl. I would prefer we pass in a decl that is marked as invalid. I don't think this is critical to fix now, however I'd like us to be consistent. There are currently many places that don't mark the decl as invalid (which need to be fixed)...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42923 91177308-0d34-0410-b5e6-96231b3b80d8
heck-dup-decl-methods-1.m
6eda8c9cefb498ac8403bc65854e6ce411a07855 12-Oct-2007 Anders Carlsson <andersca@mac.com> Add some more diagnostics for va_start, fix tests so they pass with these new diags.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42917 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
arargs.c
075878af57a14fb4e8b9313b0187c7782a2f9006 12-Oct-2007 Steve Naroff <snaroff@apple.com> Temporary fix to test case. This area is currently under construction...test case will be changing again soon.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42914 91177308-0d34-0410-b5e6-96231b3b80d8
elector-overload.m
243b64b0001172405ff803c61bdcaa8e98ec1552 12-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> This patch implementa objective-c's @compatibilty-alias declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42883 91177308-0d34-0410-b5e6-96231b3b80d8
lias-test-1.m
4b6c9051c6522894978c9ba6a819a659d102db36 11-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to create protocol conforming class types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42856 91177308-0d34-0410-b5e6-96231b3b80d8
lass-conforming-protocol-1.m
3b427b3ba518f7a7293458c2d3d92eebd8458d87 11-Oct-2007 Chris Lattner <sabre@nondot.org> rename -parse-ast-print to -ast-print
rename -parse-ast-dump to -ast-dump
remove -parse-ast, which is redundant with -fsyntax-only



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42852 91177308-0d34-0410-b5e6-96231b3b80d8
rg-duplicate.c
rg-invalid.c
rray-constraint.c
rray-init.c
ssign.c
89.c
fstring.c
ompare.c
ecl-invalid.c
efault.c
num.c
loating-point-compare.c
or.c
ormat-strings.c
d_not_builtin.m
f-empty-body.c
mplicit-def.c
ffsetof.c
eturn-stack-addr.cpp
elector-overload.m
witch-duplicate-defaults.c
witch.c
ypedef-retain.c
nused-expr.c
oid_arg.c
e21b573bbfa7f53de694b81455d0627b7a3b6554 11-Oct-2007 Steve Naroff <snaroff@apple.com> Refinements to Sema::GetObjcIdType()...

- Cache the typedef, not the type (avoids importing AST/Type.h).
- Emit an error if "id" cannot be found.
- Comment the routine and add a FIXME to reconsider how we emulate GCC's new fangled behavior. This isn't a priority for now, since almost no code depends on having "id" built-in.
- Add a test.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42845 91177308-0d34-0410-b5e6-96231b3b80d8
d_not_builtin.m
3b950178e23b1fe65552996d7bfb7542d03f89da 10-Oct-2007 Steve Naroff <snaroff@apple.com> - Make sure default return/argument types (for methods) default to "id".
- Cache the "id" type in Sema...initialize ObjcIdType and TUScope (oops).
- Fix ActOnInstanceMessage to allow for "id" type receivers...still work to do (next).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42842 91177308-0d34-0410-b5e6-96231b3b80d8
elector-overload.m
2d85f8ba62fd6fdcf0ae303d77112b413d412cae 10-Oct-2007 Anders Carlsson <andersca@mac.com> Emit a warning when the body of an if block is a NullStmt.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42840 91177308-0d34-0410-b5e6-96231b3b80d8
efault.c
f-empty-body.c
b216c8861c60af9c56c900a485233255c4452df2 10-Oct-2007 Steve Naroff <snaroff@apple.com> Make sure methods with no return type default to "id".

This fixes a crasher in Sema::MatchTwoMethodDeclarations(), identified by selector-overload.m (just added).

Added Action::ActOnTranslationUnitScope() and renamed Action::PopScope to ActOnPopScope.

Added a Translation Unit Scope instance variable to Sema (will be very useful to ObjC-related actions, since ObjC declarations are always file-scoped).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42817 91177308-0d34-0410-b5e6-96231b3b80d8
elector-overload.m
245f92a8867c02378ab485ac256ca2315a0ef94d 05-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> This is the first patch toward supporting protocol conforming
objective-c types. It also removes use of Scope* parameter in
getObjCProtocolDecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42649 91177308-0d34-0410-b5e6-96231b3b80d8
ndefined-protocol-type-1.m
85ff2646c1aeedd1105f867a5bba8a58febd1d2a 05-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Patch for 1) Checking for duplicate methods decls in intterface and category.
2) Use of the new DenseSet<t> abstractions instead of DenseMap<t,char>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42641 91177308-0d34-0410-b5e6-96231b3b80d8
heck-dup-decl-methods-1.m
4b6df3fa953267c5d755628c8afd818bb571e579 04-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Fixed all my recent test cases to have the RUN command and
fixed consequence of these changes in clang.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42600 91177308-0d34-0410-b5e6-96231b3b80d8
ategory-1.m
lass-def-test-1.m
lass-impl-1.m
lass-proto-1.m
onflicting-ivar-test-1.m
orward-class-1.m
var-sem-check-1.m
ethod-undef-category-warn-1.m
ethod-undefined-warn-1.m
bjc-legacy-implementation-1.m
rotocol-test-1.m
rotocol-test-2.m
ndef-protocol-methods-1.m
ndef-superclass-1.m
ca3adf7e8cac8c9fbaf592b1e5c2be6f082de7ba 02-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> Previously, I warned those methods not implemented in implementation class/category.
Now, I also warn those class/categories which are incomplete because of this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42544 91177308-0d34-0410-b5e6-96231b3b80d8
ethod-undef-category-warn-1.m
ethod-undefined-warn-1.m
ndef-protocol-methods-1.m
8f3fde00ad4d4f943321e338b914ae4740711c84 02-Oct-2007 Fariborz Jahanian <fjahanian@apple.com> This patch introduces the ObjcCategoryImplDecl class and does the checking related to
unimplemented methods in category implementation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42531 91177308-0d34-0410-b5e6-96231b3b80d8
ethod-undef-category-warn-1.m
00ae8d595534c0a444326204adee3486bbb43dcd 28-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to warn on umimplemented methods coming from class's
protocols.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42436 91177308-0d34-0410-b5e6-96231b3b80d8
ndef-protocol-methods-1.m
d0b015461a819913efa1161c56a8b897d7e8cdb2 27-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Patch for method implementation. It populates ObjcImplementationDecl object with method implementation declarations .
It checks and warns on those methods declared in class interface and not implemented.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42412 91177308-0d34-0410-b5e6-96231b3b80d8
ethod-undefined-warn-1.m
a9c01021724b9b546d282b8609cbe559734812ec 27-Sep-2007 Chris Lattner <sabre@nondot.org> objc messages have side effects, return true from hasLocalSideEffect,
fixing:

VoidMethod.m:14:5: warning: expression result unused
[Greeter hello];
^~~~~~~~~~~~~~~



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42380 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-unused.m
9f3d942e9970bc8f51add390b2a2c46b5a2ab747 26-Sep-2007 Ted Kremenek <kremenek@apple.com> Removed option "-parse-ast-check" from clang driver. This is now implemented
using "-parse-ast -verify".

Updated all test cases (using a sed script) that invoked -parse-ast-check to
now use -parse-ast -verify.

Fixed a bug where using "-verify" instead of "-parse-ast-check" would not
correctly create the DiagClient needed to accumulate diagnostics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42365 91177308-0d34-0410-b5e6-96231b3b80d8
rg-duplicate.c
rg-invalid.c
rray-constraint.c
rray-init.c
ssign.c
89.c
fstring.c
ompare.c
ecl-invalid.c
efault.c
num.c
loating-point-compare.c
or.c
ormat-strings.c
ffsetof.c
eturn-stack-addr.cpp
witch-duplicate-defaults.c
witch.c
ypedef-retain.c
nused-expr.c
d0b90bff98bafb72ea9809f509bf37c93c60e74e 26-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> This patch inserts ivars declared in @implementation in its object and verifies
that they conform(in type, name and numbers) to those declared in @interface.
Test case highlights kind of checking we do here.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42360 91177308-0d34-0410-b5e6-96231b3b80d8
onflicting-ivar-test-1.m
0da1c1033832b572d23ff2fe7bb2ab959768727e 25-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to make ObjcImplementationDecl derived from TypeDecl and supprt legacy
objective-c code with no @interface declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42319 91177308-0d34-0410-b5e6-96231b3b80d8
bjc-legacy-implementation-1.m
ccb4f314248fb2202637d3290f2b17af5646da08 25-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> This patch introduces a new class to keep track of class implementation info. It also adds more
semantic checks for class and protocol declarations. Test cases are good indications of kind of
checking being done in this patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42311 91177308-0d34-0410-b5e6-96231b3b80d8
lass-def-test-1.m
lass-impl-1.m
b27c156688ca557cb277ecdfea6dccc1dac5b49f 22-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> This patch adds to new things to clang:
1. Handles saving and checking on protocols used in an @interface declaration
2. Checks and saves class's super class.
3. Adds semantic check to category declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42218 91177308-0d34-0410-b5e6-96231b3b80d8
ategory-1.m
lass-proto-1.m
894c57f565869b26a65436d250a9ca7a04d2abe0 21-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> This patch instantiates objects for forward protocols and in general handles use of
protocols referenced in @protocol declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42191 91177308-0d34-0410-b5e6-96231b3b80d8
rotocol-test-2.m
bd51b8745c7424fb95abb91370d1a38a24451a6e 20-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Handle forward declaration of classes and prevent re-instantiation of
ObjcInterfaceClass Objects.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42172 91177308-0d34-0410-b5e6-96231b3b80d8
orward-class-1.m
1d5b0e37cd569f3d1ddfc5cabff649ef7e42f3c6 20-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Match to do some semantic analysis on objective-c class decl.
1. Detect used of undeclared/forward declared super class.
2. Detect duplicate definition of a class.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42168 91177308-0d34-0410-b5e6-96231b3b80d8
ndef-superclass-1.m
25e077d59a8e8e43b65882b69610a3d5e2aaf53c 17-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Patch to add objective-c's @protocl type declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42060 91177308-0d34-0410-b5e6-96231b3b80d8
rotocol-test-1.m
e267ab62464a35f69b88c9da9a982065ba6b58ea 14-Sep-2007 Fariborz Jahanian <fjahanian@apple.com> Semantic analysis for objective-c ivars.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41954 91177308-0d34-0410-b5e6-96231b3b80d8
var-sem-check-1.m
410e3e206b50e0336bd294fa5fb8dfcca3ee1af5 12-Sep-2007 Steve Naroff <snaroff@apple.com> Remove a FIXME. Replace a couple asserts with an appropriate error
diagnostic for illegal initializers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41889 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
3536b443bc50d58a79f14fca9b6842541a434854 06-Sep-2007 Steve Naroff <snaroff@apple.com> The goal of this commit is to get just enough Sema support to recognize Objective-C classes
as types. That said, the AST nodes ObjcInterfaceDecl, ObjcInterfaceType, and ObjcClassDecl are *very*
preliminary.

The good news is we no longer need -parse-noop (aka MinimalActions) to parse cocoa.m.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41752 91177308-0d34-0410-b5e6-96231b3b80d8
ocoa.m
e39245b0673560fc9567fc9df10be1d896440b31 04-Sep-2007 Chris Lattner <sabre@nondot.org> disable this for now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41701 91177308-0d34-0410-b5e6-96231b3b80d8
xx-references.cpp
371227d6dc3cf89a3165d592cd9a4cbb400ec45c 04-Sep-2007 Steve Naroff <snaroff@apple.com> More fun with initializers!

- Fixed many bugs, enhanced test case considerably, added a diagnostic, etc.
- Refactored CheckInitList() into CheckVariableInitList()/CheckConstantInitList().
- Added CheckInitExpr().
- Support for multi-dimensional arrays looking good.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41690 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
d35005ece906cca5238d75b031b8db7eac0ac6e1 03-Sep-2007 Steve Naroff <snaroff@apple.com> Finish getting "array-init.c" to work properly.

Array scalar initialization is now is reasonable shape.

Next step, structure and array of structure initializers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41681 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
38374b05791ee93300b9fbe8ceb3957f54184b37 02-Sep-2007 Steve Naroff <snaroff@apple.com> More progress on array initializers.

- Added Expr::isConstantExpr().
- Added type checking for InitListExpr elements.
- Added diagnostic for trying to initialize a variable sized object.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41674 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
6f9f307d527e3451470dd07ae932475f26c6de6e 02-Sep-2007 Steve Naroff <snaroff@apple.com> More semantic analysis of initializers.

Added 2 errors and one warning, updated test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41672 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
f009063ab7e05be7781751ff9e4b42630f07a747 02-Sep-2007 Steve Naroff <snaroff@apple.com> Start implementing semantic analysis for C initializers.

Step 1: Start instantiating InitListExpr's.
Step 2: Call newly added function Sema::CheckInitializer() from Sema::ParseDeclarator().
Step 3: Give InitListExpr's a preliminary type.
Step 4: Start emitting diagnostics for simple assignments.

Note:

As a result of step 1, the CodeGen/mandel.c test asserts "Unimplemented agg expr!", which is expected.

As a result of step 4, the test below now fails. This isn't expected and needs to be investigated (it appears type checking for C++ references is flawed in some way).

******************** TEST 'Sema/cxx-references.cpp' FAILED! ********************
Command:
clang -fsyntax-only Sema/cxx-references.cpp
Output:
Sema/cxx-references.cpp:8:12: warning: incompatible pointer types assigning 'int &*' to 'int *'
int *p = &r;
^~
Sema/cxx-references.cpp:10:20: error: incompatible types assigning 'int (int)' to 'int (&)(int)'
int (&rg)(int) = g;
^
Sema/cxx-references.cpp:13:18: error: incompatible types assigning 'int [3]' to 'int (&)[3]'
int (&ra)[3] = a;
^
Sema/cxx-references.cpp:16:14: error: incompatible types assigning 'int *' to 'int *&'
int *& P = Q;
^
4 diagnostics generated.
******************** TEST 'Sema/cxx-references.cpp' FAILED! ********************




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41671 91177308-0d34-0410-b5e6-96231b3b80d8
rray-init.c
98414c1b7d1944a57156d52e29bd41c005de09ac 31-Aug-2007 Chris Lattner <sabre@nondot.org> Fix a bug/missing-feature Ted noticed: the 'unused' warning should not
warn about the last stmt in a stmtexpr, f.e. there should be no warning for:

int maxval_stmt_expr(int x, int y) {
return ({int _a = x, _b = y; _a > _b ? _a : _b; });
}



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41655 91177308-0d34-0410-b5e6-96231b3b80d8
nused-expr.c
d7444aac1af1c2c1d5e5b7467ecf6006ee2d8abe 31-Aug-2007 Steve Naroff <snaroff@apple.com> Removed Sema::VerifyConstantArrayType(). With the new Array/ConstantArray/VariableArray nodes, this
routine was causing more trouble than it was worth. Anders/Chris noticed that it could return an error code
without emiting a diagnostic (which results in an silent invalid decl, which should *never* happen). In addition,
this routine didn't work well for typedefs and field decls. Lastly, it didn't consider that initializers aren't
in place yet.

Added Type::getAsConstantArrayType(), Type::getAsVariableArrayType(), Type::getAsVariablyModifiedType(),
and Type::isVariablyModifiedType();

Modified Sema::ParseDeclarator() and Sema::ParseField() to use the new predicates. Also added a FIXME for
the initializer omission. Also added a missing test for "static" @ file scope.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41647 91177308-0d34-0410-b5e6-96231b3b80d8
rray-constraint.c
42471f8bc6c1179a54941fac3c483ec1bd319436 31-Aug-2007 Steve Naroff <snaroff@apple.com> Final phase of array cleanup (for now), removing a FIXME from yesterday.

Moved several array constraints checks from Sema::VerifyConstantArrayType() to
Sema::GetTypeForDeclarator(). VerifyConstantArrayType() is now very simple, and
could be removed eventually.

Now, we get the following (correct) messages for BlockVarDecls:-)

[dylan:~/llvm/tools/clang] admin% ../../Debug/bin/clang x.c -pedantic
x.c:4:20: error: size of array has non-integer type 'float'
int size_not_int[f];
^
x.c:5:21: error: array size is negative
int negative_size[1-2];
^~~
x.c:6:17: warning: zero size arrays are an extension
int zero_size[0];
^
3 diagnostics generated.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41624 91177308-0d34-0410-b5e6-96231b3b80d8
rray-constraint.c
d3fb6adc8879dc0c77b540c4c89561c8a9c8bca1 30-Aug-2007 Chris Lattner <sabre@nondot.org> a new testcase


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41614 91177308-0d34-0410-b5e6-96231b3b80d8
ffsetof.c
054fad5a89c3543ea79fed08599ed3bf54cf7570 30-Aug-2007 Chris Lattner <sabre@nondot.org> -C mode doesn't return comments on "#" lines, so the diag checker doesn't pick them up.
Test this the hard way.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41605 91177308-0d34-0410-b5e6-96231b3b80d8
89-2.c
89.c
b94495155dd551ee81ad0c1865acd9ff1bbd632d 30-Aug-2007 Neil Booth <neil@daikokuya.co.uk> Ensure we diagnose long long literals in C90 mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41581 91177308-0d34-0410-b5e6-96231b3b80d8
89.c
9b3d3a9f3d60eff7b7c8d383203ff348527e3874 29-Aug-2007 Ted Kremenek <kremenek@apple.com> Added checking (during parsing) of comparison of floating point values using == or !=.
This is the same functionality gcc provides via --Wfloat-equal.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41574 91177308-0d34-0410-b5e6-96231b3b80d8
loating-point-compare.c
53a3234f4bc3fd5c7e2403321bff9c907e1f2de6 28-Aug-2007 Steve Naroff <snaroff@apple.com> Move the "invalid decl" idiom up to Decl (where we have some bits to steal:-)

Converted ParmVarDecl, FileVarDecl, BlockVarDecl, and Sema::ParseIdentifierExpr() to use the idiom.

Updated array-constraint.c to make sure we no longer get "undeclared identifier" errors:-)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41552 91177308-0d34-0410-b5e6-96231b3b80d8
rray-constraint.c
94f81fd0b0f81a99d215b225c8c5616295b063f6 28-Aug-2007 Chris Lattner <sabre@nondot.org> extwarn about VLAs in C89 mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41545 91177308-0d34-0410-b5e6-96231b3b80d8
89.c
b23deda7333cfc2316c989d10745c145dfbea6d6 28-Aug-2007 Chris Lattner <sabre@nondot.org> warn about long long when in c89 mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41543 91177308-0d34-0410-b5e6-96231b3b80d8
89.c
1e45efa00b14a3bedc3e0b56c450b69efcaecf7c 28-Aug-2007 Chris Lattner <sabre@nondot.org> new testcase


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41541 91177308-0d34-0410-b5e6-96231b3b80d8
ssign.c
ac60968d4541aa4e80fa71f64c36adfe5aa586e4 28-Aug-2007 Chris Lattner <sabre@nondot.org> compute the required destination type for an enum, emitting various warnings.

TODO: update the types of the constants and the enum.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41532 91177308-0d34-0410-b5e6-96231b3b80d8
num.c
ae3b701f59e78e058b83344be17206af3bf5d277 28-Aug-2007 Chris Lattner <sabre@nondot.org> now that all the infrastructure is in place, enforce C99 6.8.5p3.

Note the FIXME: we need some way to mark a decl erroneous :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41524 91177308-0d34-0410-b5e6-96231b3b80d8
or.c
c30ebfbf23d6a471146e3c68c2cf7f170b7e55dc 27-Aug-2007 Chris Lattner <sabre@nondot.org> extwarn about decls intermixed with code in c89 mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41477 91177308-0d34-0410-b5e6-96231b3b80d8
89.c
77878cc5aa6ad01fc0c91bac1a61819dbf3bf691 27-Aug-2007 Steve Naroff <snaroff@apple.com> Add Type::getAsBuiltinType() and Type::builtinTypesAreCompatible().
Modified Type::typesAreCompatible() to use the above.

This fixes the following bug submitted by Keith Bauer (thanks!).

int equal(char *a, const char *b)
{
return a == b;
}

Also tweaked Sema::CheckCompareOperands() to ignore the qualifiers when
comparing two pointer types (though it doesn't relate directly to this bug).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41476 91177308-0d34-0410-b5e6-96231b3b80d8
ompare.c
nused-expr.c
6e844adbe981e549ac0ad2300ea942832aad5ef6 26-Aug-2007 Chris Lattner <sabre@nondot.org> Fix a bug reported by Keith Bauer


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41452 91177308-0d34-0410-b5e6-96231b3b80d8
nused-expr.c
26b8ff45bab784183018f79ec95327aac4e7e8b0 26-Aug-2007 Steve Naroff <snaroff@apple.com> Fix bogus warnings (noticed by Chris) with array-constraints.c.

Remove bogus type conversions in Sema::GetTypeForDeclarator(). This commit
only deals with the array types (DeclaratorCheck::Array), though the
rest of this routine should be reviewed. Given the complexity of C declarators,
I don't want to change the entire routine now (will discuss with Chris tomorrow).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41443 91177308-0d34-0410-b5e6-96231b3b80d8
rray-constraint.c
ce7f4cc77f00a4e591596790cf9588e4daf71534 26-Aug-2007 Chris Lattner <sabre@nondot.org> steve's recent changes fixed this bogus warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41432 91177308-0d34-0410-b5e6-96231b3b80d8
rray-constraint.c
d28f815705497f23c2747d61b7834f2d7ea78283 26-Aug-2007 Chris Lattner <sabre@nondot.org> Cases like this:
char *C;
C != ((void*)0);

Should not warn about incompatible pointer types. Also, make sure to
insert an implicit conversion even if the operand is null.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41408 91177308-0d34-0410-b5e6-96231b3b80d8
ompare.c
0471f5bc8191e39cdb61fabcaf1870e2af2d42e8 23-Aug-2007 Chris Lattner <sabre@nondot.org> finish off switch case overlap checking, adding support for
verifying case ranges.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41331 91177308-0d34-0410-b5e6-96231b3b80d8
witch.c
6efc4d3659632ddcea4a58cb62e9ee54ca4a373e 23-Aug-2007 Chris Lattner <sabre@nondot.org> detect and diagnose empty case ranges:

switch.c:16:8: warning: empty case range specified
case 100 ... 99: ; // expected-warning {{empty case range}}
^~~~~~~~~~



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41328 91177308-0d34-0410-b5e6-96231b3b80d8
witch.c
f334850cd2fc2d4ac9b585f80d97b4f0097a0348 23-Aug-2007 Chris Lattner <sabre@nondot.org> fix a segfault in cases where there are no cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41317 91177308-0d34-0410-b5e6-96231b3b80d8
witch.c
b2ec9d6fede9cccc170a202de7bf7f523dea8be4 23-Aug-2007 Chris Lattner <sabre@nondot.org> report duplicate case values. TODO: report duplicate/overlapping ranges.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41315 91177308-0d34-0410-b5e6-96231b3b80d8
witch.c
f4021e7d5228a2be5a380269dffa0331a6c78b95 23-Aug-2007 Chris Lattner <sabre@nondot.org> start checking case values of switch stmts more closely. Emit overflow
warnings when converting case values to the expression type.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41313 91177308-0d34-0410-b5e6-96231b3b80d8
witch.c
d818a7114f3cd84ebe18ef9c69b43035309bf2ff 23-Aug-2007 Chris Lattner <sabre@nondot.org> Test that cocoa parses with -parse-noop. In the future
(when ready) this test should change to test -fsyntax-only.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41307 91177308-0d34-0410-b5e6-96231b3b80d8
ocoa.m
2b8bac52b8c5690c7a6525c95feefe29bb12178d 21-Aug-2007 Chris Lattner <sabre@nondot.org> we now correctly emit:
unused-expr.c:8:6: warning: comparison of distinct pointer types ('int volatile *' and 'int *')
VP == P;
~~ ^ ~




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41210 91177308-0d34-0410-b5e6-96231b3b80d8
nused-expr.c
f8f9517d7d027ad04e6a59cf2d70a21bf8f47b0c 20-Aug-2007 Ted Kremenek <kremenek@apple.com> Added test cases for the return-stack-address checker to test support
for the following C++ casts: static_cast, reinterpret_cast, and const_cast.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41181 91177308-0d34-0410-b5e6-96231b3b80d8
eturn-stack-addr.cpp
4774b4df075e3f6a235632eecb477c38ee0c0f78 18-Aug-2007 Ted Kremenek <kremenek@apple.com> Added extra test case to check proper handling of archaic array indexing: 4[A]


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41147 91177308-0d34-0410-b5e6-96231b3b80d8
eturn-stack-addr.cpp
71993dd85eed9cc42c6b2fa61ee5c53026b74817 17-Aug-2007 Anders Carlsson <andersca@mac.com> Add initial support for constant CFStrings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41136 91177308-0d34-0410-b5e6-96231b3b80d8
fstring.c
71895b9aa3ad71957359497e136b50fcb6136bdf 14-Aug-2007 Ted Kremenek <kremenek@apple.com> Added support for additional format string checking for the printf
family of functions. Previous functionality only included checking to
see if the format string was a string literal. Now we check parse the
format string (if it is a literal) and perform the following checks:

(1) Warn if: number conversions (e.g. "%d") != number data arguments.

(2) Warn about missing format strings (e.g., "printf()").

(3) Warn if the format string is not a string literal.

(4) Warn about the use se of '%n' conversion. This conversion is
discouraged for security reasons.

(5) Warn about malformed conversions. For example '%;', '%v'; these
are not valid.

(6) Warn about empty format strings; e.g. printf(""). Although these
can be optimized away by the compiler, they can be indicative of
broken programmer logic. We may need to add additional support to
see when such cases occur within macro expansion to avoid false
positives.

(7) Warn if the string literal is wide; e.g. L"%d".

(8) Warn if we detect a '\0' character WITHIN the format string.

Test cases are included.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41076 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
59907c4d8f6fc8aacfdaa0273bd7a9c140fbb45f 10-Aug-2007 Chris Lattner <sabre@nondot.org> initial support for checking format strings, patch by Ted Kremenek:

"I've coded up some support in clang to flag warnings for non-constant format strings used in calls to printf-like functions (all the functions listed in "man fprintf"). Non-constant format strings are a source of many security exploits in C/C++ programs, and I believe are currently detected by gcc using the flag -Wformat-nonliteral."



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41003 91177308-0d34-0410-b5e6-96231b3b80d8
ormat-strings.c
345dc62fd5d2980aab3ab2218dd0234f6bcea279 04-Aug-2007 Chris Lattner <sabre@nondot.org> the sse intrinsics are missing, leading to errors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40800 91177308-0d34-0410-b5e6-96231b3b80d8
arbon.c
f13ebf03b744386649c869014a6b4cf657144ebd 03-Aug-2007 Chris Lattner <sabre@nondot.org> oops, this is the real fix.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40766 91177308-0d34-0410-b5e6-96231b3b80d8
rray-constraint.c
6f66c26c9482d049375312f9dad2b7f7c18c4cc2 03-Aug-2007 Chris Lattner <sabre@nondot.org> update test


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40765 91177308-0d34-0410-b5e6-96231b3b80d8
rray-constraint.c
281a492261400cc9c1265046b46bee8452a1c56e 02-Aug-2007 Chris Lattner <sabre@nondot.org> make sure we don't lose the ability to parse carbon.h


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40759 91177308-0d34-0410-b5e6-96231b3b80d8
arbon.c
e80a59cc41d42a970466cb020b6f44c5b8831d70 25-Jul-2007 Chris Lattner <sabre@nondot.org> Fix a couple of bugs, add some new cool stuff.

1. Fix a todo in Parser::ParseTag, to recover better. On code like
that in test/Sema/decl-invalid.c it causes us to return a single
error instead of multiple.
2. Fix an error in Sema::ParseDeclarator, where it would crash if the
declarator didn't have an identifier. Instead, diagnose the problem.
3. Start adding infrastructure to track the range of locations covered
by a declspec or declarator. This is mostly implemented for declspec,
but could be improved, it is missing for declarator.

Thanks to Neil for pointing out this crash.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40482 91177308-0d34-0410-b5e6-96231b3b80d8
ecl-invalid.c
ab18c4c0ac1a46a38aa84c2c8ea485612e21a614 24-Jul-2007 Chris Lattner <sabre@nondot.org> implement ast building and trivial semantic analysis of stmt exprs.
This implements test/Sema/stmt_exprs.c



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40465 91177308-0d34-0410-b5e6-96231b3b80d8
tmt_exprs.c
8a87e57beb96212ee61dc08a5f691cd7f7710703 23-Jul-2007 Chris Lattner <sabre@nondot.org> correctly verify that default and case are in a switchstmt,
this fixes test/Sema/switch.c.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40438 91177308-0d34-0410-b5e6-96231b3b80d8
witch.c
c1fcb7762673be706b0a40477d5e93411e918f93 22-Jul-2007 Anders Carlsson <andersca@mac.com> Refactor switch analysis to make it possible to detect duplicate case values

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40388 91177308-0d34-0410-b5e6-96231b3b80d8
witch-duplicate-defaults.c
4fc37c515826dc506631178e58f1d0ae495ff100 21-Jul-2007 Chris Lattner <sabre@nondot.org> testcase from neil


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40173 91177308-0d34-0410-b5e6-96231b3b80d8
rg-invalid.c
d472b31d8037b506fd98531daf40aa5f85afb5e8 21-Jul-2007 Chris Lattner <sabre@nondot.org> Fix off-by-one error when emitting diagnostics. Also, make diagnostic
a bit nicer for people who pass lots of extra arguments to calls by
selecting them all instead of just the first one:

arg-duplicate.c:13:13: error: too many arguments to function
f3 (1, 1, 2, 3, 4); // expected-error {{too many arguments to function}}
^~~~~~~

This implements test/Sema/arg-duplicate.c, thanks to Neil for pointing
out this crash.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40136 91177308-0d34-0410-b5e6-96231b3b80d8
rg-duplicate.c
0fa152e72bb71c4aa184d0edd91caa9cbebbf70e 21-Jul-2007 Chris Lattner <sabre@nondot.org> Two fixes:
1) fix a crash on test/Sema/default.c by making
sure that the switch scope is non-null.
2) if there is an error sema'ing a default or case stmt,
make sure to return the substmt up, so that the error
recovery code has more acurate info to continue with.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40134 91177308-0d34-0410-b5e6-96231b3b80d8
efault.c
5265af5b555f703be365dbc32c4e518fe38d4d9a 19-Jul-2007 Chris Lattner <sabre@nondot.org> Fix a crasher that Neil reported: Sema::GetTypeForDeclarator should never
return a null type. If there is an error parsing the type, pick a new type
for error recovery purposes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40029 91177308-0d34-0410-b5e6-96231b3b80d8
rray-constraint.c
9697a5c457daefcf2bcc6c66f305852768e36041 17-Jul-2007 Chris Lattner <sabre@nondot.org> I forgot to check this in earlier


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39958 91177308-0d34-0410-b5e6-96231b3b80d8
ypedef-retain.c
08ad47cbd1f81fcb31dbc731c13b885a07e12704 17-Jul-2007 Bill Wendling <isanbard@gmail.com> Fix references:
According to the spec (C++ 5p6[expr]), we need to adjust "T&" to
"T" before further analysis. We do this via the "implicit cast"
thingy.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39953 91177308-0d34-0410-b5e6-96231b3b80d8
xx-references.cpp
26dc7b39267b7d29b35a7887a5b8e54697192192 16-Jul-2007 Chris Lattner <sabre@nondot.org> Remove an extraneous QualType from CastExpr, it's type is always
the result type of the expr node.

Implement isIntegerConstantExpr for ImplicitCastExpr nodes the same
was as for CastExpr nodes.

Implement proper sign/zero extension as well as truncation and noop
conversion in the i-c-e evaluator. This allows us to correctly
handle i-c-e's like these:

char array[1024/(sizeof (long))];
int x['\xBb' == (char) 187 ? 1: -1];

this implements test/Sema/i-c-e2.c



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39888 91177308-0d34-0410-b5e6-96231b3b80d8
-c-e2.c
7a543ad55a38853c577f23b8524fa3de3290550e 13-Jul-2007 Chris Lattner <sabre@nondot.org> Unspecified type specs default to int. This fixes a crash
on test/Sema/implicit-int.c



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39833 91177308-0d34-0410-b5e6-96231b3b80d8
mplicit-int.c
a63ff1486d2c8b9ded418ec130ae424831fe14c3 13-Jul-2007 Chris Lattner <sabre@nondot.org> new testcase that crashes the cfe due to implicit conversion fun


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39826 91177308-0d34-0410-b5e6-96231b3b80d8
-c-e2.c
5f016e2cb5d11daeb237544de1c5d59f20fe1a6e 11-Jul-2007 Reid Spencer <rspencer@reidspencer.com> Stage two of getting CFE top correct.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39734 91177308-0d34-0410-b5e6-96231b3b80d8
-c-e1.c
mplicit-def.c
nused-expr.c
oid_arg.c