]> granicus.if.org Git - clang/log
clang
11 years agoKeep space between pointer and block comment.
Daniel Jasper [Mon, 1 Jul 2013 09:34:09 +0000 (09:34 +0000)]
Keep space between pointer and block comment.

Before: void f(int */* unused */) {}
After:  void f(int * /* unused */) {}

The previous version seems to be valid C++ code but confuses many syntax
highlighters.

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

11 years agoFix braced-list detection in lieu of trailing comments.
Daniel Jasper [Mon, 1 Jul 2013 09:15:46 +0000 (09:15 +0000)]
Fix braced-list detection in lieu of trailing comments.

Before:
DoSomethingWithVector({
} /* No data */);
After:
DoSomethingWithVector({} /* No data */);

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

11 years agoFollowing the modification introduced in llvm by commit 185311
Sylvestre Ledru [Mon, 1 Jul 2013 08:13:34 +0000 (08:13 +0000)]
Following the modification introduced in llvm by commit 185311

The build system is currently miss-identifying GNU/kFreeBSD as FreeBSD.
This kind of simplification is sometimes useful, but in general it's not correct.

As GNU/kFreeBSD is an hybrid system, for kernel-related issues we want to match the
build definitions used for FreeBSD, whereas for userland-related issues we want to
match the definitions used for other systems with Glibc.

The current modification adjusts the build system so that they can be distinguished,
and explicitly adds GNU/kFreeBSD to the build checks in which it belongs.

Fixes bug #16445.

Patch by Robert Millan in the context of Debian.

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

11 years agoPut helper class in anonymous namespace.
Craig Topper [Mon, 1 Jul 2013 06:34:58 +0000 (06:34 +0000)]
Put helper class in anonymous namespace.

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

11 years agoPut helper class in anonymous namespace.
Craig Topper [Mon, 1 Jul 2013 06:29:40 +0000 (06:29 +0000)]
Put helper class in anonymous namespace.

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

11 years agoPR16502: Fix a dumb bug where we might look past the last initializer in an
Richard Smith [Mon, 1 Jul 2013 06:08:20 +0000 (06:08 +0000)]
PR16502: Fix a dumb bug where we might look past the last initializer in an
InitListExpr.

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

11 years agoPut helper classes in an anonymous namespace.
Craig Topper [Mon, 1 Jul 2013 04:21:54 +0000 (04:21 +0000)]
Put helper classes in an anonymous namespace.

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

11 years agoUse LLVM_DELETED_FUNCTION on unimplemented copy constructor and assignment operator.
Craig Topper [Mon, 1 Jul 2013 04:07:34 +0000 (04:07 +0000)]
Use LLVM_DELETED_FUNCTION on unimplemented copy constructor and assignment operator.

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

11 years agoPut helper classes in an anonymous namespace.
Craig Topper [Mon, 1 Jul 2013 04:03:19 +0000 (04:03 +0000)]
Put helper classes in an anonymous namespace.

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

11 years agoUse static for helper functions instead of an anonymous namespace per coding standards.
Craig Topper [Mon, 1 Jul 2013 03:38:29 +0000 (03:38 +0000)]
Use static for helper functions instead of an anonymous namespace per coding standards.

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

11 years agoMake string pointer const.
Craig Topper [Sun, 30 Jun 2013 22:44:02 +0000 (22:44 +0000)]
Make string pointer const.

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

11 years agoPut helper classes into anonymous namespace.
Craig Topper [Sun, 30 Jun 2013 22:29:28 +0000 (22:29 +0000)]
Put helper classes into anonymous namespace.

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

11 years agoDocumentation cleanup for TypeOrdering.h.
James Dennett [Sun, 30 Jun 2013 21:23:07 +0000 (21:23 +0000)]
Documentation cleanup for TypeOrdering.h.

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

11 years agoRestore r184205 and associated commits (after commit of r185290)
Stephen Lin [Sun, 30 Jun 2013 20:40:16 +0000 (20:40 +0000)]
Restore r184205 and associated commits (after commit of r185290)

This allows clang to use the backend parameter attribute 'returned' when generating 'this'-returning constructors and destructors in ARM and MSVC C++ ABIs.

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

11 years agoDocumentation cleanup: Mostly formatting \brief documentation, also fix a
James Dennett [Sun, 30 Jun 2013 19:39:15 +0000 (19:39 +0000)]
Documentation cleanup: Mostly formatting \brief documentation, also fix a
typo or two.

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

11 years agoTeach -Wunsequenced that the side-effects of a function evaluation are sequenced
Richard Smith [Sun, 30 Jun 2013 10:40:20 +0000 (10:40 +0000)]
Teach -Wunsequenced that the side-effects of a function evaluation are sequenced
before the value computation of the result. In C, this is implied by there being
a sequence point after their evaluation, and in C++, it's implied by the
side-effects being sequenced before the expressions and statements in the
function body.

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

11 years agoReinstate r185229, reverted in r185256, with a tweak: further ignore the
Richard Smith [Sun, 30 Jun 2013 09:48:50 +0000 (09:48 +0000)]
Reinstate r185229, reverted in r185256, with a tweak: further ignore the
standard's rule that an extern "C" declaration conflicts with any entity in the
global scope with the same name. Now we only care if the global scope entity is
a variable declaration (and so might have the same mangled name as the extern
"C" declaration). This has been reported as a standard defect.

Original commit message:

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

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

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

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

11 years agoLex: Cleanup whitespace in PragmaRegionHandler
David Majnemer [Sun, 30 Jun 2013 08:18:16 +0000 (08:18 +0000)]
Lex: Cleanup whitespace in PragmaRegionHandler

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

11 years agoBug fix: Make RecursiveASTVisitor<T>::TraverseLambdaExpr call
James Dennett [Sun, 30 Jun 2013 03:13:35 +0000 (03:13 +0000)]
Bug fix: Make RecursiveASTVisitor<T>::TraverseLambdaExpr call
WalkUpFromLambdaExpr, so that the Visit* functions are called
on that AST node.

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

11 years agoAdd enumerators to TestVisitor::Language to allow visitor tests to
James Dennett [Sun, 30 Jun 2013 03:05:49 +0000 (03:05 +0000)]
Add enumerators to TestVisitor::Language to allow visitor tests to
explicitly specify use of C++98 or C++11. Lang_CXX is preserved as
an alias for Lang_CXX98.

This does not add Lang_CXX1Y or Lang_C11, on the assumption that it's
better to add them if/when they are needed.

(This is a prerequisite for a test in a later patch for RecursiveASTVisitor.)

Reviewed by Richard Smith.

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

11 years agoCompress pairs. No functionality change.
Benjamin Kramer [Sat, 29 Jun 2013 17:52:13 +0000 (17:52 +0000)]
Compress pairs. No functionality change.

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

11 years agoDriver: Push triple objects around instead of going to std::string all the time.
Benjamin Kramer [Sat, 29 Jun 2013 16:37:14 +0000 (16:37 +0000)]
Driver: Push triple objects around instead of going to std::string all the time.

No functionality change.

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

11 years agoRevert r185229 as it breaks compilation of <windows.h>
Timur Iskhodzhanov [Sat, 29 Jun 2013 08:38:42 +0000 (08:38 +0000)]
Revert r185229 as it breaks compilation of <windows.h>

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

11 years ago[test] Add test case for rdar://14183893.
Argyrios Kyrtzidis [Fri, 28 Jun 2013 23:47:22 +0000 (23:47 +0000)]
[test] Add test case for rdar://14183893.

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

11 years agoRemove dead code.
Eli Friedman [Fri, 28 Jun 2013 22:13:27 +0000 (22:13 +0000)]
Remove dead code.

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

11 years agoPR7927, PR16247: Reimplement handling of matching extern "C" declarations
Richard Smith [Fri, 28 Jun 2013 22:03:51 +0000 (22:03 +0000)]
PR7927, PR16247: Reimplement handling of matching extern "C" declarations
across scopes.

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

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

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

11 years agoFix error recovery with in-class initializer.
Eli Friedman [Fri, 28 Jun 2013 21:07:41 +0000 (21:07 +0000)]
Fix error recovery with in-class initializer.

Previously, for a field with an invalid in-class initializer, we
would create a CXXDefaultInitExpr referring to a null Expr*.
This is not a good idea.

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

11 years agoFix line endings.
Eli Friedman [Fri, 28 Jun 2013 20:48:34 +0000 (20:48 +0000)]
Fix line endings.

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

11 years ago[ms-cxxabi] Move CodeGenVTables::needsVTTParameter to ItaniumCXXABI.
Peter Collingbourne [Fri, 28 Jun 2013 20:45:28 +0000 (20:45 +0000)]
[ms-cxxabi] Move CodeGenVTables::needsVTTParameter to ItaniumCXXABI.

This function only makes sense there.  Eventually it should no longer
be part of the CGCXXABI interface, as it is an Itanium-specific detail.

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

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

11 years ago+ "For Windows Users" section
Anton Yartsev [Fri, 28 Jun 2013 19:21:11 +0000 (19:21 +0000)]
+ "For Windows Users" section
+ description for --use-analyzer option
+ managed size of columns of the 'options' table

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

11 years agoUse the multiple argument form of path::append.
Benjamin Kramer [Fri, 28 Jun 2013 16:25:46 +0000 (16:25 +0000)]
Use the multiple argument form of path::append.

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

11 years agoFix a trivial typo, add a FIXME to have more test coverage for VTableBuilder
Timur Iskhodzhanov [Fri, 28 Jun 2013 15:42:28 +0000 (15:42 +0000)]
Fix a trivial typo, add a FIXME to have more test coverage for VTableBuilder

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

11 years agoUse lexing mode based on FormatStyle.Standard.
Alexander Kornienko [Fri, 28 Jun 2013 12:51:24 +0000 (12:51 +0000)]
Use lexing mode based on FormatStyle.Standard.

Summary:
Some valid pre-C++11 constructs change meaning when lexed in C++11
mode, e.g.
#define x(_a) printf("foo"_a);
(example from http://llvm.org/bugs/show_bug.cgi?id=16342). "foo"_a is treated as
a user-defined string literal when parsed in C++11 mode.
In order to deal with this correctly, we need to set lexing mode according to
which standard the code conforms to. We already have a configuration value for
this (FormatStyle.Standard), which seems to be appropriate to use in this case
as well.

Reviewers: klimek

CC: cfe-commits, gribozavr
Differential Revision: http://llvm-reviews.chandlerc.com/D1028

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

11 years agoLazily deserialize function template specializations. This fixes a cycle in
Richard Smith [Fri, 28 Jun 2013 04:37:53 +0000 (04:37 +0000)]
Lazily deserialize function template specializations. This fixes a cycle in
module deserialization / merging, and more laziness here is general goodness.

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

11 years agoUpdate for llvm::sys::fs::unique_file not creating directories.
Rafael Espindola [Fri, 28 Jun 2013 03:49:04 +0000 (03:49 +0000)]
Update for llvm::sys::fs::unique_file not creating directories.

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

11 years agoDelete dead code.
Eli Friedman [Fri, 28 Jun 2013 00:23:34 +0000 (00:23 +0000)]
Delete dead code.

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

11 years agoSwitch Decl instantiation to DeclNodes.inc.
Eli Friedman [Thu, 27 Jun 2013 23:21:55 +0000 (23:21 +0000)]
Switch Decl instantiation to DeclNodes.inc.

This replaces a long list of declarations for visitor functions with
a list generated from DeclNodes.inc.  Nothing really interesting came
out of it; we had comprehensive coverage anyway
(excluding FriendTemplateDecls).

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

11 years agoFix nested lifetime extension when a std::initializer_list member is
Richard Smith [Thu, 27 Jun 2013 22:54:33 +0000 (22:54 +0000)]
Fix nested lifetime extension when a std::initializer_list member is
initialized during aggregate initialization of the surrounding structure.

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

11 years agoUse the zero-argument DIBuilder::createNullPtrType in Clang.
Peter Collingbourne [Thu, 27 Jun 2013 22:51:01 +0000 (22:51 +0000)]
Use the zero-argument DIBuilder::createNullPtrType in Clang.

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

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

11 years agoEnsure that debugger calls to signature-less functions default to
John McCall [Thu, 27 Jun 2013 22:43:24 +0000 (22:43 +0000)]
Ensure that debugger calls to signature-less functions default to
passing arguments in the fixed style.

We have an abstraction for deciding this, but it's (1) deep in
IR-generation, (2) necessarily tied to exact argument lists, and
(3) triggered by unprototyped function types, which we can't
legitimately make in C++ mode.  So this solution, wherein Sema
rewrites the function type to an exact prototype but leaves the
variadic bit enabled so as to request x86-64-like platforms to
pass the extra variadic info, is very much a hack, but it's one
that works in practice on the platforms that LLDB will support
in the medium term --- the only place we know of where it's a
problem is instance methods in Windows, where variadic functions
are implicitly cdecl.  We may have a more abstracted base on which
to build a solution by then.

rdar://13731520

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

11 years agoRevert "Revert r184787: "Added arm_neon intrinsic tests.""
Michael Gottesman [Thu, 27 Jun 2013 21:52:01 +0000 (21:52 +0000)]
Revert "Revert r184787: "Added arm_neon intrinsic tests.""

This reverts commit r184817. The failure Chandler was seeing was most likely the
bug that Bob Wilson fixed in r184870 (which was a bug caught by these tests).

To be safe, I just checked again on x86-64 mac os x/linux that this test passed
(which it did).

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

11 years agoRemove bogus VarDecl::extendsLifetimeOfTemporary function and inline it into
Richard Smith [Thu, 27 Jun 2013 21:43:17 +0000 (21:43 +0000)]
Remove bogus VarDecl::extendsLifetimeOfTemporary function and inline it into
its only caller with a FIXME explaining why it's bogus.

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

11 years agoRemove unnecessary check.
Eli Friedman [Thu, 27 Jun 2013 21:20:28 +0000 (21:20 +0000)]
Remove unnecessary check.

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

11 years agoDelete dead code.
Eli Friedman [Thu, 27 Jun 2013 21:04:24 +0000 (21:04 +0000)]
Delete dead code.

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

11 years agoDelete dead code.
Eli Friedman [Thu, 27 Jun 2013 20:48:08 +0000 (20:48 +0000)]
Delete dead code.

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

11 years agoUnder -fms-extensions, only inject a friend tag name when we didn't see a tag with...
Douglas Gregor [Thu, 27 Jun 2013 20:42:30 +0000 (20:42 +0000)]
Under -fms-extensions, only inject a friend tag name when we didn't see a tag with that name in an enclosing scope.

r177473 made us correctly consider only those declarations in the
enclosing namespace scope when looking for a friend declaration. Under
ms-extensions mode, where we do some level of friend injection, this
meant that we were introducing a new tag type into a different scope
than what Microsoft actually does. Address this by only doing the
friend injection when we didn't see any tag with that name in any
outer scope. Fixes <rdar://problem/14250378>.

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

11 years agoSimplify StmtIterator.
Eli Friedman [Thu, 27 Jun 2013 20:39:04 +0000 (20:39 +0000)]
Simplify StmtIterator.

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

11 years agoSmall improvements to createOutputFile.
Rafael Espindola [Thu, 27 Jun 2013 18:26:26 +0000 (18:26 +0000)]
Small improvements to createOutputFile.

* Use a single stat to find out if the file exists and if it is a regular file.
* Use early returns when possible.
* Add comments explaining why we have each check.

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

11 years agoAdd support for passing v8fp options via -mfpu.
Joey Gouly [Thu, 27 Jun 2013 13:19:54 +0000 (13:19 +0000)]
Add support for passing v8fp options via -mfpu.

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

11 years agoA bit of program simplification from r185056
Larisse Voufo [Thu, 27 Jun 2013 03:36:30 +0000 (03:36 +0000)]
A bit of program simplification from r185056

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

11 years agoFix a conversion to incomplete type bug -- The error message now specifically states...
Larisse Voufo [Thu, 27 Jun 2013 01:50:25 +0000 (01:50 +0000)]
Fix a conversion to incomplete type bug -- The error message now specifically states that the type is incomplete and points to the forward declaration of the incomplete type.

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

11 years agoDelete dead code.
Eli Friedman [Thu, 27 Jun 2013 01:36:36 +0000 (01:36 +0000)]
Delete dead code.

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

11 years agoSimplify code.
Eli Friedman [Wed, 26 Jun 2013 23:47:39 +0000 (23:47 +0000)]
Simplify code.

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

11 years agoHandle all TemplateArguments in trivial TypeLocs.
Eli Friedman [Wed, 26 Jun 2013 23:30:50 +0000 (23:30 +0000)]
Handle all TemplateArguments in trivial TypeLocs.

Armed with a much better understanding of what
TemplateSpecializationTypeLoc::initializeArgLocs actually does, I now
understand that it's fine to just use an empty TemplateArgumentLocInfo
for Integral, Declaration, and NullPtr TemplateArguments.

Fixes PR14281. (The testcases are actually derived from libcxx_test in
deduction-crash.cpp because the original testcase was impossible to reduce.)

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

11 years agoPR16467: Teach -Wunsequenced that in C11 (unlike C++11), an assignment's
Richard Smith [Wed, 26 Jun 2013 23:16:51 +0000 (23:16 +0000)]
PR16467: Teach -Wunsequenced that in C11 (unlike C++11), an assignment's
side-effect is not sequenced before its value computation. Also fix a
mishandling of ?: expressions where the condition is constant that was
exposed by the tests for this.

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

11 years agoSema: Small cleanup around TemplateParamListContext
David Majnemer [Wed, 26 Jun 2013 22:25:55 +0000 (22:25 +0000)]
Sema: Small cleanup around TemplateParamListContext

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

11 years agoObjectiveC: diagnose duplicate declaration of
Fariborz Jahanian [Wed, 26 Jun 2013 22:10:27 +0000 (22:10 +0000)]
ObjectiveC: diagnose duplicate declaration of
private ivars in class extensions and class
@implementation. // rdar://14278560

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

11 years agoDon't use unnamed local enums as template arguments.
Joerg Sonnenberger [Wed, 26 Jun 2013 21:31:47 +0000 (21:31 +0000)]
Don't use unnamed local enums as template arguments.
Fixes -Werror bootstrap.

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

11 years agoThis patch fixes PR16395, when HandleMSProperty returns null due to a declaration...
Aaron Ballman [Wed, 26 Jun 2013 21:28:44 +0000 (21:28 +0000)]
This patch fixes PR16395, when HandleMSProperty returns null due to a declaration with no name.

Patch thanks to Robert Wilhelm.

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

11 years agoAST: small cleanup to FriendObjectKind
David Majnemer [Wed, 26 Jun 2013 21:28:41 +0000 (21:28 +0000)]
AST: small cleanup to FriendObjectKind

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

11 years agoSync file handling logic in RewriterTestContext.h and RefactoringTest.cpp.
Rafael Espindola [Wed, 26 Jun 2013 21:02:22 +0000 (21:02 +0000)]
Sync file handling logic in RewriterTestContext.h and RefactoringTest.cpp.

They are mostly duplicated and got out of sync during the PathV1 removal. We
should factor the code somewhere, but for now a FIXME will do.

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

11 years agoRewrite record layout for ms_struct structs.
Eli Friedman [Wed, 26 Jun 2013 20:50:34 +0000 (20:50 +0000)]
Rewrite record layout for ms_struct structs.

The old implementation of ms_struct in RecordLayoutBuilder was a
complete mess: it depended on complicated conditionals which didn't
really reflect the underlying logic, and placed a burden on users of
the resulting RecordLayout. This commit rips out almost all of the
old code, and replaces it with simple checks in
RecordLayoutBuilder::LayoutBitField.

This commit also fixes <rdar://problem/14252115>, a bug where class
inheritance would cause us to lay out bitfields incorrectly.

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

11 years agoUpdating the same comment in a different file, again for links. No functional change...
Aaron Ballman [Wed, 26 Jun 2013 19:33:02 +0000 (19:33 +0000)]
Updating the same comment in a different file, again for links.  No functional change intended.

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

11 years agoUpdating a link in the comments; no functional change.
Aaron Ballman [Wed, 26 Jun 2013 19:17:19 +0000 (19:17 +0000)]
Updating a link in the comments; no functional change.

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

11 years agoFix warning: commas at the end of enumerator lists are a C++11 extension [-Wc++11...
Nico Weber [Wed, 26 Jun 2013 17:31:55 +0000 (17:31 +0000)]
Fix warning: commas at the end of enumerator lists are a C++11 extension [-Wc++11-extensions]

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

11 years agoAdd support for passing '-target armv8' through the Driver.
Joey Gouly [Wed, 26 Jun 2013 17:19:48 +0000 (17:19 +0000)]
Add support for passing '-target armv8' through the Driver.

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

11 years agoMatch MSVC's handling of commas during macro argument expansion
Reid Kleckner [Wed, 26 Jun 2013 17:16:08 +0000 (17:16 +0000)]
Match MSVC's handling of commas during macro argument expansion

This allows clang to parse the type_traits header in Visual Studio 2012,
which is included widely in practice.

This is a rework of r163022 by João Matos.  The original patch broke
preprocessing of gtest headers, which this patch addresses.

Patch by Will Wilson!

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

11 years agoclang/test/Driver/pth.c: Fix r184942, a regexp like "\\\\" is redundant here. Should...
NAKAMURA Takumi [Wed, 26 Jun 2013 15:03:20 +0000 (15:03 +0000)]
clang/test/Driver/pth.c: Fix r184942, a regexp like "\\\\" is redundant here. Should be matched to single \ with '\\'.

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

11 years agoRemove last use of PathV1.h from clang.
Rafael Espindola [Wed, 26 Jun 2013 15:01:50 +0000 (15:01 +0000)]
Remove last use of PathV1.h from clang.

Instead of creating a temporary directory, remember the set of temporary files
we create.

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

11 years agoWe only create one file, no need to delete a directory.
Rafael Espindola [Wed, 26 Jun 2013 14:33:23 +0000 (14:33 +0000)]
We only create one file, no need to delete a directory.

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

11 years agoRemove unused header.
Rafael Espindola [Wed, 26 Jun 2013 13:49:47 +0000 (13:49 +0000)]
Remove unused header.

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

11 years agoTry to fix this test on the msys buildbot.
Rafael Espindola [Wed, 26 Jun 2013 13:02:16 +0000 (13:02 +0000)]
Try to fix this test on the msys buildbot.

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

11 years agoQuieting an MSVC warning about converting negative integer constants to unsigned...
Aaron Ballman [Wed, 26 Jun 2013 12:54:49 +0000 (12:54 +0000)]
Quieting an MSVC warning about converting negative integer constants to unsigned types.

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

11 years agoDon't use PathV1.h in CIndexCodeCompletion.cpp.
Rafael Espindola [Wed, 26 Jun 2013 12:54:23 +0000 (12:54 +0000)]
Don't use PathV1.h in CIndexCodeCompletion.cpp.

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

11 years agoRemove dead include.
Rafael Espindola [Wed, 26 Jun 2013 12:49:58 +0000 (12:49 +0000)]
Remove dead include.

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

11 years agoDon't use PathV1.h in cc1as_main.cpp.
Rafael Espindola [Wed, 26 Jun 2013 12:48:34 +0000 (12:48 +0000)]
Don't use PathV1.h in cc1as_main.cpp.

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

11 years agoRemove unused header.
Rafael Espindola [Wed, 26 Jun 2013 12:46:06 +0000 (12:46 +0000)]
Remove unused header.

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

11 years agoRemove unused include.
Rafael Espindola [Wed, 26 Jun 2013 12:44:19 +0000 (12:44 +0000)]
Remove unused include.

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

11 years agoclang/test/lit.cfg: Tweak getClangBuiltinIncludeDir() not to expose dosish path separ...
NAKAMURA Takumi [Wed, 26 Jun 2013 10:45:20 +0000 (10:45 +0000)]
clang/test/lit.cfg: Tweak getClangBuiltinIncludeDir() not to expose dosish path separator on MSYS bash.exe, since r184774.

    $ bin/clang.exe -print-file-name=include
    e:/path/to/build/bin\..\lib\clang\3.4\include

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

11 years agoRemove unused include.
Rafael Espindola [Wed, 26 Jun 2013 06:15:57 +0000 (06:15 +0000)]
Remove unused include.

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

11 years agoRemove more uses of llvm::sys::Path.
Rafael Espindola [Wed, 26 Jun 2013 06:13:06 +0000 (06:13 +0000)]
Remove more uses of llvm::sys::Path.

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

11 years agoRemove PathV1.h from CompilerInvocation.cpp.
Rafael Espindola [Wed, 26 Jun 2013 05:40:30 +0000 (05:40 +0000)]
Remove PathV1.h from CompilerInvocation.cpp.

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

11 years agoUse llvm::sys::fs::getMainExecutable.
Rafael Espindola [Wed, 26 Jun 2013 05:03:40 +0000 (05:03 +0000)]
Use llvm::sys::fs::getMainExecutable.

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

11 years agoRemove PathV1.h from CompilerInstance.cpp.
Rafael Espindola [Wed, 26 Jun 2013 04:32:59 +0000 (04:32 +0000)]
Remove PathV1.h from CompilerInstance.cpp.

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

11 years agoDon't use PathV1.h in ASTUnit.cpp.
Rafael Espindola [Wed, 26 Jun 2013 04:26:38 +0000 (04:26 +0000)]
Don't use PathV1.h in ASTUnit.cpp.

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

11 years agoRemove forward declarations of sys::Path.
Rafael Espindola [Wed, 26 Jun 2013 04:23:08 +0000 (04:23 +0000)]
Remove forward declarations of sys::Path.

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

11 years agoRemove the last use of PathWithStatus.
Rafael Espindola [Wed, 26 Jun 2013 04:12:57 +0000 (04:12 +0000)]
Remove the last use of PathWithStatus.

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

11 years agoUse llvm::sys::fs::unique_file.
Rafael Espindola [Wed, 26 Jun 2013 04:02:37 +0000 (04:02 +0000)]
Use llvm::sys::fs::unique_file.

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

11 years agoRemove some uses of llvm::sys::Path.
Rafael Espindola [Wed, 26 Jun 2013 03:52:38 +0000 (03:52 +0000)]
Remove some uses of llvm::sys::Path.

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

11 years agoRemove PathV1.h use from WindowsToolChain.cpp.
Rafael Espindola [Wed, 26 Jun 2013 03:39:10 +0000 (03:39 +0000)]
Remove PathV1.h use from WindowsToolChain.cpp.

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

11 years agoFix a comment.
Nico Weber [Wed, 26 Jun 2013 02:42:46 +0000 (02:42 +0000)]
Fix a comment.

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

11 years agoLazily deserialize the "first' friend declaration when deserializing a class
Richard Smith [Wed, 26 Jun 2013 02:41:25 +0000 (02:41 +0000)]
Lazily deserialize the "first' friend declaration when deserializing a class
declaration. This PCH a little lazier, and breaks a deserialization cycle that
causes crashes with modules enabled.

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

11 years agoFix PCH bug with member templates of local classes in nontemplate functions.
Faisal Vali [Wed, 26 Jun 2013 02:34:24 +0000 (02:34 +0000)]
Fix PCH bug with member templates of local classes in nontemplate functions.

As noted by Richard in the post:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130624/082605.html, the following code should not add an entry
into PendingLocalImplicitInstantiations, since local instantiations
should only occur within the context of other instantiations:

int foo(double y) {
   struct Lambda {
      template<class T> T operator()(T t) const { return t; };
   } lambda;
   return lambda(y);
}

Hence the attached code does the following:
  1) In MarkFunctionReferenced, check if ActiveInstantiations.size()
      is non-zero before adding to PendingLocalImplicitInstantiations.
  2) In InstantiateFunctionDefinition, we swap out/in
      PendingLocalImplicitInstantiations so that only those
      pending local instantiations that are added during the instantiation
      of the current function are instantiated recursively.

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

11 years agoRemove PathV1.h usage from ToolChains.cpp.
Rafael Espindola [Wed, 26 Jun 2013 02:13:00 +0000 (02:13 +0000)]
Remove PathV1.h usage from ToolChains.cpp.

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

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