|  | Commit message (Collapse) | Author | Age | Files | Lines | 
|---|
| ... |  | 
| | 
| 
| 
| 
| 
| 
| | are trying to use the old GCC "casts as lvalue" extension.  We don't and
will hopefully never support this.
llvm-svn: 59460 | 
| | 
| 
| 
| 
| 
| | qualified id.
llvm-svn: 59459 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | 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 | 
| | 
| 
| 
| 
| 
| | candidates. Thanks to Chris for the review!
llvm-svn: 59260 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | functions for built-in operators, e.g., the builtin
  bool operator==(int const*, int const*)
can be used for the expression "x1 == x2" given:
  struct X {
    operator int const*();
  } x1, x2;
The scheme for handling these built-in operators is relatively simple:
for each candidate required by the standard, create a special kind of
candidate function for the built-in. If overload resolution picks the
built-in operator, we perform the appropriate conversions on the
arguments and then let the normal built-in operator take care of it. 
There may be some optimization opportunity left: if we can reduce the
number of built-in operator overloads we generate, overload resolution
for these cases will go faster. However, one must be careful when
doing this: GCC generates too few operator overloads in our little
test program, and fails to compile it because none of the overloads it
generates match.
Note that we only support operator overload for non-member binary
operators at the moment. The other operators will follow.
As part of this change, ImplicitCastExpr can now be an lvalue.
llvm-svn: 59148 | 
| | 
| 
| 
| 
| 
| | expressions, both of values and types.
llvm-svn: 59057 | 
| | 
| 
| 
| | llvm-svn: 59000 | 
| | 
| 
| 
| | llvm-svn: 58916 | 
| | 
| 
| 
| 
| 
| 
| 
| | Parser side.
No Sema functionality change, just the signatures of the Action/Sema methods.
llvm-svn: 58913 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | operators. For example, one can now write "x + y" where x or y is a
class or enumeration type, and Clang will perform overload resolution
for "+" based on the overloaded operators it finds.
The other kinds of overloadable operators in C++ will follow this same
approach. 
Three major issues remain:
  1) We don't find member operators
  2) Since we don't have user-defined conversion operators, we can't
  call any of the built-in overloaded operators in C++ [over.built].
  3) Once we've done the semantic checks, we drop the overloaded
  operator on the floor; it doesn't get into the AST at all.
llvm-svn: 58821 | 
| | 
| 
| 
| 
| 
| 
| 
| | duplication in the handling of copy-initialization by constructor,
which occurs both for initialization of a declaration and for
overloading. The initialization code is due for some refactoring.
llvm-svn: 58756 | 
| | 
| 
| 
| 
| 
| | 'super'. Remove ObjCThis from PredefinedExpr
llvm-svn: 58698 | 
| | 
| 
| 
| 
| 
| | < FileIDs.size() && "Invalid FileID!", file c:\cygwin\home\Administrator\llvm\tools\clang\include\clang/Basic/SourceManager.h, line 513
llvm-svn: 58654 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | ImplicitConversionSequence and, when doing so, following the specific
rules of [over.best.ics]. 
The computation of the implicit conversion sequences implements C++
[over.ics.ref], but we do not (yet) have ranking for implicit
conversion sequences that use reference binding.
llvm-svn: 58357 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | of copy initialization. Other pieces of the puzzle:
  - Try/Perform-ImplicitConversion now handles implicit conversions
    that don't involve references.
  - Try/Perform-CopyInitialization uses
    CheckSingleAssignmentConstraints for C. PerformCopyInitialization
    is now used for all argument passing and returning values from a
    function.
  - Diagnose errors with declaring references and const values without
    an initializer. (Uses a new Action callback, ActOnUninitializedDecl).
  
We do not yet have implicit conversion sequences for reference
binding, which means that we don't have any overloading support for
reference parameters yet.
llvm-svn: 58353 | 
| | 
| 
| 
| | llvm-svn: 58331 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | - Do not allow expressions to ever have reference type
  - Extend Expr::isLvalue to handle more cases where having written a
    reference into the source implies that the expression is an lvalue
    (e.g., function calls, C++ casts).
  - Make GRExprEngine::VisitCall treat the call arguments as lvalues when
    they are being bound to a reference parameter.
llvm-svn: 58306 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | - 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 | 
| | 
| 
| 
| 
| 
| 
| 
| | binary expression ('id<NSTableViewDelegate>' and 'XCExtendedArrayController *').
There is still a bug here (as the FIXME in the test case indicates). Prior to this patch, the bug would generate an error. Now, we simply do nothing (which is less harmful until we can get it right). The complete bug fix will require changing ASTContext::mergeTypes(), which I'd like to defer for now.
llvm-svn: 58241 | 
| | 
| 
| 
| | llvm-svn: 58218 | 
| | 
| 
| 
| 
| 
| | support as far as I know.
llvm-svn: 58217 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | TypeQuals parameter, it causes subtle bugs where TypeQuals, while necessary, are omitted from the call.
-Remove the default argument.
-Update all call sites of ASTContext::getFunctionType.
llvm-svn: 58187 | 
| | 
| 
| 
| 
| 
| | -Add withConst/withVolatile/withRestrict methods to QualType class, that return the QualType plus the respective qualifier.
llvm-svn: 58120 | 
| | 
| 
| 
| 
| 
| | Sebastian Redl.
llvm-svn: 58094 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | conversions.
Added PerformImplicitConversion, which follows an implicit conversion sequence
computed by TryCopyInitialization and actually performs the implicit
conversions, including the extra check for ambiguity mentioned above.
llvm-svn: 58071 | 
| | 
| 
| 
| 
| 
| | created with LHS and RHS whose types didn't match.
llvm-svn: 58049 | 
| | 
| 
| 
| 
| 
| 
| 
| | undeclared identifier 'expandedValue'.
Mea culpa: I introduced this regresson in the following 2 commits: r57529 (10/14), r57841 (10/20).
llvm-svn: 58007 | 
| | 
| 
| 
| 
| 
| | CXXFieldDecl is referenced inside a method.
llvm-svn: 58000 | 
| | 
| 
| 
| 
| 
| 
| 
| | ('NSUserDefaults *') is not a structure or union.
Teach Sema::ActOnMemberReferenceExpr() to look through local category implementations associated with the class.
llvm-svn: 57995 | 
| | 
| 
| 
| 
| 
| | inline
llvm-svn: 57951 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | 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 | 
| | 
| 
| 
| | llvm-svn: 57927 | 
| | 
| 
| 
| | llvm-svn: 57909 | 
| | 
| 
| 
| 
| 
| | on id<protocol>.
llvm-svn: 57850 | 
| | 
| 
| 
| 
| 
| | of ObjC qualified id types to be consistent with gcc. This changes a handful of test case errors into warnings (diff will tell you which cases have changed).
llvm-svn: 57841 | 
| | 
| 
| 
| 
| 
| | move it to its own predicate to make it more clear.
llvm-svn: 57796 | 
| | 
| 
| 
| 
| 
| | Note: One day, we should consider moving the actual diags to ObjCQualifiedIdTypesAreCompatible(), since it has more information on the actual problem. GCC currently emits slightly more instructive errors for some cases involving protocols. I added a FIXME to the code.
llvm-svn: 57529 | 
| | 
| 
| 
| 
| 
| | unfortunately a largish/complex diff, however it was necessry to pass all the current block tests.
llvm-svn: 57337 | 
| | 
| 
| 
| 
| 
| 
| 
| | DeclContext.
This required changes to attach the compound statement later on (like we do for functions).
llvm-svn: 57304 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | - Modify BlockExpr to reference the BlockDecl.
This is "cleanup" necessary to improve our lookup semantics for blocks (to fix <rdar://problem/6272905> clang block rewriter: parameter to function not imported into block?).
Still some follow-up work to finish this (forthcoming).
llvm-svn: 57298 | 
| | 
| 
| 
| | llvm-svn: 56880 | 
| | 
| 
| 
| | llvm-svn: 56879 | 
| | 
| 
| 
| | llvm-svn: 56859 | 
| | 
| 
| 
| 
| 
| | block pointer types (^{}).
llvm-svn: 56793 | 
| | 
| 
| 
| | llvm-svn: 56775 | 
| | 
| 
| 
| 
| 
| | not require __block.
llvm-svn: 56770 | 
| | 
| 
| 
| 
| 
| | don't need a BlockDeclRefExpr.
llvm-svn: 56766 | 
| | 
| 
| 
| | llvm-svn: 56764 | 
| | 
| 
| 
| 
| 
| | identifier in NSServices.m
llvm-svn: 56761 | 
| | 
| 
| 
| 
| 
| 
| 
| | BlockDeclRef exprs.
This fixes <rdar://problem/6248392> clang: Error when using address of stack variable inside block.
llvm-svn: 56652 |