1. Aug 27, 2019
  2. Aug 26, 2019
    • Wei Mi's avatar
      [SampleFDO] Extract the code calling each section reader to readOneSection. · 077a9c70
      Wei Mi authored
      This is a followup of https://reviews.llvm.org/D66513. The code calling each
      section reader should be put into a separate function (readOneSection), so
      SampleProfileExtBinaryReader can override it. Otherwise, the base class
      SampleProfileExtBinaryBaseReader will need to be aware of all different kinds
      of section readers. That is not right.
      
      Differential Revision: https://reviews.llvm.org/D66693
      
      llvm-svn: 369919
      077a9c70
    • Dmitri Gribenko's avatar
      Moved GlobList into a separate header file · a6fed93f
      Dmitri Gribenko authored
      Summary:
      It is a separate abstraction that is used in more contexts than just
      a helper for ClangTidyDiagnosticConsumer.
      
      Subscribers: mgorny, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D66747
      
      llvm-svn: 369918
      a6fed93f
    • Kadir Cetinkaya's avatar
      [clangd] Add docs for configuration knobs in clangd · 3aeed0fd
      Kadir Cetinkaya authored
      Summary:
      This is a first step in documenting different configuration knobs we
      have in clangd.
      
      Reviewers: sammccall
      
      Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D66740
      
      llvm-svn: 369917
      3aeed0fd
    • Martin Probst's avatar
      clang-format: [JS] handle `as const`. · 5836472a
      Martin Probst authored
      Summary:
      TypeScript 3.4 supports casting into a const type using `as const`:
      
          const x = {x: 1} as const;
      
      Previously, clang-format would insert a space after the `const`. With
      this patch, no space is inserted after the sequence `as const`.
      
      Reviewers: krasimir
      
      Subscribers: cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D66736
      
      llvm-svn: 369916
      5836472a
    • Yitzhak Mandelbaum's avatar
      [clang-tidy][NFC] Qualify `makeRule` call in test, for consistency with other calls. · 0cd4ab91
      Yitzhak Mandelbaum authored
      One call `makeRule` is unqualified (and unintentionally relying on ADL to
      resolve correctly). This revision qualifies that call for consistency and to
      drop use of ADL.
      
      llvm-svn: 369915
      0cd4ab91
    • Yitzhak Mandelbaum's avatar
      [clang-tidy] TransformerClangTidyCheck: change choice of location for diagnostic message. · 640230cc
      Yitzhak Mandelbaum authored
      Summary:
      This patch changes the location specified to the
      `ClangTidyCheck::diag()`. Currently, the beginning of the matched range is
      used. This patch uses the beginning of the first fix's range.  This change both
      simplifies the code and (hopefully) gives a more intuitive result: the reported
      location aligns with the fix(es) provided, rather than the (arbitrary) range of
      the rule's match.
      
      N.B. this patch will break the line offset numbers in lit tests if the first fix
      is not at the beginning of the match.
      
      Reviewers: gribozavr
      
      Subscribers: xazax.hun, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D66676
      
      llvm-svn: 369914
      640230cc
    • Johan Vikstrom's avatar
      [clangd] Handling text editor/document lifetimes in vscode extension. · 1c9aa70b
      Johan Vikstrom authored
      Summary:
      Just reapplies highlightings for all files when visible text editors change. Could find the correct text editor that should be reapplied but going for a simple implementation instead.
      Removes the associated highlighting entry from the Colorizer when a text document is closed.
      
      Reviewers: hokein, ilya-biryukov
      
      Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D66735
      
      llvm-svn: 369911
      1c9aa70b
    • Pavel Labath's avatar
      Really fix the type mismatch error in GDBRemoteCommunicationServerCommon · 341df3f1
      Pavel Labath authored
      My previous attempt in attempt in r369904 actually broke the 32bit build
      because File::Read expects to take a reference to size_t. Fix the
      warning by using SIZE_MAX to denote failure instead.
      
      llvm-svn: 369910
      341df3f1
    • Amaury Sechet's avatar
      [X86] Automatically generate various tests. NFC · 298c0b35
      Amaury Sechet authored
      llvm-svn: 369909
      298c0b35
    • Tatyana Krasnukha's avatar
      [ProcessWindows] Remove equivalent macros · 55aafa35
      Tatyana Krasnukha authored
      llvm-svn: 369908
      55aafa35
    • Pavel Labath's avatar
      Move ProcessInstanceInfoTest to Utility · b54efd28
      Pavel Labath authored
      The class under test was moved in r355342. This moves the test code too.
      
      llvm-svn: 369907
      b54efd28
    • Pavel Labath's avatar
      ProcessInstanceInfo: Fix dumping of invalid user ids · 602f29fd
      Pavel Labath authored
      Don't attempt to print invalid user ids. Previously, these would come
      out as UINT32_MAX, or as an assertion failure.
      
      llvm-svn: 369906
      602f29fd
    • 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
  3. Aug 25, 2019