[cfe-commits] [PATCH] First OpenMP patch

Dmitri Gribenko gribozavr at gmail.com
Wed Dec 12 00:39:52 PST 2012


On Wed, Dec 12, 2012 at 6:10 AM, Alexey Bataev <a.bataev at gmx.com> wrote:
> Hello guys,
> Are there any comments on this version of patch? If no, then can I commit?

Sorry for a long delay.  I do have comments.

+// Only -Wsource-uses-openmp is passed.
+// RUN: %clang -### -S -Wsource-uses-openmp -o - %s 2>&1 | FileCheck
--check-prefix=CHECK-WOMP %s
+// CHECK-WOMP: -Wsource-uses-openmp
+// RUN: %clang -### -S -Wsource-uses-openmp -o - %s 2>&1 | FileCheck
--check-prefix=CHECK-WOMPN %s
+// CHECK-WOMPN-NOT: -Wno-source-uses-openmp

It doesn't make sense to test this by itself.  This aspect of the
Clang warning infrastructure is working well and is tested elsewhere.

Sorry if that was unclear, but what I meant to ask to test is: if
-Wsource-uses-openmp is passed or not depending on whether
-fopenmp/-fno-openmp is passed.

+  // -fno-openmp switch processing
+  if (Args.hasArg(OPT_fno_openmp)) {
+    Opts.Warnings.push_back("no-source-uses-openmp");
+  }

Now I see that since warning is controlled from the frontend, rather
than the driver, it is not possible to test the logic with -###.  I
wonder if it is possible (and makes sense!) to move this logic to the
driver, since the frontend should not make such decisions.

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/



More information about the cfe-commits mailing list