Commit Graph

48275 Commits

Author SHA1 Message Date
Serge Pavlov aa57a64ef6 Add fixits suggesting parenthesis around type name in expressions like sizeof.
This fixes PR16992 - Fixit missing when "sizeof type" found.

llvm-svn: 192200
2013-10-08 16:56:30 +00:00
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
Jiangning Liu 4617e9dc85 Implement aarch64 neon instruction set AdvSIMD (3V elem).
llvm-svn: 191945
2013-10-04 09:21:17 +00:00
Jordan Rose 6feda28756 [analyzer] Replace bug category magic strings with shared constants, take 2.
Re-commit r191910 (reverted in r191936) with layering violation fixed, by
moving the bug categories to StaticAnalyzerCore instead of ...Checkers.

llvm-svn: 191937
2013-10-04 00:25:24 +00:00
Richard Smith 25d8e737d8 Temporarily revert r191910 until the layering violation can be fixed.
llvm-svn: 191936
2013-10-03 23:38:02 +00:00
Nico Weber bc5ae6d9e6 Don't complain about -fuse-ld=gold (cf r191429).
(There's a real implementation for this flag in review.)

llvm-svn: 191926
2013-10-03 19:45:55 +00:00
Rafael Espindola 945f7e2584 Fix the test in clang_f_opts.c to fail on unknown options.
Also fix options that were broken in the previous refactorings.

llvm-svn: 191925
2013-10-03 19:34:34 +00:00
Rafael Espindola 6b186a610b Fix test.
With -### clang return 0, so we have to use FileCheck to see if there was an
error.

llvm-svn: 191923
2013-10-03 19:18:22 +00:00
Eric Christopher 3d78fe8fa0 Make this use -### instead of a temporary output.
llvm-svn: 191921
2013-10-03 18:23:29 +00:00
Eric Christopher b511a72f92 Give this a temporary output so it is cleaned up.
llvm-svn: 191917
2013-10-03 18:02:14 +00:00
Rafael Espindola 72f55d46c8 Ignore -mieee-fp.
It looks like clang always produce code with the ieee comparisons, so it is
safe to ignore this flag (we still error on -mno-ieee-fp).

llvm-svn: 191912
2013-10-03 17:06:43 +00:00
Jordan Rose 761ee868a5 [analyzer] Replace bug category magic strings with shared constants.
One small functionality change is to bring the sizeof-pointer checker in
line with the other checkers by making its category be "Logic error"
instead of just "Logic". There should be no other functionality changes.

Patch by Daniel Marjamäki!

llvm-svn: 191910
2013-10-03 16:57:20 +00:00
Jordan Rose 9db2d9adef [analyzer] Add new debug helper clang_analyzer_warnIfReached.
This will emit a warning if a call to clang_analyzer_warnIfReached is
executed, printing REACHABLE. This is a more explicit way to declare
expected reachability than using clang_analyzer_eval or triggering
a bug (divide-by-zero or null dereference), and unlike the former will
work the same in inlined functions and top-level functions. Like the
other debug helpers, it is part of the debug.ExprInspection checker.

Patch by Jared Grubb!

llvm-svn: 191909
2013-10-03 16:57:03 +00:00
Argyrios Kyrtzidis 53f45c7d55 [libclang] python: expose a few functions, patch by Loïc Jaquemet!
llvm-svn: 191907
2013-10-03 16:19:27 +00:00
Argyrios Kyrtzidis 7a4253b685 [libclang] Introduce clang_Type_getClassType which returns the class type of a member pointer type.
Patch by Che-Liang Chiou!

llvm-svn: 191906
2013-10-03 16:19:23 +00:00
Tim Northover 4599d9470a Fix test to work on Linux hosts by specifying triple.
Thought I'd checked that before

llvm-svn: 191901
2013-10-03 14:29:54 +00:00
Tim Northover e66c946ee4 ARM: *-*-darwin-eabi triples should use AAPCS.
llvm-svn: 191900
2013-10-03 14:23:28 +00:00
Matthew Curtis 274a9cc84b Gracefully (and correctly) handle init of multiple union members
We now emit warnings when doing so and code generation is consistent
with GCC. Note that the C99 spec is unclear as to the precise
behavior.

See also ...
Bug:
  http://llvm.org/bugs/show_bug.cgi?id=16644 and

cfe-dev discussion:
  http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-September/031918.html

llvm-svn: 191890
2013-10-03 12:14:24 +00:00
Faisal Vali 8ec4036669 Teach TreeTransform and family how to transform generic lambdas within templates and nested within themselves.
This does not yet include capturing (that is next).

Please see test file for examples.

This patch was LGTM'd by Doug:
http://llvm-reviews.chandlerc.com/D1784
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130930/090048.html

When I first committed this patch - a bunch of buildbots were unable to compile the code that VS2010 seemed to compile.  Seems like there was a dependency on Sema/Template.h which VS did not seem to need, but I have now added for the other compilers.  It still compiles on Visual Studio 2010 - lets hope the buildbots remain quiet (please!)

llvm-svn: 191879
2013-10-03 06:29:33 +00:00
Timur Iskhodzhanov 6745522f89 Extract ABI-specific parts of MangleContext into separate classes
Reviewed at http://llvm-reviews.chandlerc.com/D1807

llvm-svn: 191878
2013-10-03 06:26:13 +00:00
Faisal Vali 10a00ee485 Revert changes from the nested lambdas commit till i figure out
why the buildbots are failing.

llvm-svn: 191876
2013-10-03 05:58:37 +00:00
Faisal Vali ba78d34347 Teach TreeTransform and family how to transform generic lambdas within templates and nested within themselves.
This does not yet include capturing (that is next).

Please see test file for examples.

This patch was LGTM'd by Doug:
http://llvm-reviews.chandlerc.com/D1784

llvm-svn: 191875
2013-10-03 05:32:48 +00:00
Craig Topper d867805739 Change __builtin_ia32_bextri_u64 to take an i64imm to match up with LLVM backend changes.
An explicit cast is still needed in tbmintrin.h to convert any big integer down to i32imm.

Patch from Yunzhong Gao.

llvm-svn: 191872
2013-10-03 04:21:19 +00:00
Fariborz Jahanian 8c45e283f2 ObjectiveC migrator: Add individual options and
enable them for distinct feature migration.
// rdar://15003157

llvm-svn: 191863
2013-10-02 22:49:59 +00:00
Fariborz Jahanian 2bfa2b9198 ObjectiveC migrator: Add more options one for each
kind of migration. // rdar://15003157

llvm-svn: 191858
2013-10-02 21:58:13 +00:00
Fariborz Jahanian c121386170 ObjectiveC migrator. Starting distiguising different
migrations under their own option. 
wip and // rdar://15003157

llvm-svn: 191855
2013-10-02 21:32:39 +00:00
Mark Lacey 5ea993bb59 Use the CGCXXABI member on CodeGenTypes.
CodeGenTypes already has a reference to a CGCXXABI. Use this directly
rather than going through CodeGenModule to get to the same information.

This is consistent with other references to CGCXXABI in CodeGenTypes
functions defined in CGCall.cpp.

llvm-svn: 191854
2013-10-02 20:35:23 +00:00
Kaelyn Uhrain 653ff2431b Speed up CorrectTypo by avoiding lookups on unreasonable candidates.
llvm-svn: 191846
2013-10-02 18:26:35 +00:00
Fariborz Jahanian 182486c9d9 Objective-C migrator. Simplify migrator option
processing in preparation for adding several more
options. // rdar://15003157

llvm-svn: 191842
2013-10-02 17:08:12 +00:00
Timur Iskhodzhanov 40c585a568 Fix crashes when creating global instances of polymorphic classes without fields
Reviewed at http://llvm-reviews.chandlerc.com/D1795

llvm-svn: 191839
2013-10-02 16:03:16 +00:00
Reid Kleckner 4d185105e9 Accept #pragma warning(push, 0) without warning
This partially addresses PR17435, but it doesn't actually implement the
pragma.  If we implement it, we should map levels 1-4 to something like
-Wall and level 0 to something like -w.

llvm-svn: 191833
2013-10-02 15:19:23 +00:00
Daniel Jasper 164c8e1810 clang-format: Fix clang-format-diff.py according to diff specification.
Patch by Alp Toker. Many thanks!

Original descriptions:
clang-format-diff incorrectly modifies unchanged lines due to an error
in diff parsing.

The unified diff format has a default line change count of 1, and 0 may
be specified to indicate that no lines have been added. This patch
updates the parser to accurately reflect the diff specification.

This also has the benefit of stabilising the operation so it will
produce the same output when run multiple times on the same changeset,
which was previously not the case.

No tests added because this script is not currently tested (though we
should look into that!)

llvm-svn: 191820
2013-10-02 13:59:03 +00:00
Patrik Hagglund 375d6c1ee0 Fix gcc -Wunused-but-set-variable warning in r191634.
llvm-svn: 191817
2013-10-02 10:59:08 +00:00
Joey Gouly 75987a65f3 [ARM] Add a builtin to allow you to use the 'sevl' instruction.
llvm-svn: 191816
2013-10-02 10:00:18 +00:00
Nick Lewycky ce550076d0 Fix build breakage, missed committing a chunk of a patch.
llvm-svn: 191809
2013-10-02 02:33:11 +00:00
Nick Lewycky 2d84e84236 Thread a SourceLocation into the EmitCheck for "load_invalid_value". This occurs
when scalars are loaded / undergo lvalue-to-rvalue conversion.

llvm-svn: 191808
2013-10-02 02:29:49 +00:00
Jordan Rose 44e066c72a [analyzer] Add missing return after function pointer null check.
Also add some tests that there is actually a message and that the bug is
actually a hard error. This actually behaved correctly before, because:

- addTransition() doesn't actually add a transition if the new state is null;
  it assumes you want to propagate the predecessor forward and does nothing.
- generateSink() is called in order to emit a bug report.
- If at least one new node has been generated, the predecessor node is /not/
  propagated forward.

But now it's spelled out explicitly.

Found by Richard Mazorodze, who's working on a patch that may require this.

llvm-svn: 191805
2013-10-02 01:20:28 +00:00
Manman Ren 8a35855cb1 Debug Info: update testing cases when the derived-from field of a
DW_TAG_pointer_type is updated to use DITypeRef.

Paired commit with r191800.

llvm-svn: 191801
2013-10-01 23:46:19 +00:00
Kaelyn Uhrain 07e627263f Fix a typo suggestion regression introduced by r191544.
llvm-svn: 191798
2013-10-01 22:00:28 +00:00
Nick Lewycky 5fa40c3b9e No functionality change. Reflow lines that could fit on one line. Break lines
that had 80-column violations. Remove spurious emacs mode markers on .cpp files.

llvm-svn: 191797
2013-10-01 21:51:38 +00:00
Fariborz Jahanian 8f5225b3a7 ObjectiveC migrator: When doing migration, migrator must suggest
migration of headers which have become system headers by user having put
the .system_framework in the sdk directory.
// rdar://15066802

llvm-svn: 191796
2013-10-01 21:16:29 +00:00
Rafael Espindola fc74c81451 Revert commits r190613, r190560 and r190557.
The added a cmake invocation to null builds, making them a lot slower.

llvm-svn: 191784
2013-10-01 17:31:40 +00:00
Warren Hunt 2731e3e4ef Fixing implementation of bittestandset in Intrin.h.
llvm-svn: 191783
2013-10-01 17:12:40 +00:00
Ariel J. Bernal 31c181b061 Fixed replacements for files with relative paths are not applied.
Replacements were no applied when using a compilation database with paths in the
compilation command relative to the compile directory. This patch makes those
paths abosulte.

llvm-svn: 191776
2013-10-01 14:59:00 +00:00
Alexander Kornienko 1f80396d03 Refactoring: split addTokenToState into two methods.
Summary: Pure refactoring, should be no semantic changes.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek

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

llvm-svn: 191772
2013-10-01 14:41:18 +00:00
Tim Northover a77b7b8427 Typo in ARM __attribute__((interrupt)) documentation
llvm-svn: 191771
2013-10-01 14:39:43 +00:00
Tim Northover a484bc00ff Implement ARM GNU-style interrupt attribute
This attribute allows users to use a modified C or C++ function as an ARM
exception-handling function and, with care, to successfully return control to
user-space after the issue has been dealt with.

rdar://problem/14207019

llvm-svn: 191769
2013-10-01 14:34:25 +00:00
Tim Northover 6a6b63b464 Move checkStringLiteralArgument into Sema class
It's a useful function to have around for target-specific attributes.

llvm-svn: 191768
2013-10-01 14:34:18 +00:00
Timur Iskhodzhanov 4d490a3570 Run the -cxx-abi test in 32-bit mode as the 64-bit one crashes on the bots
llvm-svn: 191760
2013-10-01 14:10:03 +00:00
Timur Iskhodzhanov 156bedf8e5 Author a FIXME in a test now that PR12784 is fixed
llvm-svn: 191758
2013-10-01 13:56:35 +00:00
Amara Emerson 4cdb87b2d5 [ARM] Add -mfpu=none option to the driver.
llvm-svn: 191736
2013-10-01 10:20:54 +00:00
Alexey Bataev d5af8e472d [OpenMP] Added parsing and semantic analysis for firstprivate clause
llvm-svn: 191730
2013-10-01 05:32:34 +00:00
Faisal Vali 49b4c1f0c8 Fix computation of linkage within nested lambdas.
When nested C++11 lambdas are used in NSDMI's - this patch prevents infinite recursion by computing the linkage of any nested lambda by determining the linkage of the outermost enclosing lambda (which might inherit its linkage from its parent).

See http://llvm-reviews.chandlerc.com/D1783 for Doug's approval.

[On a related note, I need this patch so as to pass tests of transformations of nested lambdas returned from member functions]

llvm-svn: 191727
2013-10-01 02:51:53 +00:00
Eli Friedman 3be1a1c0b5 Fix typo correction usage of SemaAccess.cpp.
When we check access for lookup results, make sure we propagate the
result's access to the access control APIs; this can be different from
the natural access of the declaration depending on the path used by the lookup.

PR17394.

llvm-svn: 191726
2013-10-01 02:44:48 +00:00
Richard Smith e4aaac506c Revert r191586 and r191695. They cause crashes when building with
-relaxed-aliasing.

llvm-svn: 191725
2013-10-01 02:20:23 +00:00
Eli Friedman 4a962f03be Tweak changes in r186464 to avoid a crash.
Currently, IR generation can't handle file-scope compound literals with
non-constant initializers in C++.

Fixes PR17415 (the first crash in the bug).

(We should probably change (T){1,2,3} to use the same codepath as T{1,2,3} in
C++ eventually, given that the semantics of the latter are actually defined by
the standard.)

llvm-svn: 191719
2013-10-01 00:28:29 +00:00
Richard Smith dd0bc7b560 Remove support for arrays of runtime bound in C++1y, now they have been voted
out of the working paper. This reverts r179962 and r179992.

llvm-svn: 191718
2013-10-01 00:19:43 +00:00
Weiming Zhao 53a797ce7b Fix PR 12730: Add _GCC_HAVE_SYNC_COMPARE_AND_SWAP macros for ARM
llvm-svn: 191707
2013-09-30 22:51:32 +00:00
Warren Hunt 3f98794718 Changing __X86_64__ to __x86_64__ in Intrin.h.
llvm-svn: 191700
2013-09-30 21:08:05 +00:00
Manman Ren e5c2d919b6 Turn struct-path aware TBAA on by default.
Use -no-struct-path-tbaa to turn it off.

llvm-svn: 191695
2013-09-30 19:35:19 +00:00
David Blaikie 8b03ef8388 Remove unused variable introduced in 191666
llvm-svn: 191682
2013-09-30 17:30:41 +00:00
Yunzhong Gao f4e0b1047a Adding intrinsics to the clang front end for the x86 TBM instruction set.
Differential Revision: http://llvm-reviews.chandlerc.com/D1751

llvm-svn: 191681
2013-09-30 17:25:14 +00:00
Edwin Vane d544aa79c9 Moving style option formatting to libFormat
The help text for clang-format's -style option and the function that processes
its value is moved to libFormat in this patch. The goal is to enable other
tools that use libFormat and also have a -style option to behave consistently
with clang-format.

llvm-svn: 191666
2013-09-30 13:31:48 +00:00
Manuel Klimek 5843add31e Fix use-after-free.
TemplateDeclInstantiator takes the MultiLevelArgumentList by const-ref
and stores a const-ref member. Thus, we must not pass a temporary
into the constructor.

llvm-svn: 191665
2013-09-30 13:29:01 +00:00
Daniel Jasper eabede6d1b clang-format: Improve alignment after 'return'.
Previously, comments, could totally confuse it.

Before:
  return
             // true if code is one of a or b.
             code == a ||
         code == b;

After:
  return
      // true if code is one of a or b.
      code == a || code == b;

llvm-svn: 191654
2013-09-30 08:29:03 +00:00
Chandler Carruth 92bd47aaa5 Add a bunch of other GCC '-f' options and ignore them. This covers every
such option I've been able to find in the wild in our build system.

Note that I haven't added test cases for this. I can do so if folks
want, but they're *really* boring considering that this is all generated
code to parse and ignore unsued options.

llvm-svn: 191653
2013-09-30 07:46:08 +00:00
Chandler Carruth 2196c4256d Switch one of the ignored boolean flag multiclasses to not have an 'f'
prefix. Sort the ignored boolean 'f' flags at the bottom of this file.
No functionality changed.

llvm-svn: 191651
2013-09-30 03:55:06 +00:00
NAKAMURA Takumi 6d18236d37 SemaTemplateDeduction.cpp: Suppress a warning. [-Wunused-variable]
llvm-svn: 191648
2013-09-30 00:14:27 +00:00
Faisal Vali 98b8e18379 Revert the linkage fix.
I got a bunch of buildbot failures that i don't understand - sorry.

llvm-svn: 191647
2013-09-29 20:27:06 +00:00
Faisal Vali f9a9af3c3d Remove an unnecessary overload from ASTLambda.h
As Richard pointed out to me, dyn_cast is very cheap - there is no real benefit from adding cluttery overloads to only avoid that cast.
No functionality change.

llvm-svn: 191646
2013-09-29 20:15:45 +00:00
Faisal Vali db29268b10 Fix computation of linkage within nested lambdas.
When nested lambdas are used in NSDMI's - this prevents infinite recursion.

See http://llvm-reviews.chandlerc.com/D1783 for Doug's approval regarding the code, and then request for some tests.

[On a related note, I need this patch so as to pass tests of transformations of nested lambdas returned from member functions]

llvm-svn: 191645
2013-09-29 20:00:15 +00:00
Manuel Klimek 7491eaa24d Add section on VS integration to the ClangFormat documentation.
llvm-svn: 191642
2013-09-29 17:49:50 +00:00
Faisal Vali 850da1a3a2 Fix windows newlines :(
llvm-svn: 191641
2013-09-29 17:08:32 +00:00
Daniel Jasper 6e16d54266 Fix misspelling of -fmodules-decluse.
llvm-svn: 191640
2013-09-29 12:40:54 +00:00
Daniel Jasper 0b1f76b658 clang-format: Fix assertion on incomplete string literals.
Before, this could would lead to an assert:
  llvm::errs() << "
               << a;

llvm-svn: 191639
2013-09-29 12:02:57 +00:00
Faisal Vali 571df12581 Implement conversion to function pointer for generic lambdas without captures.
The general strategy is to create template versions of the conversion function and static invoker and then during template argument deduction of the conversion function, create the corresponding call-operator and static invoker specializations, and when the conversion function is marked referenced generate the body of the conversion function using the corresponding static-invoker specialization.  Similarly, Codegen does something similar - when asked to emit the IR for a specialized static invoker of a generic lambda, it forwards emission to the corresponding call operator. 

This patch has been reviewed in person both by Doug and Richard.  Richard gave me the LGTM.

A few minor changes:
  - per Richard's request i added a simple check to gracefully inform that captures (init, explicit or default) have not been added to generic lambdas just yet (instead of the assertion violation).
  - I removed a few lines of code that added the call operators instantiated parameters to the currentinstantiationscope. Not only did it not handle parameter packs, but it is more relevant in the patch for nested lambdas which will follow this one, and fix that problem more comprehensively.
  - Doug had commented that the original implementation strategy of using the TypeSourceInfo of the call operator to create the static-invoker was flawed and allowed const as a member qualifier to creep into the type of the static-invoker.  I currently kludge around it - but after my initial discussion with Doug, with a follow up session with Richard, I have added a FIXME so that a more elegant solution that involves the use of TrivialTypeSourceInfo call followed by the correct wiring of the template parameters to the functionprototypeloc is forthcoming.

Thanks! 
 

llvm-svn: 191634
2013-09-29 08:45:24 +00:00
Ed Schouten d062146896 Add character set related __STDC_* definitions.
Clang uses UTF-16 and UTF-32 for its char16_t's and char32_t's
exclusively. This means that we can define __STDC_UTF_16__ and
__STDC_UTF_32__ unconditionally.

While there, define __STDC_MB_MIGHT_NEQ_WC__ for FreeBSD. FreeBSD's
wchar_t's don't encode characters as ISO-10646; the encoding depends on
the locale used. Because the character set used might not be a superset
of ASCII, we must define __STDC_MB_MIGHT_NEQ_WC__.

llvm-svn: 191631
2013-09-29 07:54:52 +00:00
Richard Smith 1cdec019e8 Implement C++1y sized deallocation (n3778). This is not enabled by -std=c++1y;
instead, it's enabled by the -cc1 flag -fsized-deallocation, until we sort out
the backward-compatibility issues.

llvm-svn: 191629
2013-09-29 04:40:38 +00:00
Richard Smith ee84919175 Remove commented-out entry for ARBs, they're not in C++1y any more.
llvm-svn: 191627
2013-09-28 19:09:34 +00:00
Benjamin Kramer 5352717508 The second parameter of nexttoward is always long double.
llvm-svn: 191623
2013-09-28 17:41:03 +00:00
James Dennett 0f7691ad20 Documentation: minor fixes/improvements to documentation of DependentScopeDeclRefExpr.
llvm-svn: 191622
2013-09-28 16:30:01 +00:00
Benjamin Kramer 602623f9ae Make helper function static.
llvm-svn: 191615
2013-09-28 15:08:41 +00:00
Benjamin Kramer 20c28bebf9 Refactor comment merging.
- We scan for whitespace between comments anyways, remember any newlines seen
  along the way.
- Use this newline number to decide whether two comments are adjacent.
- Since the newline check is now free remove the caching and unused code.
- Remove unnecessary boolean state from the comment list.
- No behavioral change.

llvm-svn: 191614
2013-09-28 15:06:27 +00:00
Simon Atanasyan ee1accf14e Separate construction of bi-arch path suffix from construction of
multi-library path suffix.

The code calculates MIPS toolchain specific multi-lib path suffixes like
mips16/soft-float/el is moved to the separate function
findMultiLibSuffix(). This function called during GCC installation
detection and result is stored for the future using.

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

llvm-svn: 191612
2013-09-28 13:45:11 +00:00
Richard Smith 5b013f5050 Add compat/extension warnings for init captures.
llvm-svn: 191609
2013-09-28 05:38:27 +00:00
Richard Smith 846f13ca14 Add extra testing for init-captures.
llvm-svn: 191608
2013-09-28 05:23:21 +00:00
Richard Smith b438e62aba Mark lambda init-captures as complete.
llvm-svn: 191607
2013-09-28 04:37:56 +00:00
Richard Smith 75e3f695fb Switch from putting init capture VarDecls in the surrounding DeclContext to
putting them in the call operator's DeclContext. This better matches the
language wording and avoids some cases where code gets confused by them for
namespace-scope lambdas and the like.

llvm-svn: 191606
2013-09-28 04:31:26 +00:00
Richard Smith bb13c9a49d Per latest drafting, switch to implementing init-captures as if by declaring
and capturing a variable declaration, and complete the implementation of them.

llvm-svn: 191605
2013-09-28 04:02:39 +00:00
Jordan Rose 3553bb384b [analyzer] Make inlining decisions based on the callee being variadic.
...rather than trying to figure it out from the call site, and having
people complain that we guessed wrong and that a prototype-less call is
the same as a variadic call on their system. More importantly, fix a
crash when there's no decl at the call site (though we could have just
returned a default value).

<rdar://problem/15037033>

llvm-svn: 191599
2013-09-28 02:04:19 +00:00
Warren Hunt 41a993f6f8 Typo correction: _int64 -> __int64.
llvm-svn: 191592
2013-09-28 00:15:41 +00:00
Warren Hunt d6ffae91d5 Implements some of the more commonly used intrinsics in Intrin.h
Differential Revision: http://llvm-reviews.chandlerc.com/D1766

llvm-svn: 191590
2013-09-27 23:57:26 +00:00
Kaelyn Uhrain 30943ce6fd Don't suggest namespaces if the next token is a '.'
llvm-svn: 191589
2013-09-27 23:54:23 +00:00
Manman Ren 4f04263347 TBAA: use the same format for scalar TBAA and struct-path aware TBAA.
Struct-path aware TBAA generates tags to specify the access path,
while scalar TBAA only generates tags to scalar types.

llvm-svn: 191586
2013-09-27 23:06:41 +00:00
Fariborz Jahanian 5d783df5f7 ObjectiveC migrator. Infer property from getters only
if property name is a valid identifier in the underlying
language. // rdar://15044184

llvm-svn: 191584
2013-09-27 22:55:54 +00:00
Chandler Carruth 826eec5913 Implementation of N3760 which is planned to be voted into C++14's draft
tomorrow is complete.

There is a missing warning due to a serious issue with template
instantiation in Clang (and potentially in the core language).

llvm-svn: 191577
2013-09-27 22:30:27 +00:00
Chandler Carruth 2acfb22d23 Fix a bug where we failed to diagnose class template specialization
uses.

This fixes one of the two remaining failures to implement [[deprecated]]
as specified for C++14.

llvm-svn: 191572
2013-09-27 22:14:40 +00:00
Douglas Gregor 30e9b6c47d Note that modules are supported for C/Objective-C, and have syntax in ObjC.
llvm-svn: 191562
2013-09-27 21:23:28 +00:00
Justin Bogner bb971c98ea docs: Document CXXLiteralOperatorName and CXXUsingDirective
llvm-svn: 191560
2013-09-27 21:10:54 +00:00
Justin Bogner 753df2fac4 docs: Remove note about Identifiers being used for C++ operators
C++ operators are represented by CXXOperatorName now, which is already
documented.

llvm-svn: 191559
2013-09-27 21:10:51 +00:00
Rafael Espindola 13ca93c0e3 Update the help text.
llvm-svn: 191554
2013-09-27 20:42:38 +00:00