]> granicus.if.org Git - clang/log
clang
10 years ago[ms-cxxabi] Fix assert in unspecified inheritance memptr emission
Reid Kleckner [Tue, 15 Oct 2013 01:18:02 +0000 (01:18 +0000)]
[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.

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

10 years agoObjectiveC migrator: Support for more possibility of
Fariborz Jahanian [Tue, 15 Oct 2013 00:00:28 +0000 (00:00 +0000)]
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

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

10 years agoPR17567: Improve diagnostic for a mistyped constructor name. If we see something
Richard Smith [Tue, 15 Oct 2013 00:00:26 +0000 (00:00 +0000)]
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.

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

10 years agoAdd has_feature support for reflecting the presence of refined Objective-C ABI mangli...
Ted Kremenek [Mon, 14 Oct 2013 23:48:27 +0000 (23:48 +0000)]
Add has_feature support for reflecting the presence of refined Objective-C ABI mangling for qualified id<...>.  Fixes <rdar://problem/14799110>.

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

10 years agoProvide a dummy NetBSD tree and use --sysroot in the driver test.
Joerg Sonnenberger [Mon, 14 Oct 2013 23:26:44 +0000 (23:26 +0000)]
Provide a dummy NetBSD tree and use --sysroot in the driver test.

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

10 years agoTrivial formatting changes; no functional changes intended.
Aaron Ballman [Mon, 14 Oct 2013 23:26:04 +0000 (23:26 +0000)]
Trivial formatting changes; no functional changes intended.

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

10 years agoSwitching some custom logic to using table-generated helper methods. This also remov...
Aaron Ballman [Mon, 14 Oct 2013 23:22:37 +0000 (23:22 +0000)]
Switching some custom logic to using table-generated helper methods.  This also removes an unnecessary diagnostic.

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

10 years agoAdding a regression test for PR17578. It is marked xfail until the bug is fixed.
Yunzhong Gao [Mon, 14 Oct 2013 22:51:23 +0000 (22:51 +0000)]
Adding a regression test for PR17578. It is marked xfail until the bug is fixed.

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

10 years agoPR17576: Fix assertion on polymorphic classes with small alignment
Reid Kleckner [Mon, 14 Oct 2013 21:14:05 +0000 (21:14 +0000)]
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.

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

10 years agoFixing stdout/stderr interleaving in lit test.
Warren Hunt [Mon, 14 Oct 2013 20:58:36 +0000 (20:58 +0000)]
Fixing stdout/stderr interleaving in lit test.

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

10 years agoCorrectly check for distructors when realizing vtordisps
Warren Hunt [Mon, 14 Oct 2013 20:14:09 +0000 (20:14 +0000)]
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

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

10 years agoFor NetBSD/current on X86 do not use libgcc and default to libc++.
Joerg Sonnenberger [Mon, 14 Oct 2013 20:13:05 +0000 (20:13 +0000)]
For NetBSD/current on X86 do not use libgcc and default to libc++.
Adjust linkage to make more sense for older releases.

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

10 years agoMove comment to its proper place.
Ted Kremenek [Mon, 14 Oct 2013 19:11:25 +0000 (19:11 +0000)]
Move comment to its proper place.

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

10 years agoLit tests for Microsoft C++ record layout.
Warren Hunt [Mon, 14 Oct 2013 19:08:58 +0000 (19:08 +0000)]
Lit tests for Microsoft C++ record layout.
They weren't added with the rest of the microsoft record layout patch due me not
doing svn add.

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

10 years agoGetExprRange() (used by -Wconversion checking) should look through OpaqueValueExprs.
Ted Kremenek [Mon, 14 Oct 2013 18:55:27 +0000 (18:55 +0000)]
GetExprRange() (used by -Wconversion checking) should look through OpaqueValueExprs.

Fixes a false positive with -Wconversion involving Objective-C properties.

Fixes <rdar://problem/14415662>.

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

10 years agoAlso don't hardcode the order on this test.
Rafael Espindola [Mon, 14 Oct 2013 16:18:39 +0000 (16:18 +0000)]
Also don't hardcode the order on this test.

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

10 years agoDon't hardcode the order of the aliases.
Rafael Espindola [Mon, 14 Oct 2013 16:05:12 +0000 (16:05 +0000)]
Don't hardcode the order of the aliases.

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

10 years agoReduce double set lookups by using the result of insert.
Benjamin Kramer [Mon, 14 Oct 2013 15:16:10 +0000 (15:16 +0000)]
Reduce double set lookups by using the result of insert.

No functionality change.

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

10 years ago[AArch64] Add support for NEON scalar integer compare instructions.
Chad Rosier [Mon, 14 Oct 2013 14:37:40 +0000 (14:37 +0000)]
[AArch64] Add support for NEON scalar integer compare instructions.

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

10 years agoDo not use typo correction that is unaccessible.
Serge Pavlov [Mon, 14 Oct 2013 14:05:48 +0000 (14:05 +0000)]
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.

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

10 years agoFix use-after-free in PPCallbacksTest detected by ASan bootstrap bot
Alexey Samsonov [Mon, 14 Oct 2013 07:13:59 +0000 (07:13 +0000)]
Fix use-after-free in PPCallbacksTest detected by ASan bootstrap bot

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

10 years agoFixed "ArgSize may be used uninitialised" error when compiling with gcc.
Andy Gibbs [Mon, 14 Oct 2013 07:02:04 +0000 (07:02 +0000)]
Fixed "ArgSize may be used uninitialised" error when compiling with gcc.

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

10 years agoKeep track of indentation levels in static initializers for correct indentation with...
Alexander Kornienko [Mon, 14 Oct 2013 00:46:35 +0000 (00:46 +0000)]
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

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

10 years agoMerge common pointers for redeclarations of the same template across modules.
Richard Smith [Sun, 13 Oct 2013 23:50:45 +0000 (23:50 +0000)]
Merge common pointers for redeclarations of the same template across modules.

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

10 years agoDon't get confused by a virt-specifier after a trailing-return-type - it's not
Richard Smith [Sun, 13 Oct 2013 22:12:28 +0000 (22:12 +0000)]
Don't get confused by a virt-specifier after a trailing-return-type - it's not
an accidentally-included name for the declarator.

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

10 years agoFix typo: inccrementally
Benjamin Kramer [Sun, 13 Oct 2013 12:02:16 +0000 (12:02 +0000)]
Fix typo: inccrementally

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

10 years agoRelax header guard mismatch warning with edit distance heuristic.
Ismail Pazarbasi [Sat, 12 Oct 2013 23:17:37 +0000 (23:17 +0000)]
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.

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

10 years agoAutomatically munch semicolons after blocks.
Manuel Klimek [Sat, 12 Oct 2013 22:46:56 +0000 (22:46 +0000)]
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).

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

10 years agoclang-format: Fix assertion on unterminated #ifs.
Daniel Jasper [Sat, 12 Oct 2013 13:32:56 +0000 (13:32 +0000)]
clang-format: Fix assertion on unterminated #ifs.

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

10 years agoCallback support for OpenCL extension pragmas.
Pekka Jaaskelainen [Sat, 12 Oct 2013 09:29:48 +0000 (09:29 +0000)]
Callback support for OpenCL extension pragmas.

Patch from Rami Ylimäki and Mikael Lepistö!

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

10 years agoclang-format: No space in "<::" in C++11 mode.
Daniel Jasper [Sat, 12 Oct 2013 05:16:06 +0000 (05:16 +0000)]
clang-format: No space in "<::" in C++11 mode.

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

10 years agoAdd missing flags -fexpensive-optimizations and -minline-all-stringops as noops.
Nick Lewycky [Sat, 12 Oct 2013 04:24:31 +0000 (04:24 +0000)]
Add missing flags -fexpensive-optimizations and -minline-all-stringops as noops.

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

10 years agoConsumed analysis: replace the consumes attribute with a set_typestate
DeLesley Hutchins [Fri, 11 Oct 2013 23:03:26 +0000 (23:03 +0000)]
Consumed analysis: replace the consumes attribute with a set_typestate
attribute.  Patch by chris.wailes@gmail.com; reviewed and edited by delesley.

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

10 years agoConsumed analysis: switch from tests_consumed/unconsumed to a general
DeLesley Hutchins [Fri, 11 Oct 2013 22:30:48 +0000 (22:30 +0000)]
Consumed analysis: switch from tests_consumed/unconsumed to a general
tests_typestate attribute.  Patch by chris.wailes@gmail.com.

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

10 years agoImprove the error message for attempting to build a for range loop using a
Richard Trieu [Fri, 11 Oct 2013 22:16:04 +0000 (22:16 +0000)]
Improve the error message for attempting to build a for range loop using a
function parameter that has array type.  Such a parameter will be treated as
a pointer type instead, resulting in a missing begin function error is a
suggestion to dereference the pointer.  This provides a different,
more informative diagnostic as well as point to the parameter declaration.

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

10 years agoConsumed analysis: check destructor calls.
DeLesley Hutchins [Fri, 11 Oct 2013 21:55:33 +0000 (21:55 +0000)]
Consumed analysis: check destructor calls.
This allows the callable_when attribute to be attached to destructors.
Original patch by chris.wailes@gmail.com, reviewed and edited by delesley.

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

10 years agoDon't break string literals inside preprocessor directives.
Alexander Kornienko [Fri, 11 Oct 2013 21:43:05 +0000 (21:43 +0000)]
Don't break string literals inside preprocessor directives.

Summary:
This way we avoid breaking code which uses unknown preprocessor
directives with long string literals. The specific use case in
http://llvm.org/PR17035 isn't very common, but it seems to be a good idea to
avoid this kind of problem anyway.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D1813

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

10 years agoObjectiveC migrator. also support migration to
Fariborz Jahanian [Fri, 11 Oct 2013 21:34:56 +0000 (21:34 +0000)]
ObjectiveC migrator. also support migration to
NS_ENUM/NS_OPTIONS macros when typedef declaration
precedes enum declaration. // rdar://15200915

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

10 years agoChanged clang-format-diff.py to output diff by default. Added -i option to apply...
Alexander Kornienko [Fri, 11 Oct 2013 21:32:01 +0000 (21:32 +0000)]
Changed clang-format-diff.py to output diff by default. Added -i option to apply changes to files instead.

Summary:
"svn diff|clang-format-diff.py" will just output the diff.
Now it's possible to use:
  svn diff|clang-format-diff.py|patch -p0
as an equivalent to:
  svn diff|clang-format-diff.py -i
;)

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1840

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

10 years agoSupport formatting of preprocessor branches.
Manuel Klimek [Fri, 11 Oct 2013 21:25:45 +0000 (21:25 +0000)]
Support formatting of preprocessor branches.

We now correctly format:
  void SomeFunction(int param1,
  #ifdef X
                    NoTemplate param2,
  #else
                    template <
  #ifdef A
                        MyType<Some> >
  #else
                        Type1, Type2>
  #endif
                    param2,
  #endif
                    param3) {
    f();
  }

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

10 years agoOnly use the MS record layout when using the MS C++ ABI
Reid Kleckner [Fri, 11 Oct 2013 21:10:11 +0000 (21:10 +0000)]
Only use the MS record layout when using the MS C++ ABI

We're not ready to use it everywhere we use a win32 triple yet.

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

10 years agoTurn struct-path aware TBAA on by default.
Manman Ren [Fri, 11 Oct 2013 20:48:38 +0000 (20:48 +0000)]
Turn struct-path aware TBAA on by default.

Use -no-struct-path-tbaa to turn it off.
This is the same as r191695, which was reverted because it depends on a
commit that has issues.

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

10 years agoUse castAs instead of cast in thunk generation
Reid Kleckner [Fri, 11 Oct 2013 20:46:27 +0000 (20:46 +0000)]
Use castAs instead of cast in thunk generation

Calling convention attributes can add sugar to methods that we have to
look through.  This fixes an assertion failure in the provided test
case.

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

10 years agoFix unused variable warning in MS record layout.
Reid Kleckner [Fri, 11 Oct 2013 20:41:08 +0000 (20:41 +0000)]
Fix unused variable warning in MS record layout.

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

10 years agoAdds Microsoft compatiable C++ record layout code to clang.
Warren Hunt [Fri, 11 Oct 2013 20:19:00 +0000 (20:19 +0000)]
Adds Microsoft compatiable C++ record layout code to clang.

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

10 years ago[libclang] Introduce clang_Type_getCXXRefQualifier whichexposes ref-qualifier informa...
Argyrios Kyrtzidis [Fri, 11 Oct 2013 19:58:38 +0000 (19:58 +0000)]
[libclang] Introduce clang_Type_getCXXRefQualifier whichexposes ref-qualifier information of function type.

Patch by Che-Liang Chiou!

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

10 years agoclang-format: Don't remove 'unknown' tokens.
Daniel Jasper [Fri, 11 Oct 2013 19:45:02 +0000 (19:45 +0000)]
clang-format: Don't remove 'unknown' tokens.

In certain macros or incorrect string literals, the token stream can
contain 'unknown' tokens, e.g. a single backslash or a set of empty
ticks. clang-format simply treated them as whitespace and removed them
prior to this patch.

This fixes llvm.org/PR17215

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

10 years agoRemove extra braces.
Eric Christopher [Fri, 11 Oct 2013 18:16:51 +0000 (18:16 +0000)]
Remove extra braces.

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

10 years agoObjectiveC migrator: fixes a bug when in NS_ENUM/NS_OPTIONS
Fariborz Jahanian [Fri, 11 Oct 2013 17:35:22 +0000 (17:35 +0000)]
ObjectiveC migrator: fixes a bug when in NS_ENUM/NS_OPTIONS
migration, the typedef has annotations.
// rdar://15200602

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

10 years agoclang-cl: Mark /FA and /Fa as unsupported options
Hans Wennborg [Fri, 11 Oct 2013 17:11:51 +0000 (17:11 +0000)]
clang-cl: Mark /FA and /Fa as unsupported options

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

10 years agoDon't hardcode the alias order in this test.
Rafael Espindola [Fri, 11 Oct 2013 16:56:21 +0000 (16:56 +0000)]
Don't hardcode the alias order in this test.

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

10 years agoremove path separator from test/Driver/xcore-opts.c
Robert Lytton [Fri, 11 Oct 2013 10:55:53 +0000 (10:55 +0000)]
remove path separator from test/Driver/xcore-opts.c

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

10 years agoXCore target: add an xcore toolchain implementation
Robert Lytton [Fri, 11 Oct 2013 10:29:40 +0000 (10:29 +0000)]
XCore target: add an xcore toolchain implementation

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

10 years agoXCore : Fix bug in XCoreABIInfo::EmitVAArg()
Robert Lytton [Fri, 11 Oct 2013 10:29:34 +0000 (10:29 +0000)]
XCore : Fix bug in XCoreABIInfo::EmitVAArg()

Incorrect handling of 'double' and 'long long int'

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

10 years agoDiagnose by-copy captures of abstract classes.
Douglas Gregor [Fri, 11 Oct 2013 04:25:21 +0000 (04:25 +0000)]
Diagnose by-copy captures of abstract classes.

Fixes <rdar://problem/14468891>.

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

10 years agoThe emitted IR is the same, we need these flags to actually use the LLVM target.
Nick Lewycky [Fri, 11 Oct 2013 03:52:43 +0000 (03:52 +0000)]
The emitted IR is the same, we need these flags to actually use the LLVM target.
Mark it as requiring the x86 target.

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

10 years agoAdd -fno-function-sections and -fno-data-sections. Since
Nick Lewycky [Fri, 11 Oct 2013 03:35:10 +0000 (03:35 +0000)]
Add -fno-function-sections and -fno-data-sections. Since
-f{function,data}-sections had no tests at all, add some, and verify that the
-fno variants work as well.

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

10 years agoFix typo in comment. No functionality change.
Nick Lewycky [Fri, 11 Oct 2013 03:33:53 +0000 (03:33 +0000)]
Fix typo in comment. No functionality change.

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

10 years agoImplemented aarch64 SIMD copy related ACLE intrinsic :
Kevin Qin [Fri, 11 Oct 2013 02:34:30 +0000 (02:34 +0000)]
Implemented aarch64 SIMD copy related ACLE intrinsic :
vget_lane, vset_lane, vcopy_lane, vcreate, vdup_n, vdup_lane, vmov_n.

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

10 years agoObjectiveC migrator. When migrating to NS_ENUM/NS_OPTIONS,
Fariborz Jahanian [Thu, 10 Oct 2013 23:57:58 +0000 (23:57 +0000)]
ObjectiveC migrator. When migrating to NS_ENUM/NS_OPTIONS,
don't leave a blank line behind replacing the typedef
decl. // rdar://15200949

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

10 years agoclang-cl: simplify the -m32 -m64 test
Hans Wennborg [Thu, 10 Oct 2013 23:04:06 +0000 (23:04 +0000)]
clang-cl: simplify the -m32 -m64 test

This was just broken.

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

10 years agoclang-cl: Expose the -m32 and -m64 command-line options
Hans Wennborg [Thu, 10 Oct 2013 22:36:20 +0000 (22:36 +0000)]
clang-cl: Expose the -m32 and -m64 command-line options

And add a test to check that they work.

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

10 years agoObjectiveC. ObjectiveC's collection selector expression in
Fariborz Jahanian [Thu, 10 Oct 2013 21:58:04 +0000 (21:58 +0000)]
ObjectiveC. ObjectiveC's collection selector expression in
the fereach loop must be a non-const lvalue expression as
it will be assigned to at the beginning of the loop.
// rdar://15123684

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

10 years agoMake CodeGenTypes data members private.
Mark Lacey [Thu, 10 Oct 2013 20:57:00 +0000 (20:57 +0000)]
Make CodeGenTypes data members private.

No functionality differences.

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

10 years agoDebug Info: update testing cases when the context field of subprogram is updated
Manman Ren [Thu, 10 Oct 2013 18:40:16 +0000 (18:40 +0000)]
Debug Info: update testing cases when the context field of subprogram is updated
to use DIScopeRef.

Paired commit with r192378.

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

10 years agoObjectiveC migrator: For 'default' and 'shared' family of
Fariborz Jahanian [Thu, 10 Oct 2013 18:23:13 +0000 (18:23 +0000)]
ObjectiveC migrator: For 'default' and 'shared' family of
methods, infer their self's type as their result type.
// rdar://15145218

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

10 years agoLocate VS InstallDir in the presence of newer runtime
Hans Wennborg [Thu, 10 Oct 2013 18:03:08 +0000 (18:03 +0000)]
Locate VS InstallDir in the presence of newer runtime

This fixes getSystemRegistryString() in WindowsToolChain.cpp to
make sure that the VS version that it picks has an InstallDir.
Previously we would look for the highest version os VS and check
for InstallDir afterwards.

Patch by Yaron Keren!

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

10 years agoImplement AArch64 vector load/store multiple N-element structure class SIMD(lselem).
Hao Liu [Thu, 10 Oct 2013 17:01:49 +0000 (17:01 +0000)]
Implement AArch64 vector load/store multiple N-element structure class SIMD(lselem).
Including following 14 instructions:
4 ld1 insts: load multiple 1-element structure to sequential 1/2/3/4 registers.
ld2/ld3/ld4: load multiple N-element structure to sequential N registers (N=2,3,4).
4 st1 insts: store multiple 1-element structure from sequential 1/2/3/4 registers.
st2/st3/st4: store multiple N-element structure from sequential N registers (N = 2,3,4).

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

10 years agoDisable RTTI in one test so clang doesn't assert behind the scenes
Timur Iskhodzhanov [Thu, 10 Oct 2013 16:38:32 +0000 (16:38 +0000)]
Disable RTTI in one test so clang doesn't assert behind the scenes

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

10 years agoRevert "Implement AArch64 vector load/store multiple N-element structure class SIMD...
Tim Northover [Thu, 10 Oct 2013 16:00:08 +0000 (16:00 +0000)]
Revert "Implement AArch64 vector load/store multiple N-element structure class SIMD(lselem). "

This reverts commit r192351. The LLVM side broke the build and the Clang tests
will inevitably fail without it.

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

10 years agoRevert "Use aliases for more constructors and destructors."
Rafael Espindola [Thu, 10 Oct 2013 15:04:21 +0000 (15:04 +0000)]
Revert "Use aliases for more constructors and destructors."

This reverts commit r192300.

The change itself looks correct, but it found issues on how we handle aliases
in llvm.

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

10 years agoImplement AArch64 vector load/store multiple N-element structure class SIMD(lselem).
Hao Liu [Thu, 10 Oct 2013 14:59:36 +0000 (14:59 +0000)]
Implement AArch64 vector load/store multiple N-element structure class SIMD(lselem).
Including following 14 instructions:
4 ld1 insts: load multiple 1-element structure to sequential 1/2/3/4 registers.
ld2/ld3/ld4: load multiple N-element structure to sequential N registers (N=2,3,4).
4 st1 insts: store multiple 1-element structure from sequential 1/2/3/4 registers.
st2/st3/st4: store multiple N-element structure from sequential N registers (N = 2,3,4).

E.g. ld1(3 registers version) will load 32-bit elements {A, B, C, D, E, F} sequentially into the three 64-bit vectors list {BA, DC, FE}.
E.g. ld3 will load 32-bit elements {A, B, C, D, E, F} into the three 64-bit vectors list {DA, EB, FC}.

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

10 years agoCorrectly detect colon in bit fields. Fixes PR17333.
Alexander Kornienko [Thu, 10 Oct 2013 13:36:20 +0000 (13:36 +0000)]
Correctly detect colon in bit fields. Fixes PR17333.

Summary: Colon was incorrectly detected as a start of inheritance list. Fixed.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D1884

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

10 years agoParser: Avoid a crash-on-invalid when trying to diagnose function calls with -> in it.
Benjamin Kramer [Thu, 10 Oct 2013 12:24:40 +0000 (12:24 +0000)]
Parser: Avoid a crash-on-invalid when trying to diagnose function calls with -> in it.

Use the existing convenience function.

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

10 years agoSema: Taking the address of a dtor is illegal per C++ [class.dtor]p2.
Benjamin Kramer [Thu, 10 Oct 2013 09:44:41 +0000 (09:44 +0000)]
Sema: Taking the address of a dtor is illegal per C++ [class.dtor]p2.

Emit a proper error instead of crashing in CodeGen. PR16892.

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

10 years ago[Mips] Support FSF Mips toolchain directories tree in the Clang driver.
Simon Atanasyan [Thu, 10 Oct 2013 07:57:44 +0000 (07:57 +0000)]
[Mips] Support FSF Mips toolchain directories tree in the Clang driver.

The patch reviewed by Rafael Espindola.
http://llvm-reviews.chandlerc.com/D1843

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

10 years agoMake test portable.
Ted Kremenek [Thu, 10 Oct 2013 02:12:25 +0000 (02:12 +0000)]
Make test portable.

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

10 years agoAdd a section about clang-cl to UsersManual.rst
Hans Wennborg [Thu, 10 Oct 2013 01:15:16 +0000 (01:15 +0000)]
Add a section about clang-cl to UsersManual.rst

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

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

10 years agoFix getIntegerTypeOrder() to properly handle enums by first unwrapping their underlyi...
Ted Kremenek [Thu, 10 Oct 2013 00:54:01 +0000 (00:54 +0000)]
Fix getIntegerTypeOrder() to properly handle enums by first unwrapping their underlying integer type.  This is a precondition for calling getIntegerRank().

Fixes an assertion failure in a test case involving vectors.

Fixes <rdar://problem/15091442>

Please somebody check this.

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

10 years agoUse KEY_WOW64_32KEY when reading the registry in WindowsToolChain.cpp (PR17033)
Hans Wennborg [Wed, 9 Oct 2013 23:41:48 +0000 (23:41 +0000)]
Use KEY_WOW64_32KEY when reading the registry in WindowsToolChain.cpp (PR17033)

This exposes a 32-bit view of the registry even when Clang is built as a 64-bit
program. Since Visual Studio is a 32-bit application, this is necessary for us
to find it.

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

10 years agoRefine string literal concatenation warning within an NSArray literal to not warn...
Ted Kremenek [Wed, 9 Oct 2013 22:34:33 +0000 (22:34 +0000)]
Refine string literal concatenation warning within an NSArray literal to not warn when the literal comes from a macro expansion.  Fixes <rdar://problem/15147688>.

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

10 years agoThis patch addresses a problem encountered by the
Sean Callanan [Wed, 9 Oct 2013 21:45:11 +0000 (21:45 +0000)]
This patch addresses a problem encountered by the
ASTImporter when importing the following types:

typedef struct {
} A;

typedef struct {
  A a;
} B;

Suppose we have imported B, but we did not at that
time need to complete it.  Then later we want to
import A.  The struct is anonymous, so the first
thing we want to do is make sure no other anonymous
struct already matches it.  So we set up an
StructuralEquivalenceContext and compare B with A.

This happens at ASTImporter.cpp:2179.

Now, in this scenario, B is not complete.  So we go
and import its fields, including a, which causes A
to be imported.  The ASTImporter doesn’t yet have A
in its list of already-imported things, so we
import A.

After the StructuralEquivalenceContext is finished
determining that A and B are different, the
ASTImporter concludes that A must be imported
because no equivalent exists, so it imports a second
copy of A.  Now we have two different structs
representing A.  This is really bad news.

The patch allows the StructuralEquivalenceContext to
use the original version of B when making its
comparison, obviating the need for an import and
cutting this loop.

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

10 years agoDebug Info: update testing cases when the context and type fields of
Manman Ren [Wed, 9 Oct 2013 19:47:05 +0000 (19:47 +0000)]
Debug Info: update testing cases when the context and type fields of
template_type and template_value are updated to use DIRef.

Paired commit with r192320.

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

10 years agoObjectiveC migrator. Introduce a new objcmt-atomic-property option
Fariborz Jahanian [Wed, 9 Oct 2013 19:06:08 +0000 (19:06 +0000)]
ObjectiveC migrator. Introduce a new objcmt-atomic-property option
and use it to infer all properties as 'atomic'.
// rdar://14988132

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

10 years agoFix warnings introduced in r192314.
DeLesley Hutchins [Wed, 9 Oct 2013 18:38:53 +0000 (18:38 +0000)]
Fix warnings introduced in r192314.

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

10 years agoConsumed analysis: improve loop handling. The prior version of the analysis
DeLesley Hutchins [Wed, 9 Oct 2013 18:30:24 +0000 (18:30 +0000)]
Consumed analysis: improve loop handling.  The prior version of the analysis
marked all variables as "unknown" at the start of a loop.  The new version
keeps the initial state of variables unchanged, but issues a warning if the
state at the end of the loop is different from the state at the beginning.
This patch will eventually be replaced with a more precise analysis.

Initial patch by chris.wailes@gmail.com.  Reviewed and edited by
delesley@google.com.

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

10 years agoRevert commit r192299 until find a way to account for simlinks in OS X.
Ariel J. Bernal [Wed, 9 Oct 2013 18:27:27 +0000 (18:27 +0000)]
Revert commit r192299 until find a way to account for simlinks in OS X.

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

10 years agoInitialize vtorDisp in class constructors and destructors
Timur Iskhodzhanov [Wed, 9 Oct 2013 18:16:58 +0000 (18:16 +0000)]
Initialize vtorDisp in class constructors and destructors

Reviewed at http://llvm-reviews.chandlerc.com/D1867

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

10 years agoTighten diagnostics for calling conventions on variadic functions
Hans Wennborg [Wed, 9 Oct 2013 18:10:25 +0000 (18:10 +0000)]
Tighten diagnostics for calling conventions on variadic functions

Follow-up from r192240.

This makes it an error to use callee-cleanup conventions on variadic
functions, except for __fastcall and __stdcall, which we ignore with
a warning for GCC and MSVC compatibility.

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

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

10 years agoObjectiveC migrator. Introduce a new print policy for
Fariborz Jahanian [Wed, 9 Oct 2013 17:37:28 +0000 (17:37 +0000)]
ObjectiveC migrator. Introduce a new print policy for
suppression of strong lifetime qualifiers when
inferring property. // rdar://15082812

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

10 years agoUse aliases for more constructors and destructors.
Rafael Espindola [Wed, 9 Oct 2013 16:13:15 +0000 (16:13 +0000)]
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>;

It is safe to use aliases to weak symbols, as long and the alias itself is also
weak.

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

10 years agoThis patch fixes replacements that are not applied when relative paths are
Ariel J. Bernal [Wed, 9 Oct 2013 16:09:23 +0000 (16:09 +0000)]
This patch fixes replacements that are not applied when relative paths are
specified.

In particular it makes sure that relative paths for non-virtual files aren't
made absolute.
Added unittest test.

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

10 years agoclang-format: Fix template declaration line breaking with comment.
Daniel Jasper [Wed, 9 Oct 2013 15:06:17 +0000 (15:06 +0000)]
clang-format: Fix template declaration line breaking with comment.

Before, clang-format would always insert a linebreak before the comment
in code like:
  template <typename T> // T can be A, B or C.
  struct S {};

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

10 years ago[Mips] Group MIPS-related options checking function in one place.
Simon Atanasyan [Wed, 9 Oct 2013 12:12:39 +0000 (12:12 +0000)]
[Mips] Group MIPS-related options checking function in one place.

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

10 years ago[Mips] Make the isMipsR2Arch() function simpler - remove checking for
Simon Atanasyan [Wed, 9 Oct 2013 12:12:34 +0000 (12:12 +0000)]
[Mips] Make the isMipsR2Arch() function simpler - remove checking for
MIPS-arch.

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

10 years ago[Mips] Remove unused mips_CPUs_Group options group. It's better to join
Simon Atanasyan [Wed, 9 Oct 2013 12:12:29 +0000 (12:12 +0000)]
[Mips] Remove unused mips_CPUs_Group options group. It's better to join
all MIPS-related options to the new m_mips_Features_Group later.

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

10 years ago[Mips] Do not check for options from the OPT_mips_CPUs_Group. All these
Simon Atanasyan [Wed, 9 Oct 2013 12:12:24 +0000 (12:12 +0000)]
[Mips] Do not check for options from the OPT_mips_CPUs_Group. All these
options are aliases now.

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

10 years ago[Mips] Make mips32/mips32r2/mips64/mips64r2 real aliases for appropriate
Simon Atanasyan [Wed, 9 Oct 2013 12:12:19 +0000 (12:12 +0000)]
[Mips] Make mips32/mips32r2/mips64/mips64r2 real aliases for appropriate
march options.

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

10 years agoCode cleanup: rename VTableContext to ItaniumVTableContext, VTableBuilder to ItaniumV...
Timur Iskhodzhanov [Wed, 9 Oct 2013 11:33:51 +0000 (11:33 +0000)]
Code cleanup: rename VTableContext to ItaniumVTableContext, VTableBuilder to ItaniumVTableBuilder and clang-format code around

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

10 years agoclang/test/Coverage/codegen-next.m: Exclude this for targeting x86_64-win32.
NAKAMURA Takumi [Wed, 9 Oct 2013 09:45:27 +0000 (09:45 +0000)]
clang/test/Coverage/codegen-next.m: Exclude this for targeting x86_64-win32.

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