Skip to content
  1. Feb 17, 2012
    • Richard Smith's avatar
      Bug fix: do not emit static const local variables with mutable members · e070fd2a
      Richard Smith authored
      as constants.
      
      Refactor and simplify all the separate checks for whether a type can be
      emitted as a constant.
      
      llvm-svn: 150793
      e070fd2a
    • Richard Smith's avatar
      When performing IRGen on a global, emit it as a constant if: · ae819500
      Richard Smith authored
       1) It has a const-qualified type, and
       2) It has no mutable members, and
       3) It has no dynamic initialization, and
       4) It has trivial destruction.
      Remove the unnecessary requirement that the type be POD. This allows us to
      mark all constexpr objects with no mutable members as 'constant'.
      
      llvm-svn: 150792
      ae819500
    • Douglas Gregor's avatar
      Only add 'const' to the type of variables captured in a lambda when · 7ae3c75d
      Douglas Gregor authored
      we're capturing it by value in a non-mutable lambda.
      
      llvm-svn: 150791
      7ae3c75d
    • Douglas Gregor's avatar
      Disambiguate between C++11 lambda expressions and C99 array · a80cae11
      Douglas Gregor authored
      designators in the parser. In the worst case, this disambiguation
      requires tentative parsing just past the closing ']', but for most
      cases we'll be able to tell by looking ahead just one token (without
      going into the heavyweight tentative parsing machinery).
      
      llvm-svn: 150790
      a80cae11
    • Richard Smith's avatar
      Make sure all remaining parts of the constant evaluator are aware that an array · 14a94138
      Richard Smith authored
      can be represented by an LValue, and use that to simplify the code a little.
      
      llvm-svn: 150789
      14a94138
    • John McCall's avatar
      Whether an argument is required (in contrast with being an · a729c62b
      John McCall authored
      optional argument passed through the variadic ellipsis)
      potentially affects how we need to lower it.  Propagate
      this information down to the various getFunctionInfo(...)
      overloads on CodeGenTypes.  Furthermore, rename those
      overloads to clarify their distinct purposes, and make
      sure we're calling the right one in the right place.
      This has a nice side-effect of making it easier to construct
      a function type, since the 'variadic' bit is no longer
      separable.
      
      This shouldn't really change anything for our existing
      platforms, with one minor exception --- we should now call
      variadic ObjC methods with the ... in the "right place"
      (see the test case), which I guess matters for anyone
      running GNUStep on MIPS.  Mostly it's just a substantial
      clean-up.
      
      llvm-svn: 150788
      a729c62b
    • John McCall's avatar
      Block expressions always have a prototyped function type; expose this · c833deaa
      John McCall authored
      in the AST accessor and micro-optimize it very slightly.
      
      llvm-svn: 150787
      c833deaa
    • Douglas Gregor's avatar
      Rework the Sema/AST/IRgen dance for the lambda closure type's · 355efbb2
      Douglas Gregor authored
      conversion to function pointer. Rather than having IRgen synthesize
      the body of this function, we instead introduce a static member
      function "__invoke" with the same signature as the lambda's
      operator() in the AST. Sema then generates a body for the conversion
      to function pointer which simply returns the address of __invoke. This
      approach makes it easier to evaluate a call to the conversion function
      as a constant, makes the linkage of the __invoke function follow the
      normal rules for member functions, and may make life easier down the
      road if we ever want to constexpr'ify some of lambdas.
      
      Note that IR generation is responsible for filling in the body of
      __invoke (Sema just adds a dummy body), because the body can't
      generally be expressed in C++.
      
      Eli, please review!
      
      llvm-svn: 150783
      355efbb2
    • Richard Smith's avatar
      Reject continue/break statements within members of local functions nested within · 1002d10a
      Richard Smith authored
      loop and switch statements, by teaching Scope that a function scope never has
      a continue/break parent for the purposes of control flow. Remove the hack in
      block and lambda expressions which worked around this by pretending that such
      expressions were continue/break scopes.
      
      Remove Scope::ControlParent, since it's unused.
      
      In passing, teach default statements to recover properly from a missing ';', and
      add a fixit for same to both default and case labels (the latter already
      recovered correctly).
      
      llvm-svn: 150776
      1002d10a
    • Richard Smith's avatar
      PR12012: Fix a regression in r150419 where we would try (and fail) to · 5d108606
      Richard Smith authored
      zero-initialize class types with virtual bases when constant-evaluating an
      initializer.
      
      llvm-svn: 150770
      5d108606
    • Fariborz Jahanian's avatar
      objective-c translator. More stuff for modern meta-data. · e7a0c93c
      Fariborz Jahanian authored
      llvm-svn: 150767
      e7a0c93c
  2. Feb 16, 2012
Loading