]> granicus.if.org Git - clang/log
clang
11 years agoDebug Info: set default to gdwarf-2 for Darwin.
Manman Ren [Tue, 2 Jul 2013 23:15:25 +0000 (23:15 +0000)]
Debug Info: set default to gdwarf-2 for Darwin.

Darwin systems currently do not support dwarf version 3 or above. When we are
ready, we can bump the default to gdwarf-4 for Darwin.

For other systems, the default is dwarf version 3, if everything goes smoothly,
we can bump the version to 4.

rdar://13591116

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

11 years agoRedirect the output of a test to a temporary file to prevent messing up
Richard Trieu [Tue, 2 Jul 2013 20:49:10 +0000 (20:49 +0000)]
Redirect the output of a test to a temporary file to prevent messing up
the test environment.

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

11 years agoDocumentation: Update docs for C++ lambdas to more accurately reflect
James Dennett [Tue, 2 Jul 2013 20:28:47 +0000 (20:28 +0000)]
Documentation: Update docs for C++ lambdas to more accurately reflect
C++1y init-capture support, and to improve some Doxygen markup.

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

11 years agoDebug Info: clean up usage of Verify.
Manman Ren [Tue, 2 Jul 2013 19:01:53 +0000 (19:01 +0000)]
Debug Info: clean up usage of Verify.

No functionality change. It should suffice to check the type of a debug info
metadata, instead of calling Verify.

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

11 years ago[ms-cxxabi] Mangle variadic template parameter packs
Reid Kleckner [Tue, 2 Jul 2013 18:10:07 +0000 (18:10 +0000)]
[ms-cxxabi] Mangle variadic template parameter packs

Unlike Itanium, there is no code to indicate the beginning of a
parameter pack.  I tested this with MSVC 2013, which is the only version
that implements variadic templates so far.

This is needed to compile APInt.cpp for the MS C++ ABI.

Reviewers: timurrrr

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

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

11 years agoAdd regression test for PR12331.
Richard Smith [Tue, 2 Jul 2013 18:08:50 +0000 (18:08 +0000)]
Add regression test for PR12331.

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

11 years agoMore fixes for block mangling.
Eli Friedman [Tue, 2 Jul 2013 17:52:28 +0000 (17:52 +0000)]
More fixes for block mangling.

Make sure we properly treat names defined inside a block as local
names.  There are basically three fixes here.  One, correctly
treat blocks as a context where we need to use local-name mangling using
the new isLocalContainerContext helper. Two, make
CXXNameMangler::manglePrefix handle local names in a consistent way.
Three, extend CXXNameMangler::mangleLocalName so it can mangle a block
correctly.

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

11 years agoFix to PR15826 - clang hits assert in clang::ASTContext::getASTRecordLayout.
Serge Pavlov [Tue, 2 Jul 2013 17:31:56 +0000 (17:31 +0000)]
Fix to PR15826 - clang hits assert in clang::ASTContext::getASTRecordLayout.

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

11 years ago[analyzer] Pointers-to-members are (currently) Locs, not NonLocs.
Jordan Rose [Tue, 2 Jul 2013 16:50:24 +0000 (16:50 +0000)]
[analyzer] Pointers-to-members are (currently) Locs, not NonLocs.

While we don't model pointers-to-members besides "null" and "non-null",
we were using Loc symbols for valid pointers and NonLoc integers for the
null case. This hit the assert committed in r185401.

Fixed by using a true (Loc) null for null member pointers.

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

11 years agoSuppress "control reaches end of non-void function" warning when compiling with gcc.
Andy Gibbs [Tue, 2 Jul 2013 16:01:56 +0000 (16:01 +0000)]
Suppress "control reaches end of non-void function" warning when compiling with gcc.

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

11 years agoSimplify getting CXXRecordDecl from a base iterator
Timur Iskhodzhanov [Tue, 2 Jul 2013 16:00:40 +0000 (16:00 +0000)]
Simplify getting CXXRecordDecl from a base iterator

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

11 years agoFix ranges computed by git clang-format.
Daniel Jasper [Tue, 2 Jul 2013 13:20:35 +0000 (13:20 +0000)]
Fix ranges computed by git clang-format.

Before, the computed byte range would include the trailing newline.
clang-format on the other hand counts whitespace as belonging to the
following token, so that git-clang-format inadvertendly reformats the
first unmodified line as well.

It is not entirely clear whether clang-format's behavior itself should
be modified, but for now this seems to be a safe change.

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

11 years agoFix formatting of long declarations with const type.
Daniel Jasper [Tue, 2 Jul 2013 09:47:29 +0000 (09:47 +0000)]
Fix formatting of long declarations with const type.

Before (exceeding the column limit):
LoooooooooooooooooooooooooooooooooooooooongType const LoooooooooooooooooooooooooooooooooooooooongVariable;

After:
LoooooooooooooooooooooooooooooooooooooooongType const
LoooooooooooooooooooooooooooooooooooooooongVariable;

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

11 years agoTeach static analyzer about AttributedStmts
Pavel Labath [Tue, 2 Jul 2013 09:38:48 +0000 (09:38 +0000)]
Teach static analyzer about AttributedStmts

Summary:
Static analyzer used to abort when encountering AttributedStmts, because it
asserted that the statements should not appear in the CFG. This is however not
the case, since at least the clang::fallthrough annotation makes it through.

This commit simply makes the analyzer ignore the statement attributes.

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1030

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

11 years agoDon't skip lambdas when mangling local vars.
Eli Friedman [Tue, 2 Jul 2013 02:01:18 +0000 (02:01 +0000)]
Don't skip lambdas when mangling local vars.

This commit rearranges the logic in CXXNameMangler::mangleLocalName and
GetLocalClassDecl so that it doesn't accidentally skip over lambdas.  It
also reduces code duplication a bit.

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

11 years ago[analyzer] Explicitly disallow mixed Loc-NonLoc comparisons.
Jordan Rose [Tue, 2 Jul 2013 01:37:40 +0000 (01:37 +0000)]
[analyzer] Explicitly disallow mixed Loc-NonLoc comparisons.

The one bit of code that was using this is gone, and neither C nor C++
actually allows this. Add an assertion and remove dead code.

Found by Matthew Dempsky!

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

11 years agoSimplify code in mangler.
Eli Friedman [Mon, 1 Jul 2013 21:29:48 +0000 (21:29 +0000)]
Simplify code in mangler.

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

11 years agoSimplify linkage code for static local vars.
Eli Friedman [Mon, 1 Jul 2013 20:53:07 +0000 (20:53 +0000)]
Simplify linkage code for static local vars.

The key insight here is that weak linkage for a static local variable
should always mean linkonce_odr, because every file that needs it will
generate a definition.  We don't actually care about the precise linkage
of the parent context.  I feel a bit silly that I didn't realize this before.

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

11 years agoFix CMakeLists.txt.
Eli Friedman [Mon, 1 Jul 2013 20:34:51 +0000 (20:34 +0000)]
Fix CMakeLists.txt.

Sorry about that.

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

11 years agoFix mangling for block literals.
Eli Friedman [Mon, 1 Jul 2013 20:22:57 +0000 (20:22 +0000)]
Fix mangling for block literals.

Blocks, like lambdas, can be written in contexts which are required to be
treated as the same under ODR.  Unlike lambdas, it isn't possible to actually
take the address of a block, so the mangling of the block itself doesn't
matter. However, objects like static variables inside a block do need to
be mangled in a consistent way.

There are basically three components here. One, block literals need a
consistent numbering.  Two, objects/types inside a block literal need
to be mangled using it.  Three, objects/types inside a block literal need
to have their linkage computed correctly.

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

11 years agoFix MSP430 builtin types.
Anton Korobeynikov [Mon, 1 Jul 2013 19:42:40 +0000 (19:42 +0000)]
Fix MSP430 builtin types.

Patch by Job Noorman!

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

11 years agoFix incorrect token counting introduced by r185319.
Daniel Jasper [Mon, 1 Jul 2013 16:43:38 +0000 (16:43 +0000)]
Fix incorrect token counting introduced by r185319.

This lead to weird formatting.
Before:
DoSomethingWithVector({ {} /* No data */ }, {
  { 1, 2 }
});
After:
DoSomethingWithVector({ {} /* No data */ }, { { 1, 2 } });

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

11 years agoAvoid column limit violation in block comments in certain cases.
Alexander Kornienko [Mon, 1 Jul 2013 13:42:42 +0000 (13:42 +0000)]
Avoid column limit violation in block comments in certain cases.

Summary:
Add penalty when an excessively long line in a block comment can not be
broken on a leading whitespace. Lack of this addition can lead to severe column
width violations when they can be easily avoided.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D1071

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

11 years agoDon't align "} // namespace" comments.
Daniel Jasper [Mon, 1 Jul 2013 11:22:57 +0000 (11:22 +0000)]
Don't align "} // namespace" comments.

This is not all bad, but people are often surprised by it.

Before:
namespace {
int SomeVariable = 0; // comment
}                     // namespace

After:
namespace {
int SomeVariable = 0; // comment
} // namespace

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

11 years agoclang/test/lit.cfg: Improve is_filesystem_case_insensitive() to work properly on...
NAKAMURA Takumi [Mon, 1 Jul 2013 09:51:55 +0000 (09:51 +0000)]
clang/test/lit.cfg: Improve is_filesystem_case_insensitive() to work properly on cygwin.

Cygwin does not accept the form /CYGDRIVE/X/PATH/TO/FILE against /cygdrive/X/PATH/TO/FILE.
"cygdrive" must be lower-cased.

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

11 years agoDon't add an extra space before ellipsis after pointers.
Daniel Jasper [Mon, 1 Jul 2013 09:47:25 +0000 (09:47 +0000)]
Don't add an extra space before ellipsis after pointers.

Before (for styles where the pointer binds to the type):
template <class... Ts> void Foo(Ts... ts) {}
template <class... Ts> void Foo(Ts* ... ts) {}
After:
template <class... Ts> void Foo(Ts... ts) {}
template <class... Ts> void Foo(Ts*... ts) {}

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

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