[all-commits] [llvm/llvm-project] 839e84: [lldb] Remove assumption from Clang-based data for...

Raphael Isemann via All-commits all-commits at lists.llvm.org
Thu Dec 10 08:39:27 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 839e845277894ad37fbca8063cbf1955331fbeff
      https://github.com/llvm/llvm-project/commit/839e845277894ad37fbca8063cbf1955331fbeff
  Author: Raphael Isemann <teemperor at gmail.com>
  Date:   2020-12-10 (Thu, 10 Dec 2020)

  Changed paths:
    M lldb/source/DataFormatters/VectorType.cpp
    M lldb/source/Plugins/Language/CPlusPlus/BlockPointer.cpp
    M lldb/source/Plugins/Language/ObjC/CoreMedia.cpp

  Log Message:
  -----------
  [lldb] Remove assumption from Clang-based data formatters that their types are in the scratch AST

Several data formatters assume their types are in the Target's scratch AST and
build new types from that scratch AST instance. However, types from different
ASTs shouldn't be mixed, so this (unchecked) assumption may lead to problems if
we ever have more than one scratch AST or someone somehow invokes data
formatters on a type that are not in the scratch AST.

Instead we can use in all the formatters just the TypeSystem of the type we're
formatting. That's much simpler and avoids all the headache of finding the right
TypeSystem that matches the one of the formatted type.

Right now LLDB only has one scratch TypeSystemClang instance and we format only
types that are in the scratch AST, so this doesn't change anything in the
current way LLDB works. The intention here is to allow follow up refactorings
that introduce multiple scratch ASTs with the same Target.

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




More information about the All-commits mailing list