]> granicus.if.org Git - clang/log
clang
10 years agoTrailing linefeed.
NAKAMURA Takumi [Mon, 4 Aug 2014 22:48:09 +0000 (22:48 +0000)]
Trailing linefeed.

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

10 years agoRemove separator parameter from static local naming code
Reid Kleckner [Mon, 4 Aug 2014 22:35:30 +0000 (22:35 +0000)]
Remove separator parameter from static local naming code

It was always set to ".", which was duplicated in a few places.

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

10 years agoThread Safety Analysis: add a -Wthread-safety-negative flag that warns whenever
DeLesley Hutchins [Mon, 4 Aug 2014 22:13:06 +0000 (22:13 +0000)]
Thread Safety Analysis: add a -Wthread-safety-negative flag that warns whenever
a mutex is acquired, but corresponding mutex is not provably not-held.  This
is based on the earlier negative requirements patch.

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

10 years agoUpdate for LLVM API change.
Eric Christopher [Mon, 4 Aug 2014 21:33:42 +0000 (21:33 +0000)]
Update for LLVM API change.

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

10 years agoUsersManual: update clang-cl options
Hans Wennborg [Mon, 4 Aug 2014 21:07:58 +0000 (21:07 +0000)]
UsersManual: update clang-cl options

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

10 years agoDon't drop dllimport from qualified friend redeclarations (PR20512)
Hans Wennborg [Mon, 4 Aug 2014 20:54:39 +0000 (20:54 +0000)]
Don't drop dllimport from qualified friend redeclarations (PR20512)

This matches MSVC's logic, which seems to be that when the friend
declaration is qualified, it cannot be a declaration of a new symbol
and so the dll linkage doesn't change.

Differential Revision: http://reviews.llvm.org/D4764

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

10 years agoNit picky const-correctness with auto. No functional changes.
Aaron Ballman [Mon, 4 Aug 2014 20:49:47 +0000 (20:49 +0000)]
Nit picky const-correctness with auto. No functional changes.

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

10 years agoA static_assert declaration cannot be a template; adding the diagnostic for this...
Aaron Ballman [Mon, 4 Aug 2014 20:28:35 +0000 (20:28 +0000)]
A static_assert declaration cannot be a template; adding the diagnostic for this instead of silently accepting and producing possibly-unexpected behavior.

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

10 years agoRevert r214757 (Same fix as r214758)
Alex Lorenz [Mon, 4 Aug 2014 19:04:38 +0000 (19:04 +0000)]
Revert r214757 (Same fix as r214758)

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

10 years agoAdd CoverageMappingGen.cpp (introduced in r214752) to CMakeLists.txt
David Blaikie [Mon, 4 Aug 2014 18:59:39 +0000 (18:59 +0000)]
Add CoverageMappingGen.cpp (introduced in r214752) to CMakeLists.txt

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

10 years agoadd lib/CodeGen/CoverageMappingGen.cpp to CMake
Alex Lorenz [Mon, 4 Aug 2014 18:55:53 +0000 (18:55 +0000)]
add lib/CodeGen/CoverageMappingGen.cpp to CMake

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

10 years agoAdd coverage mapping generation.
Alex Lorenz [Mon, 4 Aug 2014 18:41:51 +0000 (18:41 +0000)]
Add coverage mapping generation.

This patch adds the '-fcoverage-mapping' option which
allows clang to generate the coverage mapping information
that can be used to provide code coverage analysis using
the execution counts obtained from the instrumentation
based profiling (-fprofile-instr-generate).

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

10 years agoRemoving some extraneous spaces; no functional changes intended.
Aaron Ballman [Mon, 4 Aug 2014 17:49:55 +0000 (17:49 +0000)]
Removing some extraneous spaces; no functional changes intended.

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

10 years agoFix crash when accessing a property of an invalid interface
Olivier Goffart [Mon, 4 Aug 2014 17:28:11 +0000 (17:28 +0000)]
Fix crash when accessing a property of an invalid interface

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

10 years agoFix crash when assiging to a property with an invalid type
Olivier Goffart [Mon, 4 Aug 2014 17:28:05 +0000 (17:28 +0000)]
Fix crash when assiging to a property with an invalid type

This is a regression from clang 3.4

Set the result to ExprError and returns true, rather than simply
returns false because errors have been reported already and returning
false show a confusing error

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

10 years agoDiagnose GNU-style attributes preceding virt-specifiers, but only when the attribute...
Aaron Ballman [Mon, 4 Aug 2014 17:03:51 +0000 (17:03 +0000)]
Diagnose GNU-style attributes preceding virt-specifiers, but only when the attribute is known to GCC. Clang accepts attributes in this position, but
GCC does not, so this is a GCC-compat warning. If the attribute is not known to GCC, then the diagnostic is suppressed.

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

10 years agoThread safety analysis: Add support for negative requirements, which are
DeLesley Hutchins [Mon, 4 Aug 2014 16:10:59 +0000 (16:10 +0000)]
Thread safety analysis:  Add support for negative requirements, which are
capability expressions of the form !expr, and denote a capability that must
not be held.

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

10 years agoHighlight the offending function parameter when the format argument refers to an...
Aaron Ballman [Mon, 4 Aug 2014 15:26:33 +0000 (15:26 +0000)]
Highlight the offending function parameter when the format argument refers to an invalid function parameter type.

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

10 years agoHighlight the offending function parameter when the format_arg argument refers to...
Aaron Ballman [Mon, 4 Aug 2014 15:17:29 +0000 (15:17 +0000)]
Highlight the offending function parameter when the format_arg argument refers to an invalid function parameter type.

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

10 years agoclang-format: Understand parameter pack initialization.
Daniel Jasper [Mon, 4 Aug 2014 14:51:02 +0000 (14:51 +0000)]
clang-format: Understand parameter pack initialization.

Before:
  Constructor(A... a) : a_(X<A> { std::forward<A>(a) }...) {}

After:
  Constructor(A... a) : a_(X<A>{std::forward<A>(a)}...) {}

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

10 years ago[Driver][Mips] Construct dynamic linker path by string concatination.
Simon Atanasyan [Mon, 4 Aug 2014 12:57:52 +0000 (12:57 +0000)]
[Driver][Mips] Construct dynamic linker path by string concatination.
That reduces a number of `if` operators and prevent a combinatorics explosion
if/when more dynamic linker path variants added.

No functional changes.

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

10 years ago[x32] Add __int128 support
Pavel Chupin [Mon, 4 Aug 2014 12:39:43 +0000 (12:39 +0000)]
[x32] Add __int128 support

Summary:
Adding __int128 support explicitly for x86_64 because currently it's on
only when pointer size >= 64 which is not the case for x32.

Test Plan: One of the tests using __int128 is updated

Reviewers: atanasyan, chandlerc

Subscribers: cfe-commits, rob.khasanov, zinovy.nis, dschuff

Differential Revision: http://reviews.llvm.org/D4755

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

10 years agoFix tests Clang::Sema/statements.c and Clang::SemaTemplate/instantiate-expr-1.cpp...
Keith Walker [Mon, 4 Aug 2014 10:13:09 +0000 (10:13 +0000)]
Fix tests Clang::Sema/statements.c and Clang::SemaTemplate/instantiate-expr-1.cpp when AArch64 is the default target.

Commit r213935 added additional validation of register constants/size for AArch64 and because these tests which contain Intel assembler the new validation caused these tests to fail when the default target is changed to an AArch64 target.

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

10 years agoAST: Fix the mangling for unqualified-blocks
David Majnemer [Mon, 4 Aug 2014 06:16:50 +0000 (06:16 +0000)]
AST: Fix the mangling for unqualified-blocks

CXXNameMangler::mangleUnqualifiedBlock believed that
MangleContext::getBlockId returned something that used Itanium-style
discriminator numbers.

Discriminator numbers start their numberign from 1 and the first
mangling that actually gets any sort of number mangled in is the second
discriminator.

However, Block IDs start from zero.  The logic for omitting the mangling
number did a ' > 1' instead of a ' > 0' comparison; this could
potentially cause mangling conflicts.

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

10 years agoAST: Propagate 'AlignIsRequired' though many levels of typedefs
David Majnemer [Mon, 4 Aug 2014 05:11:01 +0000 (05:11 +0000)]
AST: Propagate 'AlignIsRequired' though many levels of typedefs

A typedef of a typedef should have AlignIsRequired if *either* typedef
has an AlignAttr attached to it.

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

10 years agoPR11778: Fix the rejects-valid half of this bug. We still produce the same
Richard Smith [Mon, 4 Aug 2014 00:40:48 +0000 (00:40 +0000)]
PR11778: Fix the rejects-valid half of this bug. We still produce the same
poorly-worded warning for a case value that is not a possible value of the
switched-on expression.

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

10 years agoDon't destroy MacroInfos if we find the macro definition is invalid; it'll get
Richard Smith [Sun, 3 Aug 2014 23:41:04 +0000 (23:41 +0000)]
Don't destroy MacroInfos if we find the macro definition is invalid; it'll get
destroyed on shutdown regardless. Fixes a double-delete.

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

10 years agoDriver: Simplify a use of the path API
Justin Bogner [Sun, 3 Aug 2014 21:46:33 +0000 (21:46 +0000)]
Driver: Simplify a use of the path API

It's a bit more obvious what's going on if we use path::filename
rather than decrementing an iterator here.

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

10 years ago[Mips] Add the `mips64-linux-gnu` target to the test case to check `in128`
Simon Atanasyan [Sun, 3 Aug 2014 16:11:05 +0000 (16:11 +0000)]
[Mips] Add the `mips64-linux-gnu` target to the test case to check `in128`
type handling.

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

10 years agoTools.cpp: Avoid std::to_string() on -fbuild-session-timestamp to appease mingw32...
NAKAMURA Takumi [Sun, 3 Aug 2014 01:11:44 +0000 (01:11 +0000)]
Tools.cpp: Avoid std::to_string() on -fbuild-session-timestamp to appease mingw32 builder.

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

10 years agovcfsx and dss instructions require immediates, variables are not valid.
Joerg Sonnenberger [Sat, 2 Aug 2014 15:07:21 +0000 (15:07 +0000)]
vcfsx and dss instructions require immediates, variables are not valid.

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

10 years agolibclang/Makefile: Update LINK_COMPONENTS take #3. Sorry for the noise.
NAKAMURA Takumi [Sat, 2 Aug 2014 07:24:04 +0000 (07:24 +0000)]
libclang/Makefile: Update LINK_COMPONENTS take #3. Sorry for the noise.

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

10 years agolibclang/Makefile: Update LINK_COMPONENTS take #2.
NAKAMURA Takumi [Sat, 2 Aug 2014 07:16:14 +0000 (07:16 +0000)]
libclang/Makefile: Update LINK_COMPONENTS take #2.

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

10 years agolibclang/Makefile: Restore some components in LINK_COMPONENTS. Clang's Makefile(s...
NAKAMURA Takumi [Sat, 2 Aug 2014 07:05:38 +0000 (07:05 +0000)]
libclang/Makefile: Restore some components in LINK_COMPONENTS. Clang's Makefile(s) are not transitive on clang libs.

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

10 years agolibclang: Update LINK_COMPONENTS.
NAKAMURA Takumi [Sat, 2 Aug 2014 06:58:39 +0000 (06:58 +0000)]
libclang: Update LINK_COMPONENTS.

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

10 years agoIn the case of mangling collisions, make an attempt to note both definitions
Richard Smith [Sat, 2 Aug 2014 00:50:16 +0000 (00:50 +0000)]
In the case of mangling collisions, make an attempt to note both definitions
involved.

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

10 years ago[ASan] Use metadata to pass source-level information from Clang to ASan.
Alexey Samsonov [Sat, 2 Aug 2014 00:35:50 +0000 (00:35 +0000)]
[ASan] Use metadata to pass source-level information from Clang to ASan.

Instead of creating global variables for source locations and global names,
just create metadata nodes and strings. They will be transformed into actual
globals in the instrumentation pass (if necessary). This approach is more
flexible:
1) we don't have to ensure that our custom globals survive all the optimizations
2) if globals are discarded for some reason, we will simply ignore metadata for them
   and won't have to erase corresponding globals
3) metadata for source locations can be reused for other purposes: e.g. we may
   attach source location metadata to alloca instructions and provide better descriptions
   for stack variables in ASan error reports.

No functionality change.

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

10 years agoFix test from r214577 for other timezones
Ben Langmuir [Fri, 1 Aug 2014 22:58:19 +0000 (22:58 +0000)]
Fix test from r214577 for other timezones

Unsurprisingly, changing a file modification time to a specific
date/time doesn't give the same epoch time everywhere. Just make the
file move into the past and look at only the first few digits of the
epoch time.

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

10 years agoInstrProf: Update for LLVM API change
Justin Bogner [Fri, 1 Aug 2014 22:50:16 +0000 (22:50 +0000)]
InstrProf: Update for LLVM API change

We've added support for a multiple functions with the same name in
LLVM's profile data, so the lookup returning the function hash it
found doesn't make sense anymore. Update to pass in the hash we
expect.

This also adds a test that the version 1 format is still readable,
since the new API is expected to handle that.

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

10 years agoNotional simplification: defer emitting deferred inline methods until we finish
Richard Smith [Fri, 1 Aug 2014 22:42:16 +0000 (22:42 +0000)]
Notional simplification: defer emitting deferred inline methods until we finish
emitting everything, rather than potentially doing this reentrantly.

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

10 years agoActually fix problem with modules buildbot this time.
Richard Smith [Fri, 1 Aug 2014 22:17:28 +0000 (22:17 +0000)]
Actually fix problem with modules buildbot this time.

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

10 years agoAdd -fbuild-session-file as an alternative to -fbuild-session-timestamp
Ben Langmuir [Fri, 1 Aug 2014 22:12:21 +0000 (22:12 +0000)]
Add -fbuild-session-file as an alternative to -fbuild-session-timestamp

Build systems tend to traffic in files and modification times, so having
them touch a file at the beginning of the build can be easier than
having them update the compile command they use every time they build.

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

10 years ago[Sanitizer] Introduce SanitizerMetadata class.
Alexey Samsonov [Fri, 1 Aug 2014 21:35:28 +0000 (21:35 +0000)]
[Sanitizer] Introduce SanitizerMetadata class.

It is responsible for generating metadata consumed by sanitizer instrumentation
passes in the backend. Move several methods from CodeGenModule to SanitizerMetadata.
For now the class is stateless, but soon it won't be the case.

Instead of creating globals providing source-level information to ASan, we will create
metadata nodes/strings which will be turned into actual global variables in the
backend (if needed).

No functionality change.

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

10 years agoLet's assume PowerPC has no SSE.
Joerg Sonnenberger [Fri, 1 Aug 2014 21:20:02 +0000 (21:20 +0000)]
Let's assume PowerPC has no SSE.

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

10 years agoRe-commit r214547 with tests fixed. Hopefully all the bots will be happy now.
Richard Smith [Fri, 1 Aug 2014 20:39:36 +0000 (20:39 +0000)]
Re-commit r214547 with tests fixed. Hopefully all the bots will be happy now.
Original message:

Fix iterator invalidation issues that are breaking my modules buildbot's
bootstrap.

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

10 years agoMS inline asm: Tests for r214550
Reid Kleckner [Fri, 1 Aug 2014 20:23:29 +0000 (20:23 +0000)]
MS inline asm: Tests for r214550

These tests seem like an exception to the rule against assembly emitting
tests in clang.  I made an LLVM side change that can only be tested by
setting up the inline assembly machinery that is only implemented by
Clang.

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

10 years agoMS inline asm: Add tests for LLVM r214468
Reid Kleckner [Fri, 1 Aug 2014 20:23:03 +0000 (20:23 +0000)]
MS inline asm: Add tests for LLVM r214468

This used to assert.

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

10 years agoRevert r214547 due to test breakage.
Richard Smith [Fri, 1 Aug 2014 20:09:39 +0000 (20:09 +0000)]
Revert r214547 due to test breakage.

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

10 years agoFix iterator invalidation issues that are breaking my modules buildbot's bootstrap.
Richard Smith [Fri, 1 Aug 2014 19:59:14 +0000 (19:59 +0000)]
Fix iterator invalidation issues that are breaking my modules buildbot's bootstrap.

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

10 years agoUpdate build instructions for the clang-format VS plugin
Hans Wennborg [Fri, 1 Aug 2014 17:38:53 +0000 (17:38 +0000)]
Update build instructions for the clang-format VS plugin

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

10 years agoDropping some else-after-returns. No functional changes intended.
Aaron Ballman [Fri, 1 Aug 2014 17:02:34 +0000 (17:02 +0000)]
Dropping some else-after-returns. No functional changes intended.

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

10 years agoAdd IR Mangler for more stable mangling.
Eli Bendersky [Fri, 1 Aug 2014 15:01:10 +0000 (15:01 +0000)]
Add IR Mangler for more stable mangling.

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

10 years agoThe GNU-style aligned attribute has an optional expression, but the generated pretty...
Aaron Ballman [Fri, 1 Aug 2014 13:49:00 +0000 (13:49 +0000)]
The GNU-style aligned attribute has an optional expression, but the generated pretty printing logic was unaware of this. Fixed the pretty printing logic, and added a test to ensure it no longer asserts.

Added a FIXME to the code about eliding the parenthesis when pretty printing such a construct.

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

10 years agoRevert r214497: [mips] Defer va_arg expansion to the backend.
Daniel Sanders [Fri, 1 Aug 2014 13:26:28 +0000 (13:26 +0000)]
Revert r214497: [mips] Defer va_arg expansion to the backend.

It appears that the backend does not handle all cases that were handled by clang.
In particular, it does not handle structs as used in
SingleSource/UnitTests/2003-05-07-VarArgs.

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

10 years agoReplacing some more complex logic with a helper function call to ObjCMethod::getRetur...
Aaron Ballman [Fri, 1 Aug 2014 13:20:09 +0000 (13:20 +0000)]
Replacing some more complex logic with a helper function call to ObjCMethod::getReturnTypeSourceRange. No functional changes intended.

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

10 years agoXcore target: Fix CXXStdlibIncludeArgs to check 'nostdinc++' flag too.
Robert Lytton [Fri, 1 Aug 2014 13:11:46 +0000 (13:11 +0000)]
Xcore target: Fix CXXStdlibIncludeArgs to check 'nostdinc++' flag too.

Summary:
There are no tests as it is dependant upon the environment variables
XCC_C_INCLUDE_PATH & XCC_CPLUS_INCLUDE_PATH  being set.

Differential Revision: http://reviews.llvm.org/D4621

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

10 years agoclang-format: Add a space in ObjC protocols.
Daniel Jasper [Fri, 1 Aug 2014 13:03:05 +0000 (13:03 +0000)]
clang-format: Add a space in ObjC protocols.

Before:
  @interface Foo (HackStuff)<MyProtocol>

After:
  @interface Foo (HackStuff) <MyProtocol>

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

10 years agoImproving diagnostic source ranges for the nonnull attribute. Now it highlights the...
Aaron Ballman [Fri, 1 Aug 2014 12:58:11 +0000 (12:58 +0000)]
Improving diagnostic source ranges for the nonnull attribute. Now it highlights the attribute and the faulty nonpointer type when possible.

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

10 years agoFix a memory leak - dispose of the CXString after printing it in mangling.
Eli Bendersky [Fri, 1 Aug 2014 12:55:44 +0000 (12:55 +0000)]
Fix a memory leak - dispose of the CXString after printing it in mangling.

Thanks to kcc@ for noticing.

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

10 years agoInitializing the loop hint option token again.
Aaron Ballman [Fri, 1 Aug 2014 12:41:37 +0000 (12:41 +0000)]
Initializing the loop hint option token again.

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

10 years agoInitializing the loop hint option token.
Aaron Ballman [Fri, 1 Aug 2014 12:20:20 +0000 (12:20 +0000)]
Initializing the loop hint option token.

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

10 years ago[mips] Defer va_arg expansion to the backend.
Daniel Sanders [Fri, 1 Aug 2014 10:29:21 +0000 (10:29 +0000)]
[mips] Defer va_arg expansion to the backend.

Summary:
This patch causes clang to emit va_arg instructions to the backend instead of
expanding them into an implementation itself. The backend already implements
va_arg since this is necessary for NaCl so this patch is removing redundant
code.

Together with the llvm patch (D4556) that accounts for the effect of endianness
on the expansion of va_arg, this fixes PR19612.

Depends on D4556

Reviewers: sstankovic, dsanders

Reviewed By: dsanders

Subscribers: rnk, cfe-commits

Differential Revision: http://reviews.llvm.org/D4742

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

10 years ago[modules] Remove IRGen special case for emitting implicit special members if
Richard Smith [Fri, 1 Aug 2014 01:56:39 +0000 (01:56 +0000)]
[modules] Remove IRGen special case for emitting implicit special members if
they're somehow missing a body. Looks like this was left behind when the loop
was generalized, and it's not been problematic before because without modules,
a used, implicit special member function declaration must be a definition.

This was resulting in us trying to emit a constructor declaration rather than
a definition, and producing a constructor missing its member initializers.

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

10 years agoAdd comments to debug info testing case.
Manman Ren [Fri, 1 Aug 2014 01:47:13 +0000 (01:47 +0000)]
Add comments to debug info testing case.

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

10 years agoRemove this pointer that is converted to bool. In well-defined contexts, the
Richard Trieu [Fri, 1 Aug 2014 01:42:01 +0000 (01:42 +0000)]
Remove this pointer that is converted to bool.  In well-defined contexts, the
this pointer is always non-null.  If the this pointer is null, it is undefined
and the compiler may optimize it away by assuming it is non-null.  The null
checks are pushed into the callers.

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

10 years agoclang-format vs plugin: claim support for VS 14 CTP too
Hans Wennborg [Fri, 1 Aug 2014 00:02:24 +0000 (00:02 +0000)]
clang-format vs plugin: claim support for VS 14 CTP too

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

10 years agoFix buildbot: work around missing GCC C++11 feature.
Richard Smith [Thu, 31 Jul 2014 23:52:38 +0000 (23:52 +0000)]
Fix buildbot: work around missing GCC C++11 feature.

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

10 years ago[modules] Maintain an AST invariant across module load/save: if any declaration
Richard Smith [Thu, 31 Jul 2014 23:46:44 +0000 (23:46 +0000)]
[modules] Maintain an AST invariant across module load/save: if any declaration
of a function has a resolved exception specification, then all declarations of
the function do.

We should probably improve the AST representation to make this implicit (perhaps
only store the exception specification on the canonical declaration), but this
fixes things for now.

The testcase for this (which used to assert) also exposes the actual bug I was
trying to reduce here: we sometimes fail to emit the body of an imported
special member function definition. Fix for that to follow.

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

10 years agoFactor out exception specification information from
Richard Smith [Thu, 31 Jul 2014 21:57:55 +0000 (21:57 +0000)]
Factor out exception specification information from
FunctionProtoType::ExtProtoInfo. Most of the users of these fields don't care
about the other ExtProtoInfo bits and just want to talk about the exception
specification.

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

10 years agoLoop hint pragmas sometimes do not contain an identifier option (such as #pragma...
Aaron Ballman [Thu, 31 Jul 2014 21:24:32 +0000 (21:24 +0000)]
Loop hint pragmas sometimes do not contain an identifier option (such as #pragma unroll(4)). Check explicitly that the token we stored was an identifier.

Amends r214432

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

10 years agoImplemented a diagnostic to handle multiple, distinct ownership_return attributes...
Aaron Ballman [Thu, 31 Jul 2014 20:44:26 +0000 (20:44 +0000)]
Implemented a diagnostic to handle multiple, distinct ownership_return attributes on the same declaration. This removes a FIXME from the code.

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

10 years agoAdd a state variable to the loop hint attribute.
Tyler Nowicki [Thu, 31 Jul 2014 20:15:14 +0000 (20:15 +0000)]
Add a state variable to the loop hint attribute.

This patch is necessary to support constant expressions which replaces the integer value in the loop hint attribute with an expression. The integer value was also storing the pragma’s state for options like vectorize(enable/disable) and the pragma unroll and nounroll directive. The state variable is introduced to hold the state of those options/pragmas. This moves the validation of the state (keywords) from SemaStmtAttr handler to the loop hint annotation token handler.

Resubmit with changes to try to fix the build-bot issue.

Reviewed by Aaron Ballman

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

10 years agoLocal extern redeclarations of dllimport variables stay dllimport even if they don...
Hans Wennborg [Thu, 31 Jul 2014 19:29:39 +0000 (19:29 +0000)]
Local extern redeclarations of dllimport variables stay dllimport even if they don't specify the attribute

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

10 years agoReformat docstring to 80-col
Eli Bendersky [Thu, 31 Jul 2014 18:12:17 +0000 (18:12 +0000)]
Reformat docstring to 80-col

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

10 years agoRemoving an outdated FIXME. No functional changes.
Aaron Ballman [Thu, 31 Jul 2014 18:09:13 +0000 (18:09 +0000)]
Removing an outdated FIXME. No functional changes.

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

10 years agoExposes a C API to name mangling for a given cursor.
Eli Bendersky [Thu, 31 Jul 2014 18:04:56 +0000 (18:04 +0000)]
Exposes a C API to name mangling for a given cursor.

Inspired by https://gist.github.com/tritao/2766291, and was previously discussed
on cfe-dev: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-June/037577.html

Adding testing capability via c-index-test.

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

10 years agoObective-C. Patch to fix the incorrect ObjcMessageExpr argument source ranges,
Fariborz Jahanian [Thu, 31 Jul 2014 17:39:50 +0000 (17:39 +0000)]
Obective-C. Patch to fix the incorrect ObjcMessageExpr argument source ranges,
when arguments are structures or classes. PR16392.
patch by Karlis Senko

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

10 years agoDelay check for prototype on __fastcall functions until after MergeFunctionDecl.
Nico Weber [Thu, 31 Jul 2014 17:19:18 +0000 (17:19 +0000)]
Delay check for prototype on __fastcall functions until after MergeFunctionDecl.

In C, it is only known after merging decls if a function with 0 arguments has
a prototype.  Fixes PR20386, see that for more notes.

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

10 years agoAutomate attribute argument count semantic checking when there are variadic or option...
Aaron Ballman [Thu, 31 Jul 2014 16:37:04 +0000 (16:37 +0000)]
Automate attribute argument count semantic checking when there are variadic or optional arguments present. With this, the only time you should have to manually check attribute argument counts is when HasCustomParsing is set to true, or when you have variadic arguments that aren't really variadic (like ownership_holds and friends).

Updating the diagnostics in the launch_bounds test since they have been improved in that case. Adding a test for nonnull since it has little test coverage, but has truly variadic arguments.

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

10 years agoms-inline-asm: Add a test to ensure that call doesn't clobber eax.
Ehsan Akhgari [Thu, 31 Jul 2014 13:43:17 +0000 (13:43 +0000)]
ms-inline-asm: Add a test to ensure that call doesn't clobber eax.

Note that it's not clear whether this is the right behavior, please see
the review for the discussion.

Reviewers: rnk

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D4577

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

10 years agoFix parsing of classes where the class name is an absolute nested name specifier.
Manuel Klimek [Thu, 31 Jul 2014 07:19:30 +0000 (07:19 +0000)]
Fix parsing of classes where the class name is an absolute nested name specifier.

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

10 years agoPR18097: Support initializing an _Atomic(T) from an object of C++ class type T
Richard Smith [Thu, 31 Jul 2014 06:31:19 +0000 (06:31 +0000)]
PR18097: Support initializing an _Atomic(T) from an object of C++ class type T
or a class derived from T. We already supported this when initializing
_Atomic(T) from T for most (and maybe all) other reasonable values of T.

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

10 years agoSema: Disallow taking the address of a bitfield coming from preincrement
David Majnemer [Thu, 31 Jul 2014 04:52:13 +0000 (04:52 +0000)]
Sema: Disallow taking the address of a bitfield coming from preincrement

Clang forgot that '++s.m' was a bitfield l-value and permit it's address
to be taken; this would crash at CodeGen-time.

Instead, propagate the object-kind when we see the prefix
increment/decrement.

This fixes PR20496.

Differential Revision: http://reviews.llvm.org/D4733

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

10 years ago[AVX512] Add unaligned FP load intrinsics
Adam Nemet [Thu, 31 Jul 2014 04:00:39 +0000 (04:00 +0000)]
[AVX512] Add unaligned FP load intrinsics

Part of <rdar://problem/17688758>

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

10 years agoRevert r214333, "Add a state variable to the loop hint attribute."
NAKAMURA Takumi [Thu, 31 Jul 2014 01:52:33 +0000 (01:52 +0000)]
Revert r214333, "Add a state variable to the loop hint attribute."

It brought undefined behavior.

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

10 years agoRename this test so that it actually runs, and fix it so that it passes.
Richard Smith [Thu, 31 Jul 2014 00:22:56 +0000 (00:22 +0000)]
Rename this test so that it actually runs, and fix it so that it passes.

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

10 years agoUpdating a comment related to the implementation of -Woverloaded-virtual, and adding...
Aaron Ballman [Wed, 30 Jul 2014 23:50:53 +0000 (23:50 +0000)]
Updating a comment related to the implementation of -Woverloaded-virtual, and adding a FIXME to a test case. (Drive-by removal of trailing whitespace in the test case as well.)

No functional changes.

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

10 years agoUpdate for llvm change.
Rafael Espindola [Wed, 30 Jul 2014 22:52:16 +0000 (22:52 +0000)]
Update for llvm change.

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

10 years agoAdd a state variable to the loop hint attribute.
Tyler Nowicki [Wed, 30 Jul 2014 20:54:33 +0000 (20:54 +0000)]
Add a state variable to the loop hint attribute.

This patch is necessary to support constant expressions which replaces the integer value in the loop hint attribute with an expression. The integer value was also storing the pragma’s state for options like vectorize(enable/disable) and the pragma unroll and nounroll directive. The state variable is introduced to hold the state of those options/pragmas. This moves the validation of the state (keywords) from SemaStmtAttr handler to the loop hint annotation token handler.

Reviewed by Aaron Ballman

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

10 years ago[AVX512] Add intrinsic for knot
Adam Nemet [Wed, 30 Jul 2014 16:51:27 +0000 (16:51 +0000)]
[AVX512] Add intrinsic for knot

Part of <rdar://problem/17688758>

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

10 years ago[AVX512] Add some of the FP cast intrinsics
Adam Nemet [Wed, 30 Jul 2014 16:51:24 +0000 (16:51 +0000)]
[AVX512] Add some of the FP cast intrinsics

Part of <rdar://problem/17688758>

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

10 years ago[AVX512] Add set1 intrinsics
Adam Nemet [Wed, 30 Jul 2014 16:51:22 +0000 (16:51 +0000)]
[AVX512] Add set1 intrinsics

(Dropped the byte and word variants from the patch.  Turns out these are not
part of AVX512F but only AVX512BW/VL.)

Part of <rdar://problem/17688758>

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

10 years agoAdd OpenCL/SPIR kernel_arg_base_type metadata node
Fraser Cormack [Wed, 30 Jul 2014 14:39:53 +0000 (14:39 +0000)]
Add OpenCL/SPIR kernel_arg_base_type metadata node

As defined in the SPIR 1.2 specification, this node behaves similarly to
kernel_arg_type but will print the underlying type name, e.g., without
typedefs.

Example:
  typedef unsigned int myunsignedint;
would report:
  'myunsignedint' in the kernel_arg_type node
  'uint' in the kernel_arg_base_type node

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

10 years ago[SKX] Enabling SKX target (Skylake server chip)
Robert Khasanov [Wed, 30 Jul 2014 13:53:40 +0000 (13:53 +0000)]
[SKX] Enabling SKX target (Skylake server chip)
a) add SKX support to Clang driver;
b) add tests for SKX target and AVX512BW, AVX512DQ, AVX512VL features into clang driver tests

Patch by Zinovy Nis <zinovy.y.nis@intel.com>

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

10 years agoFix OpenCL/SPIR kernel_arg_type metadata node
Fraser Cormack [Wed, 30 Jul 2014 13:41:12 +0000 (13:41 +0000)]
Fix OpenCL/SPIR kernel_arg_type metadata node

This fixes a bug where kernel_arg_type was always changing 'unsigned ' to 'u'
for any parameter type, including non-canonical types.

Example:
  typedef unsigned int myunsignedint;
would report:
  "myunt"

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

10 years agoSuppress clang/test/Sema/struct-packed-align.c also on msvc for investigating.
NAKAMURA Takumi [Wed, 30 Jul 2014 12:17:38 +0000 (12:17 +0000)]
Suppress clang/test/Sema/struct-packed-align.c also on msvc for investigating.

FIXME: This test is incompatible to MS compat mode.
FIXME: Don't suppress this also on mingw. :-p

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

10 years agoclang-format: Understand 'typename' in placement new.
Daniel Jasper [Wed, 30 Jul 2014 12:14:10 +0000 (12:14 +0000)]
clang-format: Understand 'typename' in placement new.

Before:
  new (aaaaaaaaaaaaaaaaaaaaaaaaaa(
      aaaaaaaaaaaaaaaaaaaaaaa)) typename aaaaaaaaaaaaaaaaaaaaaaaa();

After:
  new (aaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaa))
      typename aaaaaaaaaaaaaaaaaaaaaaaa();

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

10 years agoSuppress clang/test/Sema/struct-packed-align.c for targeting LLP64.
NAKAMURA Takumi [Wed, 30 Jul 2014 10:44:35 +0000 (10:44 +0000)]
Suppress clang/test/Sema/struct-packed-align.c for targeting LLP64.

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

10 years ago[Driver][Mips] Add function-wrapper so simplify creation of `Multilib` objects.
Simon Atanasyan [Wed, 30 Jul 2014 09:15:10 +0000 (09:15 +0000)]
[Driver][Mips] Add function-wrapper so simplify creation of `Multilib` objects.

No functional changes.

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

10 years agoAST: Simplify some code
David Majnemer [Wed, 30 Jul 2014 08:42:33 +0000 (08:42 +0000)]
AST: Simplify some code

Iterator invalidation issues already force us to do one lookup and one
insert.
Don't use the particular bit-pattern of the 'Align' field to determine
whether or not we have already inserted into the TypeInfo DenseMap;
instead ask for an iterator to the TypeInfo entry.

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