Commit Graph

15667 Commits

Author SHA1 Message Date
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
Bernard Ogden 18b5701a68 ARM: Add -m[no-]crc to dis/enable CRC subtargetfeature from clang
Allow users to disable or enable CRC subtarget feature.

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

llvm-svn: 193600
2013-10-29 09:47:51 +00:00
Alp Toker a23d26607e Use Rewriter::overwriteChangedFiles() directly
This replaces the custom code in RefactoringTool::saveRewrittenFiles() which
lacked atomic file saving and error diagnostics, resolving an old FIXME from
r157331.

Landing this time with the proper return code, plus a very unhelpful comment
cleared up.

Rubber-stamped by Manuel Klimek.

llvm-svn: 193594
2013-10-29 08:32:41 +00:00
Alp Toker 54d5b55b0a Remove obsolete RewriteBuffer comment
The string buffer in question was replaced with RewriteRope in r43884
back in 2007.

llvm-svn: 193591
2013-10-29 07:47:57 +00:00
Nick Lewycky 2c531165ff Add missing attributes [[gnu::no_sanitize_address]] and
[[gnu::no_address_safety_analysis]].

llvm-svn: 193583
2013-10-29 03:54:41 +00:00
Nick Lewycky d0604672d9 Treat [[gnu::__const]] the same as [[gnu::const]]. GCC's tokenizer can't tell
the difference.

llvm-svn: 193582
2013-10-29 03:33:57 +00:00
Richard Smith a3feee2ad6 Allow a new syntax in a module requires-declaration:
requires ! feature

The purpose of this is to allow (for instance) the module map for /usr/include
to exclude <tgmath.h> and <complex.h> when building in C++ (these headers are
instead provided by the C++ standard library in this case, and the glibc C
<tgmath.h> header would otherwise try to include <complex.h>, resulting in a
module cycle).

llvm-svn: 193549
2013-10-28 22:18:19 +00:00