[clang] cecb0e9 - [HIP] stop forcing the lang std in the driver

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


Author: Siu Chi Chan
Date: 2022-09-29T16:18:29-04:00
New Revision: cecb0e98d4b182038f97b621b04ad43ecbac54a2

URL: https://github.com/llvm/llvm-project/commit/cecb0e98d4b182038f97b621b04ad43ecbac54a2
DIFF: https://github.com/llvm/llvm-project/commit/cecb0e98d4b182038f97b621b04ad43ecbac54a2.diff

LOG: [HIP] stop forcing the lang std in the driver

D103221 changed HIP's default to C++14, removing the driver logic to
force it into a different std.

Change-Id: I9f5220a7456687039b0bd3b3574f3124d3cc7665

Differential Revision: https://reviews.llvm.org/D134314

Change-Id: I40513f2ebe93ee53ea95c8bb3cc704487d970263

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index 5ea9e80853022..dd5596bc942e8 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -5882,11 +5882,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
 
     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:

diff  --git a/clang/test/Driver/hip-std.hip b/clang/test/Driver/hip-std.hip
index 2c996f7a6de76..5f3d4b72a9ab7 100644
--- a/clang/test/Driver/hip-std.hip
+++ b/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


        


More information about the cfe-commits mailing list