Commit Graph

48739 Commits

Author SHA1 Message Date
DeLesley Hutchins 5ede5cc9ba Thread safety analysis: check pt_guarded_by attribute when calling -> and *
on smart pointers.  -Wthread-safety-beta only.

llvm-svn: 194103
2013-11-05 23:09:56 +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
Richard Smith 6d4c6586c9 Refactor constant expression handling and make a couple of tweaks to make it a
bit more robust against future changes. This includes a slight diagnostic
improvement: if we know we're only trying to form a constant expression, take
the first diagnostic which shows the expression is not a constant expression,
rather than preferring the first one which makes the expression unfoldable.

llvm-svn: 194098
2013-11-05 22:18:15 +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
Rafael Espindola 2e2995bf50 Produce direct calls instead of alias to linkonce_odr functions.
This is a small optimization on linux, but should help more on windows
where msvc only outputs one destructor if there would be two identical ones.

llvm-svn: 194095
2013-11-05 21:37:29 +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
Daniel Jasper bbf5c1c965 clang-format: Allow line merging and partial formatting of nested blocks
Before, clang-format would always format entire nested blocks, which
can be unwanted e.g. for long DEBUG({...}) statements. Also
clang-format would not allow to merge lines in nested blocks (e.g. to
put "if (a) return;" on one line in Google style).

This is the first step of several refactorings mostly focussing on the
additional functionality (by reusing the "format many lines" code to
format the children of a nested block). The next steps are:
* Pull out the line merging into its own class.
* Seperate the formatting of many lines from the formatting of a single
  line (and the analysis of the solution space).

llvm-svn: 194090
2013-11-05 19:10:03 +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
Alp Toker 3364fe149c Disable test fully with REQUIRES
Third time's the charm, sorry for the noise.

llvm-svn: 194076
2013-11-05 13:27:19 +00:00
Alp Toker 53b74accc7 Disable the test that crashes
XFAIL wasn't enough for some of the build servers.

llvm-svn: 194073
2013-11-05 12:55:00 +00:00
Alp Toker 6731f38aca Fix a test that was never being run, mark it XFAIL
Turns out this has always been crashing since the test landed in
r186647:

  Assertion failed: (Access != AS_none && "Access specifier is AS_none inside a record decl"), function CheckAccessDeclContext, file clang/lib/AST/DeclBase.cpp, line 690.

Needs attention.

llvm-svn: 194072
2013-11-05 12:45:46 +00:00
Alp Toker f80de76ca9 Make test run reliably
llc waits for input on stdin, which was not provided in this test. It
was running only thanks to a quirk in the way lit concatenates
commands.

llvm-svn: 194071
2013-11-05 12:45:43 +00:00
Alp Toker f9cabd9ddb Fix test that was not being run
llvm-svn: 194070
2013-11-05 12:45:40 +00:00
Alp Toker 52ca4a4e47 Fix test that wasn't testing anything
llvm-svn: 194069
2013-11-05 12:45:37 +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
David Majnemer 21db51ab91 Simplify test case added in r194059
llvm-svn: 194061
2013-11-05 10:05:58 +00:00
David Majnemer 76faf1f525 Lex: Require that '#' be followed by a macro parameter name when preceded by '##'
After lexing a '##', we would look ahead and check to see if it was
followed by '__VA_ARGS__'.  After doing so, we would then go ahead and
lex the token.

However we would fail in the case where the '##' was followed by a '#'
followed by an identifier because we would have lexed the '#' separately
from the identifier, bypassing our parameter validation logic.

Instead, lex the tokens coming after the '##' later.

This fixes PR17804.

llvm-svn: 194059
2013-11-05 09:30:17 +00:00
Richard Smith 96c07b165e Remove stray comma from documentation.
llvm-svn: 194056
2013-11-05 09:12:55 +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
Richard Smith 2d1d3ca1cc Enable links now that they work.
llvm-svn: 194054
2013-11-05 08:27:00 +00:00
David Majnemer 2748da9be4 Sema: Improve comment introduced in r193397
llvm-svn: 194052
2013-11-05 08:01:18 +00:00
Rafael Espindola 26cc9bdfc0 Expand the test a bit.
llvm-svn: 194050
2013-11-05 07:11:42 +00:00
Rafael Espindola 1cc563d558 Add a testcase from the recent bootstrap failure.
llvm-svn: 194049
2013-11-05 06:44:57 +00:00
Rafael Espindola b5ac86865a Revert "Produce direct calls instead of alias to linkonce_odr functions."
This reverts commit r194046.
Debugging a bootstrap issue.

llvm-svn: 194047
2013-11-05 05:29:54 +00:00
Rafael Espindola 5d79a51a45 Produce direct calls instead of alias to linkonce_odr functions.
This is a small optimization on linux, but should help more on windows
where msvc only outputs one destructor if there would be two identical ones.

llvm-svn: 194046
2013-11-05 05:22:36 +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
Fariborz Jahanian ce4bbb2532 ObjectiveC. Method implementations should only check for
"Missing call to Super" in the overriding method and
not in the method itself. // rdar://15385981.

llvm-svn: 194031
2013-11-05 00:28:21 +00:00
Dmitri Gribenko e9bcf5b7b1 Include non-explicit submodules in exported module list
This change fixes Richard's testcase for r193815.  Now we include non-explicit
submodules into the list of exports.

The test failed previously because:
- recursive_visibility_a1.inner is not imported (only recursive_visibility_a1 is),
- thus the 'inner' submodule is not showing up in any of the import lists,
- and because of this getExportedModules() is not returning the
  correct module set -- it only considers modules that are imported.

The fix is to make Module::getExportedModules() include non-explicit submodules
into the list of exports.

llvm-svn: 194018
2013-11-04 21:51:33 +00:00
Anna Zaks 3d46ac66d8 [analyzer] Track the count of NSOrderedSet similarly to other fast enumerations.
llvm-svn: 194005
2013-11-04 19:13:08 +00:00
Anna Zaks 830d2f7701 [analyzer] Suppress warnings coming out of std::basic_string.
The analyzer cannot reason about the internal invariances of the data structure (radar://15194597).

llvm-svn: 194004
2013-11-04 19:13:03 +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
Rafael Espindola 3f643bd124 Use aliases for more constructors and destructors.
With this patch we produce alias for cases like

template<typename T>
struct foobar {
  foobar() {
  }
};
template struct foobar<void>;

We just have to be careful to produce the same aliases in every TU because
of comdats.

llvm-svn: 194000
2013-11-04 18:38:59 +00:00
Rafael Espindola a6775b622f clang-format this if.
llvm-svn: 193997
2013-11-04 17:13:51 +00:00
Justin Bogner e0ccdb1a28 CodeGen: Test that simple expressions are simplified at -O0
llvm-svn: 193995
2013-11-04 16:13:23 +00:00
Justin Bogner b23224eede CodeGen: Use EmitBranchOnBool when generating For and CXXForRange
A while ago EmitForStmt was changed to explicitly evaluate the
condition expression and create a branch instead of using
EmitBranchOnBool, so that the condition expression could be used for
some cleanup logic. The cleanup stuff has since been reorganized, and
this is no longer necessary.

In EmitCXXForRange, the evaluated condition was never used for
anything else. The logic was presumably modeled on EmitForStmt.

llvm-svn: 193994
2013-11-04 16:13:21 +00:00
Justin Bogner 085e28e4a6 CodeGen: Move an initialization away from an unrelated comment
An initialization somehow found its way in between a comment and the
block of code the comment is about. Moving the initialization makes
this less confusing.

llvm-svn: 193993
2013-11-04 16:13:18 +00:00
NAKAMURA Takumi d6f14d98c2 clang/lib/Parse/CMakeLists.txt: Fixup corresponding to r193989. ClangAttrTypeArg is required here.
llvm-svn: 193991
2013-11-04 13:10:53 +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
Benjamin Kramer d9a5e2a490 Driver: Add support for -march=bdver3 on x86.
llvm-svn: 193985
2013-11-04 10:29:51 +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
Filip Pizlo 29cc006eb8 It is no longer necessary to opt out of pretty stack traces.
llvm-svn: 193973
2013-11-04 02:25:34 +00:00
Richard Smith 2002bfec3b Update a comment to match current core issues list.
llvm-svn: 193970
2013-11-04 02:02:27 +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 42350dfcc8 Sema: Do not allow overloading between methods based on restrict
If the sole distinction between two declarations is that one has a
__restrict qualifier then we should not consider it to be an overload.

Instead, we will consider it as an incompatible redeclaration which is
similar to how MSVC, ICC and GCC would handle it.

This fixes PR17786.

N.B. We must not mangle in __restrict into method qualifiers becase we
don't allow overloading between such declarations anymore.  To do
otherwise would be a violation of the Itanium ABI.

llvm-svn: 193964
2013-11-03 23:51:28 +00:00
Alp Toker 6d023c4f1e Fix test to actually check the FixIt-applied code
r102230 added an 'echo' making this a no-op.

Also fixes FAIL on native Windows with no shell/GnuWin32.

llvm-svn: 193938
2013-11-03 01:50:38 +00:00
David Majnemer f1b0baeb21 Fix typo in err_flexible_array_empty_aggregate
llvm-svn: 193936
2013-11-03 00:16:44 +00:00
Bob Wilson 2c82c3d033 OS X 10.9+ and iOS 7+ support load/store of big atomic objects.
rdar://13973577

Patch by Fariborz Jahanian.

llvm-svn: 193935
2013-11-02 23:27:49 +00:00
Bob Wilson 0f7445b615 Default to use libc++ on OS X 10.9+ and iOS 7+.
llvm-svn: 193934
2013-11-02 23:19:53 +00:00
David Majnemer 2a779d1fae Add test case for r193923
llvm-svn: 193924
2013-11-02 12:11:58 +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 4589760efd Sema: Remove stray whitespace around Sema::CheckBaseSpecifier
llvm-svn: 193922
2013-11-02 11:24:41 +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
David Majnemer 53f71d90e2 Sema: Properly indent statements in Sema::ActOnLastBitfield
llvm-svn: 193917
2013-11-02 08:41:50 +00:00
David Majnemer 60eb3da57b Sema: trim trailing whitespace in Sema::ActOnLastBitfield
llvm-svn: 193916
2013-11-02 08:41:01 +00:00
NAKAMURA Takumi 9f6383c741 clang/test/CodeGenCXX/builtins.cpp: Fix for -Asserts.
- Don't seek "entry:" It dosen't appear with -Asserts.
  - Take care that Codegen'ed Instruction(s) wouldn't have name(s) in -Asserts.

llvm-svn: 193908
2013-11-02 02:58:42 +00:00
Richard Trieu 30bfa3623b Change the other -Wtautological-compare warnings to not trigger in template
specializations.  Also switch to -Wuninitialized for a test case that depended
on a warning firing in template specializations.

llvm-svn: 193906
2013-11-02 02:11:23 +00:00
Warren Hunt 5d80bfa746 Adding triple to lit test fixed in r193901
llvm-svn: 193902
2013-11-02 00:34:45 +00:00
Warren Hunt 4349ec4e03 Fixes lit test that doesn't fail on windows
long in linux 64 is 64 bits but is always 32 bits on windows.  The lit test was modified 
to use long long instead of long and check for 64-bit mangling.

llvm-svn: 193901
2013-11-02 00:12:15 +00:00
Warren Hunt 5ae586ad45 Improves compatibility with cl.exe when laying out array fields
Differential Revision: http://llvm-reviews.chandlerc.com/D2090

Clang was "improperly" over-aligning arrays with sizes are not a multiple of 
their alignment. 
This behavior was removed in microsoft 32 bit mode.

In addition, after examination of ASTContext::getTypeInfoImpl, a redundant code block in 
MicrosoftRecordLayoutBuilder::getAdjustedFieldInfo was deleted.

llvm-svn: 193898
2013-11-01 23:59:41 +00:00
Warren Hunt 445d83eb47 Wraps lazily generated builtins in an extern "C" context
Differential Revision: http://llvm-reviews.chandlerc.com/D2082

Adds a lang_c LinkageSpecDecl to lazily generated builtins. This enforces correct 
behavior for builtins in a variety of cases without special treatment elsewhere within 
the compiler (special treatment is removed by the patch). It also allows for C++ 
overloads of builtin functions, which Microsoft uses in their headers e.g. 
_InterlockedExchangeAdd is an extern C builtin for the long type but an inline wrapper 
for int type.

llvm-svn: 193896
2013-11-01 23:46:51 +00:00
Douglas Gregor 299787f78e Preload module maps in normal user directories, too.
... in case someone decides to -I/usr/include <rdar://problem/15235948>.

llvm-svn: 193893
2013-11-01 23:08:38 +00:00
Richard Trieu ed265941d4 Add non-type template parameter test for disabled -Wtautological-compare
warning in template specializations.

llvm-svn: 193890
2013-11-01 22:12:15 +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
Richard Trieu 36594561aa Disable -Wtautological-compare in template instantiations.
llvm-svn: 193888
2013-11-01 21:47:19 +00:00
Richard Trieu dd51d747bf Disable -Wtautological-constant-out-of-range-compare in template instantiations.
llvm-svn: 193887
2013-11-01 21:19:43 +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
Amara Emerson b4b0cc0756 AArch64: Fix wildcard matching on CHECK lines. Now recognises arch64--.
llvm-svn: 193858
2013-11-01 12:53:57 +00:00
Benjamin Kramer fc58b043b7 Sema: Make helper function static.
llvm-svn: 193857
2013-11-01 11:50:55 +00:00
Richard Smith dde17e74fa Simplify computation of visible module set.
llvm-svn: 193850
2013-11-01 02:19:14 +00:00
Faisal Vali b9657033cc Support return type deduction for templates in -fdelayed-template-parsing (microsoft) mode
Please see http://llvm-reviews.chandlerc.com/D2053 for discussion and Richard's stamp.

llvm-svn: 193849
2013-11-01 02:01:01 +00:00
Fariborz Jahanian 071b98edec ObjectiveC migrator. When inferring readwrite property,
do not remove the setter if its availability differs
from availability of the getter (which is now turned into
a property). Otherwise, synthesized setter will
inherit availability of the property (which is incorrect).
// rdar://15300059

llvm-svn: 193837
2013-11-01 00:26:48 +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
Kaelyn Uhrain bd6ddaa0e7 Fix a C struct diagnostic regression introduced by r187504 (PR17762).
llvm-svn: 193799
2013-10-31 20:32:56 +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
Rui Ueyama 727025a5e1 Use StringRef::endswith_lower. No functionality change.
llvm-svn: 193788
2013-10-31 19:12:53 +00:00
Jordan Rose 1417a7b174 [analyzer] Don't crash when a path goes through a 'delete' destructor call.
This was just left unimplemnted from r191381; the fix is to report this call
location as the location of the 'delete' expr.

PR17746

llvm-svn: 193783
2013-10-31 18:41:15 +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
Fariborz Jahanian d41dbadacd ObjectiveC migrator. Change naming hueristic for
deprecated categories, fixes a typo reported by
Jordan.

llvm-svn: 193759
2013-10-31 16:10:44 +00:00
Faisal Vali fe194d5a84 sizeof... a parameter pack should be an unevaluated context.
- can't think of a way to test this without generic lambda captures, but will include a test once that patch is made commit-ready.

patch was ok'd by Doug.
http://llvm-reviews.chandlerc.com/D2029 

llvm-svn: 193757
2013-10-31 15:58:51 +00:00
Chris Wailes 93edffa8fe Fixed bug with checking the kind of types.
The isLValueReferenceType function checks to see if the QualType's
canonical type is an LValue reference, and not if the QualType
itself is an LValue reference.  This caused a segfault when trying
to cast the QualType's Type to a LValueReference.  This is now
fixed by casting the result of getCanonicalType().

In addition, a test was added to isConsumableType to prevent
segfaults when a type being tested by the analysis is a reference
to a pointer or a pointer to a reference.

llvm-svn: 193751
2013-10-31 15:38:12 +00:00
Amara Emerson 703da2ea98 [AArch64] Add some CPU targets for "generic", A-53 and A-57.
Enables the clang driver to begin targeting specific CPUs. Introduced a
"generic" CPU which will ensure that the optional FP feature is enabled
by default when it gets to LLVM, without needing any extra arguments.
Cortex-A53 and A-57 are also introduced with tests, although backend
handling of them does not yet exist.

llvm-svn: 193740
2013-10-31 09:32:33 +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
Fariborz Jahanian 9d2ffea486 ObjectiveC migrator: annotate all protocols/methods in
a category with NSxxxDeprecated name with deprecated
annotation. // rdar://15337661

llvm-svn: 193726
2013-10-31 00:06:58 +00:00
Argyrios Kyrtzidis 28d5b6bb11 [libclang/python] Add __contains__ to SourceRange class.
Patch by Loïc Jaquemet!

llvm-svn: 193725
2013-10-31 00:03:33 +00:00
Mark Lacey fbbc738eb7 Fix Windows build by including CGFunctionInfo.h.
CodeGenTypes.h instantiates llvm::FoldingSet<> with CGFunctionInfo,
and VC++ doesn't like the static_cast from FoldingSetImpl::Node* to
CGFunctionInfo* since it hasn't seen the definition of CGFunctionInfo
and that it inherits from FoldingSetImpl::Node.

llvm-svn: 193722
2013-10-30 23:40:28 +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