]> granicus.if.org Git - clang/log
clang
13 years agoThis new field was introduced in clang-c in r141277
Douglas Gregor [Wed, 19 Oct 2011 05:47:46 +0000 (05:47 +0000)]
This new field was introduced in clang-c in r141277

Python needs this in its structure definition so it allocates enough
memory. From Anders Waldenborg!

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

13 years agoFix pr9789, assert-on-invalid while instantiating an (invalid) class template with...
David Blaikie [Wed, 19 Oct 2011 05:19:50 +0000 (05:19 +0000)]
Fix pr9789, assert-on-invalid while instantiating an (invalid) class template with a non-final parameter pack. Also improve the warning for non-final parameter packs in this scenario so it only fires once, rather than once for every template parameter after the non-final parameter pack.

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

13 years agoTweak this test to test more directly what we want, and hopefully work around the...
Douglas Gregor [Wed, 19 Oct 2011 04:17:22 +0000 (04:17 +0000)]
Tweak this test to test more directly what we want, and hopefully work around the brokenness of code completion under -fdelayed-template-parsing

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

13 years agoDon't forget to complete the objc interface before asking for information,
Argyrios Kyrtzidis [Wed, 19 Oct 2011 02:25:16 +0000 (02:25 +0000)]
Don't forget to complete the objc interface before asking for information,
otherwise lldb will suffer.

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

13 years agoAdd a -Wc++98-compat warning for friend functions of class templates which would
Richard Smith [Wed, 19 Oct 2011 00:54:10 +0000 (00:54 +0000)]
Add a -Wc++98-compat warning for friend functions of class templates which would
be implicitly instantiated (resulting in a redefinition) in C++98.

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

13 years agoAdd block information for ObjC @catch blocks.
Eric Christopher [Wed, 19 Oct 2011 00:44:01 +0000 (00:44 +0000)]
Add block information for ObjC @catch blocks.

Fixes rdar://10282889

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

13 years agoAdd a new subclass of RunCleanupScopes that also handles creating new
Eric Christopher [Wed, 19 Oct 2011 00:43:52 +0000 (00:43 +0000)]
Add a new subclass of RunCleanupScopes that also handles creating new
lexical blocks for debug info.

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

13 years agoMove static array parameter checks to SemaExpr, per Doug's request
Peter Collingbourne [Wed, 19 Oct 2011 00:16:45 +0000 (00:16 +0000)]
Move static array parameter checks to SemaExpr, per Doug's request

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

13 years ago-Wc++98-compat: warn if a SFINAE substitution in C++11 suppresses an access
Richard Smith [Wed, 19 Oct 2011 00:07:01 +0000 (00:07 +0000)]
-Wc++98-compat: warn if a SFINAE substitution in C++11 suppresses an access
control diagnostic.

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

13 years agoobjc: allow class name qualified with protocols in
Fariborz Jahanian [Tue, 18 Oct 2011 23:13:50 +0000 (23:13 +0000)]
objc: allow class name qualified with protocols in
iboutletcollection attribute. But ignore protocol
list. // rdar://10296078

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

13 years ago[analyzer] Move predecessor into the NodeBuilder context.
Anna Zaks [Tue, 18 Oct 2011 23:06:48 +0000 (23:06 +0000)]
[analyzer] Move predecessor into the NodeBuilder context.

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

13 years ago[analyzer] Make NodeBuilder and Pred node loosely coupled
Anna Zaks [Tue, 18 Oct 2011 23:06:44 +0000 (23:06 +0000)]
[analyzer] Make NodeBuilder and Pred node loosely coupled

NodeBuilder should not assume it's dealing with a single predecessor. Remove predecessor getters. Modify the BranchNodeBuilder to not be responsible for doing auto-transitions (which depend on a predecessor).

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

13 years ago[analyzer] Remove StmtNodeBuilder from CheckerContext
Anna Zaks [Tue, 18 Oct 2011 23:06:38 +0000 (23:06 +0000)]
[analyzer] Remove StmtNodeBuilder from CheckerContext

It now only depends on a generic NodeBuilder instead. As part of this change, make the generic node builder results finalized by default.

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

13 years ago[analyzer] Subclassing StmtBuilder from the NodeBuilder
Anna Zaks [Tue, 18 Oct 2011 23:06:33 +0000 (23:06 +0000)]
[analyzer] Subclassing StmtBuilder from the NodeBuilder

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

13 years ago[analyzer] Remove dead code.
Anna Zaks [Tue, 18 Oct 2011 23:06:29 +0000 (23:06 +0000)]
[analyzer] Remove dead code.
ExprEngineBuilders is not used.

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

13 years ago[analyzer] Remove redundant method + whitespace.
Anna Zaks [Tue, 18 Oct 2011 23:06:25 +0000 (23:06 +0000)]
[analyzer] Remove redundant method + whitespace.

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

13 years ago[analyzer] Modularize builder use in processBranch.
Anna Zaks [Tue, 18 Oct 2011 23:06:21 +0000 (23:06 +0000)]
[analyzer] Modularize builder use in processBranch.

Take advantage of the new builders for branch processing. As part of this change pass generic NodeBuilder (instead of BranchNodeBuilder) to the BranchCondition callback and remove the unused methods form BranchBuilder.

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

13 years ago[analyzer] Pull Pred out of NodeBuilderContext.
Anna Zaks [Tue, 18 Oct 2011 23:06:16 +0000 (23:06 +0000)]
[analyzer] Pull Pred out of NodeBuilderContext.
Each builder will have a different one, so it doesn't make sense to keep it in the context.

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

13 years ago[analyzer] Rely only on NodeBuilder inside CheckerContext.
Anna Zaks [Tue, 18 Oct 2011 23:06:11 +0000 (23:06 +0000)]
[analyzer] Rely only on NodeBuilder inside CheckerContext.

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

13 years ago[analyzer] Remove redundant assignment operator.
Anna Zaks [Tue, 18 Oct 2011 23:06:08 +0000 (23:06 +0000)]
[analyzer] Remove redundant assignment operator.

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

13 years ago[analyzer] NodeBuilder Refactoring: Subclass BranchNodeBuilder from NodeBuilder.
Anna Zaks [Tue, 18 Oct 2011 23:06:04 +0000 (23:06 +0000)]
[analyzer] NodeBuilder Refactoring: Subclass BranchNodeBuilder from NodeBuilder.

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

13 years ago[analyzer] Node Builder refactoring: Introduce a simple Node Builder responsible...
Anna Zaks [Tue, 18 Oct 2011 23:05:58 +0000 (23:05 +0000)]
[analyzer] Node Builder refactoring: Introduce a simple Node Builder responsible for generating the node frontier.

Currently we have a bunch of different node builders which provide some common
functionality but are difficult to refactor. Each builder generates nodes of
different kinds and calculates the frontier nodes, which should be propagated
to the next step (after the builder dies).

Introduce a new NodeBuilder which provides very basic node generation facilities
but takes care of the second problem. The idea is that all the other builders
will eventually use it. Use this builder in CheckerContext instead of
StmtNodeBuilder (the way the frontier is propagated to the StmtBuilder
is a hack and will be removed later on).

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

13 years agoMore metaprogramming with builtin types.
John McCall [Tue, 18 Oct 2011 22:28:37 +0000 (22:28 +0000)]
More metaprogramming with builtin types.

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

13 years ago[libclang] Make sure we do a correct invalid check in clang_getExpansionLocation.
Argyrios Kyrtzidis [Tue, 18 Oct 2011 21:59:54 +0000 (21:59 +0000)]
[libclang] Make sure we do a correct invalid check in clang_getExpansionLocation.

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

13 years agoMinor tweak to test
Douglas Gregor [Tue, 18 Oct 2011 21:43:22 +0000 (21:43 +0000)]
Minor tweak to test

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

13 years ago-Wc++98-compat and -Wc++98-compat-pedantic warnings for Sema, part 2.
Richard Smith [Tue, 18 Oct 2011 21:39:00 +0000 (21:39 +0000)]
-Wc++98-compat and -Wc++98-compat-pedantic warnings for Sema, part 2.

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

13 years agoRemove unused data member
Douglas Gregor [Tue, 18 Oct 2011 21:25:15 +0000 (21:25 +0000)]
Remove unused data member

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

13 years agoProvide result types for code completions that describe built-in
Douglas Gregor [Tue, 18 Oct 2011 21:20:17 +0000 (21:20 +0000)]
Provide result types for code completions that describe built-in
expressions (this, sizeof, etc.).

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

13 years agoAdd a __has_feature check for arc_cf_code_audited.
John McCall [Tue, 18 Oct 2011 21:18:53 +0000 (21:18 +0000)]
Add a __has_feature check for arc_cf_code_audited.

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

13 years agoMacro metaprogramming for builtin types.
John McCall [Tue, 18 Oct 2011 21:02:43 +0000 (21:02 +0000)]
Macro metaprogramming for builtin types.

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

13 years ago-Wc++98-compat and -Wc++98-compat-pedantic warnings for Sema, part 1.
Richard Smith [Tue, 18 Oct 2011 20:49:44 +0000 (20:49 +0000)]
-Wc++98-compat and -Wc++98-compat-pedantic warnings for Sema, part 1.

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

13 years agoFrontend: Support -iframework.
Daniel Dunbar [Tue, 18 Oct 2011 20:40:38 +0000 (20:40 +0000)]
Frontend: Support -iframework.

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

13 years agoSimplify RecordDeclCXX::setBases slightly. No functional change.
Richard Smith [Tue, 18 Oct 2011 20:08:55 +0000 (20:08 +0000)]
Simplify RecordDeclCXX::setBases slightly. No functional change.

Add test that a variadic base list which expands to 0 bases doesn't make the
class a non-aggregate. This test passed before the change, too.

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

13 years agoobjc: more changes in use of IBOutletCollection attribute.
Fariborz Jahanian [Tue, 18 Oct 2011 19:54:31 +0000 (19:54 +0000)]
objc: more changes in use of IBOutletCollection attribute.
'Class' is disallowed as argument.  If the argument is missing,
NSObject is assumed. // rdar://10296078

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

13 years ago[arcmt] Rewrite attributes in extensions as well. rdar://9992142
Argyrios Kyrtzidis [Tue, 18 Oct 2011 19:49:19 +0000 (19:49 +0000)]
[arcmt] Rewrite attributes in extensions as well. rdar://9992142

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

13 years agoSet the objc "property attributes as written" for extension properties as well.
Argyrios Kyrtzidis [Tue, 18 Oct 2011 19:49:16 +0000 (19:49 +0000)]
Set the objc "property attributes as written" for extension properties as well.

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

13 years agoIn C++11, a class's members are allowed to be nominated as friends.
Richard Smith [Tue, 18 Oct 2011 18:33:57 +0000 (18:33 +0000)]
In C++11, a class's members are allowed to be nominated as friends.

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

13 years ago[driver] Make the driver to link the simulator arclite lib when passing -mios-simulat...
Argyrios Kyrtzidis [Tue, 18 Oct 2011 17:40:15 +0000 (17:40 +0000)]
[driver] Make the driver to link the simulator arclite lib when passing -mios-simulator-version-min.
rdar://10218700

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

13 years agoobjc: diagnose invalid argument to an
Fariborz Jahanian [Tue, 18 Oct 2011 17:11:10 +0000 (17:11 +0000)]
objc: diagnose invalid argument to an
iboutletcollection attribute intead of crashing.
// rdar://10296078

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

13 years ago[libclang] Since an objc extension semantically continues the interface of the class
Argyrios Kyrtzidis [Tue, 18 Oct 2011 16:50:06 +0000 (16:50 +0000)]
[libclang] Since an objc extension semantically continues the interface of the class
don't use unique USRs for them, otherwise we fail to associate @implementation methods
with the methods in extensions.

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

13 years agoMake it possible to compute the type of 'this' without capturing
Douglas Gregor [Tue, 18 Oct 2011 16:47:30 +0000 (16:47 +0000)]
Make it possible to compute the type of 'this' without capturing
it. Refactoring to be used in a moment.

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

13 years agoAdd code completions for C++0x expressions
Douglas Gregor [Tue, 18 Oct 2011 16:29:03 +0000 (16:29 +0000)]
Add code completions for C++0x expressions

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

13 years ago[libclang] Index implicit property references.
Argyrios Kyrtzidis [Tue, 18 Oct 2011 15:50:50 +0000 (15:50 +0000)]
[libclang] Index implicit property references.

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

13 years ago[libclang] When printing the diagnostic print it with a new line.
Argyrios Kyrtzidis [Tue, 18 Oct 2011 15:13:14 +0000 (15:13 +0000)]
[libclang] When printing the diagnostic print it with a new line.

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

13 years ago[libclang] Index method references.
Argyrios Kyrtzidis [Tue, 18 Oct 2011 15:13:11 +0000 (15:13 +0000)]
[libclang] Index method references.

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

13 years agoUse llvm::Triple's methods to parse FreeBSD version numbers.
Benjamin Kramer [Tue, 18 Oct 2011 10:10:08 +0000 (10:10 +0000)]
Use llvm::Triple's methods to parse FreeBSD version numbers.

Who could've thought that FreeBSD would ever reach version 10!
Patch from Dimitry Andric.

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

13 years agoAnother attempt at fixing format-strings-fixit.c.
Hans Wennborg [Tue, 18 Oct 2011 09:30:37 +0000 (09:30 +0000)]
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

13 years agoDisable the ssize_t test in format-strings-fixit.c.
Hans Wennborg [Tue, 18 Oct 2011 08:58:16 +0000 (08:58 +0000)]
Disable the ssize_t test in format-strings-fixit.c.

Turns out this part of the test from r142342 wasn't portable.
The errors on the bots look like this:

E:\bb-win7\cmake-clang-i686-msys\build\tools\clang\test\Sema\Output\format-strings-fixit.c.tmp:58:13: error: conversion specifies type 'unsigned int' but the argument has type 'ssize_t' (aka 'long')
  printf("%zd", (ssize_t) 42);
          ~~^   ~~~~~~~~~~~~
          %zd

Obviously we can't typedef ssize_t to someting that doesn't have the same size as size_t and expect it to work.

But it's also weird that the format string "%zd" gets interpreted as "unsigned int" when it should clearly be signed.

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

13 years agoSuggest %zu for size_t args to printf.
Hans Wennborg [Tue, 18 Oct 2011 08:10:06 +0000 (08:10 +0000)]
Suggest %zu for size_t args to printf.

For PR11152. Make PrintSpecifier::fixType() suggest "%zu" for size_t, etc.
rather than looking at the underlying type and suggesting "%llu" or other
platform-specific length modifiers. Applies to C99 and C++11.

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

13 years agoSwitch to the C++11 warning flags in tests.
David Blaikie [Tue, 18 Oct 2011 05:54:07 +0000 (05:54 +0000)]
Switch to the C++11 warning flags in tests.
Patch by Ahmed Charles!

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

13 years agoUpdate documentation to use "C++11" instead of "C++0x"
David Blaikie [Tue, 18 Oct 2011 05:49:30 +0000 (05:49 +0000)]
Update documentation to use "C++11" instead of "C++0x"

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

13 years agoDon't format the code completion for parameters of block literal
Douglas Gregor [Tue, 18 Oct 2011 04:23:19 +0000 (04:23 +0000)]
Don't format the code completion for parameters of block literal
arguments as block literal arguments; the block literal argument code
completion should only go one level deep. Fixes <rdar://problem/10291294>.

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

13 years agoAdd -Wc++11-compat warning for an inline specifier on an explicit instantiation.
Richard Smith [Tue, 18 Oct 2011 03:44:03 +0000 (03:44 +0000)]
Add -Wc++11-compat warning for an inline specifier on an explicit instantiation.

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

13 years agoWhen transforming the arguments for a C++ "new" expression, make sure
Douglas Gregor [Tue, 18 Oct 2011 02:43:19 +0000 (02:43 +0000)]
When transforming the arguments for a C++ "new" expression, make sure
to drop the implicitly-generated value initialization expression used
for initializing scalars. Fixes <rdar://problem/10283928>.

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

13 years agoRefactor the checking for explicit template instantiations being performed in
Richard Smith [Tue, 18 Oct 2011 02:28:33 +0000 (02:28 +0000)]
Refactor the checking for explicit template instantiations being performed in
the right namespace in C++11 mode. Teach the code to prefer the 'must be in
precisely this namespace' diagnostic whenever that's true, and fix a defect
which resulted in the -Wc++11-compat warning in C++98 mode sometimes being
omitted.

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

13 years agoArgyrios says this change is required for safety under PTH.
John McCall [Tue, 18 Oct 2011 01:36:41 +0000 (01:36 +0000)]
Argyrios says this change is required for safety under PTH.
Me, I believe him.

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

13 years agoRevert accidental commit.
Eli Friedman [Tue, 18 Oct 2011 01:18:41 +0000 (01:18 +0000)]
Revert accidental commit.

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

13 years agoRewrite parts of MS ABI C++ layout. Based on work by r4start; I ended up doing this...
Eli Friedman [Tue, 18 Oct 2011 00:55:28 +0000 (00:55 +0000)]
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

13 years agoFix several bugs with #pragma clang arc_cf_code_audited and macros.
John McCall [Tue, 18 Oct 2011 00:44:04 +0000 (00:44 +0000)]
Fix several bugs with #pragma clang arc_cf_code_audited and macros.

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

13 years agoRevert r142311, -mios-simulator-version-min does not work correctly.
Argyrios Kyrtzidis [Tue, 18 Oct 2011 00:22:49 +0000 (00:22 +0000)]
Revert r142311, -mios-simulator-version-min does not work correctly.

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

13 years agoIn hasPlaceholderType(Kind) and isSpecificPlaceholderType(Kind), assert
John McCall [Mon, 17 Oct 2011 23:48:15 +0000 (23:48 +0000)]
In hasPlaceholderType(Kind) and isSpecificPlaceholderType(Kind), assert
that the parameter is actually a placeholder type kind.

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

13 years agoRemove the hack where we sniff the __IPHONE_OS_VERSION_MIN_REQUIRED define.
Argyrios Kyrtzidis [Mon, 17 Oct 2011 23:41:26 +0000 (23:41 +0000)]
Remove the hack where we sniff the __IPHONE_OS_VERSION_MIN_REQUIRED define.

We can use -mios-simulator-version-min now. rdar://10218700

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

13 years agoPerform lvalue-to-rvalue conversions on __builtin_offsetof array argument index
Richard Smith [Mon, 17 Oct 2011 23:29:39 +0000 (23:29 +0000)]
Perform lvalue-to-rvalue conversions on __builtin_offsetof array argument index
before typechecking, as suggested by John.

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

13 years ago[arcmt] In ARC default for properties is 'strong' so just remove a 'retain' if possible,
Argyrios Kyrtzidis [Mon, 17 Oct 2011 23:14:16 +0000 (23:14 +0000)]
[arcmt] In ARC default for properties is 'strong' so just remove a 'retain' if possible,
instead of changing it to 'strong'. rdar://9984862.

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

13 years agoAdd -Wc++98-compat warnings for uses of the new keywords 'alignof', 'char16_t',
Richard Smith [Mon, 17 Oct 2011 23:06:20 +0000 (23:06 +0000)]
Add -Wc++98-compat warnings for uses of the new keywords 'alignof', 'char16_t',
'char32_t', 'constexpr', 'decltype', 'noexcept', 'nullptr' and 'static_assert'.

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

13 years agoWire up support for the controlling the extended dwarf .file directive. With
Nick Lewycky [Mon, 17 Oct 2011 23:05:52 +0000 (23:05 +0000)]
Wire up support for the controlling the extended dwarf .file directive. With
r142300 but not this patch, clang -S may emit .s files that assemblers other
than llvm-mc can't parse.

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

13 years agoSilence a -Wc++0x-narrowing warning
Matt Beaumont-Gay [Mon, 17 Oct 2011 22:19:09 +0000 (22:19 +0000)]
Silence a -Wc++0x-narrowing warning

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

13 years agoImplement -static-libstdc++ for linux.
Rafael Espindola [Mon, 17 Oct 2011 22:14:51 +0000 (22:14 +0000)]
Implement -static-libstdc++ for linux.

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

13 years agoTry fixing MSVC compiler errors.
Argyrios Kyrtzidis [Mon, 17 Oct 2011 22:12:24 +0000 (22:12 +0000)]
Try fixing MSVC compiler errors.

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

13 years agoAdd missing newline.
Eli Friedman [Mon, 17 Oct 2011 21:48:31 +0000 (21:48 +0000)]
Add missing newline.

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

13 years agoMove about 20 random diagnostics under -W flags. Patch by Ahmed Charles!
Ted Kremenek [Mon, 17 Oct 2011 21:47:53 +0000 (21:47 +0000)]
Move about 20 random diagnostics under -W flags.  Patch by Ahmed Charles!

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

13 years agoInitial implementation of __atomic_is_lock_free. The input is the size of an atomic...
Eli Friedman [Mon, 17 Oct 2011 21:44:23 +0000 (21:44 +0000)]
Initial implementation of __atomic_is_lock_free.  The input is the size of an atomic type rather than an atomic type itself just to save some implementation pain; I can change that if it seems worthwhile.

I think this is the last hook needed for <atomic> besides defines for ATOMIC_CHAR_LOCK_FREE and friends.

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

13 years agoImplement -static-libgcc on linux and refactor the code responsible for adding
Rafael Espindola [Mon, 17 Oct 2011 21:39:04 +0000 (21:39 +0000)]
Implement -static-libgcc on linux and refactor the code responsible for adding
libgcc to the link line into a helper function.

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

13 years agoSubstitute for arguments in method calls -- functionality
DeLesley Hutchins [Mon, 17 Oct 2011 21:38:02 +0000 (21:38 +0000)]
Substitute for arguments in method calls -- functionality

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

13 years agoSubstitute for arguments in method calls -- refactoring
DeLesley Hutchins [Mon, 17 Oct 2011 21:33:35 +0000 (21:33 +0000)]
Substitute for arguments in method calls -- refactoring

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

13 years agoRefactor __attribute__ parsing, and add a diagnostic if the r_paren at the end
Richard Smith [Mon, 17 Oct 2011 21:20:17 +0000 (21:20 +0000)]
Refactor __attribute__ parsing, and add a diagnostic if the r_paren at the end
of an attrib is missing. gcc does not allow the closing parenthesis to be omitted.

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

13 years agoCode completion chunks are pod-like.
Benjamin Kramer [Mon, 17 Oct 2011 21:17:53 +0000 (21:17 +0000)]
Code completion chunks are pod-like.

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

13 years agoThe comparison of two vectors should return a signed result. hasIntegerRepresentation...
Tanya Lattner [Mon, 17 Oct 2011 21:00:38 +0000 (21:00 +0000)]
The comparison of two vectors should return a signed result. hasIntegerRepresentation() used to always return false for vectors, but since it was changed, it also
changed the return type of a compare of two unsigned vectors to be unsigned. This patch removes the check for hasIntegerRepresentation since its not needed and returns the appropriate signed type.
I added a new test case and updated exisiting test cases that assumed an unsigned result.

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

13 years agoobj-c++: Fix a IRGen crash when getter is a reference type.
Fariborz Jahanian [Mon, 17 Oct 2011 21:00:22 +0000 (21:00 +0000)]
obj-c++: Fix a IRGen crash when getter is a reference type.
Fix is in Sema. // rdar://10153365

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

13 years agoAdd missing case to switch.
Eli Friedman [Mon, 17 Oct 2011 20:46:28 +0000 (20:46 +0000)]
Add missing case to switch.

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

13 years agoStrip qualifiers off the type of an implicit property defined by
John McCall [Mon, 17 Oct 2011 20:05:43 +0000 (20:05 +0000)]
Strip qualifiers off the type of an implicit property defined by
only a setter.

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

13 years ago[libclang] Introduce a new high level API for indexing clients that assumes
Argyrios Kyrtzidis [Mon, 17 Oct 2011 19:48:19 +0000 (19:48 +0000)]
[libclang] Introduce a new high level API for indexing clients that assumes
more of the work involved in indexing a translation unit and simplifies client
implementations.

Only C/ObjC for now, C++ (and comments) to come.

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

13 years agoIntroduce ASTConsumer::HandleTopLevelDeclInObjCContainer which accepts
Argyrios Kyrtzidis [Mon, 17 Oct 2011 19:48:13 +0000 (19:48 +0000)]
Introduce ASTConsumer::HandleTopLevelDeclInObjCContainer which accepts
top-level declarations that occurred inside an ObjC container.

This is useful to keep track of such decls otherwise when e.g. a function
is declared inside an objc interface, it is not passed to HandleTopLevelDecl
and it is not inside the DeclContext of the interface that is returned.

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

13 years agoHave ObjCMethodDecl::getCanonicalDecl take into account redeclared methods.
Argyrios Kyrtzidis [Mon, 17 Oct 2011 19:48:09 +0000 (19:48 +0000)]
Have ObjCMethodDecl::getCanonicalDecl take into account redeclared methods.

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

13 years agoKeep track when a ObjC interface/protocol was initially created as a forward reference.
Argyrios Kyrtzidis [Mon, 17 Oct 2011 19:48:06 +0000 (19:48 +0000)]
Keep track when a ObjC interface/protocol was initially created as a forward reference.

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

13 years agoControlling macros are identifiers, not declarations.
Douglas Gregor [Mon, 17 Oct 2011 18:53:12 +0000 (18:53 +0000)]
Controlling macros are identifiers, not declarations.

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

13 years agoTeach the ARC compiler to not require __bridge casts when
John McCall [Mon, 17 Oct 2011 18:40:02 +0000 (18:40 +0000)]
Teach the ARC compiler to not require __bridge casts when
passing/receiving CF objects at +0 to/from Objective-C methods
or audited C functions.

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

13 years agoAdd a new placeholder type to represent "unbridged"
John McCall [Mon, 17 Oct 2011 18:09:15 +0000 (18:09 +0000)]
Add a new placeholder type to represent "unbridged"
casts in ARC.

No semantic analysis yet.

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

13 years agoAdd a helper function for determining whether an expression
John McCall [Mon, 17 Oct 2011 17:42:19 +0000 (17:42 +0000)]
Add a helper function for determining whether an expression
has placeholder type.

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

13 years agoWhen we end up having to parse the initializer of a C++ member early
Douglas Gregor [Mon, 17 Oct 2011 17:09:53 +0000 (17:09 +0000)]
When we end up having to parse the initializer of a C++ member early
in -fms-extensions mode, make sure we actually use that initializer
after having handled the declaration. Fixes PR11150.

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

13 years agoRevert r142142: "Make a C-style cast a const-cast, to suppress a GCC warning."
Sebastian Redl [Mon, 17 Oct 2011 16:53:50 +0000 (16:53 +0000)]
Revert r142142: "Make a C-style cast a const-cast, to suppress a GCC warning."
Richard already fixed the underlying issue, so the cast was superfluous.

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

13 years agoFor modules, all macros that aren't include guards are implicitly
Douglas Gregor [Mon, 17 Oct 2011 15:32:29 +0000 (15:32 +0000)]
For modules, all macros that aren't include guards are implicitly
public. Add a __private_macro__ directive to hide a macro, similar to
the __module_private__ declaration specifier.

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

13 years agoWhen building a module, use the macro definitions on the command line
Douglas Gregor [Mon, 17 Oct 2011 14:55:37 +0000 (14:55 +0000)]
When building a module, use the macro definitions on the command line
as part of the hash rather than ignoring them. This means we'll end up
building more module variants (overall), but it allows configuration
macros such as NDEBUG to work so long as they're specified via command
line. More to come in this space.

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

13 years agoFixed merge-mistake where ActOnAccessSpecifier was called twice for every access...
Erik Verbruggen [Mon, 17 Oct 2011 09:54:52 +0000 (09:54 +0000)]
Fixed merge-mistake where ActOnAccessSpecifier was called twice for every access specifier. The testcase has been changed to catch this too.

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

13 years agoPerform an lvalue-to-rvalue conversion on an array index in a __builtin_offsetof...
Richard Smith [Mon, 17 Oct 2011 05:48:07 +0000 (05:48 +0000)]
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

13 years agoSlightly simplify a constant expression check. No functional change.
Richard Smith [Sun, 16 Oct 2011 23:01:09 +0000 (23:01 +0000)]
Slightly simplify a constant expression check. No functional change.

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

13 years agoAdd a testcase for r142121 based on an idea from Richard Smith. Thanks!
Chandler Carruth [Sun, 16 Oct 2011 21:33:06 +0000 (21:33 +0000)]
Add a testcase for r142121 based on an idea from Richard Smith. Thanks!

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

13 years agoSplit apart the state accumulated during constant expression evaluation and the
Richard Smith [Sun, 16 Oct 2011 21:26:27 +0000 (21:26 +0000)]
Split apart the state accumulated during constant expression evaluation and the
end result. Use this split to propagate state information and diagnostics
through more of constant expression evaluation.

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

13 years agoAdd sema checks for calls to functions taking static array parameters
Peter Collingbourne [Sun, 16 Oct 2011 21:17:32 +0000 (21:17 +0000)]
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

13 years agoImplement overload resolution from init lists for scalar parameter types.
Sebastian Redl [Sun, 16 Oct 2011 18:19:34 +0000 (18:19 +0000)]
Implement overload resolution from init lists for scalar parameter types.

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