<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">I will fix that. Thanks.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Sam<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> metafoo@gmail.com [mailto:metafoo@gmail.com]
<b>On Behalf Of </b>Richard Smith<br>
<b>Sent:</b> Wednesday, May 25, 2016 2:54 PM<br>
<b>To:</b> Liu, Yaxun (Sam) <Yaxun.Liu@amd.com>; reviews+D20630+public+1c58d99d1f368a1e@reviews.llvm.org<br>
<b>Cc:</b> alexey.bader@intel.com; Anastasia Stulova <anastasia.stulova@arm.com>; cfe-commits <cfe-commits@lists.llvm.org><br>
<b>Subject:</b> Re: [PATCH] D20630: [OpenCL] Allow -std=CL|CL1.1|CL1.2|CL2.0 in driver<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p>On 25 May 2016 9:13 a.m., "Yaxun Liu via cfe-commits" <<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>> wrote:<br>
><br>
> yaxunl created this revision.<br>
> yaxunl added a reviewer: Anastasia.<br>
> yaxunl added subscribers: pxli168, bader, tstellarAMD, cfe-commits.<br>
><br>
> Fix a regression which forbids using -std=CL|CL1.1|CL1.2|CL2.0 in driver.<br>
><br>
> Changed -std=cl to -std=CL to match -cl-std=CL.<o:p></o:p></p>
<p>This is inconsistent with our existing command-line interface. It would be more consistent to change -cl-std= to accept lowercase cl instead.<o:p></o:p></p>
<p>> <a href="http://reviews.llvm.org/D20630" target="_blank">http://reviews.llvm.org/D20630</a><br>
><br>
> Files:<br>
> include/clang/Frontend/LangStandards.def<br>
> lib/Frontend/CompilerInvocation.cpp<br>
> test/Driver/<a href="http://opencl.cl" target="_blank">opencl.cl</a><br>
><br>
> Index: test/Driver/<a href="http://opencl.cl" target="_blank">opencl.cl</a><br>
> ===================================================================<br>
> --- /dev/null<br>
> +++ test/Driver/<a href="http://opencl.cl" target="_blank">opencl.cl</a><br>
> @@ -0,0 +1,11 @@<br>
> +// RUN: %clang %s<br>
> +// RUN: %clang -std=CL %s<br>
> +// RUN: %clang -std=CL1.1 %s<br>
> +// RUN: %clang -std=CL1.2 %s<br>
> +// RUN: %clang -std=CL2.0 %s<br>
> +// RUN: not %clang_cc1 -std=c99 -DOPENCL %s 2>&1 | FileCheck --check-prefix=CHECK-C99 %s<br>
> +// RUN: not %clang_cc1 -std=invalid -DOPENCL %s 2>&1 | FileCheck --check-prefix=CHECK-INVALID %s<br>
> +// CHECK-C99: error: invalid argument '-std=c99' not allowed with 'OpenCL'<br>
> +// CHECK-INVALID: error: invalid value 'invalid' in '-std=invalid'<br>
> +<br>
> +kernel void func(void);<br>
> Index: lib/Frontend/CompilerInvocation.cpp<br>
> ===================================================================<br>
> --- lib/Frontend/CompilerInvocation.cpp<br>
> +++ lib/Frontend/CompilerInvocation.cpp<br>
> @@ -1398,6 +1398,13 @@<br>
> Opts.AddVFSOverlayFile(A->getValue());<br>
> }<br>
><br>
> +bool isOpenCL(LangStandard::Kind LangStd) {<br>
> + return LangStd == LangStandard::lang_opencl<br>
> + || LangStd == LangStandard::lang_opencl11<br>
> + || LangStd == LangStandard::lang_opencl12<br>
> + || LangStd == LangStandard::lang_opencl20;<br>
> +}<br>
> +<br>
> void CompilerInvocation::setLangDefaults(LangOptions &Opts, InputKind IK,<br>
> const llvm::Triple &T,<br>
> LangStandard::Kind LangStd) {<br>
> @@ -1462,7 +1469,7 @@<br>
> Opts.ImplicitInt = Std.hasImplicitInt();<br>
><br>
> // Set OpenCL Version.<br>
> - Opts.OpenCL = LangStd == LangStandard::lang_opencl || IK == IK_OpenCL;<br>
> + Opts.OpenCL = isOpenCL(LangStd) || IK == IK_OpenCL;<br>
> if (LangStd == LangStandard::lang_opencl)<br>
> Opts.OpenCLVersion = 100;<br>
> else if (LangStd == LangStandard::lang_opencl11)<br>
> @@ -1555,8 +1562,9 @@<br>
> << A->getAsString(Args) << "C++/ObjC++";<br>
> break;<br>
> case IK_OpenCL:<br>
> - Diags.Report(diag::err_drv_argument_not_allowed_with)<br>
> - << A->getAsString(Args) << "OpenCL";<br>
> + if (!isOpenCL(LangStd))<br>
> + Diags.Report(diag::err_drv_argument_not_allowed_with)<br>
> + << A->getAsString(Args) << "OpenCL";<br>
> break;<br>
> case IK_CUDA:<br>
> case IK_PreprocessedCuda:<br>
> Index: include/clang/Frontend/LangStandards.def<br>
> ===================================================================<br>
> --- include/clang/Frontend/LangStandards.def<br>
> +++ include/clang/Frontend/LangStandards.def<br>
> @@ -132,7 +132,7 @@<br>
> Digraphs | HexFloat | GNUMode)<br>
><br>
> // OpenCL<br>
> -LANGSTANDARD(opencl, "cl",<br>
> +LANGSTANDARD(opencl, "CL",<br>
> "OpenCL 1.0",<br>
> LineComment | C99 | Digraphs | HexFloat)<br>
> LANGSTANDARD(opencl11, "CL1.1",<br>
><br>
><br>
><br>
> _______________________________________________<br>
> cfe-commits mailing list<br>
> <a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" target="_blank">
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
><o:p></o:p></p>
</div>
</div>
</body>
</html>