Commit Graph

20721 Commits

Author SHA1 Message Date
Bob Wilson 9914a02114 Propagate "-arch x86_64h" setting to the linker. <rdar://problem/15711488>
This is a follow-up to r194907, which added a new -arch setting to make it
easier to specify AVX2 targets. The "-arch x86_64h" option needs to be passed
on to the linker, but it was getting canonicalized to x86_64 by the code
in getArchTypeForDarwinArchName.

llvm-svn: 198096
2013-12-28 05:26:14 +00:00
Reid Kleckner 52b10afb08 Move MS header search test inputs to Inputs/
llvm-svn: 198086
2013-12-27 20:41:49 +00:00
Will Wilson 0fafd34a6e Implement MSVC header search algorithm in MicrosoftMode.
Follows algorithm described here: http://msdn.microsoft.com/en-us/library/36k2cdd4.aspx

llvm-svn: 198082
2013-12-27 19:46:16 +00:00
Reid Kleckner 604c8b45e4 [ms-cxxabi] Emit fewer trivial return adjusting thunks
Most importantly, this makes our vtable layout match MSVC's.  Previously
we would emit a return adjusting thunk whenever the return types
differed, even if the adjustment would have been trivial.

MSVC does emit some trivial return adjusting thunks, but only if there
was already an overridden method that required a return adjustment.

llvm-svn: 198080
2013-12-27 19:43:59 +00:00
Nico Weber 0e6daefe8f Warn on mismatched parentheses in memcmp and friends.
Thisadds a new warning that warns on code like this:

  if (memcmp(a, b, sizeof(a) != 0))

The warning looks like:

test4.cc:5:30: warning: size argument in 'memcmp' call is a comparison [-Wmemsize-comparison]
  if (memcmp(a, b, sizeof(a) != 0))
                   ~~~~~~~~~~^~~~
test4.cc:5:7: note: did you mean to compare the result of 'memcmp' instead?
  if (memcmp(a, b, sizeof(a) != 0))
      ^                          ~
                            )
test4.cc:5:20: note: explicitly cast the argument to size_t to silence this warning
  if (memcmp(a, b, sizeof(a) != 0))
                   ^
                   (size_t)(     )
1 warning generated.

This found 2 bugs in chromium and has 0 false positives on both chromium and
llvm.

The idea of triggering this warning on a binop in the size argument is due to
rnk.

llvm-svn: 198063
2013-12-26 23:38:39 +00:00
Warren Hunt 63701d2533 [ms-abi] unix-line endings in lit test, no functional change
llvm-svn: 198060
2013-12-26 22:10:14 +00:00
Warren Hunt 50de3522e6 [ms-abi] Fixes improperly sized vfptrs with pragma pack
With pragma pack, the layout engine would produce vfptrs that were 
packed width rather than pointer width.  This patch addresses the issue 
and adds a test case.

llvm-svn: 198059
2013-12-26 22:09:12 +00:00
Aaron Ballman 3e424b5070 Teach the diagnostics engine about the Attr type to make reporting on semantic attributes easier (and not require hard-coded strings). This requires a getSpelling() function on the Attr class, which is table-driven. Updates a handful of cases where a hard-coded string was being used to test the functionality out. Updating associated test cases for the improved quoting.
llvm-svn: 198055
2013-12-26 18:30:57 +00:00
Aaron Ballman 88fe322053 Removed a string literal for an attribute name, which means the attribute name will be quoted in the diagnostic. Manually added some quotes to a diagnostic for consistency. Updated the test cases as appropriate.
llvm-svn: 198054
2013-12-26 17:30:44 +00:00
Aaron Ballman cedaaea691 This diagnostic did not accept arguments, and did not have any test coverage. Parameterized the diagnostic, and made it more consistent with other attribute diagnostic wordings. Added test coverage.
Since this warning was generalized, it was also given a sensible warning group flag and the corresponding test was updated to reflect this.

llvm-svn: 198053
2013-12-26 17:07:49 +00:00
Aaron Ballman 553e68118f Removing some unneeded code, and a diagnostic that was obsoleted. The type has already been determined to be a ValueDecl by virtue of the attribute subjects.
Added some test case coverage as well.

llvm-svn: 198046
2013-12-26 14:54:11 +00:00
Alp Toker 5294e6e094 Don't reserve __builtin_types_compatible_p as a C++ keyword
Even g++ considers this a valid C++ identifier and it should only have been
visible in C mode.

Also drop the associated low-value diagnostic.

llvm-svn: 197995
2013-12-25 01:47:02 +00:00
Jiangning Liu 38799b1471 Add some missing test cases for ACLE intrinsics of AArch64 NEON.
llvm-svn: 197994
2013-12-25 01:23:43 +00:00
Nico Weber 428a93b8ab Add a FIXME to a failing test.
(See discussion in the bug for why this isn't XFAILed.)

llvm-svn: 197991
2013-12-24 20:48:13 +00:00
Alp Toker b09e5af914 Add a missing pipe in the test from r197896
Spotted by Edward

llvm-svn: 197903
2013-12-23 08:50:43 +00:00
Hao Liu f96fd37888 [AArch64]The compare to zero intrinsics should be implemented by 'icmp/fcmp' and 'sext' not 'zext'. Modify the implementation by replacing zext with sext.
llvm-svn: 197898
2013-12-23 02:44:00 +00:00
Alp Toker 054f33c801 Make some f_Group definitions anonymous and test an alternative spelling
These names weren't referred to anywhere in the source so don't need a written
name.

Depends on the TableGen fix for anonymous records in LLVM r197869.

llvm-svn: 197896
2013-12-22 22:38:57 +00:00
Aaron Ballman 888e935978 Removing the alloc_size attribute. The attribute was semantically handled, but silently ignored. Most of this feature was already reverted in June 2012 (r159016), this just cleans up the pieces left over.
llvm-svn: 197866
2013-12-21 17:15:13 +00:00
Richard Trieu 2f024f432d Add -Winfinite-recursion to Clang
This new warning detects when a function will recursively call itself on every
code path though that function.  This catches simple recursive cases such as:

void foo() {
  foo();
}

As well as more complex functions like:

void bar() {
  if (test()) {
    bar();
    return;
  } else {
    bar();
  }
  return;
}

This warning uses the CFG.  As with other CFG-based warnings, this is off
by default.  Due to false positives, this warning is also disabled for
templated functions.

llvm-svn: 197853
2013-12-21 02:33:43 +00:00
Nico Weber 7607fce112 Don't mark record decls invalid when one of its methods is invalid, PR18284.
Without this patch, record decls with invalid out-of-line method delcs would
sometimes be marked invalid, but not always.  With this patch, they are
consistently never marked invalid.

(The code to do this was added in
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20100809/033154.html
, but the test from that revision is still passing.)

As far as I can tell, this was the only place where a class was marked invalid
after its definition was complete.

llvm-svn: 197848
2013-12-21 00:49:51 +00:00
David Blaikie 3275dc4586 DebugInfo: Do not include implicit members (implicit special members, template instantiations, etc) in the list of members of a structure.
These members will still be lazily added to the relevant DWARF DIEs in
LLVM but when enumerating the members they will not appear. This allows
DWARF type units to be more consistent - the type unit will never
contain these special members (so all instances of the type should have
the same DIEs without some having some special members and others having
others) and the special members will be added to the skeletal
declaration that appears in the relevant compile_unit.

llvm-svn: 197844
2013-12-20 23:19:47 +00:00
Rafael Espindola d5e81e59b5 Override the datalayout in a module with -triple.
This matches llc's behavior.

Before this patch clang would create a TargetInfo base on -triple but a llvm
CodeGen based on the triple in the module.

llvm-svn: 197837
2013-12-20 22:01:25 +00:00
Reid Kleckner d2d1cc5156 Compare canonical return types when generating MS C++ ABI vtable thunks
This was part of the cause for PR17655.  We were generating thunks when
we shouldn't have.  I suspect that if we tweak the test case for PR17655
to actually require thunks, we can reproduce the same crash.

llvm-svn: 197836
2013-12-20 21:44:05 +00:00
Hans Wennborg e0053474b9 clang-cl: Support /P and /E (preprocess to file or stdout)
llvm-svn: 197827
2013-12-20 18:40:46 +00:00
Daniel Jasper 92669ee45c Enable layering check in unavailable modules.
If a header file belonging to a certain module is not found on the
filesystem, that header gets marked as unavailable. Now, the layering
warning (-fmodules-decluse) should still warn about headers of this
module being wrongfully included. Currently, headers belonging to those
modules are just treated as not belonging to modules at all which means
they can be included freely from everywhere.

To implement this (somewhat) cleanly, I have moved most of the layering
checks into the ModuleMap. This will also help with showing FixIts
later.

llvm-svn: 197805
2013-12-20 12:09:36 +00:00
Dmitri Gribenko 514102d24f Add a test I forgot to svn add in r197755
llvm-svn: 197756
2013-12-20 00:21:47 +00:00
Jordan Rose 821f102985 [analyzer] Fix test in previous commit to account for compiler warning.
--analyze passes -w, but -cc1 -analyze doesn't. Oops!

llvm-svn: 197741
2013-12-19 23:05:40 +00:00
Ted Kremenek 1654511884 Wordsmith "maybe" into "may be" in diagnostic, and move warning under flag.
llvm-svn: 197736
2013-12-19 22:47:11 +00:00
Jordan Rose 7ae3362458 [analyzer] Always use 'bool' as the SValBuilder condition type in C++.
We have assertions for this, but a few edge cases had snuck through where
we were still unconditionally using 'int'.

<rdar://problem/15703011>

llvm-svn: 197733
2013-12-19 22:32:39 +00:00
Aaron Ballman 37c5f5da32 After discussing with John McCall, removing the ns_bridged attribute as it is unused.
llvm-svn: 197729
2013-12-19 22:12:51 +00:00
Fariborz Jahanian 4b7946a28a ObjectiveC. Sema test for property, methods
'section' attribute. // rdar://15450637

llvm-svn: 197704
2013-12-19 17:22:23 +00:00
NAKAMURA Takumi ef4657e6f1 check-clang: Suppress LLVM_LIT in add_lit_testsuite, for now.
llvm-svn: 197702
2013-12-19 17:10:30 +00:00
Rafael Espindola 9ec8d08eb1 Small simplification: p0 is the same as p.
llvm-svn: 197700
2013-12-19 16:54:10 +00:00
NAKAMURA Takumi e6d79ec0eb [CMake][Standalone] Rewrite standalone build based on llvm-config. CLANG_PATH_TO_LLVM_*(s) are deprecated.
Checked on VS10(multiconfig) and some singleconfig builders.

* Assumptions

  - You should specify llvm-config as LLVM_CONFIG.
    CMake could find one in $PATH by default.

  - ENABLE_ASSERTIONS obeys LLVM's.

* Use cases

  a) With LLVM build tree

    Assume llvm-config is in your build tree.
    Everything should work as ever.

  b) With *installed* LLVM

    Assume distributions. The source tree can be optional.

    b1) The source tree is provided on the location `llvm-config --src-root`

      - Test utils, FileCheck &c., are imported and built in the new tree.
      - Gtest is built in the tree if gtest library is not found.
      - Lit is used in $(SRCROOT)/utils/lit/lit.py.

    b2) The source tree is not provided

      - clang and utilities can be built.
      - All tests, unittests and check-clang are invalidated and not built.

llvm-svn: 197697
2013-12-19 16:44:32 +00:00
NAKAMURA Takumi ed79c96f89 [CMake] check-clang: Include ClangUnitTests if it can be built. Check existence of gtest.h then.
llvm-svn: 197688
2013-12-19 16:05:44 +00:00
NAKAMURA Takumi 5de6b43898 [CMake] check-clang: Append items to CLANG_TEST_DEPS rather than set. CLANG_TEST_DEPS can be set in parent scope.
llvm-svn: 197687
2013-12-19 16:05:39 +00:00
NAKAMURA Takumi 5db0c689b2 [CMake] check-clang: Deprecate --path, according to r197576.
llvm-svn: 197686
2013-12-19 16:05:34 +00:00
Matt Arsenault 8ba4882c4b Update SI datalayout for 32-bit private pointers
llvm-svn: 197660
2013-12-19 05:33:14 +00:00
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
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
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
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
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