1. Sep 28, 2019
  2. Sep 27, 2019
    • Simon Pilgrim's avatar
      FunctionImportGlobalProcessing::processGlobalForThinLTO - silence static... · f71f23d1
      Simon Pilgrim authored
      FunctionImportGlobalProcessing::processGlobalForThinLTO - silence static analyzer dyn_cast<FunctionSummary> null dereference warning. NFCI.
      
      The static analyzer is warning about a potential null dereference, but we should be able to use cast<FunctionSummary> directly and if not assert will fire for us.
      
      llvm-svn: 373097
      f71f23d1
    • Luis Marques's avatar
      [RISCV] Rename FPRs and use Register arithmetic · aae97bfd
      Luis Marques authored
      The new names for FPRs ensure that the Register values within the same class are
      enumerated consecutively (the order is determined by the `LessRecordRegister`
      function object). Where there were tables mapping between 32- and 64-bit FPRs
      (and vice versa) this patch replaces them with Register arithmetic. The
      enumeration order between different register classes is expected to continue to
      be arbitrary, although it does impact the conversion from the (overloaded) asm
      FPR names to Register values, and therefore might require updates to the target
      if the sorting algorithm is changed. Static asserts were added to ensure that
      changes to the ordering that would impact the current implementation are
      detected.
      
      Differential Revision: https://reviews.llvm.org/D67423
      
      llvm-svn: 373096
      aae97bfd
    • Simon Pilgrim's avatar
      SCCP - silence static analyzer dyn_cast<StructType> null dereference warning. NFCI. · 623b0e69
      Simon Pilgrim authored
      The static analyzer is warning about a potential null dereference, but we should be able to use cast<StructType> directly and if not assert will fire for us.
      
      llvm-svn: 373095
      623b0e69
    • Dmitry Preobrazhensky's avatar
      [AMDGPU][MC] Corrected parsing of registers · 436d5b33
      Dmitry Preobrazhensky authored
      Summary of changes:
      
      refactored code for better readability and future improvements;
      fixed bug 41281: https://bugs.llvm.org/show_bug.cgi?id=41281
      
      Reviewers: artem.tamazov, arsenm
      
      Differential Revision: https://reviews.llvm.org/D65224
      
      llvm-svn: 373094
      436d5b33
    • Yitzhak Mandelbaum's avatar
      [libTooling] Transformer: refine `SourceLocation` specified as anchor of changes. · db24ef50
      Yitzhak Mandelbaum authored
      Summary: Every change triggered by a rewrite rule is anchored at a particular
      location in the source code.  This patch refines how that location is chosen and
      defines it as an explicit function so it can be shared by other Transformer
      implementations.
      
      This patch was inspired by a bug found by a clang tidy, wherein two changes were
      anchored at the same location (the expansion loc of the macro) resulting in the
      discarding of the second change.
      
      Reviewers: gribozavr
      
      Subscribers: cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D66652
      
      llvm-svn: 373093
      db24ef50
    • Louis Dionne's avatar
      [libc++] Take 2: Implement LWG 3158 · 59e26308
      Louis Dionne authored
      Summary:
      LWG 3158 marks the allocator_arg_t constructor of std::tuple as
      conditionnally explicit based on whether the default constructors
      of the tuple's members are explicitly default constructible.
      
      This was previously committed as r372778 and reverted in r372832 due to
      the commit breaking LLVM's build in C++14 mode. This issue has now been
      addressed.
      
      Reviewers: mclow.lists
      
      Subscribers: christof, jkorous, dexonsmith, libcxx-commits
      
      Tags: #libc
      
      Differential Revision: https://reviews.llvm.org/D65232
      
      llvm-svn: 373092
      59e26308
    • Lawrence D'Anna's avatar
      remove File::SetStream(), make new files instead. · 7ca15ba7
      Lawrence D'Anna authored
      Summary:
      This patch removes File::SetStream() and File::SetDescriptor(),
      and replaces most direct uses of File with pointers to File.
      Instead of calling SetStream() on a file, we make a new file and
      replace it.
      
      My ultimate goal here is to introduce a new API class SBFile, which
      has full support for python io.IOStream file objects.   These can
      redirect read() and write() to python code, so lldb::Files will
      need a way to dispatch those methods.   Additionally it will need some
      form of sharing and assigning files, as a SBFile will be passed in and
      assigned to the main IO streams of the debugger.
      
      In my prototype patch queue, I make File itself copyable and add a
      secondary class FileOps to manage the sharing and dispatch.  In that
      case SBFile was a unique_ptr<File>.
      (here: https://github.com/smoofra/llvm-project/tree/files)
      
      However in review, Pavel Labath suggested that it be shared_ptr instead.
      (here: https://reviews.llvm.org/D67793)
      
      In order for SBFile to use shared_ptr<File>, everything else should
      as well.
      
      If this patch is accepted, I will make SBFile use a shared_ptr
      I will remove FileOps from future patches and use subclasses of File
      instead.
      
      Reviewers: JDevlieghere, jasonmolenda, zturner, jingham, labath
      
      Reviewed By: labath
      
      Subscribers: lldb-commits
      
      Tags: #lldb
      
      Differential Revision: https://reviews.llvm.org/D67891
      
      llvm-svn: 373090
      7ca15ba7
    • Djordje Todorovic's avatar
      [DebugInfo] Exclude memory location values as parameter entry values · eb4c98ca
      Djordje Todorovic authored
      Abandon describing of loaded values due to safety concerns. Loaded
      values are described as derefed memory location at caller point.
      At callee we can unintentionally change that memory location which
      would lead to different entry being printed value before and after
      the memory location clobbering. This problem is described in
      llvm.org/PR43343.
      
      Patch by Nikola Prica
      
      Differential Revision: https://reviews.llvm.org/D67717
      
      llvm-svn: 373089
      eb4c98ca
    • Sven van Haastregt's avatar
      [OpenCL] Pass LangOptions as const ref · 2319eb65
      Sven van Haastregt authored
      llvm-svn: 373088
      2319eb65
    • Clement Courbet's avatar
      [llvm-exegesis] Fix r373083: Module -> Mod. · 24078fe1
      Clement Courbet authored
      SnippetRepetitorTest.cpp:66:27: error: declaration of ‘std::unique_ptr<llvm::Module> llvm::exegesis::{anonymous}::X86SnippetRepetitorTest::Module’ [-fpermissive]
         std::unique_ptr<Module> Module;
      
      llvm-svn: 373087
      24078fe1
    • Nico Weber's avatar
      gn build: (manually) merge r373082 · 171c12bb
      Nico Weber authored
      llvm-svn: 373086
      171c12bb
    • GN Sync Bot's avatar
      gn build: Merge r373083 · 940d0e2b
      GN Sync Bot authored
      llvm-svn: 373085
      940d0e2b
    • Jesper Antonsson's avatar
      [CodeGenPrepare] Mend "avoid crashing from replacing a phi twice" fix. · 39b81f1c
      Jesper Antonsson authored
      Summary:
      An erroneously negated if-statement by an earlier (March 2019) bugfix left phi replacement/simplification under optimizeMemoryInst()  in CodeGenPrepare largely inactivated. The error was found when csmith found that the same assert as in the original bug report could still be triggered in a different way. This patch fixes the bugfix. The original bug was:
       https://bugs.llvm.org/show_bug.cgi?id=41052
      ... and the previous fix was D59358.
      
      Reviewers: aprantl, skatkov
      
      Reviewed By: skatkov
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D67838
      
      llvm-svn: 373084
      39b81f1c
    • Clement Courbet's avatar
      [llvm-exegesis] Add loop mode for repeating the snippet. · 9431b72c
      Clement Courbet authored
      Summary:
      Before this change the Executable function was made by duplicating the
      snippet. This change adds a --repetion-mode={loop|duplicate} flag that
      allows choosing between this behaviour and wrapping the snippet instructions
      in a loop.
      
      The new mode can help measurements when the snippet fits in the DSB by
      short-cirtcuiting decoding. The loop adds a dec + jmp to the measurements, but
      since these are not part of the critical path, they execute in parallel
      with the measured code and do not impact measurements in practice.
      
      Overview of the change:
       - New SnippetRepetitor abstraction that handles repeating the snippet.
         The assembler delegates repeating the instructions to this class.
       - ExegesisTarget learns how to decrement loop counter and jump.
       - Some refactoring of the assembler into FunctionFiller/BasicBlockFiller.
      
      Reviewers: gchatelet
      
      Subscribers: mgorny, tschuett, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D68125
      
      llvm-svn: 373083
      9431b72c
    • Nico Weber's avatar
      clang-tidy: Don't repeat list of all checks in three places. · d69fa737
      Nico Weber authored
      Instead, put all checks in a cmake variable and reference this.
      
      Also, make clangd use the the ClangTidyForceLinker.h header instead
      of duplicating the list of modules -- the duplicate copy was missing
      the new "darwin" checker added in r373065.
      
      Differential Revision: https://reviews.llvm.org/D68132
      
      llvm-svn: 373082
      d69fa737
    • Guillaume Chatelet's avatar
      [Alignment][NFC] Remove unneeded llvm:: scoping on Align types · 18f805a7
      Guillaume Chatelet authored
      llvm-svn: 373081
      18f805a7
    • Haojian Wu's avatar
      [clangd] Remove an unrelated comment, NFC. · 7e317cab
      Haojian Wu authored
      llvm-svn: 373079
      7e317cab
    • Martin Storsjo's avatar
      [clang] [AST] Treat "inline gnu_inline" the same way as "extern inline gnu_inline" in C++ mode · 71decf84
      Martin Storsjo authored
      This matches how GCC handles it, see e.g. https://gcc.godbolt.org/z/HPplnl.
      GCC documents the gnu_inline attribute with "In C++, this attribute does
      not depend on extern in any way, but it still requires the inline keyword
      to enable its special behavior."
      
      The previous behaviour of gnu_inline in C++, without the extern
      keyword, can be traced back to the original commit that added
      support for gnu_inline, SVN r69045.
      
      Differential Revision: https://reviews.llvm.org/D67414
      
      llvm-svn: 373078
      71decf84
    • Martin Storsjo's avatar
      [LLD] Simplify the demangleItanium function. NFC. · 5ebab1f8
      Martin Storsjo authored
      Instead of returning an optional, just return the input string if
      demangling fails, as that's what all callers use anyway.
      
      Differential Revision: https://reviews.llvm.org/D68015
      
      llvm-svn: 373077
      5ebab1f8
    • Martin Storsjo's avatar
      [LLD] Convert demangleItanium to use the higher level llvm::demangle function. NFC. · dd71b2d4
      Martin Storsjo authored
      This avoids a few lines of boilerplate of dealing with C string
      allocations.
      
      Add a testcase for a case where demangling shouldn't happen.
      
      Differential Revision: https://reviews.llvm.org/D68014
      
      llvm-svn: 373076
      dd71b2d4
    • Martin Storsjo's avatar
      [LLD] [COFF] Use the unified llvm demangle frontend function. NFC. · bf6f4e99
      Martin Storsjo authored
      Add test cases for some cases where we don't want demangling to happen.
      
      Differential Revision: https://reviews.llvm.org/D67301
      
      llvm-svn: 373075
      bf6f4e99
    • Djordje Todorovic's avatar
      [lldb] Disable testing entry values as memory location · 06bc9d57
      Djordje Todorovic authored
      The D67717 excludes such locations for now.
      
      llvm-svn: 373074
      06bc9d57
    • Pavel Labath's avatar
      [lldb/cmake] add lldbCore -> clangDriver dependency · 7b8f5465
      Pavel Labath authored
      ModuleList.cpp includes clang/Driver/Driver.h. Reflect that in the build
      system. Not having this can cause build failures if ModuleList.cpp is
      built before Driver.inc is generated.
      
      llvm-svn: 373073
      7b8f5465
    • Pavel Labath's avatar
      Unwind: Add a stack scanning mechanism to support win32 unwinding · a8b284ee
      Pavel Labath authored
      Summary:
      Windows unwinding is weird. The unwind rules do not (always) describe
      the precise layout of the stack, but rather expect the debugger to scan
      the stack for something which looks like a plausible return address, and
      the unwind based on that. The reason this works somewhat reliably is
      because the the unwinder also has access to the frame sizes of the
      functions on the stack. This allows it (in most cases) to skip function
      pointers in local variables or function arguments, which could otherwise
      be mistaken for return addresses.
      
      Implementing this kind of unwind mechanism in lldb was a bit challenging
      because we expect to be able to statically describe (in the UnwindPlan)
      structure, the layout of the stack for any given instruction. Giving a
      precise desription of this is not possible, because it requires
      correlating information from two functions -- the pushed arguments to a
      function are considered a part of the callers stack frame, and their
      size needs to be considered when unwinding the caller, but they are only
      present in the unwind entry of the callee. The callee may end up being
      in a completely different module, or it may not even be possible to
      determine it statically (indirect calls).
      
      This patch implements this functionality by introducing a couple of new
      APIs:
      SymbolFile::GetParameterStackSize - return the amount of stack space
        taken up by parameters of this function.
      SymbolFile::GetOwnFrameSize - the size of this function's frame. This
        excludes the parameters, but includes stuff like local variables and
        spilled registers.
      
      These functions are then used by the unwinder to compute the estimated
      location of the return address. This address is not always exact,
      because the stack may contain some additional values -- for instance, if
      we're getting ready to call a function then the stack will also contain
      partially set up arguments, but we will not know their size because we
      haven't called the function yet. For this reason the unwinder will crawl
      up the stack from the return address position, and look for something
      that looks like a possible return address. Currently, we assume that
      something is a valid return address if it ends up pointing to an
      executable section.
      
      All of this logic kicks in when the UnwindPlan sets the value of CFA as
      "isHeuristicallyDetected", which is also the final new API here. Right
      now, only SymbolFileBreakpad implements these APIs, but in the future
      SymbolFilePDB will use them too.
      
      Differential Revision: https://reviews.llvm.org/D66638
      
      llvm-svn: 373072
      a8b284ee
    • Pavel Labath's avatar
      Disable the empty string check in TestDataFormatterStdString · 59876948
      Pavel Labath authored
      This check was failing since it was added in r372837. It should be
      possible to re-enable it once D68010 lands.
      
      llvm-svn: 373071
      59876948
    • Nico Weber's avatar
      Reland "gn build: (manually) merge r373028" · 0eb4d9dd
      Nico Weber authored
      This relands r373029, reverted in 373033, because r373028 relanded in r373066.
      
      llvm-svn: 373070
      0eb4d9dd
    • Pavel Labath's avatar
      Fix some swig warnings · 4a90ee1a
      Pavel Labath authored
      Previously, these were unseen because the wrapper script would swallow
      them. This fixes the following types of warnings:
      - methods being declared more than once
      - swig complained about ignoring operator=, so I just removed it
      
      llvm-svn: 373069
      4a90ee1a
    • Dmitri Gribenko's avatar
      Fixed indentation in a ClangTidy test · 6328f948
      Dmitri Gribenko authored
      llvm-svn: 373068
      6328f948