]> granicus.if.org Git - clang/log
clang
12 years agoIn CXXRecordDecl::isCLike(), also check for PODness.
Argyrios Kyrtzidis [Tue, 24 Jan 2012 01:37:11 +0000 (01:37 +0000)]
In CXXRecordDecl::isCLike(), also check for PODness.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148765 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoobjective-c: Ignore with warning forward class declaration whose name
Fariborz Jahanian [Tue, 24 Jan 2012 00:40:15 +0000 (00:40 +0000)]
objective-c: Ignore with warning forward class declaration whose name
matches a typedef declaring an object type. // rdar://10733000

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148760 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMake sure the integer type used to align the vaarg address is the same as the
Akira Hatanaka [Mon, 23 Jan 2012 23:59:52 +0000 (23:59 +0000)]
Make sure the integer type used to align the vaarg address is the same as the
type of pointers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148753 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agofixes location of "availability" attribute so warning is displayed at
Fariborz Jahanian [Mon, 23 Jan 2012 23:38:32 +0000 (23:38 +0000)]
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

12 years agoIgnore return type if its size is zero.
Akira Hatanaka [Mon, 23 Jan 2012 23:18:57 +0000 (23:18 +0000)]
Ignore return type if its size is zero.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148744 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove extraneous ';'.
Bill Wendling [Mon, 23 Jan 2012 22:53:59 +0000 (22:53 +0000)]
Remove extraneous ';'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148739 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMinor fixups for auto deduction of initializer lists.
Sebastian Redl [Mon, 23 Jan 2012 22:09:39 +0000 (22:09 +0000)]
Minor fixups for auto deduction of initializer lists.

Fix some review comments.
Add a test for deduction when std::initializer_list isn't available yet.
Fix redundant error messages. This fixes and outstanding FIXME too.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148735 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[libclang] For:
Argyrios Kyrtzidis [Mon, 23 Jan 2012 21:28:38 +0000 (21:28 +0000)]
[libclang] For:
@implementation I(cat)
suppress subsequent references to 'I'.

rdar://10568103

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148730 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIntroduce Sema::isNullExpr() that contains the checks that
Argyrios Kyrtzidis [Mon, 23 Jan 2012 20:38:53 +0000 (20:38 +0000)]
Introduce Sema::isNullExpr() that contains the checks that
Sema::DiagnoseSentinelCalls() does.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148722 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIn CorrectTypo, use the cached correction as a starting point instead.
Kaelyn Uhrain [Mon, 23 Jan 2012 20:18:59 +0000 (20:18 +0000)]
In CorrectTypo, use the cached correction as a starting point instead.

Previously, for unqualified lookups, a positive cache hit is used as the
only non-keyword correction and a negative cache hit immediately returns
an empty TypoCorrection. With the new callback objects, this behavior
causes false negatives by not accounting for the fact that callback
objects alter the set of potential/allowed corrections. The new behavior
is to seed the set of corrections with the cached correction (for
positive hits) to estabilishing a baseline edit distance. Negative cache
hits are only stored or used when either no callback object is provided
or when it returns true for a call to ValidateCandidate with an empty
TypoCorrection (i.e. when ValidateCandidate does not seem to be doing
any checking of the TypoCorrection, such as when an instance of the base
callback class is used solely to specify the set of keywords to be accepted).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148720 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[asan] document the need for -fno-optimize-sibling-calls
Kostya Serebryany [Mon, 23 Jan 2012 18:50:23 +0000 (18:50 +0000)]
[asan] document the need for -fno-optimize-sibling-calls

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148716 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix a typo: _MM_FLUSH_ZERO_OFF has the wrong value. rdar://10716672
Bob Wilson [Mon, 23 Jan 2012 18:27:24 +0000 (18:27 +0000)]
Fix a typo: _MM_FLUSH_ZERO_OFF has the wrong value. rdar://10716672

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148711 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIntroduce CXXRecordDecl::isCLike() that is true if the class is C-like,
Argyrios Kyrtzidis [Mon, 23 Jan 2012 16:58:45 +0000 (16:58 +0000)]
Introduce CXXRecordDecl::isCLike() that is true if the class is C-like,
without C++-specific features.

Use it to set the language to C++ when indexing non-C-like structs.
rdar://10732579

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148708 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[libclang] Index C++ template specializations, rdar://10732708
Argyrios Kyrtzidis [Mon, 23 Jan 2012 16:58:41 +0000 (16:58 +0000)]
[libclang] Index C++ template specializations, rdar://10732708

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148707 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[libclang] Index namespaces in C++ qualified lookup of members, rdar://10732798
Argyrios Kyrtzidis [Mon, 23 Jan 2012 16:58:38 +0000 (16:58 +0000)]
[libclang] Index namespaces in C++ qualified lookup of members, rdar://10732798

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148706 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[libclang] Index C++ constructor initializers, rdar://10732164
Argyrios Kyrtzidis [Mon, 23 Jan 2012 16:58:36 +0000 (16:58 +0000)]
[libclang] Index C++ constructor initializers, rdar://10732164

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148705 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoImprove Lexer::getImmediateMacroName to take into account inner macros
Argyrios Kyrtzidis [Mon, 23 Jan 2012 16:58:33 +0000 (16:58 +0000)]
Improve Lexer::getImmediateMacroName to take into account inner macros
of macro arguments.

For "MAC1( MAC2(foo) )" and location of 'foo' token it would return
"MAC1" instead of "MAC2".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148704 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoHandle pseudo-object expressions (and any other placeholder
Douglas Gregor [Mon, 23 Jan 2012 15:59:30 +0000 (15:59 +0000)]
Handle pseudo-object expressions (and any other placeholder
expression) when code-completing member access expressions. Fixes
<rdar://problem/10717172>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148703 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd -Wnarrowing as an alias for -Wc++11-narrowing, for better GCC
Douglas Gregor [Mon, 23 Jan 2012 15:52:03 +0000 (15:52 +0000)]
Add -Wnarrowing as an alias for -Wc++11-narrowing, for better GCC
compatibility.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148702 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDowngrade C++11 narrowing conversion errors to warnings default-mapped
Douglas Gregor [Mon, 23 Jan 2012 15:29:33 +0000 (15:29 +0000)]
Downgrade C++11 narrowing conversion errors to warnings default-mapped
to an error, so that users can turn them off if necessary. Note that
this does *not* change the behavior of in a SFINAE context, where we
still flag an error even if the warning is disabled. This matches
GCC's behavior.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148701 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd support for -fno-optimize-sibling-calls. Currently only implemented in the
Nick Lewycky [Mon, 23 Jan 2012 08:29:12 +0000 (08:29 +0000)]
Add support for -fno-optimize-sibling-calls. Currently only implemented in the
X86 backend in LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148689 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd a source range to the ms path. Spotted by David Blaikie.
Nico Weber [Mon, 23 Jan 2012 06:08:16 +0000 (06:08 +0000)]
Add a source range to the ms path. Spotted by David Blaikie.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148683 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIn microsoft mode, downgrade pseudo-destructors on void from error to warning.
Nico Weber [Mon, 23 Jan 2012 05:50:57 +0000 (05:50 +0000)]
In microsoft mode, downgrade pseudo-destructors on void from error to warning.

This matches cl.exe's behavior and fixes PR11791.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148682 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRename -Wswitch-enum-redundant-default to -Wswitch-redundant-default.
David Blaikie [Mon, 23 Jan 2012 04:58:54 +0000 (04:58 +0000)]
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

12 years agoImplement -Wswitch-enum correctly.
David Blaikie [Mon, 23 Jan 2012 04:46:12 +0000 (04:46 +0000)]
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

12 years agoConvert file from 60% unix 40% dos line endings to 100% unix line endings.
Nico Weber [Mon, 23 Jan 2012 04:08:13 +0000 (04:08 +0000)]
Convert file from 60% unix 40% dos line endings to 100% unix line endings.

No other changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148678 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoEli says this should check MicrosoftMode instead.
Nico Weber [Mon, 23 Jan 2012 04:01:33 +0000 (04:01 +0000)]
Eli says this should check MicrosoftMode instead.

Also change a || that I accidentally changed to && back to ||.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148677 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIn ms mode, a move assignment operator shouldn't mark a copy ctor as deleted.
Nico Weber [Mon, 23 Jan 2012 03:19:29 +0000 (03:19 +0000)]
In ms mode, a move assignment operator shouldn't mark a copy ctor as deleted.

MSVC2010's pair class has a move assignment operator but no explicit copy
constructor, which makes it unusable without this change.

For symmetry, let move copy constructors not mark the default assignment
operator as deleted either. Both changes match cl.exe's behavior.  Fixes
pr11826.

Also update the standard excerpt to point to the right paragraph.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148675 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMake sure the AST correctly represents lvalue-to-rvalue conversions where appropriate.
Eli Friedman [Mon, 23 Jan 2012 02:35:22 +0000 (02:35 +0000)]
Make sure the AST correctly represents lvalue-to-rvalue conversions where appropriate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148673 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix -Wswitch to warn about out of bounds enum cases even when there's a default
David Blaikie [Sun, 22 Jan 2012 02:31:55 +0000 (02:31 +0000)]
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

12 years agoMove -Wswitch-enum to -Wswitch
David Blaikie [Sun, 22 Jan 2012 01:58:03 +0000 (01:58 +0000)]
Move -Wswitch-enum to -Wswitch

This matches GCC's documented (& actual) behavior. What Clang had implemented
as -Wswitch-enum was actually GCC's -Wswitch behavior. -Wswitch is on by
default (part of -Wall) and warns if a switch-over-enum, without a default
case, covers all enum values.

-Wswitch-enum, on the other hand, does not have the default clause and should
fire even in the presence of a default. This warning is off by default.

With this change the -Wswitch-enum flag is off-by-default in Clang but has no
functionality at the moment. I'll add that in a future commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148648 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIn Microsoft Mode, disable the C++11 strict integral conversion rules for enumerator...
Francois Pichet [Sat, 21 Jan 2012 23:26:50 +0000 (23:26 +0000)]
In Microsoft Mode, disable the C++11 strict integral conversion rules for enumerator that were introduced with r148439. Otherwise MSVC headers won't compile in C++ 11 mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148642 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd -Wswitch-enum-redundant-default.
David Blaikie [Sat, 21 Jan 2012 18:12:07 +0000 (18:12 +0000)]
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

12 years agolib/Frontend/InitHeaderSearch.cpp: [Cygwin] Add 4.5.3.
NAKAMURA Takumi [Sat, 21 Jan 2012 14:46:07 +0000 (14:46 +0000)]
lib/Frontend/InitHeaderSearch.cpp: [Cygwin] Add 4.5.3.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148637 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[Cygwin] Abandon Cygwin-1.5 and g++-3. Use g++-4.3 and higher on Cygwin-1.7.
NAKAMURA Takumi [Sat, 21 Jan 2012 14:46:01 +0000 (14:46 +0000)]
[Cygwin] Abandon Cygwin-1.5 and g++-3. Use g++-4.3 and higher on Cygwin-1.7.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148636 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] It's possible to have a non PointerType expression evaluate to a Loc value...
Anna Zaks [Sat, 21 Jan 2012 06:59:01 +0000 (06:59 +0000)]
[analyzer] It's possible to have a non PointerType expression evaluate to a Loc value. When this happens, use the default type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148631 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUse the new installheaders makefile target in libcxx.
Bob Wilson [Sat, 21 Jan 2012 06:25:34 +0000 (06:25 +0000)]
Use the new installheaders makefile target in libcxx.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148630 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove redundant argument.
Rafael Espindola [Sat, 21 Jan 2012 05:43:40 +0000 (05:43 +0000)]
Remove redundant argument.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148628 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Make VLA checker taint aware.
Anna Zaks [Sat, 21 Jan 2012 05:07:33 +0000 (05:07 +0000)]
[analyzer] Make VLA checker taint aware.

Also, slightly modify the diagnostic message in ArrayBound and DivZero (still use 'taint', which might not mean much to the user, but plan on changing it later).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148626 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd an assertion that our use-marking actually covers all uses of a variable. The...
Eli Friedman [Sat, 21 Jan 2012 04:52:58 +0000 (04:52 +0000)]
Add an assertion that our use-marking actually covers all uses of a variable.  The assertion doesn't cover quite as much as it should, but it's a good start, at least.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148625 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix some comments relating to ExpressionEvaluationContexts. Get rid of a couple...
Eli Friedman [Sat, 21 Jan 2012 04:44:06 +0000 (04:44 +0000)]
Fix some comments relating to ExpressionEvaluationContexts.  Get rid of a couple of uses of ConstantEvaluated which don't make sense.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148624 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix code so that a SkipUntil will ignore semicolons when skipping a
Richard Trieu [Sat, 21 Jan 2012 02:59:18 +0000 (02:59 +0000)]
Fix code so that a SkipUntil will ignore semicolons when skipping a
function body.  This keeps the brace count accurate to prevent
additional errors.  Also, moved the caret from the brace to the function
name.

Code:
class F{ int Foo{ return 1; } };

Fixed error:
parameters.cc:1:14: error: function definition does not declare parameters
class F{ int Foo{ return 1; } };
             ^
1 error generated.

Old errors:
parameters.cc:1:17: error: function definition does not declare parameters
class F{ int Foo{ return 1; } };
                ^
parameters.cc:1:30: error: expected ';' after class
class F{ int Foo{ return 1; } };
                             ^
                             ;
parameters.cc:1:31: error: expected external declaration
class F{ int Foo{ return 1; } };
                              ^
3 errors generated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148621 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Unbreak the static analyzer bot. Regression from r148558.
Anna Zaks [Sat, 21 Jan 2012 01:11:35 +0000 (01:11 +0000)]
[analyzer] Unbreak the static analyzer bot. Regression from r148558.

When we build a single source file, we call clang directly (not though scan-build).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148612 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd obvious missing call to MarkDeclarationReferenced.
Eli Friedman [Sat, 21 Jan 2012 01:07:00 +0000 (01:07 +0000)]
Add obvious missing call to MarkDeclarationReferenced.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148611 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoMake clang's AST model sizeof and typeof with potentially-evaluated operands correctl...
Eli Friedman [Sat, 21 Jan 2012 01:01:51 +0000 (01:01 +0000)]
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

12 years agoarg migrator: change all "assign" of object properties
Fariborz Jahanian [Sat, 21 Jan 2012 00:43:53 +0000 (00:43 +0000)]
arg migrator: change all "assign" of object properties
to "strong" when migrating from GC. // rdar://10532449

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148607 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix the code completion string for variadic macros with more than one
Douglas Gregor [Sat, 21 Jan 2012 00:43:38 +0000 (00:43 +0000)]
Fix the code completion string for variadic macros with more than one
argument, which was broken and very ugly (and even had a test case to
make *sure* it was broken and ugly). Fixes <rdar://problem/10609117>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148606 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoadd tests for wide character encodings
Seth Cantrell [Sat, 21 Jan 2012 00:16:11 +0000 (00:16 +0000)]
add tests for wide character encodings

and fix typo

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148603 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoHandle thread safety attributes on functions with separate definitions and declarations.
DeLesley Hutchins [Fri, 20 Jan 2012 23:24:41 +0000 (23:24 +0000)]
Handle thread safety attributes on functions with separate definitions and declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148599 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoDelayed template instantiation of late-parsed attributes.
DeLesley Hutchins [Fri, 20 Jan 2012 22:50:54 +0000 (22:50 +0000)]
Delayed template instantiation of late-parsed attributes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148595 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoInstantiate dependent attributes when instantiating templates.
DeLesley Hutchins [Fri, 20 Jan 2012 22:37:06 +0000 (22:37 +0000)]
Instantiate dependent attributes when instantiating templates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148592 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoThe 'l' length modifier makes sense with the scanlist conversion specifier.
Ted Kremenek [Fri, 20 Jan 2012 22:11:52 +0000 (22:11 +0000)]
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

12 years agoTestcase for PR11345.
Eric Christopher [Fri, 20 Jan 2012 22:10:18 +0000 (22:10 +0000)]
Testcase for PR11345.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148585 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoWhen adding types to the context chain for record types, just emit
Eric Christopher [Fri, 20 Jan 2012 22:10:15 +0000 (22:10 +0000)]
When adding types to the context chain for record types, just emit
a forward declaration unless we already have a type. We can fill it in
later if it's actually used.

Fixes PR11345

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148584 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove unnecessary and incorrect redirection of stderr.
Bob Wilson [Fri, 20 Jan 2012 22:01:45 +0000 (22:01 +0000)]
Remove unnecessary and incorrect redirection of stderr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148583 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agorename -ccc-host-triple into -target
Sebastian Pop [Fri, 20 Jan 2012 22:01:23 +0000 (22:01 +0000)]
rename -ccc-host-triple into -target

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148582 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTighten format string diagnostic and make it a bit clearer (and a bit closer to GCC's).
Ted Kremenek [Fri, 20 Jan 2012 21:52:58 +0000 (21:52 +0000)]
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

12 years agoMore dead code removal (using -Wunreachable-code)
David Blaikie [Fri, 20 Jan 2012 21:50:17 +0000 (21:50 +0000)]
More dead code removal (using -Wunreachable-code)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148577 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd ability to specifiy 'restrict' on parameters of builtins, and correct this oversi...
Ted Kremenek [Fri, 20 Jan 2012 21:40:12 +0000 (21:40 +0000)]
Add ability to specifiy 'restrict' on parameters of builtins, and correct this oversight for scanf functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148573 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoPer PR 11814, use Monospace instead of Andale Mono.
Ted Kremenek [Fri, 20 Jan 2012 20:39:55 +0000 (20:39 +0000)]
Per PR 11814, use Monospace instead of Andale Mono.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148567 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Add taint awareness to DivZeroChecker.
Anna Zaks [Fri, 20 Jan 2012 20:28:31 +0000 (20:28 +0000)]
[analyzer] Add taint awareness to DivZeroChecker.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148566 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoarc migrator: replace "retain" attribute with "strong"
Fariborz Jahanian [Fri, 20 Jan 2012 19:15:02 +0000 (19:15 +0000)]
arc migrator: replace "retain" attribute with "strong"
which have same semantics in mrr as well as arr.
// rdar://10688312

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148559 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Tweak the buildbot script to include the experimental taint checker and...
Anna Zaks [Fri, 20 Jan 2012 19:10:59 +0000 (19:10 +0000)]
[analyzer] Tweak the buildbot script to include the experimental taint checker and correct the checker enabling setting.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148558 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agouse llvm:Attributes instead of unsigned
Kostya Serebryany [Fri, 20 Jan 2012 17:57:16 +0000 (17:57 +0000)]
use llvm:Attributes instead of unsigned

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148554 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoEnhance Lexer::makeFileCharRange to check for ranges inside a macro argument
Argyrios Kyrtzidis [Fri, 20 Jan 2012 16:52:43 +0000 (16:52 +0000)]
Enhance Lexer::makeFileCharRange to check for ranges inside a macro argument
expansion, in which case it returns a file range in the location where the
argument was spelled.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148551 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoReplace a dubious use of SmallVectorImpl with a proper copy.
Benjamin Kramer [Fri, 20 Jan 2012 16:39:18 +0000 (16:39 +0000)]
Replace a dubious use of SmallVectorImpl with a proper copy.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148549 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFix broken unit test
Douglas Gregor [Fri, 20 Jan 2012 16:33:00 +0000 (16:33 +0000)]
Fix broken unit test

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148547 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoExtract the (InputKind, std::string) pair used to describe inputs to
Douglas Gregor [Fri, 20 Jan 2012 16:28:04 +0000 (16:28 +0000)]
Extract the (InputKind, std::string) pair used to describe inputs to
the front end into its own class, FrontendInputFile, to make it easier
to introduce new per-input data. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148546 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoLocalize variable, remove unused assignment.
Benjamin Kramer [Fri, 20 Jan 2012 14:57:34 +0000 (14:57 +0000)]
Localize variable, remove unused assignment.

Found by the clang static analyzer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148544 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove unused variables.
Benjamin Kramer [Fri, 20 Jan 2012 14:42:32 +0000 (14:42 +0000)]
Remove unused variables.

Found by clang's own static analyzer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148542 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoReenable DeadStoresChecker under --analyze, and move the IdempotentOperationsChecker...
Ted Kremenek [Fri, 20 Jan 2012 06:00:17 +0000 (06:00 +0000)]
Reenable DeadStoresChecker under --analyze, and move the IdempotentOperationsChecker to the 'experimental' category.  Fixes <rdar://problem/10146347>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148533 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoImplement checker that looks for calls to mktemps and friends that have fewer than...
Ted Kremenek [Fri, 20 Jan 2012 05:35:06 +0000 (05:35 +0000)]
Implement checker that looks for calls to mktemps and friends that have fewer than 6 Xs.  Implements <rdar://problem/6336672>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148531 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoTurn 'SecuritySyntaxChecker' into a "meta" security checker for insecure APIs. Now
Ted Kremenek [Fri, 20 Jan 2012 01:44:29 +0000 (01:44 +0000)]
Turn 'SecuritySyntaxChecker' into a "meta" security checker for insecure APIs.  Now
multiple checks are exposed as separate checkers, but CheckerManager only creates
one Checker object.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148525 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[libclang] Fix crash when indexing attributes, rdar://10702250.
Argyrios Kyrtzidis [Fri, 20 Jan 2012 01:38:51 +0000 (01:38 +0000)]
[libclang] Fix crash when indexing attributes, rdar://10702250.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148524 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove PotentiallyPotentiallyEvaluated, and replace it with a much simpler and less...
Eli Friedman [Fri, 20 Jan 2012 01:26:23 +0000 (01:26 +0000)]
Remove PotentiallyPotentiallyEvaluated, and replace it with a much simpler and less error-prone way of handling the relevant cases.  Towards marking of whether a declaration is used more accurately.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148522 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Add socket API as a source of taint.
Anna Zaks [Fri, 20 Jan 2012 00:11:19 +0000 (00:11 +0000)]
[analyzer] Add socket API as a source of taint.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148518 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Skip casts when determining taint dependencies + pretty
Anna Zaks [Fri, 20 Jan 2012 00:11:16 +0000 (00:11 +0000)]
[analyzer] Skip casts when determining taint dependencies + pretty
printing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148517 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Add a utility method that allows to find the macro name used
Anna Zaks [Fri, 20 Jan 2012 00:11:12 +0000 (00:11 +0000)]
[analyzer] Add a utility method that allows to find the macro name used
at the given location.

This could be useful when checkers' logic depends on whether a function
is called with a given macro argument.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148516 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] Cleanup of Symbol dump methods.
Anna Zaks [Fri, 20 Jan 2012 00:11:08 +0000 (00:11 +0000)]
[analyzer] Cleanup of Symbol dump methods.

This solves a the issue of crashing gdb when dumping a symbol; +
consistent vitualization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148515 91177308-0d34-0410-b5e6-96231b3b80d8

12 years ago[analyzer] www: A minor cleanup to the dev manual.
Anna Zaks [Fri, 20 Jan 2012 00:11:04 +0000 (00:11 +0000)]
[analyzer] www: A minor cleanup to the dev manual.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148514 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFurther testing for instantiation of out-of-line constexpr static data member
Richard Smith [Thu, 19 Jan 2012 22:50:02 +0000 (22:50 +0000)]
Further testing for instantiation of out-of-line constexpr static data member
template definitions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148506 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAn instantiation of a constexpr static data member in a class template is
Richard Smith [Thu, 19 Jan 2012 22:46:17 +0000 (22:46 +0000)]
An instantiation of a constexpr static data member in a class template is
constexpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148505 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoExtend the error of invalid token after declarations to include fixits for
Richard Trieu [Thu, 19 Jan 2012 22:01:51 +0000 (22:01 +0000)]
Extend the error of invalid token after declarations to include fixits for
!=, %=, ^=, &=, *=, -=, |=, /=, <<=, <=, >=, and >>= to =.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148499 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoSilence set-but-unused warning.
Benjamin Kramer [Thu, 19 Jan 2012 21:12:23 +0000 (21:12 +0000)]
Silence set-but-unused warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148496 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIntroduce Lexer::getSourceText() that returns a string for the source
Argyrios Kyrtzidis [Thu, 19 Jan 2012 15:59:19 +0000 (15:59 +0000)]
Introduce Lexer::getSourceText() that returns a string for the source
that the given source range encompasses.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148481 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIntroduce Lexer::makeFileCharRange() that accepts a token source range
Argyrios Kyrtzidis [Thu, 19 Jan 2012 15:59:14 +0000 (15:59 +0000)]
Introduce Lexer::makeFileCharRange() that accepts a token source range
and returns a character range with file locations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148480 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoFor Lexer's isAt[Start/End]OfMacroExpansion add an out parameter for the macro
Argyrios Kyrtzidis [Thu, 19 Jan 2012 15:59:08 +0000 (15:59 +0000)]
For Lexer's isAt[Start/End]OfMacroExpansion add an out parameter for the macro
start/end location.

It is commonly needed after calling the function; with this way we avoid
recalculating it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148479 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd unit testing for Lexer.
Argyrios Kyrtzidis [Thu, 19 Jan 2012 15:59:01 +0000 (15:59 +0000)]
Add unit testing for Lexer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148478 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoExtend unwind.h with the ARM unwinder interface.
Evgeniy Stepanov [Thu, 19 Jan 2012 11:39:05 +0000 (11:39 +0000)]
Extend unwind.h with the ARM unwinder interface.

These declarations come from the sample code in the
"Exception Handling ABI for the ARM Architecture" document.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148469 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoA few style changes.
Tanya Lattner [Thu, 19 Jan 2012 01:16:16 +0000 (01:16 +0000)]
A few style changes.
Change CheckVectorLogicalOperands to pass params by ref.
Add another test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148452 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRemove the now-unused CorrectTypoContext enum.
Kaelyn Uhrain [Thu, 19 Jan 2012 00:33:34 +0000 (00:33 +0000)]
Remove the now-unused CorrectTypoContext enum.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148441 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoconstexpr: converted constant expression handling for enumerator values, case
Richard Smith [Wed, 18 Jan 2012 23:55:52 +0000 (23:55 +0000)]
constexpr: converted constant expression handling for enumerator values, case
values and non-type template arguments of integral and enumeration types.

This change causes some legal C++98 code to no longer compile in C++11 mode, by
enforcing the C++11 rule that narrowing integral conversions are not permitted
in the final implicit conversion sequence for the above cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148439 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoChange the error when a '+=' follows a declaration to suggest a fixit to '=' instead...
Richard Trieu [Wed, 18 Jan 2012 22:54:52 +0000 (22:54 +0000)]
Change the error when a '+=' follows a declaration to suggest a fixit to '=' instead of just suggesting a ';'.

Old error:
plusequaldeclare1.cc:3:8: error: expected ';' at end of declaration
  int x += 6;
       ^
       ;

New error:
plusequaldeclare1.cc:3:9: error: invalid '+=' at end of declaration; did you
      mean '='?
  int x += 6;
        ^~
        =

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148433 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoUse -Wdeprecated-objc-isa-usage for option to issue
Fariborz Jahanian [Wed, 18 Jan 2012 22:18:30 +0000 (22:18 +0000)]
Use  -Wdeprecated-objc-isa-usage for option to issue
deprecated usage of 'isa'. // rdar://8290002

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148430 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoConvert SemaDecl.cpp to pass callback objects to CorrectTypo.
Kaelyn Uhrain [Wed, 18 Jan 2012 21:41:41 +0000 (21:41 +0000)]
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

12 years agoOptimize unqualified/global name lookup in modules by introducing a
Douglas Gregor [Wed, 18 Jan 2012 20:56:22 +0000 (20:56 +0000)]
Optimize unqualified/global name lookup in modules by introducing a
generational scheme for identifiers that avoids searching the hash
tables of a given module more than once for a given
identifier. Previously, loading any new module invalidated all of the
previous lookup results for all identifiers, causing us to perform the
lookups repeatedly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148412 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoRefactor: Pull getImmediateMacroName() out of DiagnosticRenderer and
Anna Zaks [Wed, 18 Jan 2012 20:17:16 +0000 (20:17 +0000)]
Refactor: Pull getImmediateMacroName() out of DiagnosticRenderer and
into Lexer and Preprocessor; making it widely available.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148410 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoobjc: deprecate direct usage of 'isa' of objc objects
Fariborz Jahanian [Wed, 18 Jan 2012 19:08:56 +0000 (19:08 +0000)]
objc: deprecate direct usage of 'isa' of objc objects
in favor of usage of api's intended for.
// rdar://8290002

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148404 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoIn the driver, -fmodules enables modules for C/Objective-C but one
Douglas Gregor [Wed, 18 Jan 2012 15:19:58 +0000 (15:19 +0000)]
In the driver, -fmodules enables modules for C/Objective-C but one
also needs -fcxx-modules to enable modules for C++/Objective-C++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148393 91177308-0d34-0410-b5e6-96231b3b80d8

12 years agoAdd and update tests for character literals
Seth Cantrell [Wed, 18 Jan 2012 12:27:10 +0000 (12:27 +0000)]
Add and update tests for character literals

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148392 91177308-0d34-0410-b5e6-96231b3b80d8