Skip to content
  1. Nov 05, 2008
  2. Nov 04, 2008
  3. Nov 03, 2008
  4. Oct 31, 2008
  5. Oct 29, 2008
  6. Oct 27, 2008
    • Douglas Gregor's avatar
      Refactor the expression class hierarchy for casts. Most importantly: · e200adc5
      Douglas Gregor authored
        - CastExpr is the root of all casts
        - ImplicitCastExpr is (still) used for all explicit casts
        - ExplicitCastExpr is now the root of all *explicit* casts
        - ExplicitCCastExpr (new name needed!?) is a C-style cast in C or C++
        - CXXFunctionalCastExpr inherits from ExplicitCastExpr
        - CXXNamedCastExpr inherits from ExplicitCastExpr and is the root of all
          of the C++ named cast expression types (static_cast, dynamic_cast, etc.)
        - Added classes CXXStaticCastExpr, CXXDynamicCastExpr, 
          CXXReinterpretCastExpr, and CXXConstCastExpr to 
      
      Also, fixed returned-stack-addr.cpp, which broke once when we fixed
      reinterpret_cast to diagnose double->int* conversions and again when
      we eliminated implicit conversions to reference types. The fix is in
      both testcase and SemaChecking.cpp.
      
      Most of this patch is simply support for the renaming. There's very
      little actual change in semantics.
      
      llvm-svn: 58264
      e200adc5
    • Sebastian Redl's avatar
      Fix some invalid casts that are detected by Sema now or soon. · 344fc3db
      Sebastian Redl authored
      llvm-svn: 58252
      344fc3db
    • Douglas Gregor's avatar
      When destroying a translation unit, deallocate its owned declarations in... · 89ebcb9d
      Douglas Gregor authored
      When destroying a translation unit, deallocate its owned declarations in reverse order, because there may be dependencies among the declarations.
      
      llvm-svn: 58244
      89ebcb9d
  7. Oct 25, 2008
  8. Oct 24, 2008
  9. Oct 23, 2008
    • Douglas Gregor's avatar
      Add support for conversions from a pointer-to-derived to a · 5c407d9a
      Douglas Gregor authored
      pointer-to-base. Also, add overload ranking for pointer conversions
      (for both pointer-to-void and derived-to-base pointer conversions).
      
      Note that we do not yet diagnose derived-to-base pointer conversion
      errors that stem from ambiguous or inacessible base classes. These
      aren't handled during overload resolution; rather, when the conversion
      is actually used we go ahead and diagnose the error.
      
      llvm-svn: 58017
      5c407d9a
  10. Oct 22, 2008
    • Douglas Gregor's avatar
      Add representation of base classes in the AST, and verify that we · 29a9247e
      Douglas Gregor authored
      don't have duplicated direct base classes.
      
      Seriliazation of base class specifiers is not yet implemented.
      
      llvm-svn: 57991
      29a9247e
    • Douglas Gregor's avatar
      Implement ranking of standard conversion sequences by their qualification · e1eb9d8c
      Douglas Gregor authored
      conversions (e.g., comparing int* -> const int* against 
      int* -> const volatile int*); see C++ 13.3.3.2p3 bullet 3.
      
      Add Sema::UnwrapSimilarPointerTypes to simplify the control flow of
      IsQualificationConversion and CompareQualificationConversion (and fix
      the handling of the int* -> volatile int* conversion in the former).
       
      
      llvm-svn: 57978
      e1eb9d8c
    • Douglas Gregor's avatar
      Fix a thinko in the qualification-conversion check when the qualificaitons are... · ea2d4211
      Douglas Gregor authored
      Fix a thinko in the qualification-conversion check when the qualificaitons are disjoint, and add some overloading-based tests of qualification conversions
      
      llvm-svn: 57942
      ea2d4211
    • Douglas Gregor's avatar
      Initial step toward supporting qualification conversions (C++ 4.4). · 9a657934
      Douglas Gregor authored
      Changes:
        - Sema::IsQualificationConversion determines whether we have a qualification
          conversion.
        - Sema::CheckSingleAssignment constraints now follows the C++ rules in C++,
          performing an implicit conversion from the right-hand side to the type of
          the left-hand side rather than checking based on the C notion of 
          "compatibility". We now rely on the implicit-conversion code to
          determine whether the conversion can happen or
          not. Sema::TryCopyInitialization has an ugly reference-related
          hack to cope with the initialization of references, for now.
        - When building DeclRefExprs, strip away the reference type, since
          there are no expressions whose type is a reference. We'll need to
          do this throughout Sema.
        - Expr::isLvalue now permits functions to be lvalues in C++ (but not
        in C).
      
      llvm-svn: 57935
      9a657934
  11. Oct 21, 2008
  12. Oct 16, 2008
  13. Oct 15, 2008
    • Argyrios Kyrtzidis's avatar
      Fix this bug: · 2e3e7563
      Argyrios Kyrtzidis authored
      typedef int f();
      struct S {
         f *x; // incorrectly assuming this is function decl, leading to failed assertions.
      };
      
      llvm-svn: 57598
      2e3e7563
  14. Oct 09, 2008
    • Argyrios Kyrtzidis's avatar
      Fix a bug that crashed clang when parsing this: · 1207d319
      Argyrios Kyrtzidis authored
      class C {
        static const int number = 50;
        static int arr[number];
      };
      
      Here's how it worked:
      -GetTypeForDeclarator was called from both Sema::ActOnCXXMemberDeclarator and Sema::ActOnDeclarator.
      -VariableArrayTypes are not uniqued so two VariableArrayTypes were created with the same DeclRefExpr.
      -On exit they both tried to destroy that one DeclRefExpr.
      
      The fix is not to use GetTypeForDeclarator from the Sema::ActOnCXXMemberDeclarator.
      
      llvm-svn: 57313
      1207d319
  15. Oct 07, 2008
  16. Oct 06, 2008
    • Argyrios Kyrtzidis's avatar
      Implement support for C++ direct initializers in declarations, e.g. "int x(1);". · 9a1191c0
      Argyrios Kyrtzidis authored
      This is how this kind of initializers appear in the AST:
      -The Init expression of the VarDecl is a functional type construction (of the VarDecl's type).
      -The new VarDecl::hasCXXDirectInitializer() returns true.
      
      e.g, for "int x(1);":
      -VarDecl 'x' has Init with expression "int(1)" (CXXFunctionalCastExpr).
      -hasCXXDirectInitializer() of VarDecl 'x' returns true.
      
      A major benefit is that clients that don't particularly care about which exactly form was the initializer can handle both cases without special case code.
      Note that codegening works now for "int x(1);" without any changes to CodeGen.
      
      llvm-svn: 57178
      9a1191c0
  17. Oct 05, 2008
Loading