[PATCH] D134314: [HIP] stop forcing the lang std in the driver

Siu Chi Chan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 29 13:22:13 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rGcecb0e98d4b1: [HIP] stop forcing the lang std in the driver (authored by scchan).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D134314

Files:
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/test/Driver/hip-std.hip


Index: clang/test/Driver/hip-std.hip
===================================================================
--- clang/test/Driver/hip-std.hip
+++ clang/test/Driver/hip-std.hip
@@ -3,8 +3,10 @@
 
 // RUN: %clang -### --target=x86_64-unknown-linux-gnu -offload-arch=gfx906 %s \
 // RUN:   2>&1 | FileCheck -check-prefixes=DEFAULT %s
-// DEFAULT: "-cc1"{{.*}}"-fcuda-is-device"{{.*}}"-std=c++11"
-// DEFAULT: "-cc1"{{.*}}"-std=c++11"
+// DEFAULT: "-cc1"{{.*}}"-fcuda-is-device"{{.*}}
+// DEFAULT-NOT: "-std="{{.*}}
+// DEFAULT: "-cc1"{{.*}}
+// DEFAULT-NOT: "-std="{{.*}}
 
 // RUN: %clang -### --target=x86_64-unknown-linux-gnu -offload-arch=gfx906 %s \
 // RUN:   -std=c++17 %s 2>&1 | FileCheck -check-prefixes=SPECIFIED %s
@@ -13,8 +15,10 @@
 
 // RUN: %clang -### --target=x86_64-pc-windows-msvc -offload-arch=gfx906 %s \
 // RUN:   2>&1 | FileCheck -check-prefixes=MSVC-DEF %s
-// MSVC-DEF: "-cc1"{{.*}}"-fcuda-is-device"{{.*}}"-std=c++14"
-// MSVC-DEF: "-cc1"{{.*}}"-std=c++14"
+// MSVC-DEF: "-cc1"{{.*}}"-fcuda-is-device"{{.*}}
+// MSVC-DEF-NOT: "-std="{{.*}}
+// MSVC-DEF: "-cc1"{{.*}}
+// MSVC-DEF-NOT: "-std="{{.*}}
 
 // RUN: %clang -### --target=x86_64-pc-windows-msvc -offload-arch=gfx906 %s \
 // RUN:   -std=c++17 %s 2>&1 | FileCheck -check-prefixes=MSVC-SPEC %s
Index: clang/lib/Driver/ToolChains/Clang.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Clang.cpp
+++ clang/lib/Driver/ToolChains/Clang.cpp
@@ -5882,11 +5882,6 @@
 
     Args.AddLastArg(CmdArgs, options::OPT_ftrigraphs,
                     options::OPT_fno_trigraphs);
-
-    // HIP headers has minimum C++ standard requirements. Therefore set the
-    // default language standard.
-    if (IsHIP)
-      CmdArgs.push_back(IsWindowsMSVC ? "-std=c++14" : "-std=c++11");
   }
 
   // GCC's behavior for -Wwrite-strings is a bit strange:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134314.464008.patch
Type: text/x-patch
Size: 1866 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220929/0b06aeaa/attachment.bin>


More information about the cfe-commits mailing list