From 8bc56022db2d9b16aab25ce3b6fccda9dd8991fc Mon Sep 17 00:00:00 2001 From: David Tweed Date: Mon, 9 Sep 2013 09:17:24 +0000 Subject: The OpenCL standard specifies the sizes and alignments of various types than other C-family languages, as well as specifying errno is not set by the math functions. Make the clang front-end set those appropriately when the OpenCL language option is set. Patch by Erik Schnetter! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190296 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Frontend/CompilerInvocation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/Frontend/CompilerInvocation.cpp') diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index 7e21f55c76..ce4fdc32d2 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -1274,7 +1274,7 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, Opts.Blocks = Args.hasArg(OPT_fblocks); Opts.BlocksRuntimeOptional = Args.hasArg(OPT_fblocks_runtime_optional); Opts.Modules = Args.hasArg(OPT_fmodules); - Opts.CharIsSigned = !Args.hasArg(OPT_fno_signed_char); + Opts.CharIsSigned = Opts.OpenCL || !Args.hasArg(OPT_fno_signed_char); Opts.WChar = Opts.CPlusPlus && !Args.hasArg(OPT_fno_wchar); Opts.ShortWChar = Args.hasArg(OPT_fshort_wchar); Opts.ShortEnums = Args.hasArg(OPT_fshort_enums); @@ -1285,7 +1285,7 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, Opts.HeinousExtensions = Args.hasArg(OPT_fheinous_gnu_extensions); Opts.AccessControl = !Args.hasArg(OPT_fno_access_control); Opts.ElideConstructors = !Args.hasArg(OPT_fno_elide_constructors); - Opts.MathErrno = Args.hasArg(OPT_fmath_errno); + Opts.MathErrno = !Opts.OpenCL && Args.hasArg(OPT_fmath_errno); Opts.InstantiationDepth = getLastArgIntValue(Args, OPT_ftemplate_depth, 256, Diags); Opts.ConstexprCallDepth = -- cgit v1.2.3