1. Jun 20, 2020
    • Raphael Isemann's avatar
      [lldb] Replace std::isprint/isspace with llvm's locale-independent version · f5eaa2af
      Raphael Isemann authored
      Summary:
      LLVM is using its own isPrint/isSpace implementation that doesn't change depending on the current locale. LLDB should do the same
      to prevent that internal logic changes depending on the set locale.
      
      Reviewers: JDevlieghere, labath, mib, totally_not_teemperor
      
      Reviewed By: JDevlieghere
      
      Differential Revision: https://reviews.llvm.org/D82175
      f5eaa2af
    • Raphael Isemann's avatar
      [lldb] Reactivate Objective-C++ plugin · 8340fbb9
      Raphael Isemann authored
      Summary:
      Since commit 7b3ef05a the Objective-C++ plugin is dead code.
      That commit added Objective-C++ to the list of languages for which `Language::LanguageIsCPlusPlus`
      returns true. As the C++ language plugin also uses that method to figure out if it is responsible for a
      given language, the C++ plugin since then also became the plugin that we found when looking for
      a language plugin for Objective-C++. The only real fallout from that is that the source highlighting
      for Objective-C++ files never worked as we always found the C++ plugin which refuses to highlight
      files with Objective-C++ extensions.
      
      This patch just adds a special exception for Objective-C++ to the list of languages that are governed
      by the C++ plugin. Also adds a test that makes sure that we find the right plugin for all C language
      types and that the highlighting for `.mm` (Objective-C++) and `.m` (Objective-C) files works.
      
      I didn't revert 7b3ef05a as it does make sense to return
      true for Objective-C++ from `Language::LanguageIsCPlusPlus` (e.g., we currently check if we care about
      ODR violations by doing `if (Language::LanguageIsCPlusPlus(...))` and this should also work for
      Objective-C++).
      
      Fixes rdar://64420183
      
      Reviewers: aprantl
      
      Reviewed By: aprantl
      
      Subscribers: mgorny, abidh, JDevlieghere
      
      Differential Revision: https://reviews.llvm.org/D82109
      8340fbb9
    • Raphael Isemann's avatar
      [lldb] Fix that SIGWINCH crashes IOHandlerEditline when we are not using the editline backend · be18df3d
      Raphael Isemann authored
      Summary:
      TerminalSizeChanged is called from our SIGWINCH signal handler but the
      IOHandlerEditline currently doesn't check if we are actually using the real
      editline backend. If we're not using the real editline backend, `m_editline_up`
      won't be set and `IOHandlerEditline::TerminalSizeChanged` will access
      the empty unique_ptr. In a real use case we don't use the editline backend
      when we for example read input from a file. We also create some temporary
      IOHandlerEditline's during LLDB startup it seems that are also treated
      as non-interactive (apparently to read startup commands).
      
      This patch just adds a nullptr check for`m_editline_up` as we do in the rest of
      IOHandlerEditline.
      
      Fixes rdar://problem/63921950
      
      Reviewers: labath, friss
      
      Reviewed By: friss
      
      Subscribers: abidh, JDevlieghere
      
      Differential Revision: https://reviews.llvm.org/D81729
      be18df3d
    • Lang Hames's avatar
      [JITLink] Allow zero-length symbols at the end of blocks. · 22d7a01d
      Lang Hames authored
      This relaxes an assertion that required symbols to start before the end
      of a block. Instead, symbols are now required to end on or before the
      end of a block. This fixes two important corner cases: Symbols at the
      start of empty blocks/sections, and block/section end symbols.
      22d7a01d
    • Lang Hames's avatar
      [JITLink] Display host -> target address mapping in debugging output. · bf783a6a
      Lang Hames authored
      This can be helpful for sanity checking JITLink memory manager behavior.
      bf783a6a
    • Adrian Prantl's avatar
      Repair support for launching ios/tv/watch simulator binaries through platform · 7e825abd
      Adrian Prantl authored
      and delete a bunch (but not all) redundant code. If you compare the remaining implementations of Platform*Simulator.cpp, there is still an obvious leftover cleanup task.
      
      Specifically, this patch
      
      - removes SDK initialization from dotest (there is equivalent but more
        complete code in Makefile.rules)
      
      - make Platform*Simulator inherit the generic implementation of
        PlatformAppleSimulator (more can be done here)
      
      - simplify the platform logic in Makefile.rules
      
      - replace the custom SDK finding logic in Platform*Simulator with XcodeSDK
      
      - adds a test for each supported simulator
      
      Differential Revision: https://reviews.llvm.org/D81980
      7e825abd
    • Raphael Isemann's avatar
      [lldb] Disable complex tests on Windows · 6331c7d0
      Raphael Isemann authored
      The tests fail to compile there:
      ```
      complex/main.c:4:16: error: expected ';' at end of declaration
        float complex complex_float = -1.5f + -2.5f * I;
                     ^
                     ;
      ```
      6331c7d0
    • Sanjay Patel's avatar
      [VectorCombine] fix crash while transforming constants · 6d864097
      Sanjay Patel authored
      This is a variation of the proposal in D82049 with an extra test.
      6d864097
    • Fangrui Song's avatar
      [ELF] Refine LMA offset propagation rule in D76995 · 8ffb2097
      Fangrui Song authored
      If neither AT(lma) nor AT>lma_region is specified,
      D76995 keeps `lmaOffset` (LMA - VMA) if the previous section is in the
      default LMA region.
      
      This patch additionally checks that the two sections are in the same
      memory region.
      
      Add a test case derived from https://bugs.llvm.org/show_bug.cgi?id=45313
      
        .mdata : AT(0xfb01000) { *(.data); } > TCM
        // It is odd to make .bss inherit lmaOffset, because the two sections
        // are in different memory regions.
        .bss : { *(.bss) } > DDR
      
      With this patch, section VMA/LMA match GNU ld. Note, GNU ld supports
      out-of-order (w.r.t sh_offset) sections and places .text and .bss in the
      same PT_LOAD. We don't have that behavior.
      
      Reviewed By: grimar
      
      Differential Revision: https://reviews.llvm.org/D81986
      8ffb2097
    • peter klausler's avatar
      [flang] DATA stmt processing (part 3/4): Remaining prep work · 4171f80d
      peter klausler authored
      Rolls up small changes across the frontend to prepare for the large
      forthcoming patch (part 4/4) that completes DATA statement processing
      via conversion to initializers.
      
      Reviewed By: PeteSteinfeld
      
      Differential Revision: https://reviews.llvm.org/D82137
      4171f80d
    • Fangrui Song's avatar
      [ELF] Refactor ObjFile<ELFT>::initializeSymbols to enforce the invariant:... · c4d13f72
      Fangrui Song authored
      [ELF] Refactor ObjFile<ELFT>::initializeSymbols to enforce the invariant: InputFile::symbols has non null entry
      
      Fixes PR46348.
      
      ObjFile<ELFT>::initializeSymbols contains two symbol iteration loops:
      
      ```
      for each symbol
        if non-inheriting && non-local
          fill in this->symbols[i]
      
      for each symbol
        if local
          fill in this->symbols[i]
        else
          symbol resolution
      ```
      
      Symbol resolution can trigger a duplicate symbol error which will call
      InputSectionBase::getObjMsg to iterate over InputFile::symbols.  If a
      non-local symbol appears after the non-local symbol being resolved
      (violating ELF spec), its `this->symbols[i]` entry has not been filled
      in, InputSectionBase::getObjMsg will crash due to
      `dyn_cast<Defined>(nullptr)`.
      
      To fix the bug, reorganize the two loops to ensure this->symbols is
      complete before symbol resolution. This enforces the invariant:
      InputFile::symbols has none null entry when InputFile::getSymbols() is called.
      
      ```
      for each symbol
        if non-inheriting
          fill in this->symbols[i]
      
      for each symbol starting from firstGlobal
        if non-local
          symbol resolution
      ```
      
      Additionally, move the (non-local symbol in local part of .symtab)
      diagnostic from Writer<ELFT>::copyLocalSymbols() to initializeSymbols().
      
      Reviewed By: grimar, jhenderson
      
      Differential Revision: https://reviews.llvm.org/D81988
      c4d13f72
    • Stanislav Mekhanoshin's avatar
      2b87a44c
  2. Jun 19, 2020