Commit Graph

15773 Commits

Author SHA1 Message Date
Kevin Qin caac85e612 [AArch64 neon] support poly64 and relevant intrinsic functions.
llvm-svn: 194660
2013-11-14 03:29:16 +00:00
Kevin Qin 1718af6f0a Implement aarch64 neon instruction class misc.
llvm-svn: 194657
2013-11-14 02:45:18 +00:00
Serge Pavlov 3cb8022849 Added warning on structures/unions that are empty or contain only
bit fields of zero size. Warnings are generated in C++ mode and if
only such type is defined inside extern "C" block.
The patch fixed PR5065.

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

llvm-svn: 194653
2013-11-14 02:13:03 +00:00
Jiangning Liu 18b707cb3f Implement AArch64 NEON instruction set AdvSIMD (table).
llvm-svn: 194649
2013-11-14 01:57:55 +00:00
Fariborz Jahanian 0a0a39708c ObjectiveC ARC. Introduce a new attribute, 'objc_bridge'
that teaches the compiler about a subset of toll-free 
bridging semantics. This is wip. // rdar://15454846

llvm-svn: 194633
2013-11-13 23:59:17 +00:00
Reid Kleckner 59e4a6f5e2 -fms-extensions: Recognize _alloca as an alias for the alloca builtin
Differential Revision: http://llvm-reviews.chandlerc.com/D1989

llvm-svn: 194617
2013-11-13 22:58:53 +00:00
Reid Kleckner cf8933d1b7 Only provide MS builtins when -fms-extensions is on
We already have builtins that are only available in GNU mode, so this
mirrors that.

Reviewers: rsmith

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

llvm-svn: 194615
2013-11-13 22:47:22 +00:00
Dmitri Gribenko 9e6051135a Documentation parsing: move comment-to-XML conversion routines to libIndex
llvm-svn: 194610
2013-11-13 22:16:51 +00:00
Warren Hunt 486e71460d No functional change. Renaming a variable in RecordLayoutBuilder and
improving comments to make documentation more accurate.

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

llvm-svn: 194609
2013-11-13 22:16:13 +00:00
Weiming Zhao 580dcfbd27 Adds ARM backend options: -mrestrict-it and -mno-restrict-it
To support the generation of IT block in Thumbv7 way or
Thumbv8 way

llvm-svn: 194593
2013-11-13 18:31:23 +00:00
Manuel Klimek 6192c93a53 Add an optional mapping from source paths to source contents.
This allows compilation database implementations for distributed build
systems to hand all data to the client to make parsing independent of
the file system.

llvm-svn: 194571
2013-11-13 13:23:27 +00:00
Diego Novillo 5c29705c13 Add -fprofile-sample-use to Clang's driver.
This adds a new option -fprofile-sample-use=filename to Clang. It
tells the driver to schedule the SampleProfileLoader pass and passes
on the name of the profile file to use.

llvm-svn: 194567
2013-11-13 12:22:39 +00:00
Serge Pavlov 750db65bac Warn on duplicate function specifier
This patch fixes PR8264. Duplicate qualifiers already are diagnozed,
now the same diagnostics is issued for duplicate function specifiers.

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

llvm-svn: 194559
2013-11-13 06:57:53 +00:00
Dmitri Gribenko f686ed0e09 Fix closing namespace comment to reflect reality
llvm-svn: 194543
2013-11-13 02:01:24 +00:00
Fariborz Jahanian 2e793d6124 ObjectiveC migrator. Place use of NS_NONATOMIC_IOSONLY
on inferred property attribute under
 -objcmt-ns-nonatomic-iosonly  option.
// rdar://15442742

llvm-svn: 194532
2013-11-13 00:08:36 +00:00
Hans Wennborg df01974817 clang-cl: parse the /Yc flag (PR17895)
llvm-svn: 194523
2013-11-12 22:35:26 +00:00
Dmitri Gribenko d9febeb884 Documentation parsing: add support for \throws \throw \exception commands
llvm-svn: 194521
2013-11-12 22:16:08 +00:00
Weiming Zhao 87bb4920e9 add intrinsics: __builtin_arm_{dmb,dsb} for ARM
llvm-svn: 194513
2013-11-12 21:42:50 +00:00
Hans Wennborg 63d18acc7f clang-cl: parse the /GT option
llvm-svn: 194502
2013-11-12 19:21:50 +00:00
Richard Smith 16e1b07597 Rather than duplicating extension diagnostics to allow them to cause a
substitution failure, allow a flag to be set on the Diagnostic object,
to mark it as 'causes substitution failure'.

Refactor Diagnostic.td and the tablegen to use an enum for SFINAE behavior
rather than a bunch of flags.

llvm-svn: 194444
2013-11-12 02:41:45 +00:00
Faisal Vali 524ca28b2b REFACTOR: Have PushLambdaScope return the LambdaScopeInfo that it creates.
No Functionality change.

This refactoring avoids having to call getCurLambda right after PushLambdaScope, to obtain the LambdaScopeInfo that was created during the call to PushLambdaScope. 

llvm-svn: 194438
2013-11-12 01:40:44 +00:00
Sylvestre Ledru e293b1a8d8 Revert "Using an invalid -O falls back on -O3 instead of an error"
This reverts commit r194403.

Was breaking too many tests...

llvm-svn: 194420
2013-11-11 20:51:44 +00:00
Chad Rosier 09f5251c4d [AArch64] The shift right/left and insert immediate builtins expect 3
source operands, a vector, an element to insert, and a shift amount.

llvm-svn: 194407
2013-11-11 19:11:19 +00:00
Sylvestre Ledru 26386be183 Using an invalid -O falls back on -O3 instead of an error
Summary:
Currently with clang:
$ clang -O20 foo.c 
error: invalid value '20' in '-O20'

With the patch:
$ clang -O20 foo.c 
warning: invalid value '20' in '-O20'. Fall back on value '3'

Reviewers: rengolin, hfinkel

Reviewed By: rengolin

CC: cfe-commits, hfinkel, rengolin

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

llvm-svn: 194403
2013-11-11 19:01:05 +00:00
Chad Rosier 249c714bb4 [AArch64] Add support for NEON scalar floating-point convert to fixed-point instructions.
llvm-svn: 194395
2013-11-11 18:04:22 +00:00
Rafael Espindola 236db46f79 This reverts commit r194330, r194329 and r194328.
The test was still failing on OS X and mingw.

llvm-svn: 194334
2013-11-09 20:07:19 +00:00
David Chisnall e6dcfaf127 Add support for -fuse-ld=.
llvm-svn: 194328
2013-11-09 14:16:52 +00:00
Richard Smith da35e963bc Try to recover a bit better if a close brace is missing from the end of a class
definition. If we see something that looks like a namespace definition inside a
class, that strongly indicates that a close brace was missing somewhere.

llvm-svn: 194319
2013-11-09 04:52:51 +00:00
Dmitri Gribenko 322654d0a7 Comment parsing: recognize \def (but processing is a no-op, like the rest of
similar commands that duplicate the declaration name)

llvm-svn: 194312
2013-11-09 03:50:37 +00:00
Richard Smith cd556eb265 Issue a diagnostic if we see a templated friend declaration that we do not
support.

llvm-svn: 194273
2013-11-08 18:59:56 +00:00
Timur Iskhodzhanov 2c9341f979 Thread the info about vbptr sharing through ASTRecordLayout
Reviewed at http://llvm-reviews.chandlerc.com/D2120

llvm-svn: 194256
2013-11-08 11:45:35 +00:00
Benjamin Kramer 6d9d34b5a6 Remove diagnostic leftover from the ancient times when C++1y support was incomplete.
llvm-svn: 194254
2013-11-08 09:48:11 +00:00
Douglas Gregor 9f2ed47133 s/DebugPrint/dump/g
llvm-svn: 194242
2013-11-08 02:16:10 +00:00
Fariborz Jahanian ec7cea925e ObjectiveC migrator. Fixes an obscure bug where
NS_RETURNS_INNER_POINTER ends up unintentionally 
on the @property under -objcmt-migrate-all 
// rdar://15396636

llvm-svn: 194233
2013-11-08 01:15:17 +00:00
Daniel Jasper 165b29e2d2 clang-format: Make breaking before ternary operators configurable.
llvm-svn: 194229
2013-11-08 00:57:11 +00:00
Manuel Klimek 6408301421 Adds the ability to inject a DiagnosticConsumer into ClangTools.
llvm-svn: 194226
2013-11-07 23:18:05 +00:00
Douglas Gregor 594b8c934f Modules: Teach the preprocessor to recognize 'import' only after an '@'.
The preprocessor currently recognizes module declarations to load a
module based on seeing the 'import' keyword followed by an
identifier. This sequence is fairly unlikely in C (one would need a
type named 'import'), but is more common in Objective-C (where a
variable named 'import' can cause problems). Since import declarations
currently require a leading '@', recognize that in the preprocessor as
well. Fixes <rdar://problem/15084587>.

llvm-svn: 194225
2013-11-07 22:55:02 +00:00
Douglas Gregor 4b60a1594d Re-instate contextual conversion to Objective-C pointers in message sends.
When performing an Objective-C message send to a value of class type,
perform a contextual conversion to an Objective-C pointer type. We've
had this for a long time, but it recently regressed. Fixes
<rdar://problem/15234703>.

llvm-svn: 194224
2013-11-07 22:34:54 +00:00
Peter Collingbourne a2334162cf Introduce MatchFinder::matchAST.
Differential Revision: http://llvm-reviews.chandlerc.com/D2115

llvm-svn: 194223
2013-11-07 22:30:36 +00:00
Peter Collingbourne 2b94713053 Re-introduce MatchFinder::addDynamicMatcher.
Differential Revision: http://llvm-reviews.chandlerc.com/D2114

llvm-svn: 194222
2013-11-07 22:30:32 +00:00
Timur Iskhodzhanov 9e7f505515 Minor refinement of VTableBuilder.h: fix wrong indentation, rename a struct field with a more appropriate name
llvm-svn: 194202
2013-11-07 13:34:02 +00:00
Alp Toker 3f0a99b448 RewriteBuffer: Remove an unused typedef
This hasn't been used for some time.

llvm-svn: 194191
2013-11-07 06:11:33 +00:00
Faisal Vali a17d19fb41 This patch implements capturing of variables within generic lambdas.
Both Richard and I felt that the current wording in the working paper needed some tweaking - Please see http://llvm-reviews.chandlerc.com/D2035 for additional context and references to core-reflector messages that discuss wording tweaks.

What is implemented is what we had intended to specify in Bristol; but, recently felt that the specification might benefit from some tweaking and fleshing.  

As a rough attempt to explain the semantics: If a nested lambda with a default-capture names a variable within its body, and if the enclosing full expression that contains the name of that variable is instantiation-dependent - then an enclosing lambda that is capture-ready (i.e. within a non-dependent context) must capture that variable, if all intervening nested lambdas can potentially capture that variable if they need to, and all intervening parent lambdas of the capture-ready lambda can and do capture the variable.      

Of note, 'this' capturing is also currently underspecified in the working paper for generic lambdas.  What is implemented here is if the set of candidate functions in a nested generic lambda includes both static and non-static member functions (regardless of viability checking - i.e. num and type of parameters/arguments) - and if all intervening nested-inner lambdas between the capture-ready lambda and the function-call containing nested lambda can capture 'this' and if all enclosing lambdas of the capture-ready lambda can capture 'this', then 'this' is speculatively captured by that capture-ready lambda.

Hopefully a paper for the C++ committee (that Richard and I had started some preliminary work on) is forthcoming. 

This essentially makes generic lambdas feature complete, except for known bugs. The more prominent ones (and the ones I am currently aware of) being:
  - generic lambdas and init-captures are broken - but a patch that fixes this is already in the works ...
  - nested variadic expansions such as:
    auto K = [](auto ... OuterArgs) {
      vp([=](auto ... Is) {
          decltype(OuterArgs) OA = OuterArgs;
          return 0;
        }(5)...);
      return 0;
    };
    auto M = K('a', ' ', 1, " -- ", 3.14); 
   currently cause crashes.  I think I know how to fix this (since I had done so in my initial implementation) - but it will probably take some work and back & forth with Doug and Richard.

A warm thanks to all who provided feedback - and especially to Doug Gregor and Richard Smith for their pivotal guidance: their insight and prestidigitation in such matters is boundless!

Now let's hope this commit doesn't upset the buildbot gods ;)

Thanks!

llvm-svn: 194188
2013-11-07 05:17:06 +00:00
David Majnemer bed356a9ea [-fms-extensions] Add support for __FUNCDNAME__
Summary:
Similar to __FUNCTION__, MSVC exposes the name of the enclosing mangled
function name via __FUNCDNAME__.  This implementation is very naive and
unoptimized, it is expected that __FUNCDNAME__ would be used rarely in
practice.

Reviewers: rnk, rsmith, thakis

CC: cfe-commits, silvas

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

llvm-svn: 194181
2013-11-06 23:31:56 +00:00
Alp Toker 695c3325af clang-cl: Hide ignored joined flags as well
This is an addendum to r194174.

llvm-svn: 194180
2013-11-06 23:17:02 +00:00
Aaron Ballman 5116a8e739 Work around an MSVC 2013 miscompile with the Redeclarable class. Fixes PR16606
llvm-svn: 194176
2013-11-06 22:39:46 +00:00
NAKAMURA Takumi 74d31faa4e Update \param in ToolInvocation() corresponding to r194164. [-Wdocumentation]
llvm-svn: 194175
2013-11-06 22:37:12 +00:00
Alp Toker b623aaeffe clang-cl: Hide ignored flags
We don't want to them to appear in the help text for now.

llvm-svn: 194174
2013-11-06 22:36:09 +00:00
Alp Toker da9d8bfa25 clang-cl: Add /FS as an ignored flag
CMake-generated Makefiles include this cl flag which can be safely ignored
until we get PDB server support.

llvm-svn: 194165
2013-11-06 21:01:23 +00:00
Peter Collingbourne c689ee76d4 Introduce ClangTool::buildASTs, and buildASTFromCode.
These allow clients to retrieve persistent AST objects (ASTUnits) which
can be used in an ad-hoc manner after parsing.

To accommodate this change, the code for processing a CompilerInvocation
using a FrontendAction has been factored out to FrontendActionFactory, and
a new base class, ToolAction, has been introduced, allowing the tool to do
arbitrary things with each CompilerInvocation.  This change was necessary
because ASTUnit does not use the FrontendAction interface directly.

This change also causes the FileManager in ClangTool to use shared ownership.
This will become necessary because ASTUnit takes shared ownership of
FileManager (ClangTool's FileManager is currently unused by ASTUnit; this
is a FIXME).  As shown in the tests, any client of ToolInvocation will
need to be modified to use shared ownership for FileManager.

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

llvm-svn: 194164
2013-11-06 20:12:45 +00:00
Richard Smith 79c927bfe9 Add a limit to the length of a sequence of 'operator->' functions we will
follow when building a class member access expression. Based on a patch by
Rahul Jain!

llvm-svn: 194161
2013-11-06 19:31:51 +00:00
Timur Iskhodzhanov 053142a90d Fix PR17738 - add support for vtordisp thunks when using -cxx-abi microsoft
llvm-svn: 194132
2013-11-06 06:24:31 +00:00
Jiangning Liu c628af66c7 Implement AArch64 Neon instruction set Perm.
llvm-svn: 194124
2013-11-06 03:35:53 +00:00
Jiangning Liu 37f5bb1b28 Implement AArch64 Neon instruction set Bitwise Extract.
llvm-svn: 194119
2013-11-06 02:26:12 +00:00
Peter Collingbourne b23b39da21 Introduce DynTypedNode::print, dump and getSourceRange.
These functions can generally be applied to multiple kinds of AST node,
so it makes sense to add them to DynTypedNode.

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

llvm-svn: 194113
2013-11-06 00:27:12 +00:00
Peter Collingbourne 093a729e03 Introduce BoundNodes::getMap.
The purpose of this function is to allow clients of the dynamic AST matcher
to enumerate each binding.

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

llvm-svn: 194112
2013-11-06 00:27:07 +00:00
Fariborz Jahanian 23417073ee ObjectiveC migrator. Please annotation of properties with
NS_RETURNS_INNER_POINTER under -objcmt-returns-innerpointer-property
flag (off by default), as older compilers do not support such annotations.
// rdar://15396636

llvm-svn: 194100
2013-11-05 22:28:30 +00:00
Richard Smith e9ff770f8b Simplify: we don't care why constant evaluation might have failed when we're
checking an expression for constant overflow.

llvm-svn: 194099
2013-11-05 22:23:30 +00:00
Rafael Espindola 0df9e16cc7 With this patch -Wwrite-strings is still implemented with the terrible
hack of passing -fconst-strings to -cc1, but at least the driver uses
the regular warning checking code path.

Since we don't support a warning that is DefaultIgnore in one language
but not in another, this patch creates a dummy C only warning in the same
group as the existing one to get the desired effect.

llvm-svn: 194097
2013-11-05 21:43:54 +00:00
James Dennett 42c4e50f63 Documentation tweaks: Fix a typo in a reference to the C++ standard,
another typo in a comment, and update formatting of some comments to
use Doxygen \brief annotations instead of repeating the name of the
documented entity.

llvm-svn: 194092
2013-11-05 19:37:38 +00:00
Kaelyn Uhrain 89035721b9 Revert "Try to correct a mistyped "-" or ">" to "->" for some C++ cases."
Revert this patch until cases of rejected valid code (e.g. identifiers
that require ADL to be resolved properly) are fixed.

llvm-svn: 194088
2013-11-05 18:28:21 +00:00
Jiangning Liu 34a7109b47 Implement AArch64 Neon Crypto instruction classes AES, SHA, and 3 SHA.
llvm-svn: 194086
2013-11-05 17:42:24 +00:00
Timur Iskhodzhanov 5877663622 Fix vbtable indices when a class shares the vbptr with a non-virtual base
llvm-svn: 194082
2013-11-05 15:54:58 +00:00
Joey Gouly a7310a8cfa Do not allow functions or kernels called 'main' in OpenCL.
llvm-svn: 194068
2013-11-05 12:30:39 +00:00
Richard Smith b47c36f8e1 C++1y sized deallocation: if we have a use, but not a definition, of a sized
deallocation function (and the corresponding unsized deallocation function has
been declared), emit a weak discardable definition of the function that
forwards to the corresponding unsized deallocation.

This allows a C++ standard library implementation to provide both a sized and
an unsized deallocation function, where the unsized one does not just call the
sized one, for instance by putting both in the same object file within an
archive.

llvm-svn: 194055
2013-11-05 09:12:18 +00:00
Kevin Qin 9eece7b5e0 Implemented aarch64 neon intrinsic vcopy_lane with float type.
llvm-svn: 194042
2013-11-05 02:05:44 +00:00
Kaelyn Uhrain 3fb1710910 Try to correct a mistyped "-" or ">" to "->" for some C++ cases.
Similar C code isn't caught as it seems to hit a different code path.
Also, as the check is only done for record pointers, cases involving
an overloaded operator-> are not handled either. Note that the reason
this check is done in the parser instead of Sema is not related to
having enough knowledge about the current state as it is about being
able to fix up the parser's state to be able to recover and traverse the
correct code paths.

llvm-svn: 194002
2013-11-04 18:59:34 +00:00
Aaron Ballman ccdca78d50 Updating the makefile to reflect CMake; addendum to r193989.
llvm-svn: 193990
2013-11-04 13:02:44 +00:00
Aaron Ballman 4768b31797 Attributes which accept a type as their sole argument are no longer hard coded into the parser. Instead, they are automatically listed through tablegen.
llvm-svn: 193989
2013-11-04 12:55:56 +00:00
Benjamin Kramer a1ced436b1 Make ADLResult::iterator a proper iterator.
PR17796.

llvm-svn: 193986
2013-11-04 10:29:56 +00:00
Richard Smith b2504bdc0d Issue a diagnostic if an implicitly-defined move assignment operator would move
the same virtual base class multiple times (and the move assignment is used,
and the move assignment for the virtual base is not trivial).

llvm-svn: 193977
2013-11-04 04:26:14 +00:00
Richard Smith 8b86f2d401 Implement final resolution of DR1402: implicitly-declared move operators that
would be deleted are still declared, but are ignored by overload resolution.

Also, don't delete such members if a subobject has no corresponding move
operation and a non-trivial copy. This causes us to implicitly declare move
operations in more cases, but risks move-assigning virtual bases multiple
times in some circumstances (a warning for that is to follow).

llvm-svn: 193969
2013-11-04 01:48:18 +00:00
David Majnemer f1b0baeb21 Fix typo in err_flexible_array_empty_aggregate
llvm-svn: 193936
2013-11-03 00:16:44 +00:00
David Majnemer 9b1754d058 Sema: Disallow inheriting from classes with flexible array members
Flexible array members inherently index off of the end of their parent
type.

We shouldn't allow this type to be used as a base, virtual or otherwise,
because indexing off the end may find us inside of another base or the
derived types members.

llvm-svn: 193923
2013-11-02 12:00:36 +00:00
David Majnemer 5bbb1fe5d9 Remove a stray tab character from warn_objc_root_class_missing
llvm-svn: 193921
2013-11-02 11:21:23 +00:00
David Majnemer 08cd76006f Sema: Disallow derived classes with virtual bases from having flexible array members
Flexible array members only work out if they are the last field of a
record, however virtual bases would give us many situations where the
flexible array member would overlap with the virtual base fields.

It is unlikely in the extreme that this behavior was intended by the
user so raise a diagnostic instead of accepting.  This is will not
reject conforming code because flexible array members are an extension
in C++ mode.

llvm-svn: 193920
2013-11-02 11:19:13 +00:00
David Majnemer 4101621dd7 Sema: Cleanup and simplify anonymous union diagnostics
The determination of which diagnostics would be issued for certain
anonymous unions started to get a little ridiculous.  Clean this up by
inverting the condition-tree's logic from dialect -> issue to
issue -> diagnostic.

As part of this cleanup, move ext_c99_flexible_array_member from
DiagnosticParseKinds.td to DiagnosticSemaKinds.td because it's driven by
Sema, not Parse.

Also, the liberty was taken to edit ext_c99_flexible_array_member to
match other, similar, diagnostics.

llvm-svn: 193919
2013-11-02 10:38:05 +00:00
David Majnemer 77c2754d58 Sema: Flexible array members were introduced in C99, diagnose their use in C++
The declaration of a flexible array member was correctly diagnosed as an
extension in C89 mode but not in C++.

llvm-svn: 193918
2013-11-02 09:22:44 +00:00
Fariborz Jahanian e1e33f8e82 ObjectiveC. Define a new cc1 flag
-fobjc-subscripting-legacy-runtime which is off 
by default and on only when using ObjectiveC
legacy runtime. Use this flag to allow
array and dictionary subscripting and disallow
objectiveC pointer arithmatic in ObjectiveC
legacy runtime. // rdar://15363492

llvm-svn: 193889
2013-11-01 21:58:17 +00:00
Peter Collingbourne 3270164f39 SanitizerArgs: add ability to filter/diagnose unsupported sanitizers.
The thread, memory, dataflow and function sanitizers are now diagnosed if
enabled explicitly on an unsupported platform.  Unsupported sanitizers which
are enabled implicitly (as part of a larger group) are silently disabled.  As a
side effect, this makes SanitizerArgs parsing toolchain-dependent (and thus
essentially reverts r188058), and moves SanitizerArgs ownership to ToolChain.

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

llvm-svn: 193875
2013-11-01 18:16:25 +00:00
Richard Smith dde17e74fa Simplify computation of visible module set.
llvm-svn: 193850
2013-11-01 02:19:14 +00:00
Chad Rosier 74329d6cff [AArch64] Add support for NEON scalar fixed-point convert to floating-point instructions.
llvm-svn: 193817
2013-10-31 22:37:08 +00:00
Dmitri Gribenko dc360d5739 Clang modules: collect exports recursively
This change makes Module::buildVisibleModulesCache() collect exported modules
recursively.

While computing a set of exports, getExportedModules() iterates over the set of
imported modules and filters it.  But it does not consider the set of exports
of those modules -- it is the responsibility of the caller to do this.

Here is a certain instance of this issue.  Module::isModuleVisible says that
CoreFoundation.CFArray submodule is not visible from Cocoa.  Why?

- Cocoa imports Foundation.
- Foundation has an export restriction: "export *".
- Foundation imports CoreFoundation.  (Just the top-level module.)
- CoreFoundation exports CoreFoundation.CFArray.

To decide which modules are visible from Cocoa, we collect all exported modules
from immediate imports in Cocoa:

> visibleModulesFro(Cocoa) = exported(Foundation) + exported(CoreData) + exported(AppKit)

To find out which modules are exported, we filter imports according to
restrictions:

> exported(Foundation) = filterByModuleMapRestrictions(imports(Foundation))

Because Foundation imports CoreFoundation (not CoreFoundation.CFArray), the
CFArray submodule is considered not exported from Foundation, and is not
visible from Cocoa (according to Module::isModuleVisible).

llvm-svn: 193815
2013-10-31 22:24:10 +00:00
Richard Smith b87c465391 Store a TypeArgument on an attribute as a TypeSourceInfo*, rather than as a
QualType with a SourceLocation stashed alongside.

llvm-svn: 193803
2013-10-31 21:23:20 +00:00
Chad Rosier bdca387884 [AArch64] Add support for NEON scalar shift immediate instructions.
llvm-svn: 193791
2013-10-31 19:29:05 +00:00
Aaron Ballman 1306625b91 iboutletcollection really does have custom parsing.
llvm-svn: 193777
2013-10-31 17:44:01 +00:00
Benjamin Kramer 907305377a Remove unused diagnostic.
llvm-svn: 193774
2013-10-31 17:36:01 +00:00
Richard Smith b1f9a283ac Factor out custom parsing for iboutletcollection and vec_type_hint attributes
into a separate "parse an attribute that takes a type argument" codepath. This
results in both codepaths being a lot cleaner and simpler, and fixes some bugs
where the type argument handling bled into the expression argument handling and
caused us to both accept invalid and reject valid attribute arguments.

llvm-svn: 193731
2013-10-31 01:56:18 +00:00
Mark Lacey a8e7df3602 Add CodeGenABITypes.h for use in LLDB.
CodeGenABITypes is a wrapper built on top of CodeGenModule that exposes
some of the functionality of CodeGenTypes (held by CodeGenModule),
specifically methods that determine the LLVM types appropriate for
function argument and return values.

I addition to CodeGenABITypes.h, CGFunctionInfo.h is introduced, and the
definitions of ABIArgInfo, RequiredArgs, and CGFunctionInfo are moved
into this new header from the private headers ABIInfo.h and CGCall.h.

Exposing this functionality is one part of making it possible for LLDB
to determine the actual ABI locations of function arguments and return
values, making it possible for it to determine this for any supported
target without hard-coding ABI knowledge in the LLDB code.

llvm-svn: 193717
2013-10-30 21:53:58 +00:00
Hans Wennborg 31c51ccace clang-cl: Parse the /arch, /Yu and /Fp options (PR17736)
We don't support these options, but should at least parse them.

llvm-svn: 193702
2013-10-30 17:36:27 +00:00
Daniel Sanders d5f554f0bb [mips][msa] Correct definition of bins[lr] and CHECK-DAG-ize related tests
llvm-svn: 193695
2013-10-30 15:45:42 +00:00
Daniel Sanders ab94b537d7 [mips][msa] Added support for matching bmnz, bmnzi, bmz, and bmzi from normal IR (i.e. not intrinsics)
Also corrected the definition of the intrinsics for these instructions (the
result register is also the first operand), and added intrinsics for bsel and
bseli to clang (they already existed in the backend).

These four operations are mostly equivalent to bsel, and bseli (the difference
is which operand is tied to the result). As a result some of the tests changed
as described below.

bitwise.ll:
- bsel.v test adapted so that the mask is unknown at compile-time. This stops
  it emitting bmnzi.b instead of the intended bsel.v.
- The bseli.b test now tests the right thing. Namely the case when one of the
  values is an uimm8, rather than when the condition is a uimm8 (which is
  covered by bmnzi.b)

compare.ll:
- bsel.v tests now (correctly) emits bmnz.v instead of bsel.v because this
  is the same operation (see MSA.txt).

i8.ll
- CHECK-DAG-ized test.
- bmzi.b test now (correctly) emits equivalent bmnzi.b with swapped operands
  because this is the same operation (see MSA.txt).
- bseli.b still emits bseli.b though because the immediate makes it
  distinguishable from bmnzi.b.

vec.ll:
- CHECK-DAG-ized test.
- bmz.v tests now (correctly) emits bmnz.v with swapped operands (see
  MSA.txt).
- bsel.v tests now (correctly) emits bmnz.v with swapped operands (see
  MSA.txt).

llvm-svn: 193693
2013-10-30 15:20:38 +00:00
Chad Rosier 4d55e6e0a4 [AArch64] Add support for NEON scalar floating-point compare instructions.
llvm-svn: 193692
2013-10-30 15:20:07 +00:00
Daniel Sanders d74b130cc9 [mips][msa] Added support for matching bins[lr]i.[bhwd] from normal IR (i.e. not intrinsics)
This required correcting the definition of the bins[lr]i intrinsics because
the result is also the first operand.

It also required removing the (arbitrary) check for 32-bit immediates in
MipsSEDAGToDAGISel::selectVSplat().

Currently using binsli.d with 2 bits set in the mask doesn't select binsli.d
because the constant is legalized into a ConstantPool. Similar things can
happen with binsri.d with more than 10 bits set in the mask. The resulting
code when this happens is correct but not optimal.

llvm-svn: 193687
2013-10-30 14:45:14 +00:00
Alp Toker 45cf31f7d3 Recover instead of crashing on MS assembly when no target is loaded
It's possible to embed the frontend in applications that haven't initialized
backend targets so we need to handle this condition gracefully.

llvm-svn: 193685
2013-10-30 14:29:28 +00:00
Timur Iskhodzhanov 0201432a5e Make thunk this/return adjustment ABI-specific. Also, fix the return adjustment when using -cxx-abi microsoft
Reviewed at http://llvm-reviews.chandlerc.com/D2026

llvm-svn: 193679
2013-10-30 11:55:43 +00:00
Chris Wailes 9385f9f7c3 Changed tests_typestate to test_typestate for consistency.
llvm-svn: 193648
2013-10-29 20:28:41 +00:00
Rafael Espindola 8c8711207c Add support for the separate version of /FI.
Patch by Jeff Muizelaar.

llvm-svn: 193642
2013-10-29 19:42:01 +00:00
Daniel Jasper dd978ae0e1 clang-format: Option to control spacing in template argument lists.
Same as SpacesInParentheses, this option allows adding a space inside
the '<' and '>' of a template parameter list.

Patch by Christopher Olsen.

This fixes llvm.org/PR17301.

llvm-svn: 193614
2013-10-29 14:52:02 +00:00
Samuel Benzaquen f34ac3ed2c Resubmit "Refactor DynTypedMatcher into a value type class, just like Matcher<T>."
Summary: This resubmits r193100, plus a fix for a breakage with MSVC.

Reviewers: klimek, rnk

CC: cfe-commits, revane

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

llvm-svn: 193613
2013-10-29 14:37:15 +00:00