Skip to content
  1. Nov 19, 2008
  2. Nov 18, 2008
    • Chris Lattner's avatar
      start converting Sema over to using its canonical Diag method. · 377d1f8e
      Chris Lattner authored
      llvm-svn: 59561
      377d1f8e
    • Chris Lattner's avatar
    • Steve Naroff's avatar
      Fix <rdar://problem/6329769> [sema] crash on duplication definition of interface with protocols. · 119f60e1
      Steve Naroff authored
      As soon as we detect duplicate interfaces, discontinue further semantic checks (returning the original interface).
      
      This is now consistent with how we handle protocols (and less error prone in general).
      
      llvm-svn: 59541
      119f60e1
    • Douglas Gregor's avatar
      As threatened previously: consolidate name lookup and the creation of · 4ea8043d
      Douglas Gregor authored
      DeclRefExprs and BlockDeclRefExprs into a single function
      Sema::ActOnDeclarationNameExpr, eliminating a bunch of duplicate
      lookup-name-and-check-the-result code.
      
      Note that we still have the three parser entry points for identifiers,
      operator-function-ids, and conversion-function-ids, since the parser
      doesn't (and shouldn't) know about DeclarationNames. This is a Good
      Thing (TM), and there will be more entrypoints coming (e.g., for C++
      pseudo-destructor expressions).
      
      llvm-svn: 59527
      4ea8043d
    • Douglas Gregor's avatar
      Extend DeclarationName to support C++ overloaded operators, e.g., · 163c5850
      Douglas Gregor authored
      operator+, directly, using the same mechanism as all other special
      names.
      
      Removed the "special" identifiers for the overloaded operators from
      the identifier table and IdentifierInfo data structure. IdentifierInfo
      is back to representing only real identifiers.
      
      Added a new Action, ActOnOperatorFunctionIdExpr, that builds an
      expression from an parsed operator-function-id (e.g., "operator
      +"). ActOnIdentifierExpr used to do this job, but
      operator-function-ids are no longer represented by IdentifierInfo's.
      
      Extended Declarator to store overloaded operator names. 
      Sema::GetNameForDeclarator now knows how to turn the operator
      name into a DeclarationName for the overloaded operator. 
      
      Except for (perhaps) consolidating the functionality of
      ActOnIdentifier, ActOnOperatorFunctionIdExpr, and
      ActOnConversionFunctionExpr into a common routine that builds an
      appropriate DeclRefExpr by looking up a DeclarationName, all of the
      work on normalizing declaration names should be complete with this
      commit.
      
      llvm-svn: 59526
      163c5850
    • Chris Lattner's avatar
      This reworks some of the Diagnostic interfaces a bit to change how diagnostics · 8488c829
      Chris Lattner authored
      are formed.  In particular, a diagnostic with all its strings and ranges is now
      packaged up and sent to DiagnosticClients as a DiagnosticInfo instead of as a 
      ton of random stuff.  This has the benefit of simplifying the interface, making
      it more extensible, and allowing us to do more checking for things like access
      past the end of the various arrays passed in.
      
      In addition to introducing DiagnosticInfo, this also substantially changes how 
      Diagnostic::Report works.  Instead of being passed in all of the info required
      to issue a diagnostic, Report now takes only the required info (a location and 
      ID) and returns a fresh DiagnosticInfo *by value*.  The caller is then free to
      stuff strings and ranges into the DiagnosticInfo with the << operator.  When
      the dtor runs on the DiagnosticInfo object (which should happen at the end of
      the statement), the diagnostic is actually emitted with all of the accumulated
      information.  This is a somewhat tricky dance, but it means that the 
      accumulated DiagnosticInfo is allowed to keep pointers to other expression 
      temporaries without those pointers getting invalidated.
      
      This is just the minimal change to get this stuff working, but this will allow
      us to eliminate the zillions of variant "Diag" methods scattered throughout
      (e.g.) sema.  For example, instead of calling:
      
        Diag(BuiltinLoc, diag::err_overload_no_match, typeNames,
             SourceRange(BuiltinLoc, RParenLoc));
      
      We will soon be able to just do:
      
        Diag(BuiltinLoc, diag::err_overload_no_match)
            << typeNames << SourceRange(BuiltinLoc, RParenLoc));
      
      This scales better to support arbitrary types being passed in (not just 
      strings) in a type-safe way.  Go operator overloading?!
      
      llvm-svn: 59502
      8488c829
    • Ted Kremenek's avatar
      Attribute nonnull can be applied to block pointers. · 5fa5052d
      Ted Kremenek authored
      llvm-svn: 59499
      5fa5052d
    • Chris Lattner's avatar
      Change the diagnostics interface to take an array of pointers to · 16ba9139
      Chris Lattner authored
      strings instead of array of strings.  This reduces string copying
      in some not-very-important cases, but paves the way for future 
      improvements.
      
      llvm-svn: 59494
      16ba9139
    • Chris Lattner's avatar
      minor cleanups and tidying, no functionality change. · 326f7576
      Chris Lattner authored
      llvm-svn: 59485
      326f7576
    • Chris Lattner's avatar
    • Chris Lattner's avatar
      factor some code out into a helper function · 30bd3277
      Chris Lattner authored
      llvm-svn: 59483
      30bd3277
    • Sebastian Redl's avatar
  3. Nov 17, 2008
  4. Nov 16, 2008
  5. Nov 15, 2008
  6. Nov 14, 2008
    • Douglas Gregor's avatar
      Add a new expression node, CXXOperatorCallExpr, which expresses a · 993603d8
      Douglas Gregor authored
      function call created in response to the use of operator syntax that
      resolves to an overloaded operator in C++, e.g., "str1 +
      str2" that resolves to std::operator+(str1, str2)". We now build a
      CXXOperatorCallExpr in C++ when we pick an overloaded operator. (But
      only for binary operators, where we actually implement overloading)
      
      I decided *not* to refactor the current CallExpr to make it abstract
      (with FunctionCallExpr and CXXOperatorCallExpr as derived
      classes). Doing so would allow us to make CXXOperatorCallExpr a little
      bit smaller, at the cost of making the argument and callee accessors
      virtual. We won't know if this is going to be a win until we can parse
      lots of C++ code to determine how much memory we'll save by making
      this change vs. the performance penalty due to the extra virtual
      calls.
      
      llvm-svn: 59306
      993603d8
  7. Nov 13, 2008
  8. Nov 12, 2008
Loading