1. Jun 05, 2018
    • Marc-Andre Laperle's avatar
      [clangd] Remove unused variables · d41bc700
      Marc-Andre Laperle authored
      Summary: Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com>
      
      Subscribers: klimek, ilya-biryukov, ioeric, MaskRay, jkorous, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D47737
      
      llvm-svn: 334018
      d41bc700
    • Marc-Andre Laperle's avatar
      [clangd] Add "member" symbols to the index · 945b5a3d
      Marc-Andre Laperle authored
      
      
      Summary:
      This adds more symbols to the index:
      - member variables and functions
      - enum constants in scoped enums
      
      The code completion behavior should remain intact but workspace symbols should
      now provide much more useful symbols.
      Other symbols should be considered such as the ones in "main files" (files not
      being included) but this can be done separately as this introduces its fair
      share of problems.
      
      Signed-off-by: default avatarMarc-Andre Laperle <marc-andre.laperle@ericsson.com>
      
      Reviewers: ioeric, sammccall
      
      Reviewed By: ioeric, sammccall
      
      Subscribers: hokein, sammccall, jkorous, klimek, ilya-biryukov, jkorous-apple, ioeric, MaskRay, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D44954
      
      llvm-svn: 334017
      945b5a3d
    • Gabor Buella's avatar
      [X86] NFC Fix typo introduced in r328016 HSI->HDI · 1181f94a
      Gabor Buella authored
      llvm-svn: 334016
      1181f94a
    • Krzysztof Parzyszek's avatar
      [Hexagon] Minor cleanups in isel lowering · aafb8c20
      Krzysztof Parzyszek authored
      llvm-svn: 334015
      aafb8c20
    • Sam McCall's avatar
      [clangd] Test tweaks (consistency, shorter, doc). NFC · db41e1c6
      Sam McCall authored
      llvm-svn: 334014
      db41e1c6
    • Aaron Ballman's avatar
      Silence a "truncation from double to float" diagnostic in MSVC; NFC. · b1403fa0
      Aaron Ballman authored
      llvm-svn: 334013
      b1403fa0
    • Pavel Labath's avatar
      DWARFIndex: more GetFunctions cleanup · 6de9c79e
      Pavel Labath authored
      This applies similar simplification as r334004, only it touches the
      regex version of the method.
      
      llvm-svn: 334012
      6de9c79e
    • Hiroshi Inoue's avatar
      [PowerPC] reduce rotate in BitPermutationSelector · 955655f5
      Hiroshi Inoue authored
      BitPermutationSelector builds the output value by repeating rotate-and-mask instructions with input registers.
      Here, we may avoid one rotate instruction if we start building from an input register that does not require rotation.
      
      For example of the test case bitfieldinsert.ll, it first rotates left r4 by 8 bits and then inserts some bits from r5 without rotation.
      This can be executed by one rlwimi instruction, which rotates r4 by 8 bits and inserts its bits into r5.
      
      This patch adds a check for rotation amounts in the comparator used in sorting to process the input without rotation first.
      
      Differential Revision: https://reviews.llvm.org/D47765
      
      llvm-svn: 334011
      955655f5
    • Simon Pilgrim's avatar
      [X86][SSE] Fix line endings for shuffle-vs-trunc tests. NFCI. · 613fea20
      Simon Pilgrim authored
      Strip native eol property which we don't use in this folder.
      
      llvm-svn: 334010
      613fea20
    • Pavel Labath's avatar
      dotest: make inline tests compatible with -f · 66377385
      Pavel Labath authored
      Summary:
      This is split off from D47265 where I needed to be able to invoke every test
      with -f. That patch is kinda dead now, but this part seems like a good
      cleanup anyway.
      
      The problem with inline tests was in the way we were adding methods to
      the class, which left them with an incorrect __name__ property. This
      prevented dotest from finding them with -f.
      
      I fix this with (what I think is) the correct way of dynamically
      creating classes -- passing the list of methods during type construction
      instead of fixing up the class afterwards. Among other things this has
      the advantage of not needing to do anything special for debug info
      variants. As our test method will be visible to the metaclass, it will
      automagically do the multiplication for us.
      
      Reviewers: JDevlieghere, aprantl, tberghammer
      
      Subscribers: eraman, lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D47579
      
      llvm-svn: 334009
      66377385
    • Clement Courbet's avatar
      [llvm-exegesis] Add instructions to BenchmarkResult Key. · 53d35d2d
      Clement Courbet authored
      We want llvm-exegesis to explore instructions (effect of initial register values, effect of operand selection). To enable this a BenchmarkResult muststore all the relevant data in its key. This patch starts adding such data. Here we simply allow to store the generated instructions, following patches will add operands and initial values for registers.
      
      https://reviews.llvm.org/D47764
      
      Authored by: Guilluame Chatelet
      
      llvm-svn: 334008
      53d35d2d
    • Simon Pilgrim's avatar
      [X86][SSE] Add target shuffle support to X86TargetLowering::computeKnownBitsForTargetNode · fef9b6ee
      Simon Pilgrim authored
      Ideally we'd use resolveTargetShuffleInputs to handle faux shuffles as well but:
      (a) that code path doesn't handle general/pre-legalized ops/types very well.
      (b) I'm concerned about the compute time as they recurse to calls to computeKnownBits/ComputeNumSignBits which would need depth limiting somehow.
      
      llvm-svn: 334007
      fef9b6ee
    • Pavel Labath's avatar
      Fix windows build broken by r334004 · df4ca0ee
      Pavel Labath authored
      The problem was a link error due to a missing =0 on an abstract method.
      Interestingly, this was not a problem for clang/linux.
      
      llvm-svn: 334006
      df4ca0ee
    • Gabor Buella's avatar
      [X86] NFC Refactor some code in InstPrinters · 349ffcee
      Gabor Buella authored
      Summary:
      Bringing some come duplicated in the AT&T and the Intel printers
      into a common parent class.
      
      Reviewers: craig.topper
      
      Reviewed By: craig.topper
      
      Differential Revision: https://reviews.llvm.org/D47682
      
      llvm-svn: 334005
      349ffcee
    • Pavel Labath's avatar
      DWARFIndex: simplify GetFunctions methods · 5af11ab2
      Pavel Labath authored
      Now that Apple index determines method-ness straight from the debug
      info, we don't need to resolve the functions into SymbolContexts inside
      the Index classes. This removes the need for callback arguments and
      allows us to pull the common parts out of the two implementations of
      these functions back into the SymbolFileDWARF class.
      
      Reviewers: JDevlieghere, clayborg
      
      Subscribers: aprantl, lldb-commits
      
      Differential Revision: https://reviews.llvm.org/D47147
      
      llvm-svn: 334004
      5af11ab2
    • Pavel Labath's avatar
      Really fix ClangParserTest · 4e34bfcb
      Pavel Labath authored
      It turns out the test needs a fixture after all (to initialize HostInfo), so
      provide one that does that.
      
      llvm-svn: 334003
      4e34bfcb
    • Dean Michael Berris's avatar
      [XRay][compiler-rt] Use DCHECK instead of assert(...) (NFC) · 4c1fdcfb
      Dean Michael Berris authored
      Use DCHECK instead of assert(...) in the XRay runtime.
      
      llvm-svn: 334002
      4c1fdcfb
    • Dean Michael Berris's avatar
      [XRay][compiler-rt] Use static instead of inline (NFC) · 13b2fcc4
      Dean Michael Berris authored
      We don't actually need to support multiple definitions of the functions
      in FDR mode, but rather want to make sure that the implementation-detail
      functions are marked as 'static' instead. This allows the inliner to do
      its magic better for these functions too, since inline functions must
      have a unique address across translation units.
      
      llvm-svn: 334001
      13b2fcc4
    • Dean Michael Berris's avatar
      [XRay][compiler-rt] Remove __xray:: in some places (NFC) · abbeb4cb
      Dean Michael Berris authored
      This is a cosmetic change to remove unnecessary full-qualifications of
      types/functions that are already in the __xray:: namespace.
      
      llvm-svn: 334000
      abbeb4cb
    • Ilya Biryukov's avatar
      Silence unhandled enums warning in ClangASTContext::GetEncoding · fc48ac61
      Ilya Biryukov authored
      The warning started firing after r333923, which added new builtin
      types (fixed point types) into clang.
      This patch merely silences the warning to unblock our integrate, does
      not aim to support the new types in lldb.
      
      llvm-svn: 333999
      fc48ac61
    • Dean Michael Berris's avatar
      [XRay][compiler-rt] Remove namespace __xray_fdr_internal (NFC) · bd37b57b
      Dean Michael Berris authored
      We no longer need the __xray_fdr_internal namespace.
      
      llvm-svn: 333998
      bd37b57b
    • Peter Smith's avatar
      [MC][ARM] Add range checking for Thumb2 resolved fixups. · ef945b22
      Peter Smith authored
      When the branch target of a Thumb2 unconditional or conditonal branch is
      resolved at assembly time, no range checking is performed on the result
      leading to incorrect immediates. This change adds a range check:
      +- 16 Megabytes for unconditional branches, +- 1 Megabyte for the
      conditional branch.
      
      Differential Revision: https://reviews.llvm.org/D46306
      
      llvm-svn: 333997
      ef945b22
    • Pavel Labath's avatar
      Fixup r333987 · 3489b1ad
      Pavel Labath authored
      - add #include <atomic> (fixes windows build)
      - remove std::move (fixes "using move prevents copy ellision" warnings)
      
      llvm-svn: 333996
      3489b1ad
    • Simon Pilgrim's avatar
      [X86][SSE] Add basic PACKUS support to X86TargetLowering::computeKnownBitsForTargetNode · 7bbe7a29
      Simon Pilgrim authored
      Helps improve analysis of saturation ops
      
      llvm-svn: 333995
      7bbe7a29
    • Sam McCall's avatar
      [clang-tidy] fix broken test (no compile command) from r331763 · 1cd9ee8e
      Sam McCall authored
      llvm-svn: 333994
      1cd9ee8e
    • Sam McCall's avatar
      [clangd] Rewrite JSON dispatcher loop using C IO (FILE*) instead of std::istream. · 27a07cf8
      Sam McCall authored
      Summary:
      The EINTR loop around getline was added to fix an issue with mac gdb, but seems
      to loop infinitely in rare cases on linux where the parent editor exits (most
      reports with VSCode).
      I can't work out how to fix this in a portable way with std::istream, but the
      C APIs have clearer contracts and LLVM has a RetryAfterSignal function for use
      with them which seems battle-tested.
      
      While here, clean up some inconsistency around \n in log messages (now
      add it only after JSON payloads), and reduce the scope of the
      long-message handling which was only really added to fight fuzzers.
      
      Reviewers: malaperle, ilya-biryukov
      
      Subscribers: klimek, ioeric, jkorous, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D47643
      
      llvm-svn: 333993
      27a07cf8
    • Pavel Labath's avatar
      Fix ClangParserTest.cpp · 8d1421d3
      Pavel Labath authored
      The test does not use a test fixture, so it needs to be declared with
      the TEST macro.
      
      llvm-svn: 333992
      8d1421d3
    • Peter Smith's avatar
      [MC][ARM] Correct Thumb BL instruction range · 0aafe0ce
      Peter Smith authored
      The Thumb BL range is + or - either 16 Megabytes or 4 Megabytes depending
      on whether the CPU supports Thumb2 or the v8-m baseline ops. The existing
      check for BL range is incorrectly set at +- 32 Megabytes. This change
      corrects the higher range and uses the lower range if the featurebits
      don't have the necessary support for it.
      
      Differential Revision: https://reviews.llvm.org/D46305
      
      llvm-svn: 333991
      0aafe0ce
    • Alexander Ivchenko's avatar
      [X86][CET] Shadow stack fix for setjmp/longjmp · 964b27fa
      Alexander Ivchenko authored
      This is the new version of D46181, allowing setjmp/longjmp
      to work correctly with the Intel CET shadow stack by storing
      SSP on setjmp and fixing it on longjmp. The patch has been
      updated to use the cf-protection-return module flag instead
      of HasSHSTK, and the bug that caused D46181 to be reverted
      has been fixed with the test expanded to track that fix.
      
      patch by mike.dvoretsky
      
      Differential Revision: https://reviews.llvm.org/D47311
      
      llvm-svn: 333990
      964b27fa
    • Jeremy Morse's avatar
      Detect an incompatible VLA pointer assignment · 8129c5c0
      Jeremy Morse authored
      For pointer assignments of VLA types, Clang currently detects when array
      dimensions _lower_ than a variable dimension differ, and reports a warning.
      However it does not do the same when the _higher_ dimensions differ, a
      case that GCC does catch.
      
      These two pointer types
      
          int (*foo)[1][bar][3];
          int (*baz)[1][2][3];
      
      are compatible with each another, and the program is well formed if
      bar == 2, a matter that is the programmers problem. However the following:
      
          int (*qux)[2][2][3];
      
      would not be compatible with either, because the upper dimension differs
      in size. Clang reports baz is incompatible with qux, but not that foo is
      incompatible with qux because it doesn't check those higher dimensions.
      
      Fix this by comparing array sizes on higher dimensions: if both are
      constants but unequal then report incompatibility; if either dimension is
      variable then we can't know either way.
      
      Differential Revision: https://reviews.llvm.org/D47628
      
      llvm-svn: 333989
      8129c5c0
    • Tobias Grosser's avatar
      Fix formatting · a998f98b
      Tobias Grosser authored
      llvm-svn: 333988
      a998f98b
    • Jan Kratochvil's avatar
      Protect DWARFCompileUnit::m_die_array by new mutexes · c8e357f7
      Jan Kratochvil authored
      If BuildAddressRangeTable called ExtractDIEsIfNeeded(false), then another
      thread started processing data from m_die_array and then the first thread
      called final ClearDIEs() the second thread would crash.
      
      It is also required without multithreaded debugger using DW_TAG_partial_unit
      for DWZ.
      
      Differential revision: https://reviews.llvm.org/D40470
      
      llvm-svn: 333987
      c8e357f7
    • Dean Michael Berris's avatar
      [XRay][compiler-rt] Merge XRay FDR mode into a single file (NFC) · 7f88ea1f
      Dean Michael Berris authored
      We planned to have FDR mode's internals unit-tested but it turns out
      that we can just use end-to-end testing to verify the implementation.
      We're going to move towards that approach more and more going forward,
      so we're merging the implementation details of FDR mode into a single
      .cc file.
      
      We also avoid globbing in the XRay test helper macro, and instead list
      down the files from the lib directory.
      
      llvm-svn: 333986
      7f88ea1f
    • Kamil Rytarowski's avatar
      Introduce CheckASLR() in sanitizers · 7d260775
      Kamil Rytarowski authored
      Summary:
      At least the ASan, MSan, TSan sanitizers require disabled ASLR on a NetBSD.
      
      Introduce a generic CheckASLR() routine, that implements a check for the
      current process. This flag depends on the global or per-process settings.
      
      There is no simple way to disable ASLR in the build process from the
      level of a sanitizer or during the runtime execution.
      
      With ASLR enabled sanitizers that operate over the process virtual address
      space can misbehave usually breaking with cryptic messages.
      
      This check is dummy for !NetBSD.
      
      Sponsored by <The NetBSD Foundation>
      
      Reviewers: vitalybuka, joerg
      
      Reviewed By: vitalybuka
      
      Subscribers: cryptoad, kubamracek, llvm-commits, #sanitizers
      
      Tags: #sanitizers
      
      Differential Revision: https://reviews.llvm.org/D47442
      
      llvm-svn: 333985
      7d260775
    • Craig Topper's avatar
      [X86] Make all instructions that operate on MMX types, but were added after... · f17b33d6
      Craig Topper authored
      [X86] Make all instructions that operate on MMX types, but were added after the initial MMX support via one of the SSE features flags make them require the MMX feature as well.
      
      Passing -mattr=-mmx needs to disable these instructions since the MMX register class won't have been set up. But we don't want -mattr=-mmx to disable SSE so we have to do it separately.
      
      llvm-svn: 333984
      f17b33d6
    • Dean Michael Berris's avatar
      [XRay][compiler-rt] Remove __sanitizer:: from namespace __xray (NFC) · 5eaaff60
      Dean Michael Berris authored
      This is a non-functional change that removes the full qualification of
      functions in __sanitizer:: being used in __xray.
      
      llvm-svn: 333983
      5eaaff60
    • Dean Michael Berris's avatar
      [XRay][compiler-rt] Remove reliance on C++ ABI from BufferQueue · 8ba925d2
      Dean Michael Berris authored
      Summary:
      This is part of the work to address http://llvm.org/PR32274.
      
      We remove the calls to array-placement-new and array-delete. This allows
      us to rely on the internal memory management provided by
      sanitizer_common/sanitizer_internal_allocator.h.
      
      Reviewers: eizan, kpw
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D47695
      
      llvm-svn: 333982
      8ba925d2
    • Nirav Dave's avatar
      [RegAllocGreedy] Use simpler map class for EvicteeInfo. NFCI. · e5eb9966
      Nirav Dave authored
      RegAlloc keeps a insertion-time ordered map of evictee information,
      but we only use membership. Replace MapVector with contextually
      equivalent DenseMap which is smaller and faster.
      
      llvm-svn: 333981
      e5eb9966
    • Craig Topper's avatar
      [X86] Mark all the builtins and intrinsics that require MMX and an SSE feature... · 9b0c61e9
      Craig Topper authored
      [X86] Mark all the builtins and intrinsics that require MMX and an SSE feature as requiring both mmx and the sse feature.
      
      Previously we only checked the sse feature, but this means that if you passed -mno-mmx, the builtins/intrinsics wouldn't be disabled in the frontend and would instead fail backend isel.
      
      llvm-svn: 333980
      9b0c61e9
    • Petr Hosek's avatar
      [Driver][Fuchsia] Pass LTO flags to linker · 03eece72
      Petr Hosek authored
      Even though we use lld by default for Fuchsia, we use Gold plugin
      arguments like all other drivers as lld supports Gold plugin options.
      
      Differential Revision: https://reviews.llvm.org/D47668
      
      llvm-svn: 333979
      03eece72