]> granicus.if.org Git - clang/log
clang
9 years agoUse AddString/ReadString instead of doing it manually NFC
Ben Langmuir [Tue, 23 Jun 2015 18:20:23 +0000 (18:20 +0000)]
Use AddString/ReadString instead of doing it manually NFC

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

9 years ago[Modules] Consider -fmodule-feature in module hash and when loading
Ben Langmuir [Tue, 23 Jun 2015 18:20:18 +0000 (18:20 +0000)]
[Modules] Consider -fmodule-feature in module hash and when loading

Any extra features from -fmodule-feature are part of the module hash and
need to get validated on load.  Also print them with -module-file-info.

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

9 years agoDriver: Pass -I options to cc1as for .include search paths.
Jim Grosbach [Tue, 23 Jun 2015 18:20:13 +0000 (18:20 +0000)]
Driver: Pass -I options to cc1as for .include search paths.

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

9 years agoAdding a title to appease the sphinx build bot.
Aaron Ballman [Tue, 23 Jun 2015 17:31:30 +0000 (17:31 +0000)]
Adding a title to appease the sphinx build bot.

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

9 years agoAttributeReference.rst is automatically generated by a server-side process currently...
Aaron Ballman [Tue, 23 Jun 2015 17:14:51 +0000 (17:14 +0000)]
AttributeReference.rst is automatically generated by a server-side process currently. To cut down on accidental commits to this file that are not properly reflected in AttrDocs.td (such as r215806 - r215808), this file now contains nothing but a comment explaining the current state of affairs.

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

9 years ago[OPENMP] Initial support for 'depend' clause (4.0).
Alexey Bataev [Tue, 23 Jun 2015 14:25:19 +0000 (14:25 +0000)]
[OPENMP] Initial support for 'depend' clause (4.0).

Parsing and sema analysis (without support for array sections in arguments) for 'depend' clause (used in 'task' directive, OpenMP 4.0).

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

9 years agoUpdate for LLVM api change.
Rafael Espindola [Tue, 23 Jun 2015 13:59:36 +0000 (13:59 +0000)]
Update for LLVM api change.

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

9 years agoMoving r215806, r215807, and r215808 into AttrDocs.td. These changes were originally...
Aaron Ballman [Tue, 23 Jun 2015 13:41:03 +0000 (13:41 +0000)]
Moving r215806, r215807, and r215808 into AttrDocs.td. These changes were originally applied to the RST file that is automatically generated by the server, and so the changes were never properly reflected online once the server overwrote AttributeReference.rst.

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

9 years agoFixing a build bot break from r240400.
Aaron Ballman [Tue, 23 Jun 2015 13:29:33 +0000 (13:29 +0000)]
Fixing a build bot break from r240400.

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

9 years agoClarify pointer ownership semantics by hoisting the std::unique_ptr creation to the...
Aaron Ballman [Tue, 23 Jun 2015 13:15:32 +0000 (13:15 +0000)]
Clarify pointer ownership semantics by hoisting the std::unique_ptr creation to the caller instead of hiding it in emitReport. NFC.

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

9 years agoFix a warning. [-Wsign-compare]
NAKAMURA Takumi [Tue, 23 Jun 2015 10:01:20 +0000 (10:01 +0000)]
Fix a warning. [-Wsign-compare]

FIXME: Should "Level" be unsigned?

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

9 years agoSilence VC warning C4715: '`anonymous namespace'::getNativeVectorSizeForA VXABI' :
Yaron Keren [Tue, 23 Jun 2015 09:45:42 +0000 (09:45 +0000)]
Silence VC warning C4715: '`anonymous namespace'::getNativeVectorSizeForA VXABI' :
not all control paths return a value.

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

9 years agoWrite output file to temp directory. The tests shouldn't assume that
Daniel Jasper [Tue, 23 Jun 2015 09:26:37 +0000 (09:26 +0000)]
Write output file to temp directory. The tests shouldn't assume that
they can write to the current working directory.

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

9 years agoTweak clang/test/Modules/modules-with-same-name.m to run with GnuWin32's find.exe...
NAKAMURA Takumi [Tue, 23 Jun 2015 08:37:21 +0000 (08:37 +0000)]
Tweak clang/test/Modules/modules-with-same-name.m to run with GnuWin32's find.exe on newer version of Windows.

It seems "*.pcm" would be expanded with current directory by NTOS 6.x's msvcrt. GnuWin32 utils are affected.
To avoid the issue, put an expression that msvcrt's glob won't match, like "*.pc[m]".

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

9 years ago[MS ABI] Rework member pointer conversion
David Majnemer [Tue, 23 Jun 2015 07:31:11 +0000 (07:31 +0000)]
[MS ABI] Rework member pointer conversion

Member pointers in the MS ABI are made complicated due to the following:
- Virtual methods in the most derived class (MDC) might live in a
  vftable in a virtual base.
- There are four different representations of member pointer: single
  inheritance, multiple inheritance, virtual inheritance and the "most
  general" representation.
- Bases might have a *more* general representation than classes which
  derived from them, a most surprising result.

We believed that we could treat all member pointers as-if they were a
degenerate case of the multiple inheritance model.  This fell apart once
we realized that implementing standard member pointers using this ABI
requires referencing members with a non-zero vbindex.

On a bright note, all but the virtual inheritance model operate rather
similarly.  The virtual inheritance member pointer representation
awkwardly requires a virtual base adjustment in order to refer to
entities in the MDC.

However, the first virtual base might be quite far from the start of the
virtual base.  This means that we must add a negative non-virtual
displacement.

However, things get even more complicated.  The most general
representation interprets vbindex zero differently from the virtual
inheritance model: it doesn't reference the vbtable at all.

It turns out that this complexity can increase for quite some time:
consider a derived to base conversion from the most general model to the
multiple inheritance model...

To manage this complexity we introduce a concept of "normalized" member
pointer which allows us to treat all three models as the most general
model.  Then we try to figure out how to map this generalized member
pointer onto the destination member pointer model.  I've done my best to
furnish the code with comments explaining why each adjustment is
performed.

This fixes PR23878.

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

9 years ago[MS ABI] Refactor member pointer generation
David Majnemer [Tue, 23 Jun 2015 07:31:07 +0000 (07:31 +0000)]
[MS ABI] Refactor member pointer generation

The MS ABI has very complicated member pointers.  Don't attempt to
synthesize the final member pointer ab ovo usque ad mala in one go.

Instead, start with a member pointer which points to the declaration in
question as-if it's decl context was the target class.  Then, utilize
our conversion logical to convert it to the target type.

This allows us to simplify how we think about member pointers because we
don't need to consider non-zero nv adjustments before we even generate
the member pointer.  Furthermore, it gives our adjustment logic more
exposure by utilizing it in a common path.

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

9 years ago[CodeGen] Rename EmitMemberPointer to EmitMemberFunctionPointer
David Majnemer [Tue, 23 Jun 2015 07:31:01 +0000 (07:31 +0000)]
[CodeGen] Rename EmitMemberPointer to EmitMemberFunctionPointer

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

9 years ago[OPENMP] Do not emit references to original variables in 'private' clause.
Alexey Bataev [Tue, 23 Jun 2015 04:51:00 +0000 (04:51 +0000)]
[OPENMP] Do not emit references to original variables in 'private' clause.

Currently if the variable is captured in captured region, capture record for this region stores reference to this variable for future use. But we don't need to provide the reference to the original variable if it was explicitly marked as private in the 'private' clause of the OpenMP construct, this variable is replaced by private copy.
Differential Revision: http://reviews.llvm.org/D9550

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

9 years agoEliminate "enumeration value not handled in switch" warnings
Douglas Katzman [Tue, 23 Jun 2015 04:20:44 +0000 (04:20 +0000)]
Eliminate "enumeration value not handled in switch" warnings

(Caused by r240370)

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

9 years agoChange some if/else chains to 'switch' statements. NFC
Douglas Katzman [Tue, 23 Jun 2015 03:02:39 +0000 (03:02 +0000)]
Change some if/else chains to 'switch' statements. NFC

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

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

9 years agoRevert r240270 ("Fixed/added namespace ending comments using clang-tidy").
Alexander Kornienko [Mon, 22 Jun 2015 23:07:51 +0000 (23:07 +0000)]
Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").

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

9 years ago[modules] When building a module, if there are multiple matches for a header
Richard Smith [Mon, 22 Jun 2015 22:20:47 +0000 (22:20 +0000)]
[modules] When building a module, if there are multiple matches for a header
file in the loaded module maps and one of them is from the current module,
that's the right match.

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

9 years agoUpdate for LLVM API change to return by InputArgList directly (rather than by pointer...
David Blaikie [Mon, 22 Jun 2015 22:07:27 +0000 (22:07 +0000)]
Update for LLVM API change to return by InputArgList directly (rather than by pointer) from ParseArgs

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

9 years ago[CodeGen] Teach X86_64ABIInfo about AVX512.
Ahmed Bougacha [Mon, 22 Jun 2015 21:31:43 +0000 (21:31 +0000)]
[CodeGen] Teach X86_64ABIInfo about AVX512.

As specified in the SysV AVX512 ABI drafts. It follows the same scheme
as AVX2:

    Arguments of type __m512 are split into eight eightbyte chunks.
    The least significant one belongs to class SSE and all the others
    to class SSEUP.

This also means we change the OpenMP SIMD default alignment on AVX512.

Based on r240337.
Differential Revision: http://reviews.llvm.org/D9894

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

9 years ago[CodeGen] Use enum for AVX level in X86*TargetCodeGenInfo. NFCI.
Ahmed Bougacha [Mon, 22 Jun 2015 21:30:39 +0000 (21:30 +0000)]
[CodeGen] Use enum for AVX level in X86*TargetCodeGenInfo. NFCI.

Follow-up to r237989: expressing the AVX level as an enum makes it
simple to extend it with AVX512.

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

9 years ago[modules] Add a flag to disable the feature that permits conflicting redefinitions...
Richard Smith [Mon, 22 Jun 2015 21:15:01 +0000 (21:15 +0000)]
[modules] Add a flag to disable the feature that permits conflicting redefinitions of internal-linkage symbols that are not visible.

Such conflicts are an accident waiting to happen, and this feature conflicts
with the desire to include existing headers into multiple modules and merge the
results. (In an ideal world, it should not be possible to export internal
linkage symbols from a module, but sadly the glibc and libstdc++ headers
provide 'static inline' functions in a few cases.)

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

9 years agoAdd comment about the importance of being adjacent. NFC
Douglas Katzman [Mon, 22 Jun 2015 20:55:31 +0000 (20:55 +0000)]
Add comment about the importance of being adjacent. NFC

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

9 years agotest: Set lit features appropriately when using asan and ubsan together
Justin Bogner [Mon, 22 Jun 2015 18:47:10 +0000 (18:47 +0000)]
test: Set lit features appropriately when using asan and ubsan together

The asan/not_asan and ubsan/not_ubsan features weren't being set
correctly when LLVM_USE_SANITIZER is set to 'Address;Undefined'. Fix
this by doing substring instead of exact matching. Also simplify the
msan check for consistency.

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

9 years ago[modules] Include merged definition information in AST dumps.
Richard Smith [Mon, 22 Jun 2015 18:47:01 +0000 (18:47 +0000)]
[modules] Include merged definition information in AST dumps.

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

9 years agoMisc. cleanups suggested by Aaron Ballman
Douglas Gregor [Mon, 22 Jun 2015 17:19:03 +0000 (17:19 +0000)]
Misc. cleanups suggested by Aaron Ballman

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

9 years agoDocument the nullability attributes.
Douglas Gregor [Mon, 22 Jun 2015 17:06:56 +0000 (17:06 +0000)]
Document the nullability attributes.

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

9 years agoDon't use &* when get() will suffice; NFC.
Aaron Ballman [Mon, 22 Jun 2015 13:28:21 +0000 (13:28 +0000)]
Don't use &* when get() will suffice; NFC.

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

9 years agoFixed/added namespace ending comments using clang-tidy. NFC
Alexander Kornienko [Mon, 22 Jun 2015 09:47:44 +0000 (09:47 +0000)]
Fixed/added namespace ending comments using clang-tidy. NFC

The patch is generated using this command:

  $ tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \
      -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \
      work/llvm/tools/clang

To reduce churn, not touching namespaces spanning less than 10 lines.

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

9 years agoRemove incomplete comment.
Davide Italiano [Mon, 22 Jun 2015 01:19:59 +0000 (01:19 +0000)]
Remove incomplete comment.

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

9 years agoSema: add a helper for enumerating the TST id (NFC)
Saleem Abdulrasool [Sun, 21 Jun 2015 23:05:52 +0000 (23:05 +0000)]
Sema: add a helper for enumerating the TST id (NFC)

The same pattern was repeated a few times.  Create a trivial helper method to
map the Type Specifier to an ID for the diagnostic.  Flip the selection order on
one of the diagnostic messages to get the same ordering across all of the
messages.  This makes the emission of the diagnostic slightly more legible by
changing the cascading ternary into a switch in a function.  NFC.

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

9 years agoClean up CLCompatOptions.td a bit.
Nico Weber [Sun, 21 Jun 2015 20:49:05 +0000 (20:49 +0000)]
Clean up CLCompatOptions.td a bit.

Move /Qvec flags from the "// Non-aliases:" section up to the "// Aliases:"
section since the flags are just aliases.  For the same reason, move the
/vm flags the other way.  Also reflow a few lines to 80 columns.

No behavior change.

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

9 years agoASTReader: Treat InputFileOffsets as unaligned to avoid UB
Justin Bogner [Sun, 21 Jun 2015 20:32:40 +0000 (20:32 +0000)]
ASTReader: Treat InputFileOffsets as unaligned to avoid UB

This is a better approach to fixing the undefined behaviour I tried to
fix in r240228. This data doesn't necessarily have suitable alignment
for uint64_t, so use unaligned_uint64_t instead.

This fixes 225 test failures when clang is built with ubsan.

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

9 years agoRevert "ASTReader: Copy input file offset data to avoid unaligned accesses"
Justin Bogner [Sun, 21 Jun 2015 20:32:36 +0000 (20:32 +0000)]
Revert "ASTReader: Copy input file offset data to avoid unaligned accesses"

We can do this better by changing the type to unaligned_uint64_t and
paying the cost on use instead of up front.

This reverts r240228

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

9 years agoSema: convert decl + while loop into for loop (NFC)
Saleem Abdulrasool [Sun, 21 Jun 2015 18:20:01 +0000 (18:20 +0000)]
Sema: convert decl + while loop into for loop (NFC)

Convert a hand rolled for loop into an explicit for loop.  NFC.

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

9 years ago[Codegen] Don't crash if destructor is not accessible.
Davide Italiano [Sun, 21 Jun 2015 16:33:50 +0000 (16:33 +0000)]
[Codegen] Don't crash if destructor is not accessible.

Testcase provided, in the PR, by Christian Shelton and
reduced by David Majnemer.

PR: 23584
Differential Revision: http://reviews.llvm.org/D10508
Reviewed by: rnk

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

9 years agoArrayRef-ify ParseArgs
David Blaikie [Sun, 21 Jun 2015 06:32:36 +0000 (06:32 +0000)]
ArrayRef-ify ParseArgs

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

9 years agoASTReader: Copy input file offset data to avoid unaligned accesses
Justin Bogner [Sat, 20 Jun 2015 22:31:04 +0000 (22:31 +0000)]
ASTReader: Copy input file offset data to avoid unaligned accesses

We interpret Blob as an array of uint64_t here, but there's no reason
to think that it has suitable alignment. Instead, read the data in in
an alignment-safe way and store it in a std::vector.

This fixes 225 test failures when clang is built with ubsan.

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

9 years agoIntroduce a PCHContainerOperations interface (NFC).
Adrian Prantl [Sat, 20 Jun 2015 18:53:08 +0000 (18:53 +0000)]
Introduce a PCHContainerOperations interface (NFC).

A PCHContainerOperations abstract interface provides operations for
creating and unwrapping containers for serialized ASTs (precompiled
headers and clang modules). The default implementation is
RawPCHContainerOperations, which uses a flat file for the output.

The main application for this interface will be an
ObjectFilePCHContainerOperations implementation that uses LLVM to
wrap the module in an ELF/Mach-O/COFF container to store debug info
alongside the AST.

rdar://problem/20091852

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

9 years agoAvoid clearing an empty PrioritizedCXXGlobalInits, NFC
Yaron Keren [Sat, 20 Jun 2015 15:51:52 +0000 (15:51 +0000)]
Avoid clearing an empty PrioritizedCXXGlobalInits, NFC

We already test for PrioritizedCXXGlobalInits being non-empty
and process it so it makes sense to clear it only in that if.

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

9 years agoASTContext.h: Fix utf8 chars in comments.
NAKAMURA Takumi [Sat, 20 Jun 2015 04:20:23 +0000 (04:20 +0000)]
ASTContext.h: Fix utf8 chars in comments.

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

9 years agoSemaDeclObjC.cpp: Escape '@' in the comment. [-Wdocumentation]
NAKAMURA Takumi [Sat, 20 Jun 2015 03:52:52 +0000 (03:52 +0000)]
SemaDeclObjC.cpp: Escape '@' in the comment. [-Wdocumentation]

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

9 years ago[modules] When determining whether a definition of a class is visible, check all...
Richard Smith [Sat, 20 Jun 2015 01:05:19 +0000 (01:05 +0000)]
[modules] When determining whether a definition of a class is visible, check all modules even if we've already found a definition that's not visible.

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

9 years ago[modules] Refactor and slightly simplify class definition merging.
Richard Smith [Sat, 20 Jun 2015 00:22:34 +0000 (00:22 +0000)]
[modules] Refactor and slightly simplify class definition merging.

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

9 years agoSuppress bogus gcc -Wreturn-type warnings.
Nico Weber [Sat, 20 Jun 2015 00:06:30 +0000 (00:06 +0000)]
Suppress bogus gcc -Wreturn-type warnings.

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

9 years agoYet another MSVC-related fix.
Douglas Gregor [Fri, 19 Jun 2015 23:59:55 +0000 (23:59 +0000)]
Yet another MSVC-related fix.

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

9 years agoTry to fix the MSVC build
Douglas Gregor [Fri, 19 Jun 2015 23:18:05 +0000 (23:18 +0000)]
Try to fix the MSVC build

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

9 years agoStop moving attributes off of a block literal's decl specifiers.
Douglas Gregor [Fri, 19 Jun 2015 23:18:03 +0000 (23:18 +0000)]
Stop moving attributes off of a block literal's decl specifiers.

These usually apply to the return type. At one point this was necessary to
get some of them to apply to the entire block, but it appears that's working
anyway (see block-return.c).

rdar://problem/20468034

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

9 years agoHandle 'instancetype' in ParseDeclarationSpecifiers.
Douglas Gregor [Fri, 19 Jun 2015 23:18:00 +0000 (23:18 +0000)]
Handle 'instancetype' in ParseDeclarationSpecifiers.

...instead of as a special case in ParseObjCTypeName with lots of
duplicated logic. Besides being a nice refactoring, this also allows
"- (instancetype __nonnull)self" in addition to "- (nonnull instancetype)self".

rdar://problem/19924646

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

9 years agoMake -Wnullability-completeness work with -Wsystem-headers.
Douglas Gregor [Fri, 19 Jun 2015 23:17:55 +0000 (23:17 +0000)]
Make -Wnullability-completeness work with -Wsystem-headers.

rdar://problem/21134250

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

9 years agoCF_RETURNS_[NOT_]RETAINED on a param makes the inner pointer __nullable.
Douglas Gregor [Fri, 19 Jun 2015 23:17:51 +0000 (23:17 +0000)]
CF_RETURNS_[NOT_]RETAINED on a param makes the inner pointer __nullable.

That is,

  void cf2(CFTypeRef * __nullable p CF_RETURNS_NOT_RETAINED);

is equivalent to

  void cf2(CFTypeRef __nullable * __nullable p CF_RETURNS_NOT_RETAINED);

More rdar://problem/18742441

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

9 years agoAllow the cf_returns_[not_]retained attributes to appear on out-parameters.
Douglas Gregor [Fri, 19 Jun 2015 23:17:46 +0000 (23:17 +0000)]
Allow the cf_returns_[not_]retained attributes to appear on out-parameters.

Includes a simple static analyzer check and not much else, but we'll also
be able to take advantage of this in Swift.

This feature can be tested for using __has_feature(cf_returns_on_parameters).

This commit also contains two fixes:
- Look through non-typedef sugar when deciding whether something is a CF type.
- When (cf|ns)_returns(_not)?_retained is applied to invalid properties,
  refer to "property" instead of "method" in the error message.

rdar://problem/18742441

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

9 years ago[Sanitizers] Provide better diagnostic for sanitizers unsupported for target triple.
Alexey Samsonov [Fri, 19 Jun 2015 21:36:47 +0000 (21:36 +0000)]
[Sanitizers] Provide better diagnostic for sanitizers unsupported for target triple.

Introduce ToolChain::getSupportedSanitizers() that would return the set
of sanitizers available on given toolchain. By default, these are
sanitizers which don't necessarily require runtime support and are
not toolchain- or architecture-dependent.

Sanitizers (ASan, DFSan, TSan, MSan etc.) which cannot function
without runtime library are marked as supported only on platforms
for which we actually build these runtimes.

This would allow more fine-grained checks in the future: for instance,
we have to restrict availability of -fsanitize=vptr to Mac OS 10.9+
(PR23539).

Update test cases accrodingly: add tests for certain unsupported
configurations, remove test cases for -fsanitize=vptr + PS4
integration, as we don't build the runtime for PS4 at the moment.

This change was first submitted as r239953 and reverted in r239958.
The problem was and still is in Darwin toolchains, which get the
knowledge about target platform too late after initializaition, while
now we require this information when ToolChain::getSanitizerArgs() is
called. r240170 works around this issue.

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

9 years agoFix a use of err_nullability_conflicting that's triggering an assertion.
Douglas Gregor [Fri, 19 Jun 2015 20:00:10 +0000 (20:00 +0000)]
Fix a use of err_nullability_conflicting that's triggering an assertion.

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

9 years ago[CFI] Require -flto instead of implying it.
Alexey Samsonov [Fri, 19 Jun 2015 19:57:46 +0000 (19:57 +0000)]
[CFI] Require -flto instead of implying it.

Summary:
This is unfortunate, but would let us land http://reviews.llvm.org/D10467,
that makes ToolChains responsible for computing the set of sanitizers
they support.

Unfortunately, Darwin ToolChains doesn't know about actual OS they
target until ToolChain::TranslateArgs() is called. In particular, it
means we won't be able to construct SanitizerArgs for these ToolChains
before that.

This change removes SanitizerArgs::needsLTO() method, so that now
ToolChain::IsUsingLTO(), which is called very early, doesn't need
SanitizerArgs to implement this method.

Docs and test cases are updated accordingly. See
https://llvm.org/bugs/show_bug.cgi?id=23539, which describes why we
start all these.

Test Plan: regression test suite

Reviewers: pcc

Subscribers: cfe-commits

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

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

9 years agoCode completion for nullability type specifiers.
Douglas Gregor [Fri, 19 Jun 2015 18:27:52 +0000 (18:27 +0000)]
Code completion for nullability type specifiers.

Another part of rdar://problem/18868820.

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

9 years agoCheck for consistent use of nullability type specifiers in a header.
Douglas Gregor [Fri, 19 Jun 2015 18:27:45 +0000 (18:27 +0000)]
Check for consistent use of nullability type specifiers in a header.

Adds a new warning (under -Wnullability-completeness) that complains
about pointer, block pointer, or member pointer declarations that have
not been annotated with nullability information (directly or inferred)
within a header that contains some nullability annotations. This is
intended to be used to help maintain the completeness of nullability
information within a header that has already been audited.

Note that, for performance reasons, this warning will underrepresent
the number of non-annotated pointers in the case where more than one
pointer is seen before the first nullability type specifier, because
we're only tracking one piece of information per header. Part of
rdar://problem/18868820.

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

9 years agoIntroduced pragmas for audited nullability regions.
Douglas Gregor [Fri, 19 Jun 2015 18:25:57 +0000 (18:25 +0000)]
Introduced pragmas for audited nullability regions.

Introduce the clang pragmas "assume_nonnull begin" and "assume_nonnull
end" in which we make default assumptions about the nullability of many
unannotated pointers:

  - Single-level pointers are inferred to __nonnull
  - NSError** in a (function or method) parameter list is inferred to
    NSError * __nullable * __nullable.
  - CFErrorRef * in a (function or method) parameter list is inferred
    to CFErrorRef __nullable * __nullable.
  - Other multi-level pointers are never inferred to anything.

Implements rdar://problem/19191042.

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

9 years agoImplement the 'null_resettable' attribute for Objective-C properties.
Douglas Gregor [Fri, 19 Jun 2015 18:14:46 +0000 (18:14 +0000)]
Implement the 'null_resettable' attribute for Objective-C properties.

'null_resettable' properties are those whose getters return nonnull
but whose setters take nil, to "reset" the property to some
default. Implements rdar://problem/19051334.

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

9 years agoExtend type nullability qualifiers for Objective-C.
Douglas Gregor [Fri, 19 Jun 2015 18:14:38 +0000 (18:14 +0000)]
Extend type nullability qualifiers for Objective-C.

Introduce context-sensitive, non-underscored nullability specifiers
(nonnull, nullable, null_unspecified) for Objective-C method return
types, method parameter types, and properties.

Introduce Objective-C-specific semantics, including computation of the
nullability of the result of a message send, merging of nullability
information from the @interface of a class into its @implementation,
etc .

This is the Objective-C part of rdar://problem/18868820.

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

9 years agoDiagnose unsafe uses of nil and __nonnull pointers.
Douglas Gregor [Fri, 19 Jun 2015 18:13:19 +0000 (18:13 +0000)]
Diagnose unsafe uses of nil and __nonnull pointers.

This generalizes the checking of null arguments to also work with
values of pointer-to-function, reference-to-function, and block
pointer type, using the nullability information within the underling
function prototype to extend non-null checking, and diagnoses returns
of 'nil' within a function with a __nonnull return type.

Note that we don't warn about nil returns from Objective-C methods,
because it's common for Objective-C methods to mimic the nil-swallowing
behavior of the receiver by checking ostensibly non-null parameters
and returning nil from otherwise non-null methods in that
case.

It also diagnoses (via a separate flag) conversions from nullable to
nonnull pointers. It's a separate flag because this warning can be noisy.

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

9 years agoAdd a comment and FIXME based on the commit message that made the
Eric Christopher [Fri, 19 Jun 2015 18:09:33 +0000 (18:09 +0000)]
Add a comment and FIXME based on the commit message that made the
intrinsic _mm_prefetch into a builtin rather than by textual inclusion
via the intrinsic headers.

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

9 years agoAMDGPU: Fix renamed file that was somehow dropped from last commit
Matt Arsenault [Fri, 19 Jun 2015 17:55:06 +0000 (17:55 +0000)]
AMDGPU: Fix renamed file that was somehow dropped from last commit

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

9 years agoAMDGPU: Fix places missed in rename
Matt Arsenault [Fri, 19 Jun 2015 17:54:10 +0000 (17:54 +0000)]
AMDGPU: Fix places missed in rename

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

9 years agoIntroduce type nullability specifiers for C/C++.
Douglas Gregor [Fri, 19 Jun 2015 17:51:05 +0000 (17:51 +0000)]
Introduce type nullability specifiers for C/C++.

Introduces the type specifiers __nonnull, __nullable, and
__null_unspecified that describe the nullability of the pointer type
to which the specifier appertains. Nullability type specifiers improve
on the existing nonnull attributes in a few ways:
  - They apply to types, so one can represent a pointer to a non-null
    pointer, use them in function pointer types, etc.
  - As type specifiers, they are syntactically more lightweight than
    __attribute__s or [[attribute]]s.
  - They can express both the notion of 'should never be null' and
  also 'it makes sense for this to be null', and therefore can more
  easily catch errors of omission where one forgot to annotate the
  nullability of a particular pointer (this will come in a subsequent
  patch).

Nullability type specifiers are maintained as type sugar, and
therefore have no effect on mangling, encoding, overloading,
etc. Nonetheless, they will be used for warnings about, e.g., passing
'null' to a method that does not accept it.

This is the C/C++ part of rdar://problem/18868820.

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

9 years agoFix typo in comment.
Douglas Katzman [Fri, 19 Jun 2015 15:40:00 +0000 (15:40 +0000)]
Fix typo in comment.

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

9 years agoAdd nominal support for 'shave' target.
Douglas Katzman [Fri, 19 Jun 2015 14:55:19 +0000 (14:55 +0000)]
Add nominal support for 'shave' target.

This change passes through C and assembler jobs to Movidius tools by
constructing commands which are the same as ones produces by the examples
in the SDK. But rather than reference MV_TOOLS_DIR to find tools,
we will assume that binaries are installed wherever the Driver would
find its native tools. Similarly, this change assumes that -I options
will "just work" based on where SDK headers get installed, rather than
baking into the Driver some magic paths.

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

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

9 years ago[ASan] Initial support for Kernel AddressSanitizer
Alexander Potapenko [Fri, 19 Jun 2015 12:19:07 +0000 (12:19 +0000)]
[ASan] Initial support for Kernel AddressSanitizer

This patch adds initial support for the -fsanitize=kernel-address flag to Clang.
Right now it's quite restricted: only out-of-line instrumentation is supported, globals are not instrumented, some GCC kasan flags are not supported.
Using this patch I am able to build and boot the KASan tree with LLVMLinux patches from github.com/ramosian-glider/kasan/tree/kasan_llvmlinux.
To disable KASan instrumentation for a certain function attribute((no_sanitize("kernel-address"))) can be used.

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

9 years agoclang-format: Make exception to AlwaysBreakBeforeMultilineStrings more
Daniel Jasper [Fri, 19 Jun 2015 10:32:28 +0000 (10:32 +0000)]
clang-format: Make exception to AlwaysBreakBeforeMultilineStrings more
conservative.

In particular, this fixes an unwanted corner case.

Before:
  string s =
      someFunction("aaaa"
                   "bbbb");

After:
  string s = someFunction(
      "aaaa"
      "bbbb");

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

9 years agoclang-format: Add TypeScript detection to git-clang-format.
Daniel Jasper [Fri, 19 Jun 2015 08:23:10 +0000 (08:23 +0000)]
clang-format: Add TypeScript detection to git-clang-format.

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

9 years agoclang-format: Better fix to detect elaborated enum return types.
Daniel Jasper [Fri, 19 Jun 2015 08:17:32 +0000 (08:17 +0000)]
clang-format: Better fix to detect elaborated enum return types.

The previous one (r240021) regressed:
  enum E Type::f() { .. }

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

9 years ago[ATTRIBUTE] Fixed test compatibility.
Alexey Bataev [Fri, 19 Jun 2015 08:09:27 +0000 (08:09 +0000)]
[ATTRIBUTE] Fixed test compatibility.

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

9 years ago[ATTRIBUTE] Support base vector types of __attribute__((mode)), patch by Alexey Frolov
Alexey Bataev [Fri, 19 Jun 2015 07:46:21 +0000 (07:46 +0000)]
[ATTRIBUTE] Support base vector types of __attribute__((mode)), patch by Alexey Frolov

Base type of attribute((mode)) can actually be a vector type.
The patch is to distinguish between base type and base element type.

This fixes http://llvm.org/PR17453.
Differential Revision: http://reviews.llvm.org/D10058

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

9 years agoCFI: Implement bitset emission for the Microsoft ABI.
Peter Collingbourne [Fri, 19 Jun 2015 02:30:43 +0000 (02:30 +0000)]
CFI: Implement bitset emission for the Microsoft ABI.

Clang's control flow integrity implementation works by conceptually attaching
"tags" (in the form of bitset entries) to each virtual table, identifying
the names of the classes that the virtual table is compatible with. Under
the Itanium ABI, it is simple to assign tags to virtual tables; they are
simply the address points, which are available via VTableLayout. Because any
overridden methods receive an entry in the derived class's virtual table,
a check for an overridden method call can always be done by checking the
tag of whichever derived class overrode the method call.

The Microsoft ABI is a little different, as it does not directly use address
points, and overrides in a derived class do not cause new virtual table entries
to be added to the derived class; instead, the slot in the base class is
reused, and the compiler needs to adjust the this pointer at the call site
to (generally) the base class that initially defined the method. After the
this pointer has been adjusted, we cannot check for the derived class's tag,
as the virtual table may not be compatible with the derived class. So we
need to determine which base class we have been adjusted to.

Specifically, at each call site, we use ASTRecordLayout to identify the most
derived class whose virtual table is laid out at the "this" pointer offset
we are using to make the call, and check the virtual table for that tag.

Because address point information is unavailable, we "reconstruct" it as
follows: any virtual tables we create for a non-derived class receive a tag
for that class, and virtual tables for a base class inside a derived class
receive a tag for the base class, together with tags for any derived classes
which are laid out at the same position as the derived class (and therefore
have compatible virtual tables).

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

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

9 years agoFix Windows test failure.
Peter Collingbourne [Fri, 19 Jun 2015 02:24:25 +0000 (02:24 +0000)]
Fix Windows test failure.

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

9 years agoFix "the the" in comments/documentation/etc.
Eric Christopher [Fri, 19 Jun 2015 01:52:53 +0000 (01:52 +0000)]
Fix "the the" in comments/documentation/etc.

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

9 years agoImplement diagnostic mode for -fsanitize=cfi*, -fsanitize=cfi-diag.
Peter Collingbourne [Fri, 19 Jun 2015 01:51:54 +0000 (01:51 +0000)]
Implement diagnostic mode for -fsanitize=cfi*, -fsanitize=cfi-diag.

This causes programs compiled with this flag to print a diagnostic when
a control flow integrity check fails instead of aborting. Diagnostics are
printed using UBSan's runtime library.

The main motivation of this feature over -fsanitize=vptr is fidelity with
the -fsanitize=cfi implementation: the diagnostics are printed under exactly
the same conditions as those which would cause -fsanitize=cfi to abort the
program. This means that the same restrictions apply regarding compiling
all translation units with -fsanitize=cfi, cross-DSO virtual calls are
forbidden, etc.

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

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

9 years agoFix hexagon test failure.
Peter Collingbourne [Fri, 19 Jun 2015 00:39:59 +0000 (00:39 +0000)]
Fix hexagon test failure.

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

9 years agoIntroduce -fsanitize-trap= flag.
Peter Collingbourne [Thu, 18 Jun 2015 23:59:22 +0000 (23:59 +0000)]
Introduce -fsanitize-trap= flag.

This flag controls whether a given sanitizer traps upon detecting
an error. It currently only supports UBSan. The existing flag
-fsanitize-undefined-trap-on-error has been made an alias of
-fsanitize-trap=undefined.

This change also cleans up some awkward behavior around the combination
of -fsanitize-trap=undefined and -fsanitize=undefined. Previously we
would reject command lines containing the combination of these two flags,
as -fsanitize=vptr is not compatible with trapping. This required the
creation of -fsanitize=undefined-trap, which excluded -fsanitize=vptr
(and -fsanitize=function, but this seems like an oversight).

Now, -fsanitize=undefined is an alias for -fsanitize=undefined-trap,
and if -fsanitize-trap=undefined is specified, we treat -fsanitize=vptr
as an "unsupported" flag, which means that we error out if the flag is
specified explicitly, but implicitly disable it if the flag was implied
by -fsanitize=undefined.

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

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

9 years ago[modules] Merging support for enums with a local definition prior to the first
Richard Smith [Thu, 18 Jun 2015 22:07:00 +0000 (22:07 +0000)]
[modules] Merging support for enums with a local definition prior to the first
imported definition.

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

9 years ago[Driver] Compute MacOS/iOS version from triple if/when we actually need it. NFC.
Alexey Samsonov [Thu, 18 Jun 2015 21:46:05 +0000 (21:46 +0000)]
[Driver] Compute MacOS/iOS version from triple if/when we actually need it. NFC.

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

9 years agoAMDGPU: Add missing GK_VOLCANIC_ISLANDS to switch statement
Tom Stellard [Thu, 18 Jun 2015 21:13:29 +0000 (21:13 +0000)]
AMDGPU: Add missing GK_VOLCANIC_ISLANDS to switch statement

This fixes buildbot failures introduced by r240038.

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

9 years ago[modules] This debugging option doesn't need to match between module creation and...
Richard Smith [Thu, 18 Jun 2015 21:10:28 +0000 (21:10 +0000)]
[modules] This debugging option doesn't need to match between module creation and use.

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

9 years agoAdd -Winfinite-recursion to -Wmost (and -Wall), PR23789.
Nico Weber [Thu, 18 Jun 2015 21:09:24 +0000 (21:09 +0000)]
Add -Winfinite-recursion to -Wmost (and -Wall), PR23789.

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

9 years agoForgot to update to a test in r240043
David Majnemer [Thu, 18 Jun 2015 20:34:05 +0000 (20:34 +0000)]
Forgot to update to a test in r240043

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

9 years ago[MS ABI] Initialize "most general" member pointers which don't point at a vbase
David Majnemer [Thu, 18 Jun 2015 20:20:10 +0000 (20:20 +0000)]
[MS ABI] Initialize "most general" member pointers which don't point at a vbase

The most general model has fields for the vbptr offset and the vbindex.
Don't initialize the vbptr offset if the vbindex is 0: we aren't
referencing an entity from a vbase.

Getting this wrong can make member pointer equality fail.

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

9 years agoWrap to 80 columns, no behavior change.
Nico Weber [Thu, 18 Jun 2015 20:09:49 +0000 (20:09 +0000)]
Wrap to 80 columns, no behavior change.

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

9 years agoR600: Add Volcanic Islands targets
Tom Stellard [Thu, 18 Jun 2015 19:14:15 +0000 (19:14 +0000)]
R600: Add Volcanic Islands targets

Reviewers: arsenm

Subscribers: cfe-commits

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

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

9 years agoAdd missing overrides to MultiplexConsumer. Test coverage will be
Adrian Prantl [Thu, 18 Jun 2015 16:41:53 +0000 (16:41 +0000)]
Add missing overrides to MultiplexConsumer. Test coverage will be
provided by an upcoming commit.

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

9 years agoFix a typo.
Adrian Prantl [Thu, 18 Jun 2015 16:41:51 +0000 (16:41 +0000)]
Fix a typo.

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

9 years agoclang-format: Row back on the AlwaysBreakBeforeMultilineStrings change.
Daniel Jasper [Thu, 18 Jun 2015 16:05:17 +0000 (16:05 +0000)]
clang-format: Row back on the AlwaysBreakBeforeMultilineStrings change.

It was a bit too aggressive.

With this patch, we keep on breaking here:
  aaaaaaaaaaaaa(aaaaaaa,
                "aaaaaaa"
                "bbbbbbb");

But don't break in:
  aaaaaaaaaaaaa(aaaaaaaaaaaaaaa("aaaaaaa"
                                  "bbbbbbb"));

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

9 years agoclang-format: Better support functions with elaborated enum return types.
Daniel Jasper [Thu, 18 Jun 2015 15:45:17 +0000 (15:45 +0000)]
clang-format: Better support functions with elaborated enum return types.

Before, this wasn't formatted properly:
  enum ::C f() {
    return a;
  }

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

9 years agoAllow case-insensitive values for -march for AArch64 target in line with GCC.
Gabor Ballabas [Thu, 18 Jun 2015 14:23:12 +0000 (14:23 +0000)]
Allow case-insensitive values for -march for AArch64 target in line with GCC.

GCC allows case-insensitive values for -mcpu, -march and -mtune options.
This patch implements the same behaviour for the -march option for the AArch64 target.

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

9 years ago[OPENMP] Codegen for 'proc_bind' clause (4.0).
Alexey Bataev [Thu, 18 Jun 2015 13:40:03 +0000 (13:40 +0000)]
[OPENMP] Codegen for 'proc_bind' clause (4.0).

Adds emission of the code for 'proc_bind(master|close|spread)' clause:
call void @__kmpc_push_proc_bind(<loc>, i32 thread_id, i32 4|3|2)

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

9 years agoclang-format: [JS] Add a special case for indenting function literals.
Daniel Jasper [Thu, 18 Jun 2015 12:32:59 +0000 (12:32 +0000)]
clang-format: [JS] Add a special case for indenting function literals.

Before:
  var func =
      function() {
        doSomething();
      };

After:
  var func =
      function() {
    doSomething();
  };

This is a very narrow special case which fixes most of the discrepency
with what our users do. In the long run, we should try to come up with
a more generic fix for indenting these.

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

9 years ago[OPENMP] Support for '#pragma omp taskgroup' directive.
Alexey Bataev [Thu, 18 Jun 2015 12:14:09 +0000 (12:14 +0000)]
[OPENMP] Support for '#pragma omp taskgroup' directive.

Added parsing, sema analysis and codegen for '#pragma omp taskgroup' directive (OpenMP 4.0).
The code for directive is generated the following way:
#pragma omp taskgroup
<body>

void __kmpc_taskgroup(<loc>, thread_id);
<body>
void __kmpc_end_taskgroup(<loc>, thread_id);

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