1. Aug 26, 2019
    • Pavel Labath's avatar
      Fix windows build after r369894 · f899bf13
      Pavel Labath authored
      Constructing a std::vector from a llvm::map_range fails on windows,
      apparently because std::vector expects the input iterator to have a
      const operator* (map_range iterator has a non-const one).
      
      This avoids the cleverness and unrolls the map-loop manually (which is
      also slightly shorter).
      
      llvm-svn: 369905
      f899bf13
    • Pavel Labath's avatar
      Fix a type mismatch error in GDBRemoteCommunicationServerCommon · 27f56c12
      Pavel Labath authored
      GetU64 returns a uint64_t. Don't store it in size_t as that is only
      32-bit on 32-bit platforms.
      
      llvm-svn: 369904
      27f56c12
    • Pavel Labath's avatar
      Postfix: move more code out of the PDB plugin · c7deb7f8
      Pavel Labath authored
      Summary:
      Previously we moved the code which parses a single expression out of the PDB
      plugin, because that was useful for DWARF expressions in breakpad. However, FPO
      programs are used in breakpad files too (when unwinding on windows), so this
      completes the job, and moves the rest of the FPO parser too.
      
      Reviewers: amccarth, aleksandr.urakov
      
      Subscribers: aprantl, markmentovai, rnk, lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D66634
      
      llvm-svn: 369894
      c7deb7f8
    • Johan Vikstrom's avatar
      [clangd] Added a colorizer to the vscode extension. · 3b6d7040
      Johan Vikstrom authored
      Summary:
      Adds the main colorizer component. It colorizes every time clangd sends a publishSemanticHighlighting notification.
      Every time it colorizes it does a full recolorization (removes all decorations from the editor and applies new ones). The reason for this is that all ranges for the same scope share a TextEditorDecorationType. This is due to TextEditorDecorationTypes being very expensive to create. The prototype used one DecorationType per range but that ran into very big performance problems (it took >100 ms to apply 600 lines of highlightings which froze the editor).
      
      This version does not share the problem of being extremly slow, but there is probably potential to optimize it even more.
      
      No document/texteditor lifecycle management code in this CL, that will come in the next one.
      
      Reviewers: hokein, ilya-biryukov
      
      Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D66219
      
      llvm-svn: 369893
      3b6d7040
    • Pavel Labath's avatar
      Breakpad: Add support for parsing STACK WIN records · 0a9f47d7
      Pavel Labath authored
      Summary: The fields that aren't useful for us right now are simply ignored.
      
      Reviewers: amccarth, markmentovai
      
      Subscribers: rnk, lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D66633
      
      llvm-svn: 369892
      0a9f47d7
    • Bjorn Pettersson's avatar
      [GWP_ASAN] Avoid using VERSION_GREATER_EQUAL in cmake files · 140f06f1
      Bjorn Pettersson authored
      This is a fixup for r369823 which introduced the use of
      VERSION_GREATER_EQUAL in the cmake config for gwp_asan.
      
      Minimum supported version of cmake in LLVM is 3.4.3 and
      VERSION_GREATER_EQUAL was not introduced until later
      versions of cmake.
      
      llvm-svn: 369891
      140f06f1
    • Fangrui Song's avatar
      [ELF] EhFrameSection: postpone FDE liveness check to finalizeSections · 1681ceb2
      Fangrui Song authored
      EhFrameSection::addSection checks liveness of FDE early. This makes it
      infeasible to move combineEhSections() before ICF.
      
      Postpone the check to EhFrameSection::finalizeContents(). This is what
      ARMExidxSyntheticSection does and it will make a subsequent patch D66717
      simpler.
      
      Reviewed By: ruiu
      
      Differential Revision: https://reviews.llvm.org/D66727
      
      llvm-svn: 369890
      1681ceb2
    • Fangrui Song's avatar
      [ELF] Make LinkerScript::assignAddresses iterative · debcac9f
      Fangrui Song authored
      PR42990. For `SECTIONS { b = a; . = 0xff00 + (a >> 8); a = .; }`,
      we currently set st_value(a)=0xff00 while st_value(b)=0xffff.
      
      The following call tree demonstrates the problem:
      
      ```
      link<ELF64LE>(Args);
        Script->declareSymbols(); // insert a and b as absolute Defined
        Writer<ELFT>().run();
          Script->processSectionCommands();
            addSymbol(cmd);       // a and b are re-inserted. LinkerScript::getSymbolValue
                                  // is lazily called by subsequent evaluation
          finalizeSections();
            forEachRelSec(scanRelocations<ELFT>);
              processRelocAux     // another problem PR42506, not affected by this patch
            finalizeAddressDependentContent(); // loop executed once
              script->assignAddresses(); // a = 0, b = 0xff00
          script->assignAddresses(); // a = 0xff00, _end = 0xffff
      ```
      
      We need another assignAddresses() to finalize the value of `a`.
      
      This patch
      
      1) modifies assignAddress() to track the original section/value of each
        symbol and return a symbol whose section/value has changed.
      2) moves the post-finalizeSections assignAddress() inside the loop
        of finalizeAddressDependentContent() and makes it iterative.
        Symbol assignment may not converge so we make a few attempts before
        bailing out.
      
      Note, assignAddresses() must be called at least twice. The penultimate
      call finalized section addresses while the last finalized symbol values.
      It is somewhat obscure and there was no comment.
      linkerscript/addr-zero.test tests this.
      
      Reviewed By: ruiu
      
      Differential Revision: https://reviews.llvm.org/D66279
      
      llvm-svn: 369889
      debcac9f
    • Gabor Buella's avatar
      [NFC][cmake] Build fix in tools/llvm-config/CMakeLists.txt · 91e2fbad
      Gabor Buella authored
      To avoid the following error message (using cmake version 3.13.4) :
      
      ```
      CMake Error at tools/llvm-config/CMakeLists.txt:37 (string):
      Syntax error in cmake code  when parsing string-std=[^ ]\+Invalid escape sequence \+
      ```
      
      Reviewed By: mgorny
      
      Differential Revision: https://reviews.llvm.org/D58619
      
      llvm-svn: 369887
      91e2fbad
    • Bjorn Pettersson's avatar
      [LoopUnroll] Handle certain PHIs in full unrolling properly · d804bd17
      Bjorn Pettersson authored
      Summary:
      When reconstructing the CFG of the loop after unrolling,
      LoopUnroll could in some cases remove the phi operands of
      loop-carried values instead of preserving them, resulting
      in undef phi values after loop unrolling.
      
      When doing this reconstruction, avoid removing incoming
      phi values for phis in the successor blocks if the successor
      is the block we are jumping to anyway.
      
      Patch-by: ebevhan
      
      Reviewers: fhahn, efriedma
      
      Reviewed By: fhahn
      
      Subscribers: bjope, lebedev.ri, zzheng, dmgreen, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D66334
      
      llvm-svn: 369886
      d804bd17
    • Raphael Isemann's avatar
      [lldb] Construct the dummy target when the first Debugger object is constructed · d43d912b
      Raphael Isemann authored
      Summary:
      We should always have a dummy target, so we might as well construct it directly when we create a Debugger object.
      
      The idea is that if this patch doesn't cause any problems that we can get rid of all the logic
      that handles situations where we don't have a dummy target (as all that code is currently
      untested as there seems to be no way to have no dummy target in LLDB).
      
      Reviewers: labath, jingham
      
      Reviewed By: labath, jingham
      
      Subscribers: jingham, abidh, lldb-commits
      
      Tags: #lldb
      
      Differential Revision: https://reviews.llvm.org/D66581
      
      llvm-svn: 369885
      d43d912b
    • Haojian Wu's avatar
      [clangd] Send highlighting diff beyond the end of the file. · 0a6000f2
      Haojian Wu authored
      Summary: This would make the client life (tracking the changes) easier.
      
      Reviewers: jvikstrom
      
      Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D66541
      
      llvm-svn: 369884
      0a6000f2
    • Raphael Isemann's avatar
      72ca5f36
    • Fangrui Song's avatar
      [ELF] Error if --strip-all and --emit-relocs are used together · 8e5184af
      Fangrui Song authored
      --strip-all suppresses the creation of in.symtab
      This can cause a null pointer dereference in OutputSection::finalize()
      
        // --emit-relocs => copyRelocs is true
        if (!config->copyRelocs || (type != SHT_RELA && type != SHT_REL))
          return;
        ...
        link = in.symTab->getParent()->sectionIndex; // in.symTab is null
      
      Let's just disallow the combination. In some cases the combination can
      cause GNU linkers to fail:
      
      * ld.bfd: final link failed: invalid operation
      * gold: internal error in set_no_output_symtab_entry, at ../../gold/object.h:1814
      
      Reviewed By: ruiu
      
      Differential Revision: https://reviews.llvm.org/D66704
      
      llvm-svn: 369878
      8e5184af
    • Zi Xuan Wu's avatar
      [NFC][Regalloc] Add testcases for D66576 · e18aa1e0
      Zi Xuan Wu authored
      llvm-svn: 369877
      e18aa1e0
    • Amaury Sechet's avatar
      [X86] Automatically generate stack folding tests. NFC · 1ec3ad9e
      Amaury Sechet authored
      llvm-svn: 369876
      1ec3ad9e
    • Sanjay Patel's avatar
      [Hexagon] remove noise from tests; NFC · 7bd08fba
      Sanjay Patel authored
      llvm-svn: 369875
      7bd08fba
    • Sanjay Patel's avatar
      [Hexagon][x86] add tests for bit-test; NFC · b882c973
      Sanjay Patel authored
      More coverage for D66687
      (assuming we make this a generic combine with TLI hook).
      
      llvm-svn: 369874
      b882c973
    • Dmitri Gribenko's avatar
      [Wdocumentation] improve wording of a warning message · c955e4a9
      Dmitri Gribenko authored
      Based on @davezarzycki remarks in D64696 improved the wording of the warning
      message.
      
      Differential Revision: https://reviews.llvm.org/D66700
      
      Patch by Mark de Wever.
      
      llvm-svn: 369873
      c955e4a9
    • Craig Topper's avatar
      [X86][DAGCombiner] Teach narrowShuffle to use concat_vectors instead of inserting into undef · b8b90ac1
      Craig Topper authored
      Summary:
      Concat_vectors is more canonical during early DAG combine. For example, its what's used by SelectionDAGBuilder when converting IR shuffles into SelectionDAG shuffles when element counts between inputs and mask don't match. We also have combines in DAGCombiner than can pull concat_vectors through a shuffle. See partitionShuffleOfConcats. So it seems like concat_vectors is a better operation to use here. I had to teach DAGCombiner's SimplifyVBinOp to also handle concat_vectors with undef. I haven't checked yet if we can remove the INSERT_SUBVECTOR version in there or not.
      
      I didn't want to mess with the other caller of getShuffleHalfVectors that's used during shuffle lowering where insert_subvector probably is what we want to produce so I've enabled this via a boolean passed to the function.
      
      Reviewers: spatel, RKSimon
      
      Reviewed By: RKSimon
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D66504
      
      llvm-svn: 369872
      b8b90ac1
  2. Aug 25, 2019