1. Mar 02, 2017
    • Devin Coughlin's avatar
      [analyzer] pr32088: Don't destroy the temporary if its initializer causes return. · bfa8e28d
      Devin Coughlin authored
      In the following code involving GNU statement-expression extension:
        struct S {
          ~S();
        };
      
        void foo() {
          const S &x = ({ return; S(); });
        }
      function 'foo()' returns before reference x is initialized. We shouldn't call
      the destructor for the temporary object lifetime-extended by 'x' in this case,
      because the object never gets constructed in the first place.
      
      The real problem is probably in the CFG somewhere, so this is a quick-and-dirty
      hotfix rather than the perfect solution.
      
      A patch by Artem Dergachev!
      
      rdar://problem/30759076
      
      Differential Revision: https://reviews.llvm.org/D30499
      
      llvm-svn: 296646
      bfa8e28d
    • Krzysztof Parzyszek's avatar
      [Hexagon] Fix lowering of formal arguments of type i1 · 8f23dd6d
      Krzysztof Parzyszek authored
      On Hexagon, values of type i1 are passed in registers of type i32,
      even though i1 is not a legal value for these registers. This is a
      special case and needs special handling to maintain consistency of
      the lowering information.
      
      This fixes PR32089.
      
      llvm-svn: 296645
      8f23dd6d
    • Zachary Turner's avatar
      [PDB] Re-add BinaryStreamTest. · 081b1bce
      Zachary Turner authored
      This re-adds all the binary stream tests.  This was reverted due
      to some misaligned reads.  For now the offending test is
      disabled while I investigate.
      
      llvm-svn: 296643
      081b1bce
    • Hans Wennborg's avatar
      [GVNHoist] Don't hoist unsafe scalars at -Oz (PR31729) · 19c0be90
      Hans Wennborg authored
      Based on Aditya Kumar's patch:
      
      Differential Revision: https://reviews.llvm.org/D29092
      
      llvm-svn: 296642
      19c0be90
    • Vedant Kumar's avatar
      Remove unittests/DebugInfo/PDB/BinaryStreamTest.cpp (from r296555) · b0baffc9
      Vedant Kumar authored
      It breaks the ToT UBSan bots:
      
      /Users/vk/Desktop/llvm/include/llvm/DebugInfo/MSF/BinaryStreamArray.h:246:12: runtime error: reference binding to misaligned address 0x7f925540939a for type 'const int', which requires 4 byte alignment
      0x7f925540939a: note: pointer points here
       05 00  00 00 01 00 00 00 02 00  00 00 03 00 00 00 00 00  00 00 00 00 00 00 00 00  70 98 50 06 01 00
                    ^
      0  DebugInfoPDBTests                   0x0000000106263cbd llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 45
      1  DebugInfoPDBTests                   0x00000001062628ff llvm::sys::RunSignalHandlers() + 159
      2  DebugInfoPDBTests                   0x0000000106264593 SignalHandler(int) + 179
      3  libsystem_platform.dylib            0x0000000107bb3fba _sigtramp + 26
      4  libsystem_pthread.dylib             0x0000000107bd82c8 _pthread_keys + 9720
      5  libsystem_c.dylib                   0x0000000107947f83 abort + 127
      6  libclang_rt.ubsan_osx_dynamic.dylib 0x0000000106bb5fc2 __sanitizer::Abort() + 66
      7  DebugInfoPDBTests                   0x000000010613f880 llvm::FixedStreamArrayIterator<int>::operator+=(long) + 0
      8  DebugInfoPDBTests                   0x000000010613f615 llvm::FixedStreamArrayIterator<int>::operator*() const + 37
      9  DebugInfoPDBTests                   0x000000010613f3cb std::__1::enable_if<__is_forward_iterator<llvm::FixedStreamArrayIterator<int> >::value, void>::type std::__1::vector<int, std::__1::allocator<int> >::__construct_at_end<llvm::FixedStreamArrayIterator<int> >(llvm::FixedStreamArrayIterator<int>, llvm::FixedStreamArrayIterator<int>, unsigned long) + 251
      10 DebugInfoPDBTests                   0x000000010613f292 std::__1::vector<int, std::__1::allocator<int> >::vector<llvm::FixedStreamArrayIterator<int> >(llvm::FixedStreamArrayIterator<int>, std::__1::enable_if<(__is_forward_iterator<llvm::FixedStreamArrayIterator<int> >::value) && (is_constructible<int, std::__1::iterator_traits<llvm::FixedStreamArrayIterator<int> >::reference>::value), llvm::FixedStreamArrayIterator<int> >::type) + 226
      11 DebugInfoPDBTests                   0x000000010613ddb7 std::__1::vector<int, std::__1::allocator<int> >::vector<llvm::FixedStreamArrayIterator<int> >(llvm::FixedStreamArrayIterator<int>, std::__1::enable_if<(__is_forward_iterator<llvm::FixedStreamArrayIterator<int> >::value) && (is_constructible<int, std::__1::iterator_traits<llvm::FixedStreamArrayIterator<int> >::reference>::value), llvm::FixedStreamArrayIterator<int> >::type) + 87
      12 DebugInfoPDBTests                   0x000000010613d4af (anonymous namespace)::BinaryStreamTest_StreamReaderIntegerArray_Test::TestBody() + 1279
      13 DebugInfoPDBTests                   0x00000001062780f3 testing::Test::Run() + 179
      14 DebugInfoPDBTests                   0x0000000106279594 testing::TestInfo::Run() + 308
      15 DebugInfoPDBTests                   0x000000010627a6a3 testing::TestCase::Run() + 307
      16 DebugInfoPDBTests                   0x00000001062849d4 testing::internal::UnitTestImpl::RunAllTests() + 756
      17 DebugInfoPDBTests                   0x0000000106284558 testing::UnitTest::Run() + 152
      18 DebugInfoPDBTests                   0x0000000106266fa5 main + 117
      19 libdyld.dylib                       0x00000001078506a5 start + 1
      zsh: abort      ./unittests/DebugInfo/PDB/DebugInfoPDBTests
      
      llvm-svn: 296641
      b0baffc9
    • Zachary Turner's avatar
      [PDB] Remove use of std error codes. · 1fa70d71
      Zachary Turner authored
      I already created a BinaryStreamError class for this purpose,
      so update the code to use that on the remaining occurrences
      of errc values.
      
      This should also address the issue which led to r296583.
      
      llvm-svn: 296640
      1fa70d71
    • Krasimir Georgiev's avatar
    • Benjamin Kramer's avatar
      [clangd] Unbreak the shared build. · 570c2303
      Benjamin Kramer authored
      llvm-svn: 296637
      570c2303
    • Benjamin Kramer's avatar
      [clangd] Add support for FixIts. · f0af3e6b
      Benjamin Kramer authored
      Summary:
      This uses CodeActions to show 'apply fix' actions when code actions are
      requested for a location. The actions themselves make use of a
      clangd.applyFix command which has to be implemented on the editor side. I
      included an implementation for vscode.
      
      This also adds a -run-synchronously flag which runs everything on the main
      thread. This is useful for testing.
      
      Reviewers: krasimir
      
      Subscribers: cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D30498
      
      llvm-svn: 296636
      f0af3e6b
  2. Mar 01, 2017