llvm-project/lldb/unittests/Symbol
Raphael Isemann 722247c812 [lldb] Unify the two CreateTypedef implementations in TypeSystemClang
To get LLDB one step closer to fulfil the software redundancy requirements of
modern aircrafts, we apparently decided to have two separately maintained
implementations of `CreateTypedef` in TypeSystemClang. Let's pass on the idea of
an LLDB-powered jetliner and deleted one implementation.

On a more serious note: This function got duplicated a long time ago when the
idea of CompilerType with a backing TypeSystemClang subclass happened
(56939cb310). One implementation was supposed to
be called from CompilerType::CreateTypedef and the other has just always been
around to create typedefs. By accident one of the implementations is only used
by the PDB parser while the CompilerType::CreateTypedef backend is used by the
rest of LLDB.

We also had some patches over the year that only fixed one of the two functions
(D18099 for example only fixed up the CompilerType::CreateTypedef
implementation). D51162 and D86140 both fixed the same missing `addDecl` call
for one of the two implementations.

This patch:
* deletes the `CreateTypedefType` function as its only used by the PDB parser
  and the `CreateTypedef` implementation is anyway needed as it's the backend
  implementation of CompilerType.
* replaces the calls in the PDB parser by just calling the CompilerType wrapper.
* moves the documentation to the remaining function.
* moves the check for empty typedef names that was only in the deleted
  implementation to the other (I don't think this fixes anything as I believe
  all callers are already doing the same check).

I'll fix up the usual stuff (not using StringRef, not doing early exit) in a NFC
follow-up.

This patch is not NFC as the PDB parser now calls the function that has the fix
from D18099.

Reviewed By: labath, JDevlieghere

Differential Revision: https://reviews.llvm.org/D93382
2020-12-17 10:49:26 +01:00
..
Inputs [DWARFYAML] Make the include_directories, file_names and opcodes fields of the line table optional. 2020-09-18 20:21:11 +08:00
CMakeLists.txt [lldb] Move clang-based files out of Symbol 2020-01-31 12:20:10 -08:00
LocateSymbolFileTest.cpp [lldb] Make Reproducer compatbile with SubsystemRAII (NFC) 2020-08-25 13:00:04 -07:00
PostfixExpressionTest.cpp fix lldb for recent libDebugInfoDWARF API change 2020-10-23 19:20:38 -07:00
TestClangASTImporter.cpp [lldb] Move clang-based files out of Symbol 2020-01-31 12:20:10 -08:00
TestDWARFCallFrameInfo.cpp [lldb/Module] Allow for the creation of memory-only modules 2020-07-14 08:45:44 -07:00
TestLineEntry.cpp [lldb/Module] Allow for the creation of memory-only modules 2020-07-14 08:45:44 -07:00
TestType.cpp [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
TestTypeSystemClang.cpp [lldb] Unify the two CreateTypedef implementations in TypeSystemClang 2020-12-17 10:49:26 +01:00