Skip to content
  1. Dec 06, 2016
    • Mehdi Amini's avatar
      Introduces cmake option `LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING` · ebcb8a70
      Mehdi Amini authored
      Summary:
      We recently introduced a feature that enforce at link-time that the
      LLVM headers used by a clients are matching the ABI setting of the
      LLVM library linked to.
      
      However for clients that are using only headers from ADT and promise
      they won't call into LLVM, this is forcing to link libSupport. This
      new flag is intended to provide a way to configure LLVM with this
      promise for such client.
      
      Reviewers: bob.wilson, compnerd
      
      Subscribers: mgorny, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D27432
      
      llvm-svn: 288754
      ebcb8a70
    • Stephan T. Lavavej's avatar
      [libcxx] [test] D27269: Fix MSVC x64 warning C4267 "conversion from 'size_t'... · d4b83e6d
      Stephan T. Lavavej authored
      [libcxx] [test] D27269: Fix MSVC x64 warning C4267 "conversion from 'size_t' to 'int' [or 'unsigned int'], possible loss of data", part 3/4.
      
      test/std/containers/sequences/vector.bool/copy.pass.cpp
      test/std/containers/sequences/vector.bool/copy_alloc.pass.cpp
      test/std/containers/sequences/vector/vector.cons/copy.pass.cpp
      test/std/containers/sequences/vector/vector.cons/copy_alloc.pass.cpp
      Change "unsigned s = x.size();" to "typename C::size_type s = x.size();"
      because that's what it returns.
      
      test/std/strings/basic.string/string.cons/pointer_alloc.pass.cpp
      Include <cstddef>, then change "unsigned n = T::length(s);"
      to "std::size_t n = T::length(s);" because that's what char_traits returns.
      
      test/std/strings/basic.string/string.cons/substr.pass.cpp
      Change unsigned to typename S::size_type because that's what str.size() returns.
      
      test/std/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp
      This was needlessly truncating std::size_t to unsigned.
      It's being used to compare and initialize std::size_t.
      
      llvm-svn: 288753
      d4b83e6d
    • Stephan T. Lavavej's avatar
      [libcxx] [test] D27268: Fix MSVC x64 warning C4267 "conversion from 'size_t'... · f41847c4
      Stephan T. Lavavej authored
      [libcxx] [test] D27268: Fix MSVC x64 warning C4267 "conversion from 'size_t' to 'int' [or 'unsigned int'], possible loss of data", part 2/4.
      
      Use static_cast<int> when storing size_t in int (or passing size_t to int).
      
      Also, remove a spurious semicolon in test/support/archetypes.hpp.
      
      test/support/count_new.hpp
      Additionally, change data members (and parameters) to size_t.
      
      llvm-svn: 288752
      f41847c4
    • Stephan T. Lavavej's avatar
      [libcxx] [test] D27267: Fix MSVC x64 warning C4267 "conversion from 'size_t'... · baa547b9
      Stephan T. Lavavej authored
      [libcxx] [test] D27267: Fix MSVC x64 warning C4267 "conversion from 'size_t' to 'int' [or 'unsigned int'], possible loss of data", part 1/4.
      
      Replace "int n = str_.size();" with "int n = static_cast<int>(str_.size());".
      
      int is the correct type to use, because we're eventually calling
      "base::pbump(n+1);" where base is std::basic_streambuf.
      N4606 27.6.3.3.3 [streambuf.put.area]/4 declares: "void pbump(int n);"
      
      llvm-svn: 288751
      baa547b9
    • Stephan T. Lavavej's avatar
      [libcxx] [test] D27266: Remove spurious semicolons. · fe4ca8c5
      Stephan T. Lavavej authored
      llvm-svn: 288750
      fe4ca8c5
    • Stephan T. Lavavej's avatar
      [libcxx] [test] D27025: Fix MSVC warning C4389 "signed/unsigned mismatch", part 12/12. · e9c72889
      Stephan T. Lavavej authored
      Various changes:
      
      test/std/algorithms/alg.sorting/alg.merge/inplace_merge.pass.cpp
      This is comparing value_type to unsigned. value_type is sometimes int and sometimes struct S (implicitly constructible from int).
      static_cast<value_type>(unsigned) silences the warning and doesn't do anything bad (as the values in question are small).
      
      test/std/algorithms/alg.sorting/alg.nth.element/nth_element_comp.pass.cpp
      This is comparing an int remote-element to size_t. The values in question are small and non-negative,
      so either type is fine. I think that converting int to size_t is marginally better here than the reverse.
      
      test/std/containers/sequences/deque/deque.cons/size.pass.cpp
      DefaultOnly::count is int (and non-negative). When comparing to unsigned, use static_cast<unsigned>.
      
      test/std/strings/basic.string/string.access/index.pass.cpp
      We're comparing char to '0' through '9', but formed with the type size_t. Add static_cast<char>.
      
      test/std/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp
      Include <cstddef> for pedantic correctness (this test was already mentioning std::size_t).
      
      "v[i] == (i & 1)" was comparing bool to size_t. Saying "v[i] == ((i & 1) != 0)" smashes the RHS to bool.
      
      llvm-svn: 288749
      e9c72889
    • Stephan T. Lavavej's avatar
      [libcxx] [test] D27024: Fix MSVC warning C4389 "signed/unsigned mismatch", part 11/12. · 6859c20a
      Stephan T. Lavavej authored
      Change "unsigned n = 0;" to "int n = 0;". It's being compared to int elements and ptrdiff_t distances.
      
      test/std/containers/sequences/forwardlist/forwardlist.cons/move.pass.cpp
      This one's a little special, but not really. "*i == n" is comparing MoveOnly to n.
      MoveOnly is implicitly constructible from int, so int is the correct type to use here.
      
      llvm-svn: 288748
      6859c20a
    • Stephan T. Lavavej's avatar
      [libcxx] [test] D27023: Fix MSVC warning C4389 "signed/unsigned mismatch", part 10/12. · e17a155c
      Stephan T. Lavavej authored
      Add static_cast<int>. In these cases, the values are guaranteed to be small-ish,
      and they're being compared to int elements.
      
      test/std/containers/sequences/deque/deque.capacity/access.pass.cpp
      Use int instead of unsigned to iterate from 0 to 10.
      
      llvm-svn: 288747
      e17a155c
    • Stephan T. Lavavej's avatar
      [libcxx] [test] D27022: Fix MSVC warning C4389 "signed/unsigned mismatch", part 9/12. · 68a694b8
      Stephan T. Lavavej authored
      Add static_cast<std::size_t> to more comparisons. (Performed manually, unlike part 8/12.)
      
      Also, include <cstddef> when it wasn't already being included.
      
      llvm-svn: 288746
      68a694b8
    • Stephan T. Lavavej's avatar
      [libcxx] [test] D27021: Fix MSVC warning C4389 "signed/unsigned mismatch", part 8/12. · fbfb2ab6
      Stephan T. Lavavej authored
      Add static_cast<std::size_t> when comparing distance() to size().
      
      These replacements were performed programmatically with regex_replace():
      
      const vector<pair<regex, string>> reg_fmt = {
          { regex(R"(assert\((\w+)\.size\(\) == std::distance\((\w+, \w+)\)\))"),
              "assert($1.size() == static_cast<std::size_t>(std::distance($2)))" },
          { regex(R"(assert\(distance\((\w+\.begin\(\), \w+\.end\(\))\) == (\w+)\.size\(\)\))"),
              "assert(static_cast<std::size_t>(distance($1)) == $2.size())" },
          { regex(R"(assert\(std::distance\((\w+\.\w*begin\(\), \w+\.\w*end\(\))\) == (\w+)\.size\(\)\))"),
              "assert(static_cast<std::size_t>(std::distance($1)) == $2.size())" },
      };
      
      Also, include <cstddef> when it wasn't already being included.
      
      llvm-svn: 288745
      fbfb2ab6
    • Matt Arsenault's avatar
      AMDGPU: Don't required structured CFG · ad55ee58
      Matt Arsenault authored
      The structured CFG is just an aid to inserting exec
      mask modification instructions, once that is done
      we don't really need it anymore. We also
      do not analyze blocks with terminators that
      modify exec, so this should only be impacting
      true branches.
      
      llvm-svn: 288744
      ad55ee58
    • Eric Fiselier's avatar
      Add support for writing -verify shell tests · 9642b36e
      Eric Fiselier authored
      llvm-svn: 288743
      9642b36e
    • Bob Haarman's avatar
      · 312fd0ee
      Bob Haarman authored
      revert inadvertedly introduced build break
      
      Summary:
      r288722 introduced a build break due some code that should
      not have been part of the commit. This change removes the offending
      code.
      
      Reviewers: davide, ruiu
      
      Differential Revision: https://reviews.llvm.org/D27435
      
      llvm-svn: 288742
      312fd0ee
    • Richard Smith's avatar
      Revert r288626, which reverts r288449. Original commit message: · a114c46e
      Richard Smith authored
      Recover better from an incompatible .pcm file being provided by -fmodule-file=. We try to include the headers of the module textually in this case, still enforcing the modules semantic rules. In order to make that work, we need to still track that we're entering and leaving the module. Also, if the module was also marked as unavailable (perhaps because it was missing a file), we shouldn't mark the module unavailable -- we don't need the module to be complete if we're going to enter it textually.
      
      llvm-svn: 288741
      a114c46e
    • Richard Trieu's avatar
      Add test for r288732, warn on unsigned zero in std::max · 5165a741
      Richard Trieu authored
      llvm-svn: 288740
      5165a741
    • Richard Smith's avatar
      Additional test file missed from r288737. · 8893f35a
      Richard Smith authored
      llvm-svn: 288738
      8893f35a
    • Richard Smith's avatar
      [modules] Use the "redundant #include" diagnostic rather than the "module · b9d0193e
      Richard Smith authored
      import can't appear here" diagnostic if an already-visible module is textually
      entered (because we have the module map but not the AST file) within a
      function/namespace scope.
      
      llvm-svn: 288737
      b9d0193e
    • Eric Fiselier's avatar
      Allow enabling/disabling testing with module using env LIBCXX_USE_MODULES=1 · 8e27c2b9
      Eric Fiselier authored
      The Clang modules implementation breaks enough that libc++ needs an easy way
      to enable/disable using modules on the Zorg builders. Editing Zorg itself
      requires a buildmaster restart which only happens weekly. This patch
      allows LIBCXX_USE_MODULES to be used to enable/disable the feature,
      allowing the buildslave to disable it as need be.
      
      llvm-svn: 288736
      8e27c2b9
    • Eric Fiselier's avatar
      Add module definitions for <experimental/foo> headers · e1f72557
      Eric Fiselier authored
      llvm-svn: 288735
      e1f72557
    • Weiming Zhao's avatar
      Summary: Currently there is no way to disable deprecated warning from asm like this · b38cfced
      Weiming Zhao authored
      clang  -target arm deprecated-asm.s -c
        deprecated-asm.s:30:9: warning: use of SP or PC in the list is deprecated
             stmia   r4!, {r12-r14}
      
      We have to have an option what can disable it.
      
      Patched by Yin Ma!
      
      Reviewers: joey, echristo, weimingz
      
      Subscribers: llvm-commits, aemerson
      
      Differential Revision: https://reviews.llvm.org/D27219
      
      llvm-svn: 288734
      b38cfced
    • Eric Fiselier's avatar
      Add module definitions for string_view · ca648c97
      Eric Fiselier authored
      llvm-svn: 288733
      ca648c97
    • Richard Trieu's avatar
      Warn on unsigned zero in call to std::max · 67c00715
      Richard Trieu authored
      New default warning that triggers when an unsigned zero is used in a call to
      std::max.  For unsigned values, zero is the minimum value, so any call to
      std::max is always equal to the other value.  A common pattern was to take
      the max of zero and the difference of two unsigned values, not taking into
      account that unsigned values wrap around below zero.  This warning also emits
      a note with a fixit hint to remove the zero and call to std::max.
      
      llvm-svn: 288732
      67c00715
    • Kostya Serebryany's avatar
      [libFuzzer] refactor the code to allow collecting features in different ways.... · fe1094b8
      Kostya Serebryany authored
      [libFuzzer] refactor the code to allow collecting features in different ways. Also initialize a couple of Fuzzer:: members that might have been used uninitialized :(
      
      llvm-svn: 288731
      fe1094b8
    • Eric Fiselier's avatar
      Add modules for any/optional/variant · 392aa108
      Eric Fiselier authored
      llvm-svn: 288730
      392aa108
    • Serge Rogatch's avatar
      [XRay][AArch64] Attempt to fix unstable test XRay-aarch64-linux::patching-unpatching.cc · 882fc5d0
      Serge Rogatch authored
      Summary: Currently test XRay-aarch64-linux::patching-unpatching.cc sometimes passes, sometimes fails. This is an attempt to fix it by handling better the situations when both `__arm__` and `__aarch64__` are defined.
      
      Reviewers: dberris, rengolin
      
      Subscribers: llvm-commits, iid_iunknown, aemerson, rengolin, dberris
      
      Differential Revision: https://reviews.llvm.org/D27421
      
      llvm-svn: 288729
      882fc5d0
    • Eric Fiselier's avatar
      Adjust libc++ test infastructure to fully support modules · daf21c3f
      Eric Fiselier authored
      This patch overhalls the libc++ test format/configuration in order to fully support modules. By "fully support" I mean get almost all of the tests passing. The main hurdle for doing this is handling tests that `#define _LIBCPP_FOO` macros to test a different configuration. This patch deals with these tests in the following ways:
      
      1. For tests that define single `_LIBCPP_ABI_FOO` macros have been annotated with `// MODULES_DEFINES: _LIBCPP_ABI_FOO`. This allows the test suite to define the macro on the command line so it uses a different set of modules.
      2. Tests for libc++'s debug mode (which define custom `_LIBCPP_ASSERT`) are automatically detected by the test suite and are compiled and run with modules disabled.
      
      This patch also cleans up how the `CXXCompiler` helper class handles enabling/disabling language features.
      
      NOTE: This patch uses `LIT` features which were only committed to LLVM today. If this patch breaks running the libc++ tests you probably need to update LLVM.
      llvm-svn: 288728
      daf21c3f
    • Tim Northover's avatar
      GlobalISel: avoid looking too closely at PHIs when we bail. · 800638fd
      Tim Northover authored
      The function used to finish off PHIs by adding the relevant basic blocks can
      fail if we're aborting and still don't actually have the needed
      MachineBasicBlocks. So avoid trying in that case.
      
      llvm-svn: 288727
      800638fd
    • Mike Aizatsky's avatar
      [sanitizers] mac prints null differently · 48ee418f
      Mike Aizatsky authored
      llvm-svn: 288726
      48ee418f
    • Davide Italiano's avatar
      [SCCP] Remove manual folding of terminator instructions. · 3dad93d9
      Davide Italiano authored
      There are two cases handled here:
      1) a branch on undef
      2) a switch with an undef condition.
      
      Both cases are currently handled by ResolvedUndefsIn. If we have
      a branch on undef, we force its value to false (which is trivially
      foldable). If we have a switch on undef, we force to the first
      constant (which is also foldable).
      
      llvm-svn: 288725
      3dad93d9
  2. Dec 05, 2016
Loading