[Lldb-commits] [PATCH] D53530: Fix (and improve) the support for C99 variable length array types

Davide Italiano via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Oct 25 10:57:59 PDT 2018


davide added inline comments.


================
Comment at: source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp:213-229
+  // Handle variables with incomplete array types.
+  auto *type = in_value.GetCompilerType().GetOpaqueQualType();
+  auto qual_type = clang::QualType::getFromOpaquePtr(type).getCanonicalType();
+  if (qual_type->getTypeClass() == clang::Type::IncompleteArray) {
+    if (auto variable = in_value.GetVariable()) {
+      auto *lldb_type = variable->GetType();
+      auto *symbol_file = lldb_type->GetSymbolFile();
----------------
clayborg wrote:
> We must abstract this via the TypeSystem stuff and make this happen via the CompilerType interface. What happens when "in_value" is a swift type or other type from the type system? Crash
My understanding is that it is not possible today to get here with a swift type. In fact, `GetDynamicTypeAndAddress` in swift will be always called on a `SwiftLanguageRuntime`. 

That said, I'm not necessarily advocating against the abstraction, just pointing out that this is just a theoretical concern, and given this is an internal API in the debugger, it could be possibly enforced by an assertion to make sure people don't change the status quo accidentally.


https://reviews.llvm.org/D53530





More information about the lldb-commits mailing list