]> granicus.if.org Git - clang/log
clang
11 years agoRun clang-format on lib/Format code after r184894. No other changes.
Nico Weber [Wed, 26 Jun 2013 00:30:14 +0000 (00:30 +0000)]
Run clang-format on lib/Format code after r184894. No other changes.

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

11 years agoFormatter: Don't put a space after parameter-naming block comments.
Nico Weber [Wed, 26 Jun 2013 00:15:19 +0000 (00:15 +0000)]
Formatter: Don't put a space after parameter-naming block comments.

Before: f(a, b, /*doFoo=*/ false);
Now: f(a, b, /*doFoo=*/false);

This style is a lot more common:
$ ack -H '=\*\/\w' lib | wc -l
    1281
$ ack -H '=\*\/ \w' lib | wc -l
      70

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

11 years agoDon't check for triviality on fields of templated records. We can't know the
Nick Lewycky [Tue, 25 Jun 2013 23:22:23 +0000 (23:22 +0000)]
Don't check for triviality on fields of templated records. We can't know the
answer until after instantiation. Fixes PR16061!

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

11 years agoImplement DR136
David Majnemer [Tue, 25 Jun 2013 23:09:30 +0000 (23:09 +0000)]
Implement DR136

Friend declarations that specify a default argument must be a definition
and the only declaration in the translation unit.

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

11 years agoMake this test properly test both things it's trying to test.
Richard Smith [Tue, 25 Jun 2013 22:37:05 +0000 (22:37 +0000)]
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

11 years agoMissing test update from r184884.
Richard Smith [Tue, 25 Jun 2013 22:22:42 +0000 (22:22 +0000)]
Missing test update from r184884.

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

11 years agoPR8302: Check for shadowing a template parameter when declaring a template
Richard Smith [Tue, 25 Jun 2013 22:21:36 +0000 (22:21 +0000)]
PR8302: Check for shadowing a template parameter when declaring a template
template parameter.

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

11 years agoDon't try to get the layout of an invalid decl in getDeclAlign.
Matt Beaumont-Gay [Tue, 25 Jun 2013 22:19:15 +0000 (22:19 +0000)]
Don't try to get the layout of an invalid decl in getDeclAlign.

When the decl that we're getting alignment for is a FieldDecl, and the field's
parent record is invalid, skip the actual field alignment calculation (and
return 1-byte alignment in the general case).

Also, assert in in getASTRecordLayout that the decl is valid. This was
inspired by PR16292; see also r184581 and r184751.

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

11 years agoImplement DR21
David Majnemer [Tue, 25 Jun 2013 22:08:55 +0000 (22:08 +0000)]
Implement DR21

A default template-argument shall not be specified in a friend template
declaration.

Interestingly, we properly handled default template arguments on friend
class members but not on just friend classes.

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

11 years agoFix null pointer dereference if we redeclare an unprototyped function. Patch by
Richard Smith [Tue, 25 Jun 2013 20:34:17 +0000 (20:34 +0000)]
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

11 years agoFix a comment.
Nico Weber [Tue, 25 Jun 2013 19:25:12 +0000 (19:25 +0000)]
Fix a comment.

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

11 years agoMore of N3652: don't add an implicit 'const' to 'constexpr' member functions when...
Richard Smith [Tue, 25 Jun 2013 18:46:26 +0000 (18:46 +0000)]
More of N3652: don't add an implicit 'const' to 'constexpr' member functions when checking for overloads in C++1y.

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

11 years agoObjective-C: Warn when IBOutletCollection property
Fariborz Jahanian [Tue, 25 Jun 2013 17:34:50 +0000 (17:34 +0000)]
Objective-C: Warn when IBOutletCollection property
is declared to have 'assign' attribute.
// rdar://14212998

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

11 years agoRemove misplaced comment
Eli Bendersky [Tue, 25 Jun 2013 17:07:56 +0000 (17:07 +0000)]
Remove misplaced comment

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

11 years agoIn tooling, reenable freeing of datastructures in codegen, just as we do for
Nick Lewycky [Tue, 25 Jun 2013 17:01:21 +0000 (17:01 +0000)]
In tooling, reenable freeing of datastructures in codegen, just as we do for
the frontend. We don't want to respect the -disable-free flag here.

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

11 years agoUse simpler version of llvm::sys::fs::exists.
Rafael Espindola [Tue, 25 Jun 2013 15:14:22 +0000 (15:14 +0000)]
Use simpler version of llvm::sys::fs::exists.

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

11 years agoDon't use PathV1.h in Tools.cpp.
Rafael Espindola [Tue, 25 Jun 2013 15:03:59 +0000 (15:03 +0000)]
Don't use PathV1.h in Tools.cpp.

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

11 years agoUse the simpler version of llvm::sys::fs::exists.
Rafael Espindola [Tue, 25 Jun 2013 14:48:00 +0000 (14:48 +0000)]
Use the simpler version of llvm::sys::fs::exists.

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

11 years agoUse the new llvm::sys::EnvPathSeparator.
Rafael Espindola [Tue, 25 Jun 2013 14:29:51 +0000 (14:29 +0000)]
Use the new llvm::sys::EnvPathSeparator.

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

11 years agoFix a couple of PPC predefined macros that I spotted while driving by
Chandler Carruth [Tue, 25 Jun 2013 11:13:47 +0000 (11:13 +0000)]
Fix a couple of PPC predefined macros that I spotted while driving by
this code. These aren't technically standard predefines for the platform
but apparantly lots of folks use them as they show up within LLVM's own
codebase. ;] This may even fix some self host issues w/ the JIT!!!

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

11 years agoAdd r184803 back now that the bug in unique_file has been fixed.
Rafael Espindola [Tue, 25 Jun 2013 04:26:55 +0000 (04:26 +0000)]
Add r184803 back now that the bug in unique_file has been fixed.

Original message:

Use the new PathV2 instead of implementing the logic in clang.

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

11 years agoRevert "Use the new PathV2 instead of implementing the logic in clang."
Rafael Espindola [Tue, 25 Jun 2013 02:35:32 +0000 (02:35 +0000)]
Revert "Use the new PathV2 instead of implementing the logic in clang."

This reverts commit 184803 while I debug the failures on the bots.

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

11 years agoRevert r184787: "Added arm_neon intrinsic tests."
Chandler Carruth [Tue, 25 Jun 2013 02:18:39 +0000 (02:18 +0000)]
Revert r184787: "Added arm_neon intrinsic tests."

This test doesn't actually pass when run with llvm-lit for me or in
a bot that actually always tries to run it.

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

11 years ago[analyzer] Handle zeroing CXXConstructExprs.
Jordan Rose [Tue, 25 Jun 2013 01:56:08 +0000 (01:56 +0000)]
[analyzer] Handle zeroing CXXConstructExprs.

Re-apply r184511, reverted in r184561, with the trivial default constructor
fast path removed -- it turned out not to be necessary here.

Certain expressions can cause a constructor invocation to zero-initialize
its object even if the constructor itself does no initialization. The
analyzer now handles that before evaluating the call to the constructor,
using the same "default binding" mechanism that calloc() uses, rather
than simply ignoring the zero-initialization flag.

<rdar://problem/14212563>

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

11 years ago[analyzer] Don't initialize virtual base classes more than once.
Jordan Rose [Tue, 25 Jun 2013 01:55:59 +0000 (01:55 +0000)]
[analyzer] Don't initialize virtual base classes more than once.

In order to make sure virtual base classes are always initialized once,
the AST contains initializers for the base class in /all/ of its
descendents, not just the immediate descendents. However, at runtime,
the most-derived object is responsible for initializing all the virtual
base classes; all the other initializers will be ignored.

The analyzer now checks to see if it's being called from another base
constructor, and if so does not perform virtual base initialization.

<rdar://problem/14236851>

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

11 years agoFix regression from r184810.
Eli Friedman [Tue, 25 Jun 2013 01:55:41 +0000 (01:55 +0000)]
Fix regression from r184810.

Specifically, CallExpr::getCalleeDecl() can return null, so make sure to
handle that correctly.

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

11 years agoMake -vectorize-... proper cc1 flags instead of abusing -backend-option. Fixes
Nick Lewycky [Tue, 25 Jun 2013 01:49:44 +0000 (01:49 +0000)]
Make -vectorize-... proper cc1 flags instead of abusing -backend-option. Fixes
usage of clang as a library.

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

11 years agoFix deserializing of class template partial specializations. Assign sequence
Richard Smith [Tue, 25 Jun 2013 01:25:15 +0000 (01:25 +0000)]
Fix deserializing of class template partial specializations. Assign sequence
numbers as we deserialize class template partial specializations. We can't
assume that the old sequence numbers will work.

The sequence numbers are still deterministic, but are now a lot less
predictable for class template partial specializations in modules/PCH.

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

11 years agoFix noexcept for delete expressions.
Eli Friedman [Tue, 25 Jun 2013 01:24:22 +0000 (01:24 +0000)]
Fix noexcept for delete expressions.

Using "delete" on a pointer to an incomplete type can't throw.
While I'm here, clean up the signature of the canCalleeThrow() helper.

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

11 years agoRemove PathV1.h from Driver.cpp.
Rafael Espindola [Tue, 25 Jun 2013 01:11:59 +0000 (01:11 +0000)]
Remove PathV1.h from Driver.cpp.

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

11 years agoFormatter/ObjC: Correctly format casts in objc message send expressions.
Nico Weber [Tue, 25 Jun 2013 00:55:57 +0000 (00:55 +0000)]
Formatter/ObjC: Correctly format casts in objc message send expressions.

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

11 years agoUse the new PathV2 instead of implementing the logic in clang.
Rafael Espindola [Tue, 25 Jun 2013 00:55:28 +0000 (00:55 +0000)]
Use the new PathV2 instead of implementing the logic in clang.

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

11 years agoDelete a couple dead checks.
Eli Friedman [Tue, 25 Jun 2013 00:46:32 +0000 (00:46 +0000)]
Delete a couple dead checks.

Use castAs<> where appropriate. Don't check conditionals which are
always true. Delete a bit of dead code. Reindent a bunch of code which
is no longer guarded by an if statement.

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

11 years agoFormatter/Objc: Add a test that checks that @import is formatted correctly.
Nico Weber [Tue, 25 Jun 2013 00:25:40 +0000 (00:25 +0000)]
Formatter/Objc: Add a test that checks that @import is formatted correctly.

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

11 years agoDelete dead code.
Eli Friedman [Tue, 25 Jun 2013 00:25:19 +0000 (00:25 +0000)]
Delete dead code.

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

11 years agoReorder builds based by ordering.
Eric Christopher [Tue, 25 Jun 2013 00:21:29 +0000 (00:21 +0000)]
Reorder builds based by ordering.

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

11 years agoCheck for matching template-parameter-lists when merging template declarations.
Richard Smith [Mon, 24 Jun 2013 22:51:00 +0000 (22:51 +0000)]
Check for matching template-parameter-lists when merging template declarations.

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

11 years agoAccept both / and \\ to fix the windows bots.
Rafael Espindola [Mon, 24 Jun 2013 22:07:15 +0000 (22:07 +0000)]
Accept both / and \\ to fix the windows bots.

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

11 years agoTweak -Wdeprecated-objc-pointer-introspection to have a subgroup for results of using...
Ted Kremenek [Mon, 24 Jun 2013 21:35:39 +0000 (21:35 +0000)]
Tweak -Wdeprecated-objc-pointer-introspection to have a subgroup for results of using -performSelectorXXX.

-performSelector: and friends return a value that is boxed as an Objective-C
pointer.  Sometimes it is an Objective-C pointer, sometimes it isn't.
Some clients may wish to silence this warning based on calling
this method.

Fixes <rdar://problem/14147304>

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

11 years agoAdded arm_neon intrinsic tests.
Michael Gottesman [Mon, 24 Jun 2013 21:25:42 +0000 (21:25 +0000)]
Added arm_neon intrinsic tests.

This is a large test and thus it will only run if you pass in --param
run_long_tests=trueto LIT. This is intended so that this test can run on
buildbots and not when one runs make check.

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

11 years ago[NeonIntrinsicTestEmitter] vld1/vst1 do not require the :64 hint.
Michael Gottesman [Mon, 24 Jun 2013 21:25:39 +0000 (21:25 +0000)]
[NeonIntrinsicTestEmitter] vld1/vst1 do not require the :64 hint.

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

11 years ago[NeonIntrinsicTestEmitter] Fix incorrect FileCheck pattern where we were expecting...
Michael Gottesman [Mon, 24 Jun 2013 21:25:37 +0000 (21:25 +0000)]
[NeonIntrinsicTestEmitter] Fix incorrect FileCheck pattern where we were expecting a ',' prefix to alignment hints.

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

11 years ago[NeonIntrinsicTestEmitter] Add requirement to arm neon intrinsic tests for the featur...
Michael Gottesman [Mon, 24 Jun 2013 21:25:34 +0000 (21:25 +0000)]
[NeonIntrinsicTestEmitter] Add requirement to arm neon intrinsic tests for the feature long_tests.

This will prevent the tests from running on normal make check. You will need to
actually pass in --param run_long_tests=true to LIT in order to run these.

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

11 years ago[libclang/codecompletion] Make sure the top-level decl hash takes into account Import...
Argyrios Kyrtzidis [Mon, 24 Jun 2013 21:19:12 +0000 (21:19 +0000)]
[libclang/codecompletion] Make sure the top-level decl hash takes into account ImportDecls.

The top-level hash is used to determine if we need to update the global code-completion results.
ImportDecls did not affect the hash so a newly introduced ImportDecl would not trigger an update of the global results.

rdar://14202797

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

11 years agoChange mangling of objects inside block literals.
Eli Friedman [Mon, 24 Jun 2013 20:24:19 +0000 (20:24 +0000)]
Change mangling of objects inside block literals.

This changes the mangling of local static variables/etc. inside blocks
to do something simple and sane.  This avoids depending on the way we mangle
blocks, which isn't really appropriate here.

John, please take a look at this to make sure the mangling I chose is sane.

Fixes <rdar://problem/14074423>.

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

11 years agoFix "funciton" typo from r184763
Reid Kleckner [Mon, 24 Jun 2013 20:08:40 +0000 (20:08 +0000)]
Fix "funciton" typo from r184763

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

11 years ago[ms-cxxabi] Use sugared types in the mangler instead of canonical types
Reid Kleckner [Mon, 24 Jun 2013 19:21:52 +0000 (19:21 +0000)]
[ms-cxxabi] Use sugared types in the mangler instead of canonical types

At this point, it's clear that the MSVC mangler uses the type-as-written
instead of the canonical type, so this should bring us closer to MSVC.
The main thrust of this change is to fix the way we mangle decayed array
parameters of function pointer parameters.  With a DecayedType sugar
node, this code can now be much simpler.

Fixes PR16096.

This also fixes a separate issue that Richard spotted in review.
Because separate declarations of the same entity can be spelled and
mangled differently, MSVC always mangles the earliest declaration in an
attempt to avoid link errors.  Clang now does the same.

Reviewers: rsmith

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

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

11 years ago[arcmt/driver] For the -ccc-arcmt-* flags, claim them when -fno-objc-arc is passed...
Argyrios Kyrtzidis [Mon, 24 Jun 2013 19:01:18 +0000 (19:01 +0000)]
[arcmt/driver] For the -ccc-arcmt-* flags, claim them when -fno-objc-arc is passed to avoid the
"argument unused during compilation" warning.

rdar://14240566

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

11 years agoUse getAs<> where appropriate on QualTypes instead of using dyn_cast.
Eli Friedman [Mon, 24 Jun 2013 18:47:11 +0000 (18:47 +0000)]
Use getAs<> where appropriate on QualTypes instead of using dyn_cast.

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

11 years agoConvert some uses of llvm::sys::Path.
Rafael Espindola [Mon, 24 Jun 2013 18:33:43 +0000 (18:33 +0000)]
Convert some uses of llvm::sys::Path.

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

11 years agoUse the simpler version of llvm::sys::fs::exists.
Rafael Espindola [Mon, 24 Jun 2013 18:19:15 +0000 (18:19 +0000)]
Use the simpler version of llvm::sys::fs::exists.

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

11 years ago[analyzer] Add a debug checker that prints Exploded Graph
Anna Zaks [Mon, 24 Jun 2013 18:12:12 +0000 (18:12 +0000)]
[analyzer] Add a debug checker that prints Exploded Graph
Add a debug checker that is useful to understand how the ExplodedGraph is
built; it can be triggered using the following command:

 clang -cc1 -analyze -analyzer-checker=debug.ViewExplodedGraph my_program.c

A patch by Béatrice Creusillet!

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

11 years agoConvert last use of PathV1.h in Compilation.cpp
Rafael Espindola [Mon, 24 Jun 2013 17:59:44 +0000 (17:59 +0000)]
Convert last use of PathV1.h in Compilation.cpp

The way we decide which file to remove is fairly odd. I took a quick look at
maybe changing that, but it would be a more work than I want to put at this
right now, so I left pair of FIXMEs.

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

11 years ago[AST] Introduce a new DecayedType sugar node
Reid Kleckner [Mon, 24 Jun 2013 17:51:48 +0000 (17:51 +0000)]
[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

11 years agoAdd the global namespace (the "::" namespace specifier) to the list of
Kaelyn Uhrain [Mon, 24 Jun 2013 17:49:03 +0000 (17:49 +0000)]
Add the global namespace (the "::" namespace specifier) to the list of
namespaces to try for potential typo corrections.

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

11 years agoCheck the canonical parameter type with getAs<>() in a static checker
Reid Kleckner [Mon, 24 Jun 2013 16:56:16 +0000 (16:56 +0000)]
Check the canonical parameter type with getAs<>() in a static checker

This will prevent breakage when I introduce the DecayedType sugar node.

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

11 years agoConvert a use of PathV1.h
Rafael Espindola [Mon, 24 Jun 2013 16:46:15 +0000 (16:46 +0000)]
Convert a use of PathV1.h

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

11 years agoAdd some invalid-decl checks to clang_Type_getOffsetOf.
Matt Beaumont-Gay [Mon, 24 Jun 2013 16:12:35 +0000 (16:12 +0000)]
Add some invalid-decl checks to clang_Type_getOffsetOf.

print-size-type.cpp was checking for specific record layout output for invalid
decls; I've removed the checks but left the records as tests for not crashing.

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

11 years agoConvert a use of PathV1.h.
Rafael Espindola [Mon, 24 Jun 2013 15:00:11 +0000 (15:00 +0000)]
Convert a use of PathV1.h.

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

11 years ago[Sema] Call CheckParmForFunctionDef on ObjC method parameters
Reid Kleckner [Mon, 24 Jun 2013 14:38:26 +0000 (14:38 +0000)]
[Sema] Call CheckParmForFunctionDef on ObjC method parameters

CheckParmForFunctionDef performs standard checks for type completeness
and other things like a destructor check for the MSVC++ ABI.

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

11 years agoclang/unittests/ASTMatchers/Dynamic/RegistryTest.cpp: Suppress unexpected failures...
NAKAMURA Takumi [Mon, 24 Jun 2013 13:19:26 +0000 (13:19 +0000)]
clang/unittests/ASTMatchers/Dynamic/RegistryTest.cpp: Suppress unexpected failures on MS hosts.

FIXME: A couple of tests have been suppressed.
I know it'd be bad with _MSC_VER here, though.

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

11 years agoclang/test/Driver/coverage-ld.c: Tweak expressions to match dosish pathsep on win32...
NAKAMURA Takumi [Mon, 24 Jun 2013 13:19:20 +0000 (13:19 +0000)]
clang/test/Driver/coverage-ld.c: Tweak expressions to match dosish pathsep on win32 hosts.

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

11 years agoThe profile library must come before the C library so that it can use
Chandler Carruth [Mon, 24 Jun 2013 09:38:45 +0000 (09:38 +0000)]
The profile library must come before the C library so that it can use
atexit.

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

11 years agoAvoid adding entries to the DeclContext lookup table multiple times when lazily
Richard Smith [Mon, 24 Jun 2013 07:20:36 +0000 (07:20 +0000)]
Avoid adding entries to the DeclContext lookup table multiple times when lazily
constructing a lookup table.

Previously, buildLookup would add lookup table entries for each item lexically
within the DC, and adding the first entry with a given name would trigger the
external source to add all its entries with that name. Then buildLookup would
carry on and re-add those entries all over again.

Instead, follow a simple rule: a declaration from an external source is only
ever made visible by the external source. One exception to this: since we don't
usually build a lookup table for the TU in C, and we never serialize one, we
don't expect the external source to provide lookups in the TU in C, so we build
those ones ourselves.

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

11 years agoDebugInfo: ensure negative enumerators are emitted as such
David Blaikie [Mon, 24 Jun 2013 07:13:13 +0000 (07:13 +0000)]
DebugInfo: ensure negative enumerators are emitted as such

There's still a problem here - since we're not appropriately using the
signedness/range of the enum to chooset the encoding and emission of
enumerators, but GCC has some bugs around this too so I assume that's
not /such/ a high priority though I may get to it soon out of
completeness.

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

11 years agoDebugInfo: Merge a bad debug info enum test into a good one
David Blaikie [Mon, 24 Jun 2013 06:47:30 +0000 (06:47 +0000)]
DebugInfo: Merge a bad debug info enum test into a good one

The assembly generation testing has been moved to an LLVM test case.

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

11 years agoSlightly improve cross-module merging for function templates.
Richard Smith [Mon, 24 Jun 2013 04:45:28 +0000 (04:45 +0000)]
Slightly improve cross-module merging for function templates.

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

11 years agoComment parsing: allow "\param ..." to describe variadic arguments
Dmitri Gribenko [Mon, 24 Jun 2013 04:41:32 +0000 (04:41 +0000)]
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

11 years agoWhen setting the external visible declarations for a decl context, check
Richard Smith [Mon, 24 Jun 2013 01:46:41 +0000 (01:46 +0000)]
When setting the external visible declarations for a decl context, check
whether they replace any existing lookups in the context, rather than
accumulating a bunch of lookup results referring to the same entity.

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

11 years agoAdd -ast-dump-lookups switch to -cc1 to dump DeclContext lookup maps. Test to
Richard Smith [Mon, 24 Jun 2013 01:45:33 +0000 (01:45 +0000)]
Add -ast-dump-lookups switch to -cc1 to dump DeclContext lookup maps. Test to
follow.

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

11 years agoMove comment on Sema::isFunctionPointerVarDecl() to the header file
Dmitri Gribenko [Mon, 24 Jun 2013 01:33:34 +0000 (01:33 +0000)]
Move comment on Sema::isFunctionPointerVarDecl() to the header file

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

11 years agoDocumentation parsing: recognize \relates, \related, \relatesonly, \relatedonly
Dmitri Gribenko [Sun, 23 Jun 2013 23:33:14 +0000 (23:33 +0000)]
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

11 years agoArrayRef'ize Sema::CodeCompleteConstructorInitializer
Dmitri Gribenko [Sun, 23 Jun 2013 22:58:02 +0000 (22:58 +0000)]
ArrayRef'ize Sema::CodeCompleteConstructorInitializer

Patch by Robert Wilhelm.

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

11 years agoFix the addition of Clang's profile runtime library to the link step
Chandler Carruth [Sun, 23 Jun 2013 11:28:48 +0000 (11:28 +0000)]
Fix the addition of Clang's profile runtime library to the link step
when specifying --coverage (or related) flags.

The system for doing this was based on the old LLVM-hosted profile_rt
library, and hadn't been updated for Linux to use the new compiler-rt
library. Also, it couldn't possibly work on multiarch or biarch systems
in many cases. The whole thing now works much the same as the sanitizer
libraries that are built and used out of the compiler-rt repo.

Note that other target OSes haven't been updated because I don't know if
they're doing anything special with the installation path of profile_rt.
I suspect however that *all* of these are wrong and would encourage
maintainers of each target to take a hard look at how compiler-rt
runtime libraries are linked on their platforms.

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

11 years agoThe makefile build system had two lists of the 32-bit runtime libraries
Chandler Carruth [Sun, 23 Jun 2013 10:10:25 +0000 (10:10 +0000)]
The makefile build system had two lists of the 32-bit runtime libraries
to build and one had grown out of sync. Put this list in a variable so
this doesn't happen again.

The whole thing here is somewhat suspicious as we don't support 32-bit
environments with a 64-bit bi-arch capable compiler, but none have
complained yet about this so I'm just leaving it alone.

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

11 years agoSlightly loosen the test as there are other linker invocation patterns.
Chandler Carruth [Sun, 23 Jun 2013 08:39:08 +0000 (08:39 +0000)]
Slightly loosen the test as there are other linker invocation patterns.

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

11 years agoAdd and tighten up tests for cross compiling tool selection. This now
Chandler Carruth [Sun, 23 Jun 2013 08:24:15 +0000 (08:24 +0000)]
Add and tighten up tests for cross compiling tool selection. This now
verifies that we run the assembler and linker in the correct mode, and
that we can successfully use a bi-arch variant of a GCC installation in
a generic cross compilation invocation of Clang.

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

11 years agoAdd null check (resolves PR16423)
Stephen Lin [Sun, 23 Jun 2013 07:37:13 +0000 (07:37 +0000)]
Add null check (resolves PR16423)

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

11 years agoAST: Clean up FriendObjectKind related decls
David Majnemer [Sun, 23 Jun 2013 03:38:10 +0000 (03:38 +0000)]
AST: Clean up FriendObjectKind related decls

Allow the comments in the FriendObjectKind enumerator-list show up in
doxygen. Also, some small readability improvements in related functions.

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

11 years agoComment parsing: followup to r184610: allow multiple \returns
Dmitri Gribenko [Sat, 22 Jun 2013 23:03:37 +0000 (23:03 +0000)]
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

11 years agoFix assert if an attempt is made to explicitly instantiate an alias template.
Richard Smith [Sat, 22 Jun 2013 22:03:31 +0000 (22:03 +0000)]
Fix assert if an attempt is made to explicitly instantiate an alias template.
Patch by Ismail Pazarbasi!

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

11 years agoAdd dumping support for DeclContext's StoredDeclsMap.
Richard Smith [Sat, 22 Jun 2013 21:49:40 +0000 (21:49 +0000)]
Add dumping support for DeclContext's StoredDeclsMap.

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

11 years agoDebugInfo: Support (using GNU extensions) for template template parameters and parame...
David Blaikie [Sat, 22 Jun 2013 18:59:18 +0000 (18:59 +0000)]
DebugInfo: Support (using GNU extensions) for template template parameters and parameter packs

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

11 years agoRemove duplicated case.
Benjamin Kramer [Sat, 22 Jun 2013 16:44:45 +0000 (16:44 +0000)]
Remove duplicated case.

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

11 years agoInstantiation bug fix extension (cf. r184503) -- minor code fixes, including a typo...
Larisse Voufo [Sat, 22 Jun 2013 13:56:11 +0000 (13:56 +0000)]
Instantiation bug fix extension (cf. r184503) -- minor code fixes, including a typo that caused a runtime assertion after firing diagnosis for class definitions, with the 'template' keyword as template header, in friend declarations.

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

11 years agoReword and reformat some of the "Multiarch" code in the toolchain setup.
Chandler Carruth [Sat, 22 Jun 2013 11:35:51 +0000 (11:35 +0000)]
Reword and reformat some of the "Multiarch" code in the toolchain setup.

There are fundamentally two different things that were getting conflated
here.

1) A bi-arch GCC toolchain install. This is not a full blown cross
   compiler, but it supports targetting both 32-bit and 64-bit variants
   of the same architecture using multilib OS installs and runtimes.

2) A "multiarch" Debian OS/runtime layout that lays out the libraries,
   headers, etc as-if there were going to be a full blown cross compiler
   even when in reality it is just a bi-arch GCC targeting two variants.
   Also, these tend to use oddly "canonicalized" triples without the
   vendor in them unlike the typical cross compiler runtime library
   search that vanilla GCC cross compilers perform.

Now, when we mean the bi-arch nature of GCC accomplished with just
a suffix or tweak to the GCC paths, we say 'Biarch' or something
related. When we mean the Debian layout of includes and libraries, we
say multiarch or reference the multiarch triple.

In the process of reading and often renaming stuff in all these places,
also reformat with clang-format. No functionality change should be going
on here, this is just tidying up.

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

11 years agoRevert r184401 which reverted r183462.
David Majnemer [Sat, 22 Jun 2013 06:43:58 +0000 (06:43 +0000)]
Revert r184401 which reverted r183462.

The problem with r183462 was that we assumed that a diagnostic id of
zero would be silent.

This small correction to CheckDerivedToBaseConversion changes it's
behavior to omit the diagnostic when given a diagnostic id of zero.

This fix passes the test case added in r184402.

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

11 years agoExtend -Wnon-pod-varargs to check calls made from member pointers.
Richard Trieu [Sat, 22 Jun 2013 02:30:38 +0000 (02:30 +0000)]
Extend -Wnon-pod-varargs to check calls made from member pointers.

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

11 years agoFixed typo.
Alexander Kornienko [Sat, 22 Jun 2013 01:35:36 +0000 (01:35 +0000)]
Fixed typo.

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

11 years ago[analyzer] Use output form collections’ count to decide if ObjC for loop should be...
Anna Zaks [Sat, 22 Jun 2013 00:23:26 +0000 (00:23 +0000)]
[analyzer] Use output form collections’ count to decide if ObjC for loop should be entered

This fixes false positives by allowing us to know that a loop is always entered if
the collection count method returns a positive value and vice versa.

Addresses radar://14169391.

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

11 years ago[CFG] Set the “loop target” (back edge) for VisitObjCForCollectionStmt loops
Anna Zaks [Sat, 22 Jun 2013 00:23:20 +0000 (00:23 +0000)]
[CFG] Set the “loop target” (back edge) for VisitObjCForCollectionStmt loops

Add the back edge info by creating a basic block, marked as loop target. This is
consistent with how other loops are processed, but was omitted from
VisitObjCForCollectionStmt.

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

11 years agoExtend -Wnon-pod-varargs to more cases, such as function pointers as return
Richard Trieu [Sat, 22 Jun 2013 00:20:41 +0000 (00:20 +0000)]
Extend -Wnon-pod-varargs to more cases, such as function pointers as return
types and function pointer arrays.

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

11 years agoDebugInfo: Random tidying up/simplification
David Blaikie [Sat, 22 Jun 2013 00:09:36 +0000 (00:09 +0000)]
DebugInfo: Random tidying up/simplification

No functionality change intended.

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

11 years agoProvide suggested no-arg calls for overloaded member functions missing calls
David Blaikie [Fri, 21 Jun 2013 23:54:45 +0000 (23:54 +0000)]
Provide suggested no-arg calls for overloaded member functions missing calls

Reviewed by Richard Smith.

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

11 years ago[docs] `-fno-sanitize=` is accepted too.
Sean Silva [Fri, 21 Jun 2013 23:50:58 +0000 (23:50 +0000)]
[docs] `-fno-sanitize=` is accepted too.

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

11 years ago[document parsing]: Allow multiple adjacent \return and the like
Fariborz Jahanian [Fri, 21 Jun 2013 23:49:29 +0000 (23:49 +0000)]
[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

11 years agoTeach ARM va_arg to ignore empty structs.
Tim Northover [Fri, 21 Jun 2013 23:05:33 +0000 (23:05 +0000)]
Teach ARM va_arg to ignore empty structs.

Empty structs are ignored for parameter passing purposes, but va_arg was
incrementing the pointer anyway which could lead to va_list getting out of
sync.

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

11 years agoCheck for trivial constructibility before emptiness in ARM ABI.
Tim Northover [Fri, 21 Jun 2013 22:49:34 +0000 (22:49 +0000)]
Check for trivial constructibility before emptiness in ARM ABI.

According to the Itanium ABI (3.1.1), types with non-trivial copy constructors
passed by value should be passed indirectly, with the caller creating a
temporary.

We got this mostly correct, but forgot that empty structs can have non-trivial
constructors too and passed them incorrectly. This simply reverses the order of
the check.

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

11 years ago[NVPTX] Fix inline asm test case to use LLVM IR instead of PTX so it works even when...
Justin Holewinski [Fri, 21 Jun 2013 22:39:56 +0000 (22:39 +0000)]
[NVPTX] Fix inline asm test case to use LLVM IR instead of PTX so it works even when the NVPTX target is not built

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

11 years agoDebugInfo test: Rename function to avoid using the same name as a type
David Blaikie [Fri, 21 Jun 2013 21:58:54 +0000 (21:58 +0000)]
DebugInfo test: Rename function to avoid using the same name as a type

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