This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGac3894cf1e09: [Clang] Move XCore specific options from 
Clang.cpp to XCore.cpp (authored by benshi001).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D118535/new/

https://reviews.llvm.org/D118535

Files:
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/lib/Driver/ToolChains/XCore.cpp
  clang/test/Driver/xcore-opts.c


Index: clang/test/Driver/xcore-opts.c
===================================================================
--- clang/test/Driver/xcore-opts.c
+++ clang/test/Driver/xcore-opts.c
@@ -4,9 +4,8 @@
 // RUN: %clang -target xcore %s -g0 -### -o %t.o 2>&1 | FileCheck 
-check-prefix CHECK-G0 %s
 
 // CHECK: "-mframe-pointer=none"
-// CHECK: "-nostdsysteminc"
+// CHECK: "-nostdsysteminc" "-fno-use-cxa-atexit"
 // CHECK: "-fno-signed-char"
-// CHECK: "-fno-use-cxa-atexit"
 // CHECK-NOT: "-fcxx-exceptions"
 // CHECK-NOT: "-fexceptions"
 // CHECK-NOT: "-fcommon"
@@ -30,4 +29,3 @@
 // CHECK-G0: xcc"
 // CHECK-G0-NOT: "-g"
 // CHECK-G0: xcc"
-
Index: clang/lib/Driver/ToolChains/XCore.cpp
===================================================================
--- clang/lib/Driver/ToolChains/XCore.cpp
+++ clang/lib/Driver/ToolChains/XCore.cpp
@@ -130,6 +130,10 @@
                                            ArgStringList &CC1Args,
                                            Action::OffloadKind) const {
   CC1Args.push_back("-nostdsysteminc");
+  // Set `-fno-use-cxa-atexit` to default.
+  if (!DriverArgs.hasFlag(options::OPT_fuse_cxa_atexit,
+                          options::OPT_fno_use_cxa_atexit, false))
+    CC1Args.push_back("-fno-use-cxa-atexit");
 }
 
 void XCoreToolChain::AddClangCXXStdlibIncludeArgs(
Index: clang/lib/Driver/ToolChains/Clang.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -6266,7 +6266,6 @@
   if (!Args.hasFlag(
           options::OPT_fuse_cxa_atexit, options::OPT_fno_use_cxa_atexit,
           !RawTriple.isOSAIX() && !RawTriple.isOSWindows() &&
-              TC.getArch() != llvm::Triple::xcore &&
               ((RawTriple.getVendor() != llvm::Triple::MipsTechnologies) ||
                RawTriple.hasEnvironment())) ||
       KernelOrKext)


Index: clang/test/Driver/xcore-opts.c
===================================================================
--- clang/test/Driver/xcore-opts.c
+++ clang/test/Driver/xcore-opts.c
@@ -4,9 +4,8 @@
 // RUN: %clang -target xcore %s -g0 -### -o %t.o 2>&1 | FileCheck -check-prefix CHECK-G0 %s
 
 // CHECK: "-mframe-pointer=none"
-// CHECK: "-nostdsysteminc"
+// CHECK: "-nostdsysteminc" "-fno-use-cxa-atexit"
 // CHECK: "-fno-signed-char"
-// CHECK: "-fno-use-cxa-atexit"
 // CHECK-NOT: "-fcxx-exceptions"
 // CHECK-NOT: "-fexceptions"
 // CHECK-NOT: "-fcommon"
@@ -30,4 +29,3 @@
 // CHECK-G0: xcc"
 // CHECK-G0-NOT: "-g"
 // CHECK-G0: xcc"
-
Index: clang/lib/Driver/ToolChains/XCore.cpp
===================================================================
--- clang/lib/Driver/ToolChains/XCore.cpp
+++ clang/lib/Driver/ToolChains/XCore.cpp
@@ -130,6 +130,10 @@
                                            ArgStringList &CC1Args,
                                            Action::OffloadKind) const {
   CC1Args.push_back("-nostdsysteminc");
+  // Set `-fno-use-cxa-atexit` to default.
+  if (!DriverArgs.hasFlag(options::OPT_fuse_cxa_atexit,
+                          options::OPT_fno_use_cxa_atexit, false))
+    CC1Args.push_back("-fno-use-cxa-atexit");
 }
 
 void XCoreToolChain::AddClangCXXStdlibIncludeArgs(
Index: clang/lib/Driver/ToolChains/Clang.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -6266,7 +6266,6 @@
   if (!Args.hasFlag(
           options::OPT_fuse_cxa_atexit, options::OPT_fno_use_cxa_atexit,
           !RawTriple.isOSAIX() && !RawTriple.isOSWindows() &&
-              TC.getArch() != llvm::Triple::xcore &&
               ((RawTriple.getVendor() != llvm::Triple::MipsTechnologies) ||
                RawTriple.hasEnvironment())) ||
       KernelOrKext)
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to