1e8d8bef9SDimitry Andric //===- ObjC.h ---------------------------------------------------*- C++ -*-===// 2e8d8bef9SDimitry Andric // 3e8d8bef9SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4e8d8bef9SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 5e8d8bef9SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6e8d8bef9SDimitry Andric // 7e8d8bef9SDimitry Andric //===----------------------------------------------------------------------===// 8e8d8bef9SDimitry Andric 9e8d8bef9SDimitry Andric #ifndef LLD_MACHO_OBJC_H 10e8d8bef9SDimitry Andric #define LLD_MACHO_OBJC_H 11e8d8bef9SDimitry Andric 12e8d8bef9SDimitry Andric #include "llvm/Support/MemoryBuffer.h" 13e8d8bef9SDimitry Andric 14bdd1243dSDimitry Andric namespace lld::macho { 15e8d8bef9SDimitry Andric 16e8d8bef9SDimitry Andric namespace objc { 17e8d8bef9SDimitry Andric 18*0fca6ea1SDimitry Andric namespace symbol_names { 19e8d8bef9SDimitry Andric constexpr const char klass[] = "_OBJC_CLASS_$_"; 20*0fca6ea1SDimitry Andric constexpr const char klassPropList[] = "__OBJC_$_CLASS_PROP_LIST_"; 21*0fca6ea1SDimitry Andric 22e8d8bef9SDimitry Andric constexpr const char metaclass[] = "_OBJC_METACLASS_$_"; 23e8d8bef9SDimitry Andric constexpr const char ehtype[] = "_OBJC_EHTYPE_$_"; 24e8d8bef9SDimitry Andric constexpr const char ivar[] = "_OBJC_IVAR_$_"; 25*0fca6ea1SDimitry Andric constexpr const char instanceMethods[] = "__OBJC_$_INSTANCE_METHODS_"; 26*0fca6ea1SDimitry Andric constexpr const char classMethods[] = "__OBJC_$_CLASS_METHODS_"; 27*0fca6ea1SDimitry Andric constexpr const char listProprieties[] = "__OBJC_$_PROP_LIST_"; 28*0fca6ea1SDimitry Andric 29*0fca6ea1SDimitry Andric constexpr const char category[] = "__OBJC_$_CATEGORY_"; 30*0fca6ea1SDimitry Andric constexpr const char categoryInstanceMethods[] = 31*0fca6ea1SDimitry Andric "__OBJC_$_CATEGORY_INSTANCE_METHODS_"; 32*0fca6ea1SDimitry Andric constexpr const char categoryClassMethods[] = 33*0fca6ea1SDimitry Andric "__OBJC_$_CATEGORY_CLASS_METHODS_"; 34*0fca6ea1SDimitry Andric constexpr const char categoryProtocols[] = "__OBJC_CATEGORY_PROTOCOLS_$_"; 35*0fca6ea1SDimitry Andric 36*0fca6ea1SDimitry Andric constexpr const char swift_objc_category[] = "__CATEGORY_"; 37*0fca6ea1SDimitry Andric constexpr const char swift_objc_klass[] = "_$s"; 38*0fca6ea1SDimitry Andric } // namespace symbol_names 39e8d8bef9SDimitry Andric 4006c3fb27SDimitry Andric // Check for duplicate method names within related categories / classes. 4106c3fb27SDimitry Andric void checkCategories(); 42*0fca6ea1SDimitry Andric void mergeCategories(); 4306c3fb27SDimitry Andric 44*0fca6ea1SDimitry Andric void doCleanup(); 45e8d8bef9SDimitry Andric } // namespace objc 46e8d8bef9SDimitry Andric 47e8d8bef9SDimitry Andric bool hasObjCSection(llvm::MemoryBufferRef); 48e8d8bef9SDimitry Andric 49bdd1243dSDimitry Andric } // namespace lld::macho 50e8d8bef9SDimitry Andric 51e8d8bef9SDimitry Andric #endif 52