[cfe-commits] [PATCH] Bugfix for problem setting CXXOperatorNames option for OpenCL

Andy Arvanitis andy.arvanitis at gmail.com
Fri Apr 15 20:48:39 PDT 2011


Hi,

I'm submitting a fix for an error in lib/Frontend/CompilerInvokation.cpp
where the flag for CXX operator names gets overwritten (it was set by
OpenCL, and could be by other languages in the future).

Patch attached. BTW, I couldn't find a report for it in Bugzilla -- I didn't
try to create one though, let me know if I should.


  // OpenCL has some additional defaults.
  if (LangStd == LangStandard::lang_opencl) {
    Opts.OpenCL = 1;
    Opts.AltiVec = 1;
    Opts.CXXOperatorNames = 1;
    Opts.LaxVectorConversions = 1;
    Opts.DefaultFPContract = 1;
  }

  if (LangStd == LangStandard::lang_cuda)
    Opts.CUDA = 1;

  // OpenCL and C++ both have bool, true, false keywords.
  Opts.Bool = Opts.OpenCL || Opts.CPlusPlus;

  Opts.GNUKeywords = Opts.GNUMode;
  Opts.CXXOperatorNames = Opts.CPlusPlus;

-- Section of fix patch --

   Opts.GNUKeywords = Opts.GNUMode;
-  Opts.CXXOperatorNames = Opts.CPlusPlus;
+  if (Opts.CPlusPlus)
+    Opts.CXXOperatorNames = 1;



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110415/914d497e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: opencl_op_names.patch
Type: application/octet-stream
Size: 559 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110415/914d497e/attachment.obj>


More information about the cfe-commits mailing list