Skip to content
  1. Apr 22, 2012
  2. Apr 20, 2012
  3. Apr 19, 2012
  4. Apr 18, 2012
  5. Apr 17, 2012
    • Richard Smith's avatar
      Implement DR1330 in C++11 mode, to support libstdc++4.7 which uses it. · f623c962
      Richard Smith authored
      We have a new flavor of exception specification, EST_Uninstantiated. A function
      type with this exception specification carries a pointer to a FunctionDecl, and
      the exception specification for that FunctionDecl is instantiated (if needed)
      and used in the place of the function type's exception specification.
      
      When a function template declaration with a non-trivial exception specification
      is instantiated, the specialization's exception specification is set to this
      new 'uninstantiated' kind rather than being instantiated immediately.
      
      Expr::CanThrow has migrated onto Sema, so it can instantiate exception specs
      on-demand. Also, any odr-use of a function triggers the instantiation of its
      exception specification (the exception specification could be needed by IRGen).
      In passing, fix two places where a DeclRefExpr was created but the corresponding
      function was not actually marked odr-used. We used to get away with this, but
      don't any more.
      
      Also fix a bug where instantiating an exception specification which refers to
      function parameters resulted in a crash. We still have the same bug in default
      arguments, which I'll be looking into next.
      
      This, plus a tiny patch to fix libstdc++'s common_type, is enough for clang to
      parse (and, in very limited testing, support) all of libstdc++4.7's standard
      headers.
      
      llvm-svn: 154886
      f623c962
  6. Apr 16, 2012
    • Rafael Espindola's avatar
      Revert r154749 for now at John McCall's request. · 78158af5
      Rafael Espindola authored
      llvm-svn: 154846
      78158af5
    • Douglas Gregor's avatar
      Implement C++11 [expr.prim.general]p3, which permits the use of 'this' · 3024f07c
      Douglas Gregor authored
      in the declaration of a non-static member function after the
      (optional) cv-qualifier-seq, which in practice means in the exception
      specification and late-specified return type. 
      
      The new scheme here used to manage 'this' outside of a member function
      scope is more general than the Scope-based mechanism previously used
      for non-static data member initializers and late-parsesd attributes,
      because it can also handle the cv-qualifiers on the member
      function. Note, however, that a separate pass is required for static
      member functions to determine whether 'this' was used, because we
      might not know that we have a static function until after declaration
      matching.
      
      Finally, this introduces name mangling for 'this' and for the implicit
      'this', which is intended to match GCC's mangling. Independent
      verification for the new mangling test case would be appreciated.
      
      Fixes PR10036 and PR12450.
      
      llvm-svn: 154799
      3024f07c
  7. Apr 15, 2012
    • Richard Smith's avatar
      PR12226: don't generate wrong code if a braced string literal is used to · 9ec1e48b
      Richard Smith authored
      initialize an array of unsigned char. Outside C++11 mode, this bug was benign,
      and just resulted in us emitting a constant which was double the required
      length, padded with 0s. In C++11, it resulted in us generating an array whose
      first element was something like  i8 ptrtoint ([n x i8]* @str to i8).
      
      llvm-svn: 154756
      9ec1e48b
  8. Apr 14, 2012
  9. Apr 13, 2012
  10. Apr 12, 2012
  11. Apr 11, 2012
  12. Apr 10, 2012
  13. Apr 08, 2012
  14. Apr 07, 2012
  15. Apr 06, 2012
  16. Apr 04, 2012
  17. Apr 03, 2012
    • Eric Christopher's avatar
      Change location information for synthesized properties to be at the · b7e821a6
      Eric Christopher authored
      property file/line rather than the @synthesize file/line. Avoids
      some nasty confusing-ness with conflating the file from the scope
      and the line from the original declaration. Use    the current scope
      location as a separate parameter so that we can    match it up
      better in the line table with the beginning of the scope.
      
      Update a couple of testcases accordingly since I had to change
      that we actually use the passed in location in EmitFunctionStart
      and for the new metadata parameter and add a new testcase to
      make sure we've got the right line numbers for synthesized
      properties.
      
      Part of rdar://11026482
      
      llvm-svn: 153917
      b7e821a6
  18. Mar 30, 2012
    • John McCall's avatar
      Make sure we unique static-local decls across multiple emissions of · b88a566c
      John McCall authored
      the function body, but do so in a way that doesn't make any assumptions
      about the static local actually having a proper, unique mangling,
      since apparently we don't do that correctly at all.
      
      llvm-svn: 153776
      b88a566c
    • Chandler Carruth's avatar
      Revert r153723, and its follow-ups r153728 and r153733. · 84537952
      Chandler Carruth authored
      These patches cause us to miscompile and/or reject code with static
      function-local variables in an extern-C context. Previously, we were
      papering over this as long as the variables are within the same
      translation unit, and had not seen any failures in the wild. We still
      need a proper fix, which involves mangling static locals inside of an
      extern-C block (as GCC already does), but this patch causes pretty
      widespread regressions. Firefox, and many other applications no longer
      build.
      
      Lots of test cases have been posted to the list in response to this
      commit, so there should be no problem reproducing the issues.
      
      llvm-svn: 153768
      84537952
    • John McCall's avatar
      Do the static-locals thing properly in the face of unions and · 87590e60
      John McCall authored
      other things which might mess with the variable's type.
      
      llvm-svn: 153733
      87590e60
    • John McCall's avatar
      When emitting a static local variable in C++, handle · 947c1830
      John McCall authored
      the case that the variable already exists.  Partly this is just
      protection against people making crazy declarations with custom
      asm labels or extern "C" names that intentionally collide with
      the manglings of such variables, but the main reason is that we
      can actually emit a static local variable twice with the
      requirement that it match up.  There may be other cases with
      (e.g.) the various nested functions, but the main exemplar is
      with constructor variants, where we can be forced into
      double-emitting the function body under certain circumstances
      like (currently) the presence of virtual bases.
      
      llvm-svn: 153723
      947c1830
    • Eli Friedman's avatar
      ConstStructBuilder: fix offset math for base classes so it works correctly in... · a154dd5b
      Eli Friedman authored
      ConstStructBuilder: fix offset math for base classes so it works correctly in general.  Found by inspection.
      
      llvm-svn: 153720
      a154dd5b
  19. Mar 29, 2012
  20. Mar 28, 2012
    • Chandler Carruth's avatar
      Move the emission of strict enum range metadata behind a flag (the same · 8b4140d7
      Chandler Carruth authored
      flag as GCC uses: -fstrict-enums). There is a *lot* of code making
      unwarranted assumptions about the underlying type of enums, and it
      doesn't seem entirely reasonable to eagerly break all of it.
      
      Much more importantly, the current state of affairs is *very* good at
      optimizing based upon this information, which causes failures that are
      very distant from the actual enum. Before we push for enabling this by
      default, I think we need to implement -fcatch-undefined-behavior support
      for instrumenting and trapping whenever we store or load a value outside
      of the range. That way we can track down the misbehaving code very
      quickly.
      
      I discussed this with Rafael, and currently the only important cases he
      is aware of are the bool range-based optimizations which are staying
      hard enabled. We've not seen any issue with those either, and they are
      much more important for performance.
      
      llvm-svn: 153550
      8b4140d7
  21. Mar 24, 2012
Loading