1 //===-- SystemInitializerLLGS.cpp -------------------------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 #include "SystemInitializerLLGS.h" 10 11 #if defined(__APPLE__) 12 #include "Plugins/ObjectFile/Mach-O/ObjectFileMachO.h" 13 using HostObjectFile = ObjectFileMachO; 14 #elif defined(_WIN32) 15 #include "Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h" 16 using HostObjectFile = ObjectFilePECOFF; 17 #else 18 #include "Plugins/ObjectFile/ELF/ObjectFileELF.h" 19 using HostObjectFile = ObjectFileELF; 20 #endif 21 22 using namespace lldb_private; 23 24 llvm::Error SystemInitializerLLGS::Initialize() { 25 if (auto e = SystemInitializerCommon::Initialize()) 26 return e; 27 28 HostObjectFile::Initialize(); 29 30 return llvm::Error::success(); 31 } 32 33 void SystemInitializerLLGS::Terminate() { 34 HostObjectFile::Terminate(); 35 SystemInitializerCommon::Terminate(); 36 } 37