Revert "Add a getter to retrieve the XcodeSDK from Module and unit-test it. (NFC)"
authorAdrian Prantl <aprantl@apple.com>
Fri, 24 Apr 2020 23:59:48 +0000 (16:59 -0700)
committerAdrian Prantl <aprantl@apple.com>
Fri, 24 Apr 2020 23:59:48 +0000 (16:59 -0700)
This reverts commit 345df863ce649860bea9040fe5c2f10780d29080.

(Forgot to git-add the new file)

lldb/include/lldb/Core/Module.h
lldb/unittests/SymbolFile/DWARF/CMakeLists.txt
lldb/unittests/SymbolFile/DWARF/DWARFASTParserClangTests.cpp
lldb/unittests/TestingSupport/Symbol/YAMLModuleTester.cpp
lldb/unittests/TestingSupport/Symbol/YAMLModuleTester.h

index c8cb03e..35d00d2 100644 (file)
@@ -864,11 +864,6 @@ public:
   bool RemapSourceFile(llvm::StringRef path, std::string &new_path) const;
   bool RemapSourceFile(const char *, std::string &) const = delete;
 
-  /// Return the Xcode SDK this module was compiled against.  This
-  /// is computed by merging the SDKs from each compilation unit in
-  /// the module.
-  XcodeSDK GetXcodeSDK() const { return m_xcode_sdk; }
-
   /// Update the ArchSpec to a more specific variant.
   bool MergeArchitecture(const ArchSpec &arch_spec);
 
index ece8266..0a4d3cc 100644 (file)
@@ -1,7 +1,6 @@
 add_lldb_unittest(SymbolFileDWARFTests
   DWARFASTParserClangTests.cpp
   SymbolFileDWARFTests.cpp
-  XcodeSDKModuleTests.cpp
 
   LINK_LIBS
     lldbCore
index 21c2d16..4ec76bd 100644 (file)
@@ -7,7 +7,6 @@
 //===----------------------------------------------------------------------===//
 
 #include "Plugins/SymbolFile/DWARF/DWARFASTParserClang.h"
-#include "Plugins/SymbolFile/DWARF/DWARFCompileUnit.h"
 #include "Plugins/SymbolFile/DWARF/DWARFDIE.h"
 #include "TestingSupport/Symbol/YAMLModuleTester.h"
 #include "gmock/gmock.h"
@@ -115,47 +114,3 @@ TEST_F(DWARFASTParserClangTests,
   EXPECT_THAT(ast_parser.GetDeclContextToDIEMapKeys(),
               testing::UnorderedElementsAre(decl_ctxs[0], decl_ctxs[3]));
 }
-
-
-#ifndef __APPLE__
-TEST_F(DWARFASTParserClangTests, TestXcodeSDK) {
-  PlatformDarwin::Initialize();
-  const char *yamldata = R"(
-debug_str:
-  - MacOSX10.9.sdk
-debug_abbrev:
-  - Code:            0x00000001
-    Tag:             DW_TAG_compile_unit
-    Children:        DW_CHILDREN_no
-    Attributes:
-      - Attribute:       DW_AT_language
-        Form:            DW_FORM_data2
-      - Attribute:       DW_AT_APPLE_sdk
-        Form:            DW_FORM_strp
-debug_info:
-  - Length:
-      TotalLength:     8
-    Version:         2
-    AbbrOffset:      0
-    AddrSize:        8
-    Entries:
-      - AbbrCode:        0x00000001
-        Values:
-          - Value:           0x000000000000000C
-          - Value:           0x0000000000000000
-      - AbbrCode:        0x00000000
-        Values:          []
-...
-)";
-
-  YAMLModuleTester t(yamldata, "x86_64-apple-macosx");
-  auto dwarf_unit_sp = t.GetDwarfUnit();
-  auto *dwarf_cu = llvm::cast<DWARFCompileUnit>(dwarf_unit_sp.get());
-  ASSERT_TRUE((bool)dwarf_cu);
-  ASSERT_TRUE((bool)dwarf_cu->GetSymbolFileDWARF().GetCompUnitForDWARFCompUnit(
-      *dwarf_cu));
-  auto module = t.GetModule();
-  XcodeSDK sdk = module->GetXcodeSDK();
-  ASSERT_EQ(sdk.GetType(), XcodeSDK::Type::MacOSX);
-}
-#endif
index f40ff1d..59b6bcc 100644 (file)
@@ -51,8 +51,7 @@ public:
       lldb::SectionType sect_type =
           llvm::StringSwitch<lldb::SectionType>(name)
               .Case("debug_info", lldb::eSectionTypeDWARFDebugInfo)
-              .Case("debug_abbrev", lldb::eSectionTypeDWARFDebugAbbrev)
-              .Case("debug_str", lldb::eSectionTypeDWARFDebugStr);
+              .Case("debug_abbrev", lldb::eSectionTypeDWARFDebugAbbrev);
       auto &membuf = entry.getValue();
       lldb::addr_t file_vm_addr = 0;
       lldb::addr_t vm_size = 0;
index 7a638b5..c8ce131 100644 (file)
@@ -32,8 +32,7 @@ protected:
 public:
   /// Parse the debug info sections from the YAML description.
   YAMLModuleTester(llvm::StringRef yaml_data, llvm::StringRef triple);
-  DWARFUnitSP GetDwarfUnit() const { return m_dwarf_unit; }
-  lldb::ModuleSP GetModule() const { return m_module_sp; }
+  DWARFUnitSP GetDwarfUnit() { return m_dwarf_unit; }
 };
 
 } // namespace lldb_private