|  | Commit message (Collapse) | Author | Age | Files | Lines | 
|---|
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | just like all other members, and remove the special variables in
CXXRecordDecl to store them. This eliminates a lot of special-case
code for constructors and destructors, including
ActOnConstructor/ActOnDeclarator and special lookup rules in
LookupDecl. The result is far more uniform and manageable.
Diagnose the redeclaration of member functions.
llvm-svn: 61048 | 
| | 
| 
| 
| | llvm-svn: 61038 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| | together in the same way that we link RecordDecl/CXXRecordDecl nodes. 
Unify ActOnTag and ActOnTagStruct.
Fixes PR clang/2753.
llvm-svn: 61034 | 
| | 
| 
| 
| | llvm-svn: 60993 | 
| | 
| 
| 
| 
| 
| | Convert a few functions.
llvm-svn: 60983 | 
| | 
| 
| 
| | llvm-svn: 60947 | 
| | 
| 
| 
| | llvm-svn: 60920 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | the type of the enumeration once the enumeration has been defined.
Fix the overloading test-case to properly create enums that promote
the way we want them to.
Implement C++0x promotions from enumeration types to long
long/unsigned long long. We're using these promotions in Carbon.h
(since long long is a common extension).
Fixes PR clang/2954: http://llvm.org/bugs/show_bug.cgi?id=2954
llvm-svn: 60917 | 
| | 
| 
| 
| | llvm-svn: 60897 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | 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 | 
| | 
| 
| 
| 
| 
| | belongs
llvm-svn: 60708 | 
| | 
| 
| 
| | llvm-svn: 60693 | 
| | 
| 
| 
| | llvm-svn: 60645 | 
| | 
| 
| 
| | llvm-svn: 60638 | 
| | 
| 
| 
| | llvm-svn: 60628 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | 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 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | parameters, with some semantic analysis:
  - Template parameters are introduced into template parameter scope
  - Complain about template parameter shadowing (except in Microsoft mode)
Note that we leak template parameter declarations like crazy, a
problem we'll remedy once we actually create proper declarations for
templates. 
Next up: dependent types and value-dependent/type-dependent
expressions.
llvm-svn: 60597 | 
| | 
| 
| 
| 
| 
| | PR2963
llvm-svn: 60591 | 
| | 
| 
| 
| | llvm-svn: 60580 | 
| | 
| 
| 
| | llvm-svn: 60377 | 
| | 
| 
| 
| | llvm-svn: 59979 | 
| | 
| 
| 
| 
| 
| 
| 
| | 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 | 
| | 
| 
| 
| 
| 
| | "previously defined here" diagnostics all notes.
llvm-svn: 59920 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | 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 | 
| | 
| 
| 
| 
| 
| 
| | without calling getAsString().  This implicitly puts quotes around the
name, so diagnostics need to be tweaked to accommodate this.
llvm-svn: 59916 | 
| | 
| 
| 
| | llvm-svn: 59881 | 
| | 
| 
| 
| | llvm-svn: 59822 | 
| | 
| 
| 
| | llvm-svn: 59714 | 
| | 
| 
| 
| | llvm-svn: 59713 | 
| | 
| 
| 
| | llvm-svn: 59712 | 
| | 
| 
| 
| 
| 
| 
| | looking up the "std" identifier is trivial.  Just do it, particularly
since this is only done if the namespace hasn't already been looked up.
llvm-svn: 59710 | 
| | 
| 
| 
| 
| 
| | used in one cold place.
llvm-svn: 59709 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | struct A {
  struct B;
};
struct A::B {
  void m() {} // Assertion failed: getContainingDC(DC) == CurContext && "The next DeclContext should be lexically contained in the current one."
};
Introduce DeclContext::getLexicalParent which may be different from DeclContext::getParent when nested-names are involved, e.g:
   namespace A {
      struct S;
   }
   struct A::S {}; // getParent() == namespace 'A'
                   // getLexicalParent() == translation unit
llvm-svn: 59650 | 
| | 
| 
| 
| 
| 
| | PragmaPackStack. Thanks Chris!
llvm-svn: 59616 | 
| | 
| 
| 
| | llvm-svn: 59609 | 
| | 
| 
| 
| | llvm-svn: 59600 | 
| | 
| 
| 
| | 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 | 
| | 
| 
| 
| | llvm-svn: 59561 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | 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: 59470 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | destructors, and conversion functions. The placeholders were used to
work around the fact that the parser and some of Sema really wanted
declarators to have simple identifiers; now, the code that deals with
declarators will use DeclarationNames.
llvm-svn: 59469 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | C++ constructors, destructors, and conversion functions now have a
FETokenInfo field that IdentifierResolver can access, so that these
special names are handled just like ordinary identifiers. A few other
Sema routines now use DeclarationNames instead of IdentifierInfo*'s.
To validate this design, this code also implements parsing and
semantic analysis for id-expressions that name conversion functions,
e.g.,
  return operator bool();
The new parser action ActOnConversionFunctionExpr takes the result of
parsing "operator type-id" and turning it into an expression, using
the IdentifierResolver with the DeclarationName of the conversion
function. ActOnDeclarator pushes those conversion function names into
scope so that the IdentifierResolver can find them, of course.
llvm-svn: 59462 | 
| | 
| 
| 
| 
| 
| 
| 
| | representing the names of declarations in the C family of
languages. DeclarationName is used in NamedDecl to store the name of
the declaration (naturally), and ObjCMethodDecl is now a NamedDecl.
llvm-svn: 59441 | 
| | 
| 
| 
| | llvm-svn: 59426 | 
| | 
| 
| 
| 
| 
| | Thanks to Doug for the review. Actual effects of mutable to follow.
llvm-svn: 59331 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | 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 | 
| | 
| 
| 
| | llvm-svn: 59255 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | conversion functions. Instead, we just use a placeholder identifier
for these (e.g., "<constructor>") and override NamedDecl::getName() to
provide a human-readable name.
This is one potential solution to the problem; another solution would
be to replace the use of IdentifierInfo* in NamedDecl with a different
class that deals with identifiers better. I'm also prototyping that to
see how it compares, but this commit is better than what we had
previously.
llvm-svn: 59193 |