Commit Graph

49774 Commits

Author SHA1 Message Date
Rafael Espindola dc265edb3b On spacv8 f128 is only aligned to 64 bits.
LLVM already got this right.

Found on "Figure 3-1: Scalar Types" on http://sparc.com/standards/psABI3rd.pdf.

llvm-svn: 197651
2013-12-19 03:03:04 +00:00
Aaron Ballman e8d9f8dd01 Switched code from using hasAttr followed by getAttr to simply call getAttr directly and check the resulting value.
No functional changes intended.

llvm-svn: 197650
2013-12-19 03:02:49 +00:00
Aaron Ballman b06f2ef33c Switched code from using hasAttr followed by getAttr to simply call getAttr directly and check the resulting value. Also fixes some minor formatting issues surrounding the getAttr code.
No functional changes intended.

llvm-svn: 197649
2013-12-19 02:58:51 +00:00
Aaron Ballman 9ead1243a5 Replacing calls to getAttr with calls to hasAttr for clarity. No functional change intended -- this only replaces Boolean uses of getAttr.
llvm-svn: 197648
2013-12-19 02:39:40 +00:00
Dmitri Gribenko b353ee1808 PCH: fix a crash caused by a circular deserialization dependency
We started by trying to deserialize decltype(func-param) in a trailing return
type, which causes the function parameter decl to be deserialized, which pulls
in the function decl, which pulls the function type, which pulls the same
decltype() in the return type, and then we crashed.

llvm-svn: 197644
2013-12-19 02:05:20 +00:00
Dmitri Gribenko 092ab4a9fe Simplify CXXMethodDecl::isVirtual() for __interface case
llvm-svn: 197643
2013-12-19 01:58:52 +00:00
Adrian Prantl 0866acd3a3 Debug info: (Bugfix) emit CRV qualifiers for pointers to member functions.
rdar://problem/15678916.

llvm-svn: 197641
2013-12-19 01:38:47 +00:00
Warren Hunt f037bd1e7c [ms-abi] Update Alignment for VtorDisps
The alignment impact of the virtual bases apperas to be applied in 
order, rather than up front.  This patch adds the new behavior and 
provides a test case.

llvm-svn: 197639
2013-12-19 00:43:59 +00:00
Aaron Ballman 66039937e8 Added a comment about the launch_bounds attribute's AST node being required. Since there were no test cases for the attribute, some have been added. This promptly demonstrated a bug with the semantic handling, which is also fixed.
llvm-svn: 197637
2013-12-19 00:41:31 +00:00
Aaron Ballman 8edb5c2081 Refactor the Microsoft inheritance attribute handling so that it no longer has special treatment. Also fixes a minor bug where the attributes were being parsed as though they were GNU-style attributes when they were in fact keyword attributes.
llvm-svn: 197629
2013-12-18 23:44:18 +00:00
Rafael Espindola 1c09b264e3 Fix the DataLayout string produced by clang for NaCl.
Reviewed by Derek Schuff.

llvm-svn: 197628
2013-12-18 23:41:04 +00:00
Ted Kremenek b79ee57080 Implemented delayed processing of 'unavailable' checking, just like with 'deprecated'.
Fixes <rdar://problem/15584219> and <rdar://problem/12241361>.

This change looks large, but all it does is reuse and consolidate
the delayed diagnostic logic for deprecation warnings with unavailability
warnings.  By doing so, it showed various inconsistencies between the
diagnostics, which were close, but not consistent.  It also revealed
some missing "note:"'s in the deprecated diagnostics that were showing
up in the unavailable diagnostics, etc.

This change also changes the wording of the core deprecation diagnostics.
Instead of saying "function has been explicitly marked deprecated"
we now saw "'X' has been been explicitly marked deprecated".  It
turns out providing a bit more context is useful, and often we
got the actual term wrong or it was not very precise
 (e.g., "function" instead of "destructor").  By just saying the name
of the thing that is deprecated/deleted/unavailable we define
this issue away.  This diagnostic can likely be further wordsmithed
to be shorter.

llvm-svn: 197627
2013-12-18 23:30:06 +00:00
Reid Kleckner e7106c9e0b Use getAsCXXRecordDecl to shorten some gets and casts
llvm-svn: 197626
2013-12-18 23:17:05 +00:00
Fariborz Jahanian cb8c7da266 ObjectiveC. support "section" attribute on properties
and methods. rdar://15450637

llvm-svn: 197625
2013-12-18 23:09:57 +00:00
Douglas Gregor d1e3ceb5ec Require the type of a by-copy capture to be complete before creating its field.
The problem here is more serious than the fix implies. Adding a field
to a class updates the triviality bits for the class (among other
things). Failing to require a complete type before adding the field
meant that these updates don't happen in the well-formed case where
the capture is an uninstantiated class template specialization,
leading the lambda itself to be treated as having a trivial copy
constructor when it shouldn't. Fixes <rdar://problem/15560464>.

llvm-svn: 197623
2013-12-18 23:02:36 +00:00
Rafael Espindola ea03a1ff1c Add a test for mipsel-nacl too.
llvm-svn: 197617
2013-12-18 22:40:42 +00:00
Alp Toker 1d8362cd19 Enhance OpenMP parser tests from r197553 / r197598
Move some of the verifier directives away from the end of the pragma line.

This ensures that the diagnostics relate to the trailing token being tested and
not the verifier comments which are themselves part of the token stream.

llvm-svn: 197616
2013-12-18 22:34:19 +00:00
Adrian Prantl 0630eb7094 Debug info: Implement (rvalue) reference qualifiers for C++11 non-static
member functions. Paired commit with LLVM.

rdar://problem/15356637

llvm-svn: 197612
2013-12-18 21:48:18 +00:00
Douglas Gregor 6878214bc9 Allow Objective-C pointer conversions following an explicit user conversion.
Finishes the work started in r194224, and fixes <rdar://problem/15494681>.

llvm-svn: 197609
2013-12-18 21:46:16 +00:00
Alp Toker 679bf0141b clang-format-diff.py: fix -regex/-iregex matching
While debating the finer points of file extension matching, we somehow missed
the bigger problem that the current code will match anything starting with the
default or user-specified pattern (e.g. lit.site.cfg.in).

Fix this by doing what find(1) does, implicitly wrapping the pattern with ^$.

llvm-svn: 197608
2013-12-18 21:34:07 +00:00
Fariborz Jahanian 283bf89506 Objective-C. After providing a fix-it for a
cstring, converted to NSString, produce the
matching AST for it. This also required some
refactoring of the previous code. // rdar://14106083

llvm-svn: 197605
2013-12-18 21:04:43 +00:00
Rafael Espindola afa854c15e Make setABIAPCS and setABIAAPCS easier to reason about.
These functions now always set the same variables in the same order and they
don't overlap with thep constructor.

llvm-svn: 197604
2013-12-18 20:24:51 +00:00
Rafael Espindola d6c2b720ae Split setABI in two helpers. No functionality change.
llvm-svn: 197603
2013-12-18 19:47:32 +00:00
Alp Toker b14a4709f5 Fix OpenMP recovery with trailing tokens following the pragma
The recovery was failing due to a missing case in SkipUntil().

Also add back tests from r197553 that were reverted in the previous commit.

llvm-svn: 197598
2013-12-18 19:10:54 +00:00
Alp Toker d751fa7868 Revert "[OPENMP] Fix for parsing OpenMP directives with extra braces, brackets and parens"
These parser changes were redundant. The same or better recovery can be
achieved with a one-line fix to SkipUntil() due to land in the next commit.

This reverts commit r197553.

llvm-svn: 197597
2013-12-18 19:10:49 +00:00
Artyom Skrobov 67e6d506d8 Adding a win32-targeted test into Tooling/multi-jobs.cpp, to make sure it doesn't get broken again
(prompted by NAKAMURA Takumi)

llvm-svn: 197596
2013-12-18 18:55:36 +00:00
NAKAMURA Takumi 59379524c8 check-clang: Fixup r197576, to replace CMAKE_CFG_INTDIR on clang_tools_dir.
llvm-svn: 197593
2013-12-18 18:25:13 +00:00
Pekka Jaaskelainen 43c39d5f1f OpenCL: Do not force 64 bit floats for (embedded) targets with only 32bit floats.
llvm-svn: 197592
2013-12-18 18:15:03 +00:00
Fariborz Jahanian 8ef938972a ObjectiveC. Fixes the sentence in a diagnostic.
// rdar://15397430

llvm-svn: 197586
2013-12-18 16:51:06 +00:00
Rafael Espindola 666a2ab64e clang-format parts of the file.
I am about to send a patch for review touching these and clang-formating first
makes the patch much easier to read.

llvm-svn: 197585
2013-12-18 16:38:48 +00:00
Aaron Ballman 0362a6d466 Implement the MSABI and SysVABI calling conventions for Objective-C method declarations. This appears to be an omission from r189644.
llvm-svn: 197584
2013-12-18 16:23:37 +00:00
Aaron Ballman b4ca40bd4d Adding some comments about AST node requirements for attributes which create AST nodes but never actually make use of them. No functional changes.
llvm-svn: 197582
2013-12-18 15:59:41 +00:00
Rafael Espindola af789a05b2 Whitespace cleanup.
llvm-svn: 197580
2013-12-18 15:52:38 +00:00
Alp Toker f22856a415 Remove OpenCL-specific type keywords and specifiers
This commit kills off custom type specifier and keyword handling of OpenCL C
data types.

Although the OpenCL spec describes them as keywords, we can handle them more
elegantly as predefined types. This should provide better error correction and
code completion as well as simplifying the implementation.

The primary intention is however to simplify the C/C++ parser and save some
packed bits on AST structures that had been extended in r170432 just for
OpenCL.

llvm-svn: 197578
2013-12-18 15:29:05 +00:00
Rafael Espindola 0ea96eba43 Add -f64:32:64 to the darwin ppc32 DataLayout.
A f64 inside a struct can be 32 bit aligned on darwin.

llvm-svn: 197577
2013-12-18 15:16:50 +00:00
NAKAMURA Takumi 462ba80fda check-clang: Introduce clang_tools_dir in lit.site.cfg, for clang separated from llvm.
llvm-svn: 197576
2013-12-18 15:08:56 +00:00
NAKAMURA Takumi 96357e6af7 clang/test/CMakeLists.txt: Prune CLANG_SOURCE_DIR and CLANG_BINARY_DIR. They are set at top.
llvm-svn: 197575
2013-12-18 15:08:49 +00:00
Daniel Jasper 969643594e clang-format: Fix indentation corner case.
Before:
  aaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
                 .aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
  aaaaaaaaaa = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
                   .aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa();

After:
  aaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
                 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
                 .aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
  aaaaaaaaaa = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
                   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
                   .aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa();

Probably still not ideal, but should be a step into the right direction.

llvm-svn: 197557
2013-12-18 10:44:36 +00:00
Alexey Bataev cb164ab273 [OPENMP] Fix for parsing OpenMP directives with extra braces, brackets and parens
llvm-svn: 197553
2013-12-18 08:46:25 +00:00
Daniel Jasper 3460b2546c clang-format: Fix ObjC method expr in binary expressions.
Before:
  bool a = ([aaaaaaaa aaaaa] == aaaaaaaaaaaaaaaaa || [aaaaaaaa aaaaa] ==
                                                         aaaaaaaaaaaaaaaaaaaa);

After:
  bool a = ([aaaaaaaa aaaaa] == aaaaaaaaaaaaaaaaa ||
            [aaaaaaaa aaaaa] == aaaaaaaaaaaaaaaaaaaa);

This fixes llvm.org/PR18271.

llvm-svn: 197552
2013-12-18 07:08:51 +00:00
Rafael Espindola 754207bc5c Use arm-nacl-gnueabi instead of arm-nacl to match the previous tests.
llvm-svn: 197550
2013-12-18 04:53:17 +00:00
Rafael Espindola 667c576169 Split this test into one per supporter nacl arch.
Right now clang produces the same DataLayout for all of them, but it could, for
example, add 'n' specifications when the end architecture is given.

No functionality change, this should just make future changes easier to read.

llvm-svn: 197549
2013-12-18 04:35:56 +00:00
Rafael Espindola 4960968509 Print the 'p' specification before the 'i' specification.
No functionality change.

llvm-svn: 197548
2013-12-18 04:14:53 +00:00
Hans Wennborg deff70309f Fix comment-code function name mismatch
llvm-svn: 197544
2013-12-18 01:39:59 +00:00
Alp Toker c49406d18c clang-format-diff.py: add the OpenCL file extension
It's handled correctly as a C-family language.

llvm-svn: 197542
2013-12-18 00:58:58 +00:00
Fariborz Jahanian 1b30b593ba ObjectiveC. typo fix in my last patch,
per Jordan's review. 

llvm-svn: 197540
2013-12-18 00:52:54 +00:00
Rafael Espindola c2e60f52ae Add a 's' specifications to AArch64.
This has no functionality change as clang adds explicit alignment info for
byval arguments. The only difference is that now the clang produced
DataLayout string for AArch64 is identical to the LLVM produced one.

llvm-svn: 197538
2013-12-17 23:30:58 +00:00
Alp Toker 8fbec67731 Move some more test-and-consumes over to TryConsumeToken()
llvm-svn: 197537
2013-12-17 23:29:36 +00:00
Fariborz Jahanian 7e350d23b2 Objctive-C. warn if dealloc is being overridden in
a category implementation. // rdar://15397430

llvm-svn: 197534
2013-12-17 22:44:28 +00:00
Dmitri Gribenko e8bc31f0ab Documentation comment parsing: when checking if we have typedef to something
that we consider a function for the purposes of checking \param and \returns,
look through reference types.

llvm-svn: 197530
2013-12-17 22:22:14 +00:00
Dmitri Gribenko fa68a57cf7 Documentation comment parsing: allow \param and \returns on std::function,
boost::function and similar function-like objects

llvm-svn: 197528
2013-12-17 22:06:11 +00:00
Aaron Ballman f2db7626f0 None of these attributes currently make use of an AST node, so setting ASTNode = 0 to reduce complexity. No functional change intended.
llvm-svn: 197525
2013-12-17 21:35:24 +00:00
Rafael Espindola 07eeb29386 Use triples that match the -target-abi option.
llvm-svn: 197522
2013-12-17 21:01:22 +00:00
Roman Divacky 78589ecd50 Use the integrated assembler by default on FreeBSD/ppc and ppc64.
llvm-svn: 197521
2013-12-17 20:34:25 +00:00
Reid Kleckner 89077a1b00 [ms-cxxabi] The 'most derived' ctor parameter usually comes last
Unlike Itanium's VTTs, the 'most derived' boolean or bitfield is the
last parameter for non-variadic constructors, rather than the second.
For variadic constructors, the 'most derived' parameter comes after the
'this' parameter.  This affects constructor calls and constructor decls
in a variety of places.

Reviewers: timurrrr

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

llvm-svn: 197518
2013-12-17 19:46:40 +00:00
Dmitri Gribenko f869ad15a3 Documentation comment parsing: rearrange tests to clarify the intent of these tests
llvm-svn: 197517
2013-12-17 19:45:12 +00:00
Hans Wennborg 33104c40ef Fix line endings in microsoft-dtor-lookup-cxx11.cpp
llvm-svn: 197516
2013-12-17 19:39:18 +00:00
Fariborz Jahanian bd714e9bb1 Objective-C. Make diagnostics and fix-its consistent
when diagnosing casting of a cstring literal to
NSString in default and -fobjc-arc mode. 
// rdar://14106083

llvm-svn: 197515
2013-12-17 19:33:43 +00:00
Dmitri Gribenko 110dfa81fd Fix strange indentation and remove trailing whitespace on empty lines
llvm-svn: 197513
2013-12-17 19:28:18 +00:00
Alp Toker de50ff3c4b Bring order to the OpenCL keywords
Avoid the gratuitous repurposing of C++ keyword 'private' by using a keyword
alias.

Also attempt to document the OpenCL keywords based on scraps of information
found online.

The purpose of this commit is to reduce impact on the C++ parser.

llvm-svn: 197511
2013-12-17 18:17:46 +00:00
Hans Wennborg e955e3998f [ms-cxxabi] Don't do destructor check on declarations if the dtor is deleted
We would previously emit redundant diagnostics for the following code:

  struct S {
    virtual ~S() = delete;
    void operator delete(void*, int);
    void operator delete(void*, double);
  } s;

First we would check on ~S() and error about the ambigous delete functions,
and then we would error about using the deleted destructor.

If the destructor is deleted, there's no need to check it.

Also, move the check from Sema::ActOnFields to CheckCompleteCXXClass. These
are run at almost the same time, called from ActOnFinishCXXMemberSpecification.
However, CHeckCompleteCXXClass may mark a defaulted destructor as deleted, and
if that's the case we don't want to check it.

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

llvm-svn: 197509
2013-12-17 17:49:22 +00:00
Alp Toker b164a349f9 Fix indentation from r197490 plus some typos
llvm-svn: 197507
2013-12-17 17:25:19 +00:00
Rafael Espindola f034b6e4c2 Remove -f128:128 from the DataLayout strings. It is the default.
llvm-svn: 197504
2013-12-17 16:07:35 +00:00
Rafael Espindola 12256302cf The PS3 is a ppc64 and has 64 bit registers. Update DataLayout accordingly.
llvm-svn: 197502
2013-12-17 15:40:00 +00:00
Rafael Espindola 26c67b7879 Remove -f16:16:32 from the XCore DataLayout string.
This makes it identical to the string llvm produces.

llvm-svn: 197500
2013-12-17 14:34:42 +00:00
Alp Toker a3ebe6ee2b Refactor and micro-optimize ConsumeToken()
1) Introduce TryConsumeToken() to handle the common test-and-consume pattern.
   This brings about readability improvements in the parser and optimizes to avoid
   redundant checks in the common case.

2) Eliminate the ConsumeCodeCompletionTok special case from ConsumeToken(). This
   was used by only one caller which has been switched over to the more
   appropriate ConsumeCodeCompletionToken() function.

llvm-svn: 197497
2013-12-17 14:12:37 +00:00
Alp Toker 53358e43bc Simplify RevertibleTypeTraits as a form of contextual keyword
Now that we emit diagnostics for keyword-as-identifier hacks (-Wkeyword-compat)
we can go ahead and simplify some of the old revertible keyword support.

This commit adds a TryIdentKeywordUpgrade() function to mirror the recently
added TryKeywordIdentFallback() and uses it to replace the hard-coded list of
REVERTIBLE_TYPE_TRAITs.

llvm-svn: 197496
2013-12-17 14:12:30 +00:00
Daniel Jasper 8fb00b0f79 Update comment of changed parameter of ModuleMap constructor.
llvm-svn: 197495
2013-12-17 13:21:13 +00:00
Daniel Jasper bad63ae2a5 clang-format: Don't adapt local format to macros.
Formatting this:
   void f() { // 1 space initial indent.
      int i;
  #define A   \
      int i;  \
     int j;
        int k; // Format this line.
   }
   void f() {
       #define A 1 // Format this line.
   }

Before:
   void f() { // 1 space initial indent.
      int i;
  #define A   \
      int i;  \
     int j;
     int k;  // Format this line.
   }
   void f() {
   #define A 1  // Format this line.
   }

After:
   void f() { // 1 space initial indent.
      int i;
  #define A   \
      int i;  \
     int j;
      int k;  // Format this line.
   }
   void f() {
  #define A 1  // Format this line.
   }

llvm-svn: 197494
2013-12-17 12:38:55 +00:00
Richard Barton 5828d7b936 LIBRARY_PATH environment variable should only be supported on a native compiler.
llvm-svn: 197490
2013-12-17 11:11:25 +00:00
Daniel Jasper a15b8e920d Add missing file from r197485.
(Yes, the irony is not lost on me :-) ).

llvm-svn: 197486
2013-12-17 10:47:49 +00:00
Daniel Jasper 0761a8a085 Modules: Don't warn upon missing headers while reading the module map.
Instead, mark the module as unavailable so that clang errors as soon as
someone tries to build this module.

This works towards the long-term goal of not stat'ing the header files at all
while reading the module map and instead read them only when the module is
being built (there is a corresponding FIXME in parseHeaderDecl()).  However, it
seems non-trivial to get there and this unblock us and moves us into the right
direction.

Also changed the implementation to reuse the same DiagnosticsEngine.

llvm-svn: 197485
2013-12-17 10:31:37 +00:00
NAKAMURA Takumi b1ec06b0a2 [CMake][Standalone] Import LLVM_LIT_TOOLS_DIR.
llvm-svn: 197461
2013-12-17 04:14:26 +00:00
NAKAMURA Takumi e3d8f1a17e [CMake][Standalone] Fix llvm-tblgen's directory to use LLVM_TOOLS_BINARY_DIR instead of LLVM_BINARY_DIR.
LLVM_BINARY_DIR points OBJROOT.

FIXME: llvm-config should show *real* bindir with --bindir.
llvm-svn: 197460
2013-12-17 04:14:22 +00:00
NAKAMURA Takumi 17645a4772 [CMake][Standalone] Fixup r197395 for standalone build.
Standalone scripts shall be rewritten.

llvm-svn: 197459
2013-12-17 04:14:17 +00:00
Alp Toker 2dea15b53c ASTContext: Refactor implicit record creation
Tidy up built-in record creation to reduce code duplication.

Continuation of r197336.

llvm-svn: 197452
2013-12-17 01:22:38 +00:00
Dmitri Gribenko 3fb18bbd34 Add a test for -fno-diagnostics-fixit-info
llvm-svn: 197450
2013-12-17 01:19:19 +00:00
Fariborz Jahanian 769c04ea35 ObjectiveC migrator. Fixes a bug when protocol
conformance is inferred. // rdar://15515206

llvm-svn: 197448
2013-12-17 01:01:33 +00:00
Richard Trieu c689691618 For -Wconsumed, walk the namespaces to find if the top most namespace is "std"
to determine if a move function is the std::move function.  This allows functions
like std::__1::move to also be treated a the move function.

llvm-svn: 197445
2013-12-17 00:40:40 +00:00
Rafael Espindola 8ddf8bce91 Reorder these DataLayout entries to match the order LLVM uses.
This completes the cleanup/refactoring of DataLayout on the clang side. Next
is figuring out the differences between the llvm and clang produced strings

llvm-svn: 197442
2013-12-17 00:04:48 +00:00
NAKAMURA Takumi ea0c73b84e clang/lib/Headers/CMakeLists.txt: Revert part of r197395. It should not be staged yet.
llvm-svn: 197441
2013-12-17 00:02:38 +00:00
Rafael Espindola 2da3532aba The preferred alignment defaults to the ABI one. Omit it if it is the same.
llvm-svn: 197440
2013-12-16 23:27:41 +00:00
Rafael Espindola 91b0cbf3fc Remove another default I missed before.
llvm-svn: 197437
2013-12-16 23:03:23 +00:00
Fariborz Jahanian 381edf5759 ObjectiveC. Further improvements of use
of objc_bridge_related attribute; eliminate
unnecessary diagnostics which is issued elsewhere,
fixit now produces a valid AST tree per convention.
This results in some simplification in handling of
this attribute as well. // rdar://15499111

llvm-svn: 197436
2013-12-16 22:54:37 +00:00
Rafael Espindola 04c685b5e4 Clang DataLayout string cleanup: don't print other defaults.
I missed these in previous commits.

llvm-svn: 197435
2013-12-16 22:50:41 +00:00
Rafael Espindola 7f53473de7 Remove dead data.
The f80:128:128 was followed by a f80:32:32 and so never used. Looks like this
was there since r91746.

llvm-svn: 197433
2013-12-16 22:15:35 +00:00
Rafael Espindola 47debc0136 Clang DataLayout string cleanup: don't print the pointer defaults.
llvm-svn: 197430
2013-12-16 21:59:14 +00:00
Rafael Espindola 61a69257a4 Clang DataLayout string cleanup: don't print the aggregate defaults.
llvm-svn: 197429
2013-12-16 21:51:30 +00:00
Richard Trieu 31f3a713ae Fix PR18260 - Make std::move handling in -Wconsumed only trigger on std::move
llvm-svn: 197428
2013-12-16 21:41:30 +00:00
Rafael Espindola 8a91f2fd85 Clang DataLayout string cleanup: don't print the vector defaults.
llvm-svn: 197427
2013-12-16 21:38:22 +00:00
Dmitri Gribenko f7d23ff1a6 In a standalone Clang build, default to building tests, like LLVM does
LLVM_INCLUDE_TESTS is set in the top-level LLVM CMakeLists, which is not being
executed when Clang is built in a separate directory.

llvm-svn: 197423
2013-12-16 20:54:13 +00:00
Rafael Espindola 20b0d92767 Clang DataLayout string cleanup: don't print the FP defaults.
llvm-svn: 197422
2013-12-16 20:34:33 +00:00
Rafael Espindola 32083d503b Clang DataLayout string cleanup: don't print the integer defaults.
llvm-svn: 197421
2013-12-16 20:21:07 +00:00
Rafael Espindola c4d672a49d Misc test cleanups.
* tbaa-struct.cpp always has a 64 bit pointer.
* f32:32:32, f64:64:64 and f128:128:128 are defaults, don't assume they are
  printed.

llvm-svn: 197415
2013-12-16 19:53:26 +00:00
Kaelyn Uhrain 5dfc94b160 Revert "Maybe add new warning for shadowing simple tag types"
This reverts commit 2b43f500cfea10a8c59c986dcfc24fd08eecc77d.

This was accidentally committed because I failed to notice my client
wasn't clean prior to submitting a fix for a crasher.

llvm-svn: 197410
2013-12-16 19:25:47 +00:00
Kaelyn Uhrain a6c78feba6 Make Sema::BuildCXXNestedNameSpecifier correctly clear the previous
CXXScopeSpec when necessary while performing typo correction. This fixes
the crash reported in PR18213 (the problem existed since r185487, and
r193020 made it easier to hit).

llvm-svn: 197409
2013-12-16 19:19:18 +00:00
Kaelyn Uhrain a1c32d53fb Maybe add new warning for shadowing simple tag types
llvm-svn: 197408
2013-12-16 19:19:13 +00:00
Joerg Sonnenberger d75a1f8761 Support EABIHF environment on ARM.
llvm-svn: 197406
2013-12-16 19:16:04 +00:00
Joerg Sonnenberger 0c1652dabd GNUEABIHF is the same as GNUEABI for anything not float/double related,
so use the same exception size as GNUEABI does.

llvm-svn: 197404
2013-12-16 18:30:28 +00:00
Chad Rosier 75df5680fe [AArch64] Fix v1fx patterns for Floating-point Multiply Extend and Floating-point Compare to Zero.
llvm-svn: 197403
2013-12-16 18:29:54 +00:00
Nico Weber ef9a766555 Add bit_FXSAVE as an alias for bit_FXSR, for gcc compat.
llvm-svn: 197399
2013-12-16 17:54:57 +00:00
NAKAMURA Takumi a8c958de47 [CMake] Introduce CLANG_RUNTIME_OUTPUT_INTDIR and CLANG_LIBRARY_OUTPUT_INTDIR.
llvm-svn: 197395
2013-12-16 16:03:21 +00:00
Daniel Jasper 43e6a28d1f clang-format: Keep trailing annotations together.
Before:
  virtual void aaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaa aaaa, aaaaaaaaaaa aaaaa) const
      override;
  virtual void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa() const
      override;

After:
  virtual void aaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaa aaaa,
                     aaaaaaaaaaa aaaaa) const override;
  virtual void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()
      const override;

llvm-svn: 197391
2013-12-16 15:01:54 +00:00
Daniel Jasper 34dc4811a2 Revert "Modules: Make missing headers in a module.map a warning not an error."
This was committed accidentally.

llvm-svn: 197389
2013-12-16 14:57:22 +00:00
Daniel Jasper 5c6ee49fa0 Modules: Make missing headers in a module.map a warning not an error.
Instead, mark the module as unavailable so that clang errors as soon as
someone tries to build this module.

A better long-term strategy might be to not stat the header files at all
while reading the module map and instead read them only when the module
is being built (there is a corresponding FIXME in parseHeaderDecl()).
However, it seems non-trivial to get there and this would be a temporary
solution to unblock us.

Also changed the implementation to reuse the same DiagnosticsEngine as
otherwise warnings can't be enabled or disabled with command-line flags.

llvm-svn: 197388
2013-12-16 14:53:57 +00:00
Alexander Kornienko a594ba8a76 Always break before the colon in constructor initializers, when
BreakConstructorInitializersBeforeComma is true.

This option is used in WebKit style, so this also ensures initializer lists are
not put on a single line, as per the WebKit coding guidelines.

Patch by Florian Sowade!

llvm-svn: 197386
2013-12-16 14:35:51 +00:00
Alexander Kornienko 25c683891c Added -iregex for case-insensitive regex to filter file names.
Summary:
-regex and -iregex both mimic options of the find utility.
Made the default list of extensions case-insensitive, so that it's not only C
and CPP extensions are accepted in upper case.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits

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

llvm-svn: 197378
2013-12-16 10:57:30 +00:00
Daniel Jasper 3682fcda17 clang-format: Fix formatting of function type parameters.
Before:
  void f() { typedef void (*f)(int * a); }
After:
  void f() { typedef void (*f)(int *a); }

llvm-svn: 197369
2013-12-16 08:36:18 +00:00
Daniel Jasper c39b56fe14 clang-format: Improve handling of raw string literals.
Especially try to keep existing line breaks before raw string literals,
as the code author might have aligned content to it.

Thereby, clang-format now keeps things like:

  parseStyle(R"(
      BasedOnStyle: Google,
      ColumnLimit: 100)");
  parseStyle(
      R"(BasedOnStyle: Google,
         ColumnLimit: 100)");

llvm-svn: 197368
2013-12-16 07:23:08 +00:00
Duncan P. N. Exon Smith d68c7aa7e6 Stop crashing on empty asm input constraints
An empty string for an ASM input constraint is invalid, and will crash
during clang CodeGen.  Change TargetInfo::validateInputConstraint to
reject an empty string.

<rdar://problem/15552191>

llvm-svn: 197362
2013-12-16 03:20:06 +00:00
Rafael Espindola ee4b398828 Add tests for all DescriptionString in Targets.cpp.
These right now just test that the same string is present in two files, but will
become more useful as clang's handling of DataLayout is refactored.

llvm-svn: 197347
2013-12-15 17:53:44 +00:00
Rafael Espindola bf34990ed9 Delete dead code.
This is always overwritten by the one in NaClTargetInfo.

llvm-svn: 197346
2013-12-15 17:21:28 +00:00
Benjamin Kramer 0c5636db39 Remove unused diagnostic.
llvm-svn: 197345
2013-12-15 14:51:00 +00:00
Aaron Ballman 64e6986e39 Allow target-specific attributes to share a spelling between different attributes via the ParseKind field. Attributes will be given a common parsed attribute identifier (the AttributeList::AT_* enum), but retain distinct Attr subclasses.
This new functionality is used to implement the ARM and MSP430 interrupt attribute.

Patch reviewed by Richard Smith over IRC.

llvm-svn: 197343
2013-12-15 13:05:48 +00:00
Alp Toker 56b5cc91af ASTContext: Declare builtin types implicitly
__builtin_va_list and friends have been showing up where they shouldn't for way
to long, making unwanted appearences in -ast-print, tooling and source level
visitors and even the hello world tutorial on the clang website.

This commit factors down the implicit typedef and record creation facilities to
ensure they're marked implicit.

Also fixes a unit test that was testing incorrect behaviour, and removes old
hacks in the DeclPrinter that tried to skip implicit declarations manually.

llvm-svn: 197336
2013-12-15 10:36:26 +00:00
Alp Toker 6de6da603e Lexer: Issue -Wbackslash-newline-escape for line comments
The warning for backslash and newline separated by whitespace was missed in
this code path.

backslash<whitespace><newline> is handled differently from compiler to compiler
so it's important to warn consistently where there's ambiguity.

Matches similar handling of block comments and non-comment lines.

llvm-svn: 197331
2013-12-14 23:32:31 +00:00
Alp Toker 099b0d3741 Fix test containing backslash and newline separated by space
This was silently accepted by clang without warning due to a lexer bug.

llvm-svn: 197330
2013-12-14 23:32:27 +00:00
Hans Wennborg c570061064 Add triple to CodeGenCXX/2004-03-08-ReinterpretCastCopy.cpp in MS ABI mode
I don't think we should need a triple, but this allows us to run the test
until we fix it (PR18251).

llvm-svn: 197326
2013-12-14 17:04:17 +00:00
NAKAMURA Takumi 8562ec0caf CompilationDatabase.cpp:stripPositionalArgs(): Match not "no-integrated-as" but "-no-integrated-as", it really fixes r197229.
llvm-svn: 197309
2013-12-14 06:03:28 +00:00
Alp Toker 82d14cddb6 Remove 'not' from some CodeGen tests
These were just missing an expected-no-diagnostics directive.

Also add -std=c++11 to a test warning noisly about extensions.

llvm-svn: 197308
2013-12-14 04:49:06 +00:00
Richard Smith 3298368de9 PR18246: When performing template argument deduction to decide which template
is specialized by an explicit specialization, start from the first declaration
in case we've got a member of a class template (redeclarations might not number
the template parameters the same way).

Our recover here is still far from ideal.

llvm-svn: 197305
2013-12-14 03:18:05 +00:00
Argyrios Kyrtzidis 0f7f222c59 [objc] Add a test to make sure that a class can add a secondary initializer via a category
and still inherit the designated initializers of its super class.

llvm-svn: 197301
2013-12-14 02:16:41 +00:00
Alp Toker 6ed7251683 Revert "Don't require -re suffix on -verify directives with regexes."
This patch was submitted to the list for review and didn't receive a LGTM.

(In fact one explicit objection and one query were raised.)

This reverts commit r197295.

llvm-svn: 197299
2013-12-14 01:07:05 +00:00
Richard Smith 8a0dde75f1 PR18232: implement instantiation for class-scope explicit specializations of
class templates (a Microsoft extension).

llvm-svn: 197298
2013-12-14 01:04:22 +00:00
Hans Wennborg 9b395ef284 Don't require -re suffix on -verify directives with regexes.
Differential Revision: http://llvm-reviews.chandlerc.com/D2392

llvm-svn: 197295
2013-12-14 00:46:53 +00:00
Faisal Vali 57ae056a5c Quick-Fix pointer arithmetic when performing multi-D new-array initialization.
clang still doesn't emit the right llvm code when initializing multi-D arrays it seems.

For e.g. the following code would still crash for me on Windows 7, 64 bit:

auto f4 = new int[100][200][300]{{{1,2,3}, {4, 5, 6}}, {{10, 20, 30}}};

It seems that the final new loop that iterates through each outermost array and memsets it to zero gets confused with its final ptr arithmetic.

This patch ensures that it converts the pointer to the allocated type (int [200][300]) before incrementing it (instead of using the base type: 'int').

Richard somewhat squeamishly approved the patch (as a quick fix to potentially make it into 3.4) - while exhorting for a more optimized fix in the future. http://llvm-reviews.chandlerc.com/D2398
 
Thanks Richard!

llvm-svn: 197294
2013-12-14 00:40:05 +00:00
Hans Wennborg 442e4f7f5f Prepare for using MS ABI by default for Win32: update CodeGenCXX tests
llvm-svn: 197281
2013-12-13 22:43:52 +00:00
Richard Smith 6cda8ee96f Add a testcase and a FIXME for an accepts-invalid.
llvm-svn: 197280
2013-12-13 22:28:48 +00:00
Richard Smith 3c9198fce3 Detabify and fix formatting.
llvm-svn: 197279
2013-12-13 22:26:20 +00:00
Rafael Espindola a8df53f4ad Consolidate DataLayout string testing in one file.
llvm-svn: 197276
2013-12-13 21:49:53 +00:00
Alp Toker 88f64e6aeb Remove an unused parameter and include after r197273
llvm-svn: 197274
2013-12-13 21:19:30 +00:00
Alp Toker cbb9034e2a Eliminate BinaryTypeTraitExpr
There's nothing special about type traits accepting two arguments.

This commit eliminates BinaryTypeTraitExpr and switches all related handling
over to TypeTraitExpr.

Also fixes a CodeGen failure with variadic type traits appearing in a
non-constant expression.

The BTT/TT prefix and evaluation code is retained as-is for now but will soon
be further cleaned up.

This is part of the ongoing work to unify type traits.

llvm-svn: 197273
2013-12-13 20:49:58 +00:00
Rafael Espindola 49806f4dbe Delete dead code.
llvm-svn: 197270
2013-12-13 20:27:54 +00:00
Rafael Espindola 46ea763e7c Convert test to FileCheck.
llvm-svn: 197269
2013-12-13 20:11:02 +00:00
Rafael Espindola 1658de9a2a Every target sets DescriptionString. Assert that.
llvm-svn: 197268
2013-12-13 19:56:31 +00:00
Rafael Espindola 4c50d46e0c Convert test to FileCheck
llvm-svn: 197267
2013-12-13 19:44:40 +00:00
Fariborz Jahanian 07e7e6cbc8 Objective-C. Remove obsolete option from test.
// rdar://15641300

llvm-svn: 197263
2013-12-13 19:06:55 +00:00
Rafael Espindola f62bcc0d9c Use a: and s: instead of a0: and s0: in the DataLayout strings.
They are equivalent and the size of 'a' and 's' is unused.

llvm-svn: 197256
2013-12-13 18:40:15 +00:00
Hans Wennborg 86be54cc80 Tighten test regexes checking for __attribute__((thiscall)) on function types.
The tests were perhaps made too relaxed in r197164 when we switched to the new
MinGW ABI. This makes sure we check explicitly for an optional thiscall
attribute and nothing else.

We should still look into whether we should print these attributes at all in
these cases.

llvm-svn: 197252
2013-12-13 18:34:23 +00:00
Fariborz Jahanian 059021a369 Objective-C. Do not issue warning when 'readonly'
property declaration has a memory management
attribute (retain, copy, etc.). Sich properties
are usually overridden to become 'readwrite'
via a class extension (which require the memory
management attribute specified). In the absence of class
extension override, memory management attribute is
needed to produce correct Code Gen. for the
property getter in any case and this warning becomes
confusing to user. // rdar://15641300

llvm-svn: 197251
2013-12-13 18:19:59 +00:00
Rafael Espindola 14c57ebed5 Convert test to FileCheck and make it more strict.
llvm-svn: 197248
2013-12-13 17:47:34 +00:00
Jordan Rose 3dcbca3719 [analyzer] Add -analyzer-config to scan-build.
-analyzer-config options are now passed from scan-build through to
ccc-analyzer and then to clang.

Patch by Daniel Connelly!

llvm-svn: 197246
2013-12-13 17:16:28 +00:00
Alp Toker 08c2500f9c Fix raw lex crash and -frewrite-includes noeol-at-eof failure
Raw lexers don't have a preprocessor so we need to null check.

llvm-svn: 197245
2013-12-13 17:04:55 +00:00
Joey Gouly 2cd9db1cef [OpenCL] Produce an error when the work group and vec type hint attributes
are used on non-kernel functions.

Reviewed by Aaron over IRC!

llvm-svn: 197243
2013-12-13 16:15:28 +00:00
Rafael Espindola 984c9d86cb Add a clang side test for pr18235 too.
llvm-svn: 197242
2013-12-13 16:11:31 +00:00
Tim Northover a5877505d7 ARM MachO embedded: fix test without FileCheck line
Well, that's one way to pass a test, I suppose. Unfortunately actually doing
the testing means I didn't pass all I thought (embedded v7a is not supported,
apparently). I'll deal with that with the move to -none-macho rather than
putting heinous hacks in right now.

llvm-svn: 197240
2013-12-13 16:05:12 +00:00
Artyom Skrobov 3a4fe36916 clang-check to ignore -no-integrated-as because certain drivers can't handle it
llvm-svn: 197229
2013-12-13 13:43:48 +00:00
Manuel Klimek 6b5460c75a Move the input files for the unnecessary-module-map-parsing test to Inputs.
Needed to change rename.m to set the right include path so we don't
import a broken module due to recursive module checking.

llvm-svn: 197222
2013-12-13 10:08:24 +00:00
Renato Golin f2fcddb967 Move comment to its rightful place
llvm-svn: 197219
2013-12-13 09:27:34 +00:00
Ted Kremenek 33e430fc58 Refine 'objc_protocol_requires_explicit_implementation' attribute to better handle indirect protocols.
llvm-svn: 197209
2013-12-13 06:26:14 +00:00