[all-commits] [llvm/llvm-project] 8715ff: [lldb] Fix that trailing backslashes in source lin...

Raphael Isemann via All-commits all-commits at lists.llvm.org
Thu Nov 14 02:25:07 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 8715ffdf1aafbfca7c3d7f1622fe586243f31df1
      https://github.com/llvm/llvm-project/commit/8715ffdf1aafbfca7c3d7f1622fe586243f31df1
  Author: Raphael Isemann <teemperor at gmail.com>
  Date:   2019-11-14 (Thu, 14 Nov 2019)

  Changed paths:
    M lldb/source/Plugins/Language/ClangCommon/ClangHighlighter.cpp
    M lldb/unittests/Language/Highlighting/HighlighterTest.cpp

  Log Message:
  -----------
  [lldb] Fix that trailing backslashes in source lines break the Clang highlighter

Summary:
Clang's raw Lexer doesn't produce any tokens for trailing backslashes in a line. This doesn't work with
LLDB's Clang highlighter which builds the source code to display from the list of tokens the Lexer returns.
This causes that lines with trailing backslashes are lacking the backslash and the following newline when
rendering source code in LLDB.

This patch removes the trailing newline from the current line we are highlighting. This way Clang doesn't
drop the backslash token and we just restore the newline after tokenising.

Fixes rdar://57091487

Reviewers: JDevlieghere, labath

Reviewed By: JDevlieghere, labath

Subscribers: labath, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D70177




More information about the All-commits mailing list