1. Feb 15, 2019
    • Clement Courbet's avatar
      [MergeICmps][NFC] Improve doc. · cc004df7
      Clement Courbet authored
      llvm-svn: 354128
      cc004df7
    • Adam Balogh's avatar
      [Analyzer] Fix for test file of bug 40625 · 55725785
      Adam Balogh authored
      Test fixed and changed to true positive, FIXME about false positive removed.
      
      llvm-svn: 354127
      55725785
    • Hans Wennborg's avatar
      Speculatively revert r354051 "Recommit Optional specialization for trivially copyable types" · cc980bfa
      Hans Wennborg authored
      and
      r354055 "Optional specialization for trivially copyable types, part2"
      
      These are suspected to cause Clang to get miscompiled on Ubuntu 14.04
      (Trusty) which uses GCC 4.8.4. Reverting for an hour to see if this
      helps. See llvm-commits thread.
      
      > Recommit Optional specialization for trivially copyable types
      >
      > Unfortunately the original code gets misscompiled by GCC (at least 8.1),
      > this is a tentative workaround using std::memcpy instead of inplace new
      > for trivially copyable types. I'll revert if it breaks.
      >
      > Original revision: https://reviews.llvm.org/D57097
      
      llvm-svn: 354126
      cc980bfa
    • Pavel Labath's avatar
      Remove alignment from struct XSAVE altogether · 4f85014d
      Pavel Labath authored
      I reduced the alignment of this struct in r342029 to avoid compiler
      warnings about under-aligned allocations, but it turns out that this
      still causes problems with some compilers (see r353778). As I hinted in
      r342029, I don't believe any special aligment is necessary here (the
      only reason for that would be if we used some aligned SSE instructions to
      access this buffer, but I don't see any reason why we should do that),
      so here I go all the way, and remove the alignment requirements (except
      the ones naturally imposed by basic types) altogether.
      
      llvm-svn: 354125
      4f85014d
    • Max Kazantsev's avatar
      [NFCI] Factor out block removal from stack of nested loops · c065b025
      Max Kazantsev authored
      llvm-svn: 354124
      c065b025
    • Simon Pilgrim's avatar
      623c38d6
    • Michal Gorny's avatar
      [lldb] [MainLoop] Add kevent() EINTR handling · 53eabaab
      Michal Gorny authored
      Add missing EINTR handling for kevent() calls.  If the call is
      interrupted, return from Poll() as if zero events were returned and let
      the polling resume on next iteration.  This fixes test flakiness
      on NetBSD.
      
      Includes a test case suggested by Pavel Labath on D42206.
      
      Differential Revision: https://reviews.llvm.org/D58230
      
      llvm-svn: 354122
      53eabaab
    • Anastasia Stulova's avatar
      [OpenCL][PR40707] Allow OpenCL C types in C++ mode. · 2c4730de
      Anastasia Stulova authored
      Allow all OpenCL types to be parsed in C++ mode.
      
      llvm-svn: 354121
      2c4730de
    • Gabor Marton's avatar
      [ASTImporter] Import every Decl in lambda record · 302f300a
      Gabor Marton authored
      Summary:
      Previously only the fields were imported. Now every Decl is imported.
      This way the destructor decl is not missing after import.
      
      Patch by balazske (Balázs Kéri)
      
      Reviewers: a.sidorin, shafik
      
      Reviewed By: shafik
      
      Subscribers: balazske, cfe-commits, Szelethus, martong, dkrupp
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D57740
      
      llvm-svn: 354120
      302f300a
    • Sam Parker's avatar
      [BPI] Look through bitcasts in calcZeroHeuristic · 0b53e845
      Sam Parker authored
      Constant hoisting may have hidden a constant behind a bitcast so that
      it isn't folded into its users. However, this prevents BPI from
      calculating some of its heuristics that are based upon constant
      values. So, I've added a simple helper function to look through these
      casts.
      
      Differential Revision: https://reviews.llvm.org/D58166
      
      llvm-svn: 354119
      0b53e845
    • Max Kazantsev's avatar
      [NFC] Promote DFS to field for further use · 136f09be
      Max Kazantsev authored
      llvm-svn: 354118
      136f09be
    • Simon Pilgrim's avatar
      [X86][AVX] lowerShuffleAsLanePermuteAndPermute - fully populate the lane shuffle mask (PR40730) · 6ce08672
      Simon Pilgrim authored
      As detailed on PR40730, we are not correctly filling in the lane shuffle mask (D53148/rL344446) - we fill in for the correct src lane but don't add it to the correct mask element, so any reference to the correct element is likely to see an UNDEF mask index.
      
      This allows constant folding to propagate UNDEFs prior to the lane mask being (correctly) lowered to vperm2f128.
      
      This patch fixes the issue by fully populating the lane shuffle mask - this is more than is necessary (if we only filled in the required mask elements we might be able to match other shuffle instructions - broadcasts etc.), but its the most cautious approach as this needs to be cherrypicked into the 8.0.0 release branch.
      
      Differential Revision: https://reviews.llvm.org/D58237
      
      llvm-svn: 354117
      6ce08672
    • Sam McCall's avatar
      [clangd] Unlink VFS working dir from OS working dir. Reland of r351051 · 0446b40b
      Sam McCall authored
      llvm-svn: 354116
      0446b40b
    • Diana Picus's avatar
      [ARM GlobalISel] Style fix. NFCI · c0f964eb
      Diana Picus authored
      Add the opcode for ADDrr / t2ADDrr to the Opcode cache, as we did for
      all other opcodes where the handling is otherwise the same between arm
      mode and thumb2.
      
      llvm-svn: 354115
      c0f964eb
    • Pavel Labath's avatar
      Fix the gdb-client test suite for python3 · 5f54fe23
      Pavel Labath authored
      This applies the same fix that was done in r354106 to the lldb-server
      test: bitcasting the string to a bytes object before sending it over a
      socket. Since the gdb-remote protocol occasionally contains binary data,
      and it does not assign any particular encoding to them, this is the
      right thing to do here.
      
      llvm-svn: 354114
      5f54fe23
    • Diana Picus's avatar
      [ARM GlobalISel] Support branches for Thumb2 · a00425ff
      Diana Picus authored
      Just like arm mode, but with different opcodes.
      
      llvm-svn: 354113
      a00425ff
    • Pavel Labath's avatar
      Sort files in source/Host/CMakeLists.txt · 0ed2d160
      Pavel Labath authored
      llvm-svn: 354112
      0ed2d160
    • Alex Bradbury's avatar
      [RISCV] Add assembler support for LA pseudo-instruction · 22531c4a
      Alex Bradbury authored
      This patch also introduces the emitAuipcInstPair helper, which is then used
      for both emitLoadAddress and emitLoadLocalAddress.
      
      Differential Revision: https://reviews.llvm.org/D55325
      Patch by James Clarke.
      
      llvm-svn: 354111
      22531c4a
    • Alex Bradbury's avatar
      [RISCV] Support assembling %got_pcrel_hi operator · 8eb87e59
      Alex Bradbury authored
      Differential Revision: https://reviews.llvm.org/D55279
      Patch by James Clarke.
      
      llvm-svn: 354110
      8eb87e59
    • Sam McCall's avatar
      Revert "[Analysis] -Wunreachable-code shouldn't fire on the increment of a foreach loop" · 24f13573
      Sam McCall authored
      This reverts commit r354102.
      
      llvm-svn: 354109
      24f13573
    • Sam Parker's avatar
      [ARM CGP] Fix ConvertTruncs · 3c17cb7b
      Sam Parker authored
      ConvertTruncs is used to replace a trunc for an AND mask, however
      this function wasn't working as expected. By performing the change
      later, we can create a wide type integer mask instead of a narrow -1
      value, which could then be simply removed (incorrectly). Because we
      now perform this action later, it's necessary to cache the trunc type
      before we perform the promotion.
      
      Differential Revision: https://reviews.llvm.org/D57686
      
      llvm-svn: 354108
      3c17cb7b
    • Max Kazantsev's avatar
      [NFC] Tweak SplitBlockAndInsertIfThen to use existing ThenBlock · 73db5c13
      Max Kazantsev authored
      llvm-svn: 354107
      73db5c13
    • Pavel Labath's avatar
      Fix lldb-server test suite for python3 · 0af864b4
      Pavel Labath authored
      Summary:
      This patch finishes the python3-ification of the lldb-server test suite.
      It reverts the partial attempt in r352709 to encode/decode the string
      via utf8 before writing to the socket. This wasn't enough because the
      gdb-remote protocol can sometimes (but not very often) carry binary
      data, and the utf8 codec chokes on that. Instead I add utility functions
      to the "seven" module for performing "identity" transformations on the
      byte data. This basically drills back the hole in the python type system
      that the string/bytes distinction was supposed to plug. That is not
      ideal, but was the best solution of the alternatives I could come up
      with. The options I considered were:
      - make use of the type system to add type safety to the test suite: This
        required making a lot of changes to the test suite, since most of the
        strings would now become byte objects instead, and it was not even
        fully clear to me where to draw the line. One extreme solution would
        be to just use byte objects everywhere, as the protocol doesn't
        support non-ascii characters anyway. However, this appeared to be:
        a) weird, because most of the protocol actually deals with strings,
           but we would have to prefix everything with 'b'
        b) clunky, because the handling of the bytes objects is sufficiently
           different in PY2 and PY3 (e.g. b'a'[0] is a string in PY2, but an
           int in PY3).
      - using the latin1 codec (which gives an identity transformation for the
        first 256 code points of unicode) instead of the custom
        bytes_to_string functions. This almost could work, but it was still
        slightly different between python 2 and 3, because in PY2 in would
        return a unicode object, which would then cause problems when
        combined with regular strings if it contained 8-bit chars.
      
      With this in mind, I think the best solution for the time being is to
      just coerce everything into the string type as early as possible, and
      have things proceed indentically on both python versions. Once we stop
      supporting python3, we can revisit the idea of using bytes objects more
      prevasively.
      
      Reviewers: davide, zturner, serge-sans-paille
      
      Subscribers: lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D58177
      
      llvm-svn: 354106
      0af864b4
    • Pavel Labath's avatar
      Use sys.executable in lldb-dotest · b302bd23
      Pavel Labath authored
      Without that, dotest.py would be executed with the default python
      interpreter, which may not be the same one that lldb is built with.
      
      This still requires the user do know which python interpreter to use
      when running lldb-dotest, but now he is at least able to choose it, if
      he knows which one to use.
      
      llvm-svn: 354105
      b302bd23
    • Pavel Labath's avatar
      Embed swig version into lldb.py in a different way · 8d6b60c1
      Pavel Labath authored
      Summary:
      Instead of doing string chopping on the resulting python file, get swig
      to output the version for us. The two things which make slightly
      non-trivial are:
      - in order to get swig to expand SWIG_VERSION for us, we cannot use
        %pythoncode directly, but we have to go through an intermediate macro.
      - SWIG_VERSION is a hex number, but it's components are supposed to be
        interpreted decimally, so there is a bit of integer magic needed to
        get the right number to come out.
      
      I've tested that this approach works both with the latest (3.0.12) and
      oldest (1.3.40) supported swig.
      
      Reviewers: zturner, jingham, serge-sans-paille
      
      Subscribers: jdoerfert, lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D58172
      
      llvm-svn: 354104
      8d6b60c1
    • Pavel Labath's avatar
      Remove redundant semicolon after namespace-closing '}' · 8c02e778
      Pavel Labath authored
      llvm-svn: 354103
      8c02e778
    • Sam McCall's avatar
      [Analysis] -Wunreachable-code shouldn't fire on the increment of a foreach loop · ce2b40de
      Sam McCall authored
      Summary:
      The idea is that the code here isn't written, so doesn't indicate a bug.
      Similar to code expanded from macros.
      
      This means the warning no longer fires on this code:
        for (auto C : collection) {
          process(C);
          return;
        }
        handleEmptyCollection();
      Unclear whether this is more often a bug or not in practice, I think it's a
      reasonable idiom in some cases.
      Either way, if we want to warn on "loop that doesn't loop", I think it should be
      a separate warning, and catch `while(1) break;`
      
      Reviewers: ilya-biryukov, ioeric
      
      Subscribers: cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D58134
      
      llvm-svn: 354102
      ce2b40de
    • Max Kazantsev's avatar
      [TEST] Update test comments, refactor checks with update_test_checks.py · 184bd7a0
      Max Kazantsev authored
      This patch changes messages in guards-related tests to adequately reflect
      reality.
      
      llvm-svn: 354101
      184bd7a0
    • Aaron Smith's avatar
      Fix for build bot problem from last change · 96b82107
      Aaron Smith authored
      llvm-svn: 354100
      96b82107
    • Aaron Smith's avatar
      Implement GetLoadAddress for the Windows process plugin · eb6671e7
      Aaron Smith authored
      Summary:
      When a process is loaded, update its sections with the load address to resolve any created breakpoints. For the remote debugging case, the debugged process is launched remotely so GetLoadAddress is intended to pass the load address from remote to LLDB (client).
      
      
      Reviewers: zturner, llvm-commits, clayborg, labath
      
      Reviewed By: labath
      
      Subscribers: mgorny, sas, Hui, clayborg, labath, lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D56237
      
      llvm-svn: 354099
      eb6671e7
    • Matt Arsenault's avatar
      X86: Replace isSafeToClobberEFLAGS implementation · 2a5488b8
      Matt Arsenault authored
      Also use modifiesRegister instead of looping over operands.
      
      llvm-svn: 354098
      2a5488b8
    • Francis Visoiu Mistrih's avatar
      Revert "Fix implementation of [temp.local]p4." · 0650f897
      Francis Visoiu Mistrih authored
      This reverts commit 40bd10b7.
      
      This seems to now emit an error when building the sanitizer tests:
      http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/53965/consoleFull.
      
      llvm-svn: 354097
      0650f897
    • Francis Visoiu Mistrih's avatar
      3fb7d4f5
    • Julian Lettner's avatar
      [lit][NFC] Cleanup copy&paste naming mistake · bd40ecf7
      Julian Lettner authored
      llvm-svn: 354095
      bd40ecf7
    • Matt Davis's avatar
      [llvm-cxxfilt] Fix a comment typo. NFC. · 58227432
      Matt Davis authored
      llvm-svn: 354094
      58227432
    • Aditya Nandakumar's avatar
      [GISel][NFC]: Add methods to speed up insertion into GISelWorklist · 0e362ec1
      Aditya Nandakumar authored
      https://reviews.llvm.org/D58073
      
      Speed up insertion during the initial populating phase into the
      GISelWorkList by deferring repeatedly resizing the DenseMap.
      This results in ~10% improvement in the combiner passes, and
      ~3% speedup in the Legalizer.
      
      reviewed by: aemerson.
      
      llvm-svn: 354093
      0e362ec1
    • Kostya Serebryany's avatar
      77cbc625
    • Richard Smith's avatar
      Fix implementation of [temp.local]p4. · 40bd10b7
      Richard Smith authored
      When a template-name is looked up, we need to give injected-class-name
      declarations of class templates special treatment, as they denote a
      template rather than a type.
      
      Previously we achieved this by applying a filter to the lookup results
      after completing name lookup, but that is incorrect in various ways, not
      least of which is that it lost all information about access and how
      members were named, and the filtering caused us to generally lose
      all ambiguity errors between templates and non-templates.
      
      We now preserve the lookup results exactly, and the few places that need
      to map from a declaration found by name lookup into a declaration of a
      template do so explicitly. Deduplication of repeated lookup results of
      the same injected-class-name declaration is done by name lookup instead
      of after the fact.
      
      llvm-svn: 354091
      40bd10b7
    • Richard Smith's avatar
      PR40642: Fix determination of whether the final statement of a statement · a6e8d5e5
      Richard Smith authored
      expression is a discarded-value expression.
      
      Summary:
      We used to get this wrong in three ways:
      
      1) During parsing, an expression-statement followed by the }) ending a
         statement expression was always treated as producing the value of the
         statement expression. That's wrong for ({ if (1) expr; })
      2) During template instantiation, various kinds of statement (most
         statements not appearing directly in a compound-statement) were not
         treated as discarded-value expressions, resulting in missing volatile
         loads (etc).
      3) In all contexts, an expression-statement with attributes was not
         treated as producing the value of the statement expression, eg
         ({ [[attr]] expr; }).
      
      Also fix incorrect enforcement of OpenMP rule that directives can "only
      be placed in the program at a position where ignoring or deleting the
      directive would result in a program with correct syntax". In particular,
      a label (be it goto, case, or default) should not affect whether
      directives are permitted.
      
      Reviewers: aaron.ballman, rjmccall
      
      Subscribers: cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D57984
      
      llvm-svn: 354090
      a6e8d5e5
    • Ana Pazos's avatar
      Fixed failure on Darwin due to r354064 · 6dbe8659
      Ana Pazos authored
      Summary:
      instrprof-darwin-exports.c test fails on Darwin due  to r354064.
      
      Updated clang list of exported symbols to fix the issue.
      
      Reviewers: vsk
      
      Reviewed By: vsk
      
      Subscribers: davidxl, efriedma
      
      Differential Revision: https://reviews.llvm.org/D58259
      
      llvm-svn: 354089
      6dbe8659