From 7994e1d071cbd7d9e2736c97b538adce2773365d Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Mon, 22 Jul 2019 16:49:59 +0000 Subject: [PATCH] [OPENMP][MSVC]Enable /openmp[:experimental] to compile OpenMP. Mapped /openmp[:experimental] to -fopenmp option and /openmp- option to -fno-openmp llvm-svn: 366702 --- clang/include/clang/Driver/CLCompatOptions.td | 11 +++++++---- clang/test/Driver/fopenmp.c | 4 ++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/clang/include/clang/Driver/CLCompatOptions.td b/clang/include/clang/Driver/CLCompatOptions.td index a0af303..bb51c3a 100644 --- a/clang/include/clang/Driver/CLCompatOptions.td +++ b/clang/include/clang/Driver/CLCompatOptions.td @@ -254,7 +254,13 @@ def _SLASH_Zp_flag : CLFlag<"Zp">, Alias, AliasArgs<["1"]>; def _SLASH_Zs : CLFlag<"Zs">, HelpText<"Syntax-check only">, Alias; - +def _SLASH_openmp_ : CLFlag<"openmp-">, + HelpText<"Disable OpenMP support">, Alias; +def _SLASH_openmp : CLFlag<"openmp">, HelpText<"Enable OpenMP support">, + Alias; +def _SLASH_openmp_experimental : CLFlag<"openmp:experimental">, + HelpText<"Enable OpenMP support with experimental SIMD support">, + Alias; // Non-aliases: @@ -381,7 +387,6 @@ def _SLASH_FS : CLIgnoredFlag<"FS">; def _SLASH_JMC : CLIgnoredFlag<"JMC">; def _SLASH_kernel_ : CLIgnoredFlag<"kernel-">; def _SLASH_nologo : CLIgnoredFlag<"nologo">; -def _SLASH_openmp_ : CLIgnoredFlag<"openmp-">; def _SLASH_permissive_ : CLIgnoredFlag<"permissive-">; def _SLASH_RTC : CLIgnoredJoined<"RTC">; def _SLASH_sdl : CLIgnoredFlag<"sdl">; @@ -436,8 +441,6 @@ def _SLASH_hotpatch : CLFlag<"hotpatch">; def _SLASH_kernel : CLFlag<"kernel">; def _SLASH_LN : CLFlag<"LN">; def _SLASH_MP : CLJoined<"MP">; -def _SLASH_openmp : CLFlag<"openmp">; -def _SLASH_openmp_experimental : CLFlag<"openmp:experimental">; def _SLASH_Qfast_transcendentals : CLFlag<"Qfast_transcendentals">; def _SLASH_QIfist : CLFlag<"QIfist">; def _SLASH_Qimprecise_fwaits : CLFlag<"Qimprecise_fwaits">; diff --git a/clang/test/Driver/fopenmp.c b/clang/test/Driver/fopenmp.c index 63334ba..20f583f 100644 --- a/clang/test/Driver/fopenmp.c +++ b/clang/test/Driver/fopenmp.c @@ -13,6 +13,10 @@ // RUN: %clang -target x86_64-windows-gnu -fopenmp=libomp -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP // RUN: %clang -target x86_64-windows-gnu -fopenmp=libgomp -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-NO-OPENMP // RUN: %clang -target x86_64-windows-gnu -fopenmp=libiomp5 -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP +// RUN: %clang -target x86_64-windows-gnu -fopenmp=libiomp5 -c %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-CC1-OPENMP +// RUN: %clang_cl --target=x86_64-windows-msvc /openmp -### -- %s 2>&1 | FileCheck --check-prefix=CHECK-CC1-OPENMP %s +// RUN: %clang_cl --target=i686-windows-msvc /openmp:experimental -### -- %s 2>&1 | FileCheck --check-prefix=CHECK-CC1-OPENMP %s +// RUN: %clang_cl --target=x86_64-windows-msvc /openmp- -### -- %s 2>&1 | FileCheck --check-prefix=CHECK-CC1-NO-OPENMP %s // // CHECK-CC1-OPENMP: "-cc1" // CHECK-CC1-OPENMP: "-fopenmp" -- 2.7.4