Skip to content
Snippets Groups Projects
  1. Feb 15, 2017
  2. Feb 07, 2017
  3. Dec 20, 2016
    • Richard Smith's avatar
      [c++1z] P0195R2: Support pack-expansion of using-declarations. · c8c1a196
      Richard Smith authored
      This change introduces UsingPackDecl as a marker for the set of UsingDecls
      produced by pack expansion of a single (unresolved) using declaration. This is
      not strictly necessary (we just need to be able to map from the original using
      declaration to its expansions somehow), but it's useful to maintain the
      invariant that each declaration reference instantiates to refer to one
      declaration.
      
      This is a re-commit of r290080 (reverted in r290092) with a fix for a
      use-after-lifetime bug.
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290203 91177308-0d34-0410-b5e6-96231b3b80d8
      c8c1a196
  4. Dec 19, 2016
  5. Dec 09, 2016
    • Reid Kleckner's avatar
      Store decls in prototypes on the declarator instead of in the AST · 3a67a19e
      Reid Kleckner authored
      This saves two pointers from FunctionDecl that were being used for some
      rare and questionable C-only functionality.  The DeclsInPrototypeScope
      ArrayRef was added in r151712 in order to parse this kind of C code:
      
          enum e {x, y};
          int f(enum {y, x} n) {
           return x; // should return 1, not 0
          }
      
      The challenge is that we parse 'int f(enum {y, x} n)' it its own
      function prototype scope that gets popped before we build the
      FunctionDecl for 'f'. The original change was doing two questionable
      things:
      
      1. Saving all tag decls introduced in prototype scope on a TU-global
      Sema variable. This is problematic when you have cases like this, where
      'x' and 'y' shouldn't be visible in 'f':
          void f(void (*fp)(enum { x, y } e)) { /* no x */ }
      This patch fixes that, so now 'f' can't see 'x', which is consistent
      with GCC.
      
      2. Storing the decls in FunctionDecl in ActOnFunctionDeclarator so that
      they could be used in ActOnStartOfFunctionDef. This is just an
      inefficient way to move information around. The AST lives forever, but
      the list of non-parameter decls in prototype scope is short lived.
      
      Moving these things to the Declarator solves both of these issues.
      
      Reviewers: rsmith
      
      Subscribers: jmolloy, cfe-commits
      
      Differential Revision: https://reviews.llvm.org/D27279
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289225 91177308-0d34-0410-b5e6-96231b3b80d8
      3a67a19e
  6. Oct 20, 2016
  7. May 26, 2016
  8. May 09, 2016
  9. Apr 15, 2016
  10. Apr 13, 2016
  11. Apr 08, 2016
    • Alexey Bader's avatar
      [OpenCL] Complete image types support. · aa8b893c
      Alexey Bader authored
      I. Current implementation of images is not conformant to spec in the following points:
        1. It makes no distinction with respect to access qualifiers and therefore allows to use images with different access type interchangeably. The following code would compile just fine:
      
              void write_image(write_only image2d_t img);
              kernel void foo(read_only image2d_t img) { write_image(img); } // Accepted code
      
           which is disallowed according to s6.13.14.
      
        2. It discards access qualifier on generated code, which leads to generated code for the above example:
      
              call void @write_image(%opencl.image2d_t* %img);
      
           In OpenCL2.0 however we can have different calls into write_image with read_only and wite_only images.
           Also generally following compiler steps have no easy way to take different path depending on the image access: linking to the right implementation of image types, performing IR opts and backend codegen differently.
      
        3. Image types are language keywords and can't be redeclared s6.1.9, which can happen currently as they are just typedef names.
        4. Default access qualifier read_only is to be added if not provided explicitly.
      
      II. This patch corrects the above points as follows:
        1. All images are encapsulated into a separate .def file that is inserted in different points where image handling is required. This avoid a lot of code repetition as all images are handled the same way in the code with no distinction of their exact type.
        2. The Cartesian product of image types and image access qualifiers is added to the builtin types. This simplifies a lot handling of access type mismatch as no operations are allowed by default on distinct Builtin types. Also spec intended access qualifier as special type qualifier that are combined with an image type to form a distinct type (see statement above - images can't be created w/o access qualifiers).
        3. Improves testing of images in Clang.
      
      Author: Anastasia Stulova
      Reviewers: bader, mgrang.
      Subscribers: pxli168, pekka.jaaskelainen, yaxunl.
      Differential Revision: http://reviews.llvm.org/D17821
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@265783 91177308-0d34-0410-b5e6-96231b3b80d8
      aa8b893c
  12. Mar 04, 2016
  13. Jan 09, 2016
  14. Nov 11, 2015
    • Richard Smith's avatar
      Add support for GCC's '__auto_type' extension, per the GCC manual: · ea21696b
      Richard Smith authored
      https://gcc.gnu.org/onlinedocs/gcc/Typeof.html
      
      Differences from the GCC extension:
       * __auto_type is also permitted in C++ (but only in places where
         it could appear in C), allowing its use in headers that might
         be shared across C and C++, or used from C++98
       * __auto_type can be combined with a declarator, as with C++ auto
         (for instance, "__auto_type *p")
       * multiple variables can be declared in a single __auto_type
         declaration, with the C++ semantics (the deduced type must be
         the same in each case)
      
      This patch also adds a missing restriction on applying typeof to
      a bit-field, which GCC has historically rejected in C (due to
      lack of clarity as to whether the operand should be promoted).
      The same restriction also applies to __auto_type in C (in both
      GCC and Clang).
      
      This also fixes PR25449.
      
      Patch by Nicholas Allegra!
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252690 91177308-0d34-0410-b5e6-96231b3b80d8
      ea21696b
  15. Sep 23, 2015
  16. Jun 23, 2015
  17. Jun 22, 2015
  18. Mar 27, 2015
  19. Dec 30, 2014
  20. Nov 19, 2014
  21. Nov 08, 2014
    • Richard Smith's avatar
      [c++1z] N4295: fold-expressions. · 4617a9df
      Richard Smith authored
      This is a new form of expression of the form:
      
        (expr op ... op expr)
      
      where one of the exprs is a parameter pack. It expands into
      
        (expr1 op (expr2onwards op ... op expr))
      
      (and likewise if the pack is on the right). The non-pack operand can be
      omitted; in that case, an empty pack gives a fallback value or an error,
      depending on the operator.
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221573 91177308-0d34-0410-b5e6-96231b3b80d8
      4617a9df
  22. Oct 27, 2014
  23. Aug 29, 2014
  24. Aug 12, 2014
  25. May 29, 2014
  26. May 26, 2014
  27. Apr 23, 2014
  28. Mar 12, 2014
  29. Mar 02, 2014
  30. Jan 07, 2014
  31. Dec 18, 2013
    • Alp Toker's avatar
      Remove OpenCL-specific type keywords and specifiers · e0738f6c
      Alp Toker authored
      This commit kills off custom type specifier and keyword handling of OpenCL C
      data types.
      
      Although the OpenCL spec describes them as keywords, we can handle them more
      elegantly as predefined types. This should provide better error correction and
      code completion as well as simplifying the implementation.
      
      The primary intention is however to simplify the C/C++ parser and save some
      packed bits on AST structures that had been extended in r170432 just for
      OpenCL.
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197578 91177308-0d34-0410-b5e6-96231b3b80d8
      e0738f6c
  32. Aug 17, 2013
  33. Jun 20, 2013
  34. Jun 07, 2013
  35. May 16, 2013
Loading