Commit Graph

48174 Commits

Author SHA1 Message Date
Daniel Jasper f9a5e4043c clang-format: Improve indentation when deriving from templated classes.
Before:
  struct aaaaaaaaaaaaa : public aaaaaaaaaaaaaaaaaaa< //
      aaaaaaaaaaaaaaaa> {};
  struct aaaaaaaaaaaaaaaaaaaa : public aaaaaaaaaaaaaaaaaaa<
      aaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaa> {};

After:
  struct aaaaaaaaaaaaa : public aaaaaaaaaaaaaaaaaaa< //
                             aaaaaaaaaaaaaaaa> {};
  struct aaaaaaaaaaaaaaaaaaaa
      : public aaaaaaaaaaaaaaaaaaa<aaaaaaaaaaaaaaaaaaaaa,
                                   aaaaaaaaaaaaaaaaaaaaaa> {};

llvm-svn: 192187
2013-10-08 16:24:07 +00:00
Daniel Jasper e8845ad4c5 clang-format: Don't exit with failure on empty files.
Also let clang-format-diff.py detect errors based on clang-format's
return code. Otherwise messages like "Can't find usable .clang-format,
falling back to LLVM style" can make it fail, which might be undesired.

Patch by Alp Toker. Thank you!

llvm-svn: 192184
2013-10-08 15:54:36 +00:00
Alp Toker d4a72d5ce5 Make InstantiatingTemplate depth checks clearer
The bool conversion operator on InstantiatingTemplate never added value and
only served to obfuscate the template instantiation routines.

This replaces the conversion and its callers with an explicit isInvalid()
function to make it clear what's going on at a glance.

llvm-svn: 192177
2013-10-08 08:09:04 +00:00
Daniel Jasper ec01cd6e7f clang-format: Improve constructor initializer linewrapping.
Specifically make ConstructorInitializerAllOnOneLineOrOnePerLine work
nicely with BreakConstructorInitializersBeforeComma.

This fixes llvm.org/PR17395.

llvm-svn: 192168
2013-10-08 05:11:18 +00:00
Faisal Vali d2598e97a4 Fix linkage calculation of auto member functions returning lambdas
As described by Richard in https://groups.google.com/a/isocpp.org/d/msg/std-discussion/S1kmj0wF5-g/fb6agEYoL2IJ

we should allow:

template<typename S>
struct A {

template<typename T> static auto default_lambda() {
  return [](const T&) { return 42; };
}

template<class U = decltype(default_lambda<S>())>
  U func(U u = default_lambda<S>()) { return u; }

};

int run2 = A<double>{}.func()(3.14);

int run3 = A<char>{}.func()('a');

This patch allows the code using the same trickery that was used to allow the code in non-member functions at namespace scope.


Please see http://llvm-reviews.chandlerc.com/D1844 for richard's approval.

llvm-svn: 192166
2013-10-08 04:15:04 +00:00
Reid Kleckner 9a7f3e61a9 [ms-cxxabi] Fix the calling convention for operator new in records
Summary:
Operator new, new[], delete, and delete[] are all implicitly static when
declared inside a record.  CXXMethodDecl already knows this, but we need
to account for that before we pick the calling convention for the
function type.

Fixes PR17371.

Reviewers: rsmith

CC: cfe-commits

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

llvm-svn: 192150
2013-10-08 00:58:57 +00:00
Justin Bogner 84ff5ee448 Sema: Only merge typedef attributes if the previous decl is a typedef
In r186373, we started merging attributes on typedefs, but this causes
us to try to merge attributes even if the previous declaration was not
a typedef.

Only merge the attributes if the previous decl was also a typedef.

Fixes rdar://problem/15044218

llvm-svn: 192146
2013-10-08 00:19:09 +00:00
Manman Ren 4f755deaf6 TBAA: use the same format for scalar TBAA and struct-path aware TBAA.
An updated version of r191586 with bug fix.

Struct-path aware TBAA generates tags to specify the access path,
while scalar TBAA only generates tags to scalar types.

We should not generate a TBAA tag with null being the first field. When
a TBAA type node is null, the tag should be null too. Make sure we
don't decorate an instruction with a null TBAA tag.

Added a testing case for the bug reported by Richard with -relaxed-aliasing
and -fsanitizer=thread.

llvm-svn: 192145
2013-10-08 00:08:49 +00:00
Ted Kremenek db49a5df47 Split test to test -Wshadow with emmintrin.h more portable.
llvm-svn: 192144
2013-10-08 00:03:41 +00:00
Ted Kremenek 854cc293a7 Suppress useless -Wshadow warning when using _mm* macros from emmintrin.h
Fixes <rdar://problem/10679282>.

I'm not completely satisfied with this patch.  Sprinkling "diagnostic ignored"
_Pragmas throughout this file is gross, but I couldn't suppress
it for the entire file.

llvm-svn: 192143
2013-10-07 23:51:11 +00:00
Reid Kleckner b66ae3f34f clang-cl: Accept and mostly ignore /vm*, /GF, /GF-, /Zm, and /bigobj
Patch by David Ziman!

llvm-svn: 192141
2013-10-07 23:19:01 +00:00
Richard Smith 20d920c844 Add a triple to unbreak buildbots where size_t is not 'unsigned long'.
llvm-svn: 192140
2013-10-07 22:58:25 +00:00
Richard Smith fee2c8d814 Remove -ast-dump-xml.
llvm-svn: 192131
2013-10-07 20:56:34 +00:00
Fariborz Jahanian 985da6c936 ObjectiveC migrator: A typical implementation of
'default' methods in Foundation does not
infer 'instancetype' for methods' result type.
// rdar://15145218

llvm-svn: 192129
2013-10-07 20:41:53 +00:00
Richard Smith b8b41d3ea4 Add support for WG21 N3599 (literal operator template for strings) as a GNU
extension. The GCC folks have decided to support this even though the standard
committee have not yet approved this feature.

Patch by Hristo Venev!

llvm-svn: 192128
2013-10-07 19:57:58 +00:00
Fariborz Jahanian d29406233b ObjectiveC modern rewriter. Rewrite typedefs
declared locally in ObjectiveC containers.
// rdar://15143875

llvm-svn: 192127
2013-10-07 19:54:22 +00:00
Matt Arsenault 2f15263807 Fix objectsize tests after r192117
llvm-svn: 192120
2013-10-07 19:00:18 +00:00
Fariborz Jahanian 88ff20ef2a ObjectiveC: Warn when 'readonly' property has explicit
ownership attribute (such as 'copy', 'assign' etc.)
// rdar://15131088

llvm-svn: 192115
2013-10-07 17:20:02 +00:00
Jordan Rose 42b4248f05 [analyzer] ArrayRef-ize BugReporter::EmitBasicReport.
No functionality change.

llvm-svn: 192114
2013-10-07 17:16:59 +00:00
Jordan Rose 7741132f47 [analyzer] RetainCountChecker: add support for CFAutorelease.
<rdar://problems/13710586&13710643>

llvm-svn: 192113
2013-10-07 17:16:52 +00:00
Chad Rosier 027dfade54 [AArch64] Add support for NEON scalar arithmetic instructions:
SQDMULH, SQRDMULH, FMULX, FRECPS, and FRSQRTS.

llvm-svn: 192112
2013-10-07 17:07:17 +00:00
Argyrios Kyrtzidis fe04fe0d41 [libclang] Add some tests by Loïc Jaquemet that I forgot to add earlier.
llvm-svn: 192108
2013-10-07 16:38:40 +00:00
NAKAMURA Takumi f7c520ff66 Sema::tryCaptureVariable(): Prune three unused variables, HasBlocksAttr, IsBlock, and IsLambda. [-Wunused-variable]
llvm-svn: 192095
2013-10-07 09:32:50 +00:00
Manuel Klimek 91e48586ae Fix incorrect detection of class definitions with alignas specification.
llvm-svn: 192094
2013-10-07 09:15:41 +00:00
Richard Smith 0b87e0739e When merging class definitions across modules in C++, merge together fields.
This change doesn't go all the way to making fields redeclarable; instead, it
makes them 'mergeable', which means we can find the canonical declaration, but
not much else (and for a declaration that's not from a module, the canonical
declaration is always that declaration).

llvm-svn: 192092
2013-10-07 08:02:11 +00:00
David Majnemer 3f8f8c9dbd Driver: Use the canonical command line arguments.
Summary:
Use the arguments given to the OS at process creation-time instead of
the arguments passed into main() by the C runtime environment.  The ones
that main() received may not be suitable (e.g. not Unicode).

Depends on D1834

CC: cfe-commits

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

llvm-svn: 192091
2013-10-07 07:33:27 +00:00
Faisal Vali ad090d82f2 Refactor tryCaptureVar using ExtractMethod. No functionality change.
In chicago, Doug had requested that I go ahead and commit the refactor  as a separate change, if all the tests passed.  

Lets hope the buildbots stay quiet.

Thanks!

llvm-svn: 192087
2013-10-07 05:13:48 +00:00
Timur Iskhodzhanov 20df98c0d0 Fix PR17382 - properly group virtual method overloads in the vftable
llvm-svn: 192067
2013-10-06 15:31:37 +00:00
Daniel Jasper 320997e6b3 clang-format: Remove empty lines after visibility modifiers.
Formatting:
  class C {
  public:

    f();
  };

Now leads to:
  class C {
  public:
    f();
  };

llvm-svn: 192062
2013-10-06 11:40:08 +00:00
Sylvestre Ledru 0c4813e695 remove a dead assignment. The variables are set just right after. Found by scan-build http://buildd-clang.debian.net/scan-build/
llvm-svn: 192061
2013-10-06 09:54:18 +00:00
Mark Lacey 3825e83d6b Pass CGCXXABIs around directly.
In functions that only need to use the CGCXXABI member of a CodeGenTypes
class, pass that reference around directly rather than a reference to
a CodeGenTypes class.

This makes the actual dependence on CGCXXABI clear at the call sites.

llvm-svn: 192052
2013-10-06 01:33:34 +00:00
Aaron Ballman 4c9b7dc92e Switching the CallableWhen attribute over to using the string literal helper function instead of custom logic.
llvm-svn: 192050
2013-10-05 22:45:34 +00:00
Nick Lewycky 50e8f480ea Add support for -mcx16, and predefine __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 when
it is enabled. Also enable it on the same architectures that GCC does.

llvm-svn: 192045
2013-10-05 20:14:27 +00:00
Aaron Ballman 7fc6e1bc59 Silencing an MSVC warning; SmallSet::count returns a bool instead of a size_t.
llvm-svn: 192043
2013-10-05 19:56:07 +00:00
Craig Topper d335c9da22 Use logical/arithmetic operations instead of builtins in tbmintrin.h. This way we can remove the intrinsic support from the backend.
llvm-svn: 192036
2013-10-05 17:08:42 +00:00
Simon Atanasyan a0d895733b Remove unused param from Linux::computeSysRoot().
llvm-svn: 192034
2013-10-05 14:37:55 +00:00
Benjamin Kramer 3c529ca930 Sema: Cleanup redundant variable NumArgsToCheck
Patch by Daniel Marjamäki!

llvm-svn: 192030
2013-10-05 10:03:01 +00:00
Jiangning Liu b96ebac02b Implement aarch64 neon instruction set AdvSIMD (Across).
llvm-svn: 192029
2013-10-05 08:22:55 +00:00
Alp Toker 1dc02a360d Remove unused Sema::DelayedDestructorExceptionSpecs
This was a leftover from r160847.

llvm-svn: 192027
2013-10-05 06:50:51 +00:00
Manman Ren c174ea9ac8 Debug Info: update testing cases when the derived-from field of a
DW_TAG_pointer_type is updated to use DITypeRef.

Paired commit with r192018.

llvm-svn: 192019
2013-10-05 01:43:22 +00:00
DeLesley Hutchins 210791a021 Consumed Analysis: Change callable_when so that it can take a list of states
that a function can be called in.  This reduced the total number of annotations
needed and makes writing more complicated behaviour less burdensome.
Patch by chriswails@gmail.com.

llvm-svn: 191983
2013-10-04 21:28:06 +00:00
Fariborz Jahanian b809a0e280 ObjectiveC. Allow readonly properties without an explicit ownership
(assign/unsafe_unretained/weak/retain/strong/copy) in super class
to be overridden by a property with any explicit ownership in the 
subclass. // rdar://15014468

llvm-svn: 191971
2013-10-04 18:06:08 +00:00
Eric Christopher 0562b27dcb Temporarily revert r191801 due to conflicts with the revert of r191792.
llvm-svn: 191968
2013-10-04 17:08:47 +00:00
Rafael Espindola aa2976f388 Don't assume instruction names in the output.
llvm-svn: 191957
2013-10-04 14:42:00 +00:00
Rafael Espindola c4b1aea2d1 Add test from pr17476.
llvm-svn: 191956
2013-10-04 14:33:42 +00:00
Rafael Espindola 4b35f27206 Revert "Teach TreeTransform and family how to transform generic lambdas within templates and nested within themselves."
This reverts commit r191879. It caused llvm.org/pr17476.

llvm-svn: 191955
2013-10-04 14:28:51 +00:00
Amaury de la Vieuville 21bf6ed730 Do not emit undefined lsrh/ashr for NEON shifts
These IR instructions are undefined when the amount is equal to operand
size, but NEON right shifts support such shifts. Work around that by
emitting a different IR in these cases.

llvm-svn: 191953
2013-10-04 13:13:15 +00:00
Simon Atanasyan eeb6f27fd5 Revert r191947. The problem is not MIPS-specific and requires more
general solution.

llvm-svn: 191951
2013-10-04 11:46:54 +00:00
Timur Iskhodzhanov 555a7727c1 Simplify MicrosoftCXXNameMangler::mangleFunctionType
llvm-svn: 191950
2013-10-04 11:25:05 +00:00
Simon Atanasyan 777669be1e [Mips] For MIPS '-fPIC -static' means to compile as -fPIC but link with
-static. So do not turn off the PIC flag if -static passed to the
driver in case of MIPS target.

http://llvm.org/bugs/show_bug.cgi?id=14693

llvm-svn: 191947
2013-10-04 10:36:42 +00:00