|  | Commit message (Collapse) | Author | Age | Files | Lines | 
|---|
| | 
| 
| 
| 
| 
| | matching the storage layout for this ivar
llvm-svn: 60996 | 
| | 
| 
| 
| 
| 
| 
| 
| | __PRETTY_FUNCTION__ outside func
Yeah, this is "useful".
llvm-svn: 60921 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | and separates lexical name lookup from qualified name lookup. In
particular:
  * Make DeclContext the central data structure for storing and
    looking up declarations within existing declarations, e.g., members
    of structs/unions/classes, enumerators in C++0x enums, members of
    C++ namespaces, and (later) members of Objective-C
    interfaces/implementations. DeclContext uses a lazily-constructed
    data structure optimized for fast lookup (array for small contexts,
    hash table for larger contexts). 
  * Implement C++ qualified name lookup in terms of lookup into
    DeclContext.
  * Implement C++ unqualified name lookup in terms of
    qualified+unqualified name lookup (since unqualified lookup is not
    purely lexical in C++!)
  * Limit the use of the chains of declarations stored in
    IdentifierInfo to those names declared lexically.
  * Eliminate CXXFieldDecl, collapsing its behavior into
    FieldDecl. (FieldDecl is now a ScopedDecl).
  * Make RecordDecl into a DeclContext and eliminates its
    Members/NumMembers fields (since one can just iterate through the
    DeclContext to get the fields).
llvm-svn: 60878 | 
| | 
| 
| 
| 
| 
| | integer) correctly, to (complex floating point + complex floating point)
llvm-svn: 60862 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | "else" clause, e.g.,
  if (int X = foo()) {
  } else {
    if (X) { // warning: X is always zero in this context
    }
  }
Fixes rdar://6425550 and lets me think about something other than
DeclContext.
llvm-svn: 60858 | 
| | 
| 
| 
| 
| 
| | vars
llvm-svn: 60849 | 
| | 
| 
| 
| | llvm-svn: 60848 | 
| | 
| 
| 
| | llvm-svn: 60816 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | template<typename T> void f(T x) {
    g(x); // g is a dependent name, so don't even bother to look it up
    g(); // error: g is not a dependent name
  }
Note that when we see "g(", we build a CXXDependentNameExpr. However,
if none of the call arguments are type-dependent, we will force the
resolution of the name "g" and replace the CXXDependentNameExpr with
its result.
GCC actually produces a nice error message when you make this
mistake, and even offers to compile your code with -fpermissive. I'll
do the former next, but I don't plan to do the latter.
llvm-svn: 60618 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | expressions, and value-dependent expressions. This permits us to parse
some template definitions.
This is not a complete solution; we're missing type- and
value-dependent computations for most of the expression types, and
we're missing checks for dependent types and type-dependent
expressions throughout Sema.
llvm-svn: 60615 | 
| | 
| 
| 
| 
| 
| 
| 
| | the containing block.  Introduce a new getCurFunctionOrMethodDecl
method to check to see if we're in a function or objc method.
Minor cleanups to other related places.  This fixes rdar://6405429.
llvm-svn: 60564 | 
| | 
| 
| 
| | llvm-svn: 60483 | 
| | 
| 
| 
| 
| 
| | don't want that :)
llvm-svn: 60333 | 
| | 
| 
| 
| 
| 
| | Sema::CheckConditionalOperands.
llvm-svn: 60319 | 
| | 
| 
| 
| | llvm-svn: 60305 | 
| | 
| 
| 
| | llvm-svn: 60235 | 
| | 
| 
| 
| | llvm-svn: 60138 | 
| | 
| 
| 
| 
| 
| | interface pointers
llvm-svn: 60096 | 
| | 
| 
| 
| 
| 
| | makes ActOnCallExpr simpler
llvm-svn: 60094 | 
| | 
| 
| 
| | llvm-svn: 60093 | 
| | 
| 
| 
| 
| 
| 
| 
| | instead of converting them to strings first.  This also fixes a
bunch of minor inconsistencies in the diagnostics emitted by clang
and adds a bunch of FIXME's to DiagnosticKinds.def.
llvm-svn: 59948 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | uses of getName() with uses of getDeclName().  This upgrades a bunch of
diags to take DeclNames instead of std::strings.
This also tweaks a couple of diagnostics to be cleaner and changes
CheckInitializerTypes/PerformInitializationByConstructor to pass
around DeclarationNames instead of std::strings.
llvm-svn: 59947 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | with implicit quotes around them.  This has a bunch of follow-on 
effects and requires tweaking to a whole lot of code.  This causes
a regression in two tests (xfailed) by causing it to emit things like:
  Line 10: duplicate interface declaration for category 'MyClass1' ('Category1')
instead of:
  Line 10: duplicate interface declaration for category 'MyClass1(Category1)'
I will fix this in a follow-up commit.
As part of this, I had to start switching stuff to use ->getDeclName() instead
of Decl::getName() for consistency.  This is good, but I was planning to do this
as an independent patch.  There will be several follow-on patches
to clean up some of the mess, but this patch is already too big.
llvm-svn: 59917 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | diags over to use this.  QualTypes implicitly print single quotes around 
them for uniformity and future extension.
Doing this requires a little function pointer dance to prevent libbasic
from depending on libast.
llvm-svn: 59907 | 
| | 
| 
| 
| 
| 
| | 'implicit' property with no 'setter'.
llvm-svn: 59878 | 
| | 
| 
| 
| 
| 
| 
| | Issuing diagnostics when assigning to read-only properties.
This is work in progress.
llvm-svn: 59874 | 
| | 
| 
| 
| 
| 
| | in the overload diagnostics.
llvm-svn: 59871 | 
| | 
| 
| 
| | llvm-svn: 59831 | 
| | 
| 
| 
| | llvm-svn: 59829 | 
| | 
| 
| 
| 
| 
| | and fall through better.
llvm-svn: 59799 | 
| | 
| 
| 
| 
| 
| | expression (smart_ptr->mem).
llvm-svn: 59732 | 
| | 
| 
| 
| | llvm-svn: 59716 | 
| | 
| 
| 
| | llvm-svn: 59714 | 
| | 
| 
| 
| | llvm-svn: 59712 | 
| | 
| 
| 
| 
| 
| 
| | just check for it when needed.  It doesn't incur real cost
in any hot paths.
llvm-svn: 59708 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | with function call syntax, e.g.,
  Functor f;
  f(x, y);
This is the easy part of handling calls to objects of class type 
(C++ [over.call.object]). The hard part (coping with conversions from
f to function pointer or reference types) will come later. Nobody uses
that stuff anyway, right? :)
llvm-svn: 59663 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | built-in operator candidates. Test overloading of '&' and ','.
In C++, a comma expression is an lvalue if its right-hand
subexpression is an lvalue. Update Expr::isLvalue accordingly.
llvm-svn: 59643 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | post-decrement, including support for generating all of the built-in
operator candidates for these operators. 
C++ and C have different rules for the arguments to the builtin unary
'+' and '-'. Implemented both variants in Sema::ActOnUnaryOp.
In C++, pre-increment and pre-decrement return lvalues. Update
Expr::isLvalue accordingly.
llvm-svn: 59638 | 
| | 
| 
| 
| | llvm-svn: 59609 | 
| | 
| 
| 
| | llvm-svn: 59589 | 
| | 
| 
| 
| 
| 
| 
| 
| | __builtin_prefetch code to only emit one diagnostic per builtin_prefetch.
While this has nothing to do with the rest of the patch, the code seemed
like overkill when I was updating it.
llvm-svn: 59588 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | not "int".
Fix a typo in the promotion of enumeration types that was causing some
integral promotions to look like integral conversions (leading to
extra ambiguities in overload resolution).
Check for "acceptable" overloaded operators based on the types of the
arguments. This is a somewhat odd check that is specified by the
standard, but I can't see why it actually matters: the overload
candidates it suppresses don't seem like they would ever be picked as
the best candidates.
llvm-svn: 59583 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | to support operators defined as member functions, e.g.,
  struct X { 
    bool operator==(X&);
  };
Overloading with non-member operators is supported, and the special
rules for the implicit object parameter (e.g., the ability for a
non-const *this to bind to an rvalue) are implemented.
This change also refactors and generalizes the code for adding
overload candidates for overloaded operator calls (C++ [over.match.expr]),
both to match the rules more exactly (name lookup of non-member
operators actually ignores member operators) and to make this routine
more reusable for the other overloaded operators.
Testing for the initialization of the implicit object parameter is
very light. More tests will come when we get support for calling
member functions directly (e.g., o.m(a1, a2)).
llvm-svn: 59564 | 
| | 
| 
| 
| | llvm-svn: 59561 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | 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 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | 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 | 
| | 
| 
| 
| | llvm-svn: 59485 | 
| | 
| 
| 
| | llvm-svn: 59484 | 
| | 
| 
| 
| | llvm-svn: 59483 | 
| | 
| 
| 
| | llvm-svn: 59470 |