forked from OSchip/llvm-project
[AIX] Default AIX to using -fno-use-cxa-atexit
On AIX, we use __atexit to register dtor functions rather than __cxa_atexit. So a driver change is needed to default AIX to using -fno-use-cxa-atexit. Windows platform does not uses __cxa_atexit either. Following its precedent, we remove the assertion for when -fuse-cxa-atexit is specified by the user, do not produce a message and silently default to -fno-use-cxa-atexit behavior. Differential Revision: https://reviews.llvm.org/D82136
This commit is contained in:
parent
22337bfe7d
commit
3f2e61c1fe
|
@ -4528,8 +4528,6 @@ void XLCXXABI::registerGlobalDtor(CodeGenFunction &CGF, const VarDecl &D,
|
|||
// Create __dtor function for the var decl.
|
||||
llvm::Function *dtorStub = CGF.createAtExitStub(D, dtor, addr);
|
||||
|
||||
if (CGM.getCodeGenOpts().CXAAtExit)
|
||||
llvm::report_fatal_error("using __cxa_atexit unsupported on AIX");
|
||||
// Register above __dtor with atexit().
|
||||
CGF.registerGlobalDtorWithAtExit(dtorStub);
|
||||
|
||||
|
|
|
@ -5498,7 +5498,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
|
|||
// -fuse-cxa-atexit is default.
|
||||
if (!Args.hasFlag(
|
||||
options::OPT_fuse_cxa_atexit, options::OPT_fno_use_cxa_atexit,
|
||||
!RawTriple.isOSWindows() &&
|
||||
!RawTriple.isOSAIX() && !RawTriple.isOSWindows() &&
|
||||
TC.getArch() != llvm::Triple::xcore &&
|
||||
((RawTriple.getVendor() != llvm::Triple::MipsTechnologies) ||
|
||||
RawTriple.hasEnvironment())) ||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
// RUN: %clang_cc1 -triple powerpc-ibm-aix-xcoff -S -emit-llvm -x c++ \
|
||||
// RUN: -fno-use-cxa-atexit -std=c++2a < %s | \
|
||||
// RUN: -std=c++2a < %s | \
|
||||
// RUN: FileCheck --check-prefixes=CHECK,CHECK32 %s
|
||||
|
||||
// RUN: %clang_cc1 -triple powerpc64-ibm-aix-xcoff -S -emit-llvm -x c++ \
|
||||
// RUN: -fno-use-cxa-atexit -std=c++2a < %s | \
|
||||
// RUN: -std=c++2a < %s | \
|
||||
// RUN: FileCheck --check-prefixes=CHECK,CHECK64 %s
|
||||
|
||||
namespace test1 {
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
// RUN: %clang -### -target mips-unknown-none-gnu -c %s -o /dev/null 2>&1 | FileCheck %s -check-prefix CHECK-MIPS
|
||||
// RUN: %clang -### -target mips-mti-none-gnu -c %s -o /dev/null 2>&1 | FileCheck %s -check-prefix CHECK-MIPS
|
||||
// RUN: %clang -### -target sparc-sun-solaris -c %s -o /dev/null 2>&1 | FileCheck %s -check-prefix CHECK-SOLARIS
|
||||
// RUN: %clang -### -target powerpc-ibm-aix-xcoff -c %s -o /dev/null 2>&1 | FileCheck %s -check-prefix CHECK-AIX
|
||||
// RUN: %clang -### -target powerpc64-ibm-aix-xcoff -c %s -o /dev/null 2>&1 | FileCheck %s -check-prefix CHECK-AIX
|
||||
|
||||
// CHECK-WINDOWS: "-fno-use-cxa-atexit"
|
||||
// CHECK-SOLARIS-NOT: "-fno-use-cxa-atexit"
|
||||
|
@ -24,6 +26,7 @@
|
|||
// CHECK-XCORE: "-fno-use-cxa-atexit"
|
||||
// CHECK-MTI: "-fno-use-cxa-atexit"
|
||||
// CHECK-MIPS-NOT: "-fno-use-cxa-atexit"
|
||||
// CHECK-AIX: "-fno-use-cxa-atexit"
|
||||
|
||||
// RUN: %clang -target x86_64-apple-darwin -fregister-global-dtors-with-atexit -fno-register-global-dtors-with-atexit -c -### %s 2>&1 | \
|
||||
// RUN: FileCheck --check-prefix=WITHOUTATEXIT %s
|
||||
|
|
Loading…
Reference in New Issue