Implement -cl-std=

llvm-svn: 120882
This commit is contained in:
Peter Collingbourne 2010-12-04 01:51:40 +00:00
parent 422542625b
commit fafa66500b
2 changed files with 9 additions and 0 deletions

View File

@ -609,3 +609,5 @@ def cl_fast_relaxed_math : Flag<"-cl-fast-relaxed-math">,
HelpText<"OpenCL only. Sets -cl-finite-math-only and -cl-unsafe-math-optimizations, and defines __FAST_RELAXED_MATH__">; HelpText<"OpenCL only. Sets -cl-finite-math-only and -cl-unsafe-math-optimizations, and defines __FAST_RELAXED_MATH__">;
def cl_mad_enable : Flag<"-cl-mad-enable">, def cl_mad_enable : Flag<"-cl-mad-enable">,
HelpText<"OpenCL only. Enable less precise MAD instructions to be generated.">; HelpText<"OpenCL only. Enable less precise MAD instructions to be generated.">;
def cl_std_EQ : Joined<"-cl-std=">,
HelpText<"OpenCL language standard to compile for">;

View File

@ -1322,6 +1322,13 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
<< A->getAsString(Args) << A->getValue(Args); << A->getAsString(Args) << A->getValue(Args);
} }
if (const Arg *A = Args.getLastArg(OPT_cl_std_EQ)) {
if (strcmp(A->getValue(Args), "CL1.1") != 0) {
Diags.Report(diag::err_drv_invalid_value)
<< A->getAsString(Args) << A->getValue(Args);
}
}
CompilerInvocation::setLangDefaults(Opts, IK, LangStd); CompilerInvocation::setLangDefaults(Opts, IK, LangStd);
// We abuse '-f[no-]gnu-keywords' to force overriding all GNU-extension // We abuse '-f[no-]gnu-keywords' to force overriding all GNU-extension