Commit Graph

32760 Commits

Author SHA1 Message Date
Fariborz Jahanian 4a8865b145 ObjectiveC migrator. 'atomic' is the default attribute.
Don't add it to inferred property. // rdar://14988132

llvm-svn: 192834
2013-10-16 19:48:23 +00:00
Rafael Espindola 3bfa4688ef Emit a .ident saying that clang produced this file.
Patch by Katya Romanova.

llvm-svn: 192832
2013-10-16 19:28:50 +00:00
Yunzhong Gao 6108936fa6 Enabling 3DNow! prefetch instruction support for a few AMD processors in the
clang front end. This change will allow the __PRFCHW__ macro to be set on these
processors and hence include prfchwintrin.h in x86intrin.h header. Support for
the intrinsic itself seems to have already been added in r178041.

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

llvm-svn: 192829
2013-10-16 19:07:02 +00:00
Fariborz Jahanian 33304e3087 ObjectiveC migrator. Use 'assign' for 'delegate'
properties. // rdar://15231860

llvm-svn: 192826
2013-10-16 18:52:17 +00:00
Timur Iskhodzhanov 62082b7e0b [-cxx-abi microsoft] Fix this argument/parameter offsets for virtual destructors in the presence of virtual bases
Reviewed at http://llvm-reviews.chandlerc.com/D1939

llvm-svn: 192822
2013-10-16 18:24:06 +00:00
Fariborz Jahanian 2eaec611ac ObjectiveC++: support for passing C++11 style initialized temporaries to
objc++ properties using property-dot syntax.
// rdar://14654207

llvm-svn: 192819
2013-10-16 17:51:43 +00:00
Jordan Rose ac07c8dae7 [analyzer] Don't draw edges to C++11 in-class member initializers.
Since these aren't lexically in the constructor, drawing arrows would
be a horrible jump across the body of the class. We could still do
better here by skipping over unimportant initializers, but this at least
keeps everything within the body of the constructor.

<rdar://problem/14960554>

llvm-svn: 192818
2013-10-16 17:45:35 +00:00
Benjamin Kramer 34cb04393a Driver: Factor duplicated code.
llvm-svn: 192817
2013-10-16 17:42:39 +00:00
Akira Hatanaka 3764e6c112 [mips] Enable frame-pointer elimination for -O1 and above.
llvm-svn: 192815
2013-10-16 17:13:08 +00:00
Chad Rosier 2681b3fb61 Update comment.
llvm-svn: 192807
2013-10-16 16:30:39 +00:00
Benjamin Kramer 9940a5df86 Sema: Simplify the check if a method returns an instance of the class.
Just checking if the parent of the method is the same as the return type
should be sufficient. Also fixes PR17587.

llvm-svn: 192802
2013-10-16 16:21:04 +00:00
Chad Rosier 069b90463d [AArch64] Add support for NEON scalar signed saturating accumulated of unsigned
value and unsigned saturating accumulate of signed value instructions.

llvm-svn: 192801
2013-10-16 16:09:16 +00:00
Rafael Espindola 002667c32b On 32 bit windows, mangle stdcall and fastcall decls in clang.
This removes the dependency on the llvm mangler doing it for us. In isolation,
the benefit is that the testing of what mangling is applied is all in one place:
(C, C++) X (Itanium, Microsoft) are all handled by clang.

This also gives me hope that in the future the llvm mangler (and llvm-ar) will
not depend on TargetMachine.

llvm-svn: 192762
2013-10-16 01:40:34 +00:00
Richard Smith 01a7337c6d C++ modules: merging for enumerations and enumerators with multiple definitions
(eg through template instantiations in multiple modules).

llvm-svn: 192740
2013-10-15 22:02:41 +00:00
Richard Smith 71bec06c36 Teach the AST dumper to dump the canonical declaration for a mergeable declaration.
llvm-svn: 192739
2013-10-15 21:58:30 +00:00
Eric Christopher 07429ffce5 Reflow slightly.
llvm-svn: 192736
2013-10-15 21:22:34 +00:00
Chad Rosier a70fb7b716 [AArch64] Add support for NEON scalar signed saturating absolute value and
scalar signed saturating negate instructions.

llvm-svn: 192734
2013-10-15 21:19:02 +00:00
Richard Smith ea3019d23a Add constant evaluation support for __builtin_isinf, __builtin_isfinite,
__builtin_isnan, and __builtin_isnormal. Patch by Karthik Bhat! Tests by me.

llvm-svn: 192729
2013-10-15 19:07:14 +00:00
Reid Kleckner 916ac4d233 ms-compat: Fix taking the address of a member of a dependent base
If unqualified id lookup fails while parsing a class template with a
dependent base, clang with -fms-compatibility will pretend the user
prefixed the name with 'this->' in order to delay the lookup.  However,
if there was a unary ampersand, Sema::ActOnDependentIdExpression() will
create a DependentDeclRefExpr, which is not what we wanted at all.  Fix
this by building the CXXDependentScopeMemberExpr directly instead.

In order to be fully MSVC compatible, we would have to defer all
attempts at name lookup to instantiation time.  However, until we have
real problems with system headers that can't be parsed, we'll put off
implementing that.

Fixes PR16014.

Reviewers: rsmith

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

llvm-svn: 192727
2013-10-15 18:38:02 +00:00
Argyrios Kyrtzidis ca5c7be088 [libclang] For an unscoped enum include the enumerators in the top-level code-completion hash since they enter the top-level namespace.
rdar://14703327

llvm-svn: 192720
2013-10-15 17:37:55 +00:00
Fariborz Jahanian daf4831868 ObjectiveC driver. Scrap -fno-objc-legacy-dispatch for NeXT
runtime. It will be silently ignored and regardless
of deployment target. // rdar://14803286

llvm-svn: 192719
2013-10-15 17:16:30 +00:00
Serge Pavlov e8ae13f79c Fixed code style of my change.
llvm-svn: 192708
2013-10-15 14:24:32 +00:00
David Majnemer 5f7efefe66 Sema: Cleanup formatting of C++ exceptions related code
No functional change.

llvm-svn: 192684
2013-10-15 09:50:08 +00:00
David Majnemer fad8f48cf3 Sema: Cleanup formatting of SEH related code
No functional change.

llvm-svn: 192683
2013-10-15 09:33:02 +00:00
David Majnemer 7e75550fa1 Sema: Don't crash when __try/__except/__finally appears in a template function
We wouldn't transform the compound statement in any of these forms,
causing crashes when it got time to act on them.  Additionally, we
wouldn't check to see if the handler was invalid before deciding whether
or not we should continue acting on the __try.

This fixes PR17584.

llvm-svn: 192682
2013-10-15 09:30:14 +00:00
David Majnemer ff17f83673 Sema: Consider it an error to apply __builtin_offsetof to a member in a virtual base
icc 13 and g++ 4.9 both reject this while we would crash.

Fixes PR17578.

llvm-svn: 192674
2013-10-15 06:28:23 +00:00
Ted Kremenek da2f405b09 Special case '%C' handling in ObjC format strings to handle integer literals that can represent unicode characters
Fixes <rdar://problem/13991617>.

llvm-svn: 192673
2013-10-15 05:25:17 +00:00
Richard Smith e952106164 Correctly skip type sugar when determining the width of an enum type. Derived
from a patch by Justin Bogner.

llvm-svn: 192671
2013-10-15 04:56:17 +00:00
Richard Smith c2c8bb8209 Tidy up and improve error recovery for C++11 attributes in bad places. Based on
a patch by Michael Han.

llvm-svn: 192666
2013-10-15 01:34:54 +00:00
Reid Kleckner aec4409174 [ms-cxxabi] Fix assert in unspecified inheritance memptr emission
If a class is using the unspecified inheritance model for member
pointers and later we find the class is defined to use single
inheritance, zero out the vbptr offset field of the member pointer when
it is formed.

llvm-svn: 192664
2013-10-15 01:18:02 +00:00
Fariborz Jahanian 059e05eeef ObjectiveC migrator: Support for more possibility of
migration to NS_ENUM/NS_OPTIONS macros; when
typedef'ed to NSInteger/NSUInteger preceeds well
before of the enum declaration. // rdar://15201056

llvm-svn: 192645
2013-10-15 00:00:28 +00:00
Richard Smith fb8b7b9a1c PR17567: Improve diagnostic for a mistyped constructor name. If we see something
that looks like a function declaration, except that it's missing a return type,
try typo-correcting it to the relevant constructor name.

In passing, fix a bug where the missing-type-specifier recovery codepath would
drop a preceding scope specifier on the floor, leading to follow-on diagnostics
and incorrect recovery for the auto-in-c++98 hack.

llvm-svn: 192644
2013-10-15 00:00:26 +00:00
Ted Kremenek b0cba4ce75 Add has_feature support for reflecting the presence of refined Objective-C ABI mangling for qualified id<...>. Fixes <rdar://problem/14799110>.
llvm-svn: 192643
2013-10-14 23:48:27 +00:00
Aaron Ballman dbd586fc7c Trivial formatting changes; no functional changes intended.
llvm-svn: 192640
2013-10-14 23:26:04 +00:00
Aaron Ballman 91c98e1e0b Switching some custom logic to using table-generated helper methods. This also removes an unnecessary diagnostic.
llvm-svn: 192639
2013-10-14 23:22:37 +00:00
Reid Kleckner bd5bd4b36a PR17576: Fix assertion on polymorphic classes with small alignment
We have to reserve at least the width of a pointer for the vfptr.  For
classes with small alignment, we weren't reserving enough space, and
were overlapping the first field with the vfptr.

llvm-svn: 192626
2013-10-14 21:14:05 +00:00
Warren Hunt 42be77672a Correctly check for distructors when realizing vtordisps
This patch fixes the distructor test when checking for vtordisp requirements in 
microsoft record layout.  A test case is also included.

Addresses:
http://llvm.org/bugs/show_bug.cgi?id=16406#c7

llvm-svn: 192616
2013-10-14 20:14:09 +00:00
Joerg Sonnenberger a443563ff0 For NetBSD/current on X86 do not use libgcc and default to libc++.
Adjust linkage to make more sense for older releases.

llvm-svn: 192615
2013-10-14 20:13:05 +00:00
Ted Kremenek b3a38a9405 Move comment to its proper place.
llvm-svn: 192613
2013-10-14 19:11:25 +00:00
Ted Kremenek a553fbfcd1 GetExprRange() (used by -Wconversion checking) should look through OpaqueValueExprs.
Fixes a false positive with -Wconversion involving Objective-C properties.

Fixes <rdar://problem/14415662>.

llvm-svn: 192611
2013-10-14 18:55:27 +00:00
Benjamin Kramer 9f8e2d77c1 Reduce double set lookups by using the result of insert.
No functionality change.

llvm-svn: 192598
2013-10-14 15:16:10 +00:00
Chad Rosier 193573ec89 [AArch64] Add support for NEON scalar integer compare instructions.
llvm-svn: 192597
2013-10-14 14:37:40 +00:00
Serge Pavlov c0cd80fb20 Do not use typo correction that is unaccessible.
This patch fixes PR17019. When doing typo correction, Sema::CorrectTypo uses
correction already seen for the same typo. This causes problems if that
correction is from another scope and cannot be accessed in the current.

llvm-svn: 192594
2013-10-14 14:05:48 +00:00
Andy Gibbs d9ba47271d Fixed "ArgSize may be used uninitialised" error when compiling with gcc.
llvm-svn: 192570
2013-10-14 07:02:04 +00:00
Alexander Kornienko e2e0387f3e Keep track of indentation levels in static initializers for correct indentation with tabs.
Summary:
Store IndentationLevel in ParentState and use it instead of the
Line::Level when indening.
Also fixed incorrect indentation level calculation in formatFirstToken.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek

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

llvm-svn: 192563
2013-10-14 00:46:35 +00:00
Richard Smith d46d6dea68 Merge common pointers for redeclarations of the same template across modules.
llvm-svn: 192560
2013-10-13 23:50:45 +00:00
Richard Smith f39720b26e Don't get confused by a virt-specifier after a trailing-return-type - it's not
an accidentally-included name for the declarator.

llvm-svn: 192559
2013-10-13 22:12:28 +00:00
Benjamin Kramer e28815758e Fix typo: inccrementally
llvm-svn: 192551
2013-10-13 12:02:16 +00:00
Ismail Pazarbasi 8d0f2f3ae3 Relax header guard mismatch warning with edit distance heuristic.
If the edit distance between the two macros is more than 50%, DefinedMacro may not be header guard or can be header guard of another header file or it might be defining something completely different set by the build environment.

llvm-svn: 192547
2013-10-12 23:17:37 +00:00
Manuel Klimek b212f3baa1 Automatically munch semicolons after blocks.
While it is mostly a user error to have the extra semicolon,
formatting it graciously will correctly format in the cases
where we do not fully understand the code (macros).

llvm-svn: 192543
2013-10-12 22:46:56 +00:00