[all-commits] [llvm/llvm-project] 85bcc1: [lldb] Make SBType::IsTypeComplete more consistent...
Raphael Isemann via All-commits
all-commits at lists.llvm.org
Sat Oct 30 04:29:03 PDT 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 85bcc1eb2f56af00123a8d6b99e9ad677613767c
https://github.com/llvm/llvm-project/commit/85bcc1eb2f56af00123a8d6b99e9ad677613767c
Author: Raphael Isemann <teemperor at gmail.com>
Date: 2021-10-30 (Sat, 30 Oct 2021)
Changed paths:
M lldb/bindings/interface/SBType.i
M lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
R lldb/test/API/functionalities/type_completion/Makefile
R lldb/test/API/functionalities/type_completion/TestTypeCompletion.py
R lldb/test/API/functionalities/type_completion/main.cpp
A lldb/test/API/lang/cpp/complete-type-check/Makefile
A lldb/test/API/lang/cpp/complete-type-check/TestCppIsTypeComplete.py
A lldb/test/API/lang/cpp/complete-type-check/main.cpp
A lldb/test/API/lang/objc/complete-type-check/Makefile
A lldb/test/API/lang/objc/complete-type-check/TestObjCIsTypeComplete.py
A lldb/test/API/lang/objc/complete-type-check/main.m
Log Message:
-----------
[lldb] Make SBType::IsTypeComplete more consistent by forcing the loading of definitions
Currently calling SBType::IsTypeComplete returns true for record types if and
only if the underlying record in our internal Clang AST has a definition.
The function however doesn't actually force the loading of any external
definition from debug info, so it currently can return false even if the type is
actually defined in a program's debug info but LLDB hasn't lazily created the
definition yet.
This patch changes the behaviour to always load the definition first so that
IsTypeComplete now consistently returns true if there is a definition in the
module/target.
The motivation for this patch is twofold:
* The API is now arguably more useful for the user which don't know or care
about the internal lazy loading mechanism of LLDB.
* With D101950 there is no longer a good way to ask a Decl for a definition
without automatically pulling in a definition from the ExternalASTSource. The
current behaviour doesn't seem useful enough to justify the necessary
workarounds to preserve it for a time after D101950.
Note that there was a test that used this API to test lazy loading of debug info
but that has been replaced with TestLazyLoading by now (which just dumps the
internal Clang AST state instead).
Reviewed By: aprantl
Differential Revision: https://reviews.llvm.org/D112615
More information about the All-commits
mailing list