From 292134551c7bce4c5e7d20cc50e2706b8bb34dbe Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Thu, 2 Oct 2025 16:48:11 -0700 Subject: [PATCH] [LLDB] Guard Swift-specific code --- lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp index 10a7558881f2e..5ee3b3f2a7eac 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp @@ -14,7 +14,6 @@ #include "DWARFDeclContext.h" #include "DWARFUnit.h" #include "LogChannelDWARF.h" -#include "Plugins/TypeSystem/Swift/TypeSystemSwiftTypeRef.h" #include "lldb/Symbol/Type.h" #include "llvm/ADT/iterator.h" @@ -23,6 +22,10 @@ #include "llvm/DebugInfo/DWARF/DWARFTypePrinter.h" #include "llvm/Support/raw_ostream.h" +#ifdef LLDB_ENABLE_SWIFT +#include "Plugins/TypeSystem/Swift/TypeSystemSwiftTypeRef.h" +#endif + using namespace lldb_private; using namespace lldb_private::plugin::dwarf; using namespace llvm::dwarf; @@ -441,6 +444,7 @@ static void GetDeclContextImpl(DWARFDIE die, bool derive_template_names, // Add this DIE's contribution at the end of the chain. auto push_ctx = [&](CompilerContextKind kind, llvm::StringRef name) { +#ifdef LLDB_ENABLE_SWIFT // BEGIN SWIFT // // FIXME: This layering violation works around a limitation in @@ -458,6 +462,7 @@ static void GetDeclContextImpl(DWARFDIE die, bool derive_template_names, name = base_name; } // END SWIFT +#endif context.push_back({kind, ConstString(name)}); }; switch (die.Tag()) {