diff --git a/llvm/include/llvm/Analysis/TargetLibraryInfo.def b/llvm/include/llvm/Analysis/TargetLibraryInfo.def index b9146f53648aaf98d8cf9ff8c46ed4d11ac97ab8..bc69417bef53db4d813a8a20b2e1527226c52d4e 100644 --- a/llvm/include/llvm/Analysis/TargetLibraryInfo.def +++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.def @@ -151,7 +151,6 @@ TLI_DEFINE_ENUM_INTERNAL(under_IO_putc) TLI_DEFINE_STRING_INTERNAL("_IO_putc") TLI_DEFINE_SIG_INTERNAL(Int, Int, Ptr) -#if defined(BUILD_FOR_OPENEULER) /// void _Unwind_Resume(_Unwind_Exception *); TLI_DEFINE_ENUM_INTERNAL(_Unwind_Resume) TLI_DEFINE_STRING_INTERNAL("_Unwind_Resume") @@ -161,7 +160,6 @@ TLI_DEFINE_SIG_INTERNAL(Void, Ptr) TLI_DEFINE_ENUM_INTERNAL(terminate) TLI_DEFINE_STRING_INTERNAL("_ZSt9terminatev") TLI_DEFINE_SIG_INTERNAL(Void) -#endif /// void operator delete[](void*); TLI_DEFINE_ENUM_INTERNAL(ZdaPv) @@ -478,24 +476,20 @@ TLI_DEFINE_ENUM_INTERNAL(cospif) TLI_DEFINE_STRING_INTERNAL("__cospif") TLI_DEFINE_SIG_INTERNAL(Flt, Flt) -#if defined(BUILD_FOR_OPENEULER) /// void * __cxa_allocate_exception(size_t thrown_size) TLI_DEFINE_ENUM_INTERNAL(__cxa_allocate_exception) TLI_DEFINE_STRING_INTERNAL("__cxa_allocate_exception") TLI_DEFINE_SIG_INTERNAL(Ptr, SizeT) -#endif /// int __cxa_atexit(void (*f)(void *), void *p, void *d); TLI_DEFINE_ENUM_INTERNAL(cxa_atexit) TLI_DEFINE_STRING_INTERNAL("__cxa_atexit") TLI_DEFINE_SIG_INTERNAL(Int, Ptr, Ptr, Ptr) -#if defined(BUILD_FOR_OPENEULER) /// void *__cxa_begin_catch(void *e) TLI_DEFINE_ENUM_INTERNAL(__cxa_begin_catch) TLI_DEFINE_STRING_INTERNAL("__cxa_begin_catch") TLI_DEFINE_SIG_INTERNAL(Ptr, Ptr) -#endif /// void __cxa_guard_abort(guard_t *guard); /// guard_t is int64_t in Itanium ABI or int32_t on ARM eabi. @@ -513,12 +507,10 @@ TLI_DEFINE_ENUM_INTERNAL(cxa_guard_release) TLI_DEFINE_STRING_INTERNAL("__cxa_guard_release") TLI_DEFINE_SIG_INTERNAL(Void, Ptr) -#if defined(BUILD_FOR_OPENEULER) /// void __cxa_throw(void *, void *, void (*)(void *)); TLI_DEFINE_ENUM_INTERNAL(cxa_throw) TLI_DEFINE_STRING_INTERNAL("__cxa_throw") TLI_DEFINE_SIG_INTERNAL(Void, Ptr, Ptr, Ptr) -#endif /// double __exp10_finite(double x); TLI_DEFINE_ENUM_INTERNAL(exp10_finite) diff --git a/llvm/lib/CodeGen/DwarfEHPrepare.cpp b/llvm/lib/CodeGen/DwarfEHPrepare.cpp index d8882bd53ed6f475255782c4d53d443b9b4f3441..158ed29e4043b20df2925d51724aaa7d8e7d1268 100644 --- a/llvm/lib/CodeGen/DwarfEHPrepare.cpp +++ b/llvm/lib/CodeGen/DwarfEHPrepare.cpp @@ -234,11 +234,9 @@ bool DwarfEHPrepare::InsertUnwindResumeCalls() { } RewindFunction = F.getParent()->getOrInsertFunction(RewindName, FTy); -#if defined(BUILD_FOR_OPENEULER) // If -fno-plt is enabled, add NonLazyBind for this library call. if (F.getParent()->getRtLibUseGOT()) (cast(RewindFunction.getCallee()))->addFnAttr(Attribute::NonLazyBind); -#endif // Create the basic block where the _Unwind_Resume call will live. if (ResumesLeft == 1) { diff --git a/llvm/lib/Target/AArch64/AArch64Subtarget.cpp b/llvm/lib/Target/AArch64/AArch64Subtarget.cpp index 901dc2254c21301cf5410bda34f9fec58c9876b4..b91a87ad4dfa49701b989f64a5b8b303ad9eb16d 100644 --- a/llvm/lib/Target/AArch64/AArch64Subtarget.cpp +++ b/llvm/lib/Target/AArch64/AArch64Subtarget.cpp @@ -24,9 +24,7 @@ #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineScheduler.h" #include "llvm/IR/GlobalValue.h" -#if defined(BUILD_FOR_OPENEULER) #include "llvm/IR/Module.h" -#endif #include "llvm/TargetParser/AArch64TargetParser.h" using namespace llvm; @@ -443,20 +441,15 @@ unsigned AArch64Subtarget::classifyGlobalFunctionReference( // NonLazyBind goes via GOT unless we know it's available locally. auto *F = dyn_cast(GV); -#if defined(BUILD_FOR_OPENEULER) -// Check if NonLazyBind should go via GOT: -// 1. The target is not MachO, or MachO uses NonLazyBind. -// 2. The function's parent module requires GOT for runtime library calls. -// 3. The symbol is not assumed to be DSO-local. -// 4. The symbol does not have local linkage. + + // Check if NonLazyBind should go via GOT: + // 1. The target is not MachO, or MachO uses NonLazyBind. + // 2. The function's parent module requires GOT for runtime library calls. + // 3. The symbol is not assumed to be DSO-local. + // 4. The symbol does not have local linkage. if ((!isTargetMachO() || MachOUseNonLazyBind) && F && F->getParent()->getRtLibUseGOT() && !(TM.shouldAssumeDSOLocal(*GV->getParent(), GV) || GV->hasLocalLinkage())) -#else - if ((!isTargetMachO() || MachOUseNonLazyBind) && F && - F->hasFnAttribute(Attribute::NonLazyBind) && - !TM.shouldAssumeDSOLocal(*GV->getParent(), GV)) -#endif return AArch64II::MO_GOT; if (getTargetTriple().isOSWindows()) { diff --git a/llvm/test/CodeGen/AArch64/fno-plt.c b/llvm/test/CodeGen/AArch64/fno-plt.c index 4853cd33d7d1db1c5a566cc0dd1803af34f3484e..81ed912ce927e1b3dd3e2071e53efca78b84dc58 100644 --- a/llvm/test/CodeGen/AArch64/fno-plt.c +++ b/llvm/test/CodeGen/AArch64/fno-plt.c @@ -1,4 +1,3 @@ -// REQUIRES: build_for_openeuler // RUN: clang %s -shared -fno-plt -O2 -fno-inline -fPIC -o noplt.so // RUN: llvm-objdump -d noplt.so | FileCheck %s --check-prefix=CHECK-NO-PLT diff --git a/llvm/test/CodeGen/AArch64/fno-plt.cpp b/llvm/test/CodeGen/AArch64/fno-plt.cpp index 619e5d1cc60eab9f597b03bf9284235f1bc99485..c5a1f2f24b376fc59f4fd4197c7f085a1b7ce867 100644 --- a/llvm/test/CodeGen/AArch64/fno-plt.cpp +++ b/llvm/test/CodeGen/AArch64/fno-plt.cpp @@ -1,4 +1,3 @@ -// REQUIRES: build_for_openeuler // RUN: clang -x c++ %s -shared -fno-plt -O2 -fno-inline -fPIC -o noplt.so // RUN: llvm-objdump -d noplt.so | FileCheck %s --check-prefix=CHECK-NO-PLT