- Jan 05, 2009
-
-
Douglas Gregor authored
DeclContexts whose members are visible from enclosing DeclContexts up to (and including) the innermost enclosing non-transparent DeclContexts. Transparent DeclContexts unify the mechanism to be used for various language features, including C enumerations, anonymous unions, C++0x inline namespaces, and C++ linkage specifications. Please refer to the documentation in the Clang internals manual for more information. Only enumerations and linkage specifications currently use transparent DeclContexts. Still to do: use transparent DeclContexts to implement anonymous unions and GCC's anonymous structs extension, and, later, the C++0x features. We also need to tighten up the DeclContext/ScopedDecl link to ensure that every ScopedDecl is in a single DeclContext, which will ensure that we can then enforce ownership and reduce the memory footprint of DeclContext. llvm-svn: 61735
-
- Dec 30, 2008
-
-
Douglas Gregor authored
llvm-svn: 61486
-
- Dec 26, 2008
-
-
Douglas Gregor authored
llvm-svn: 61442
-
- Dec 24, 2008
-
-
Douglas Gregor authored
semantics and improve our handling of default arguments. Specifically, we follow this order: - As soon as the see the '}' in the class definition, the class is complete and we add any implicit declarations (default constructor, copy constructor, etc.) to the class. - If there are any default function arguments, parse them - If there were any inline member function definitions, parse them As part of this change, we now keep track of the the fact that we've seen unparsed default function arguments within the AST. See the new ParmVarDecl::hasUnparsedDefaultArg member. This allows us to properly cope with calls inside default function arguments to other functions where we're making use of the default arguments. Made some C++ error messages regarding failed initializations more specific. llvm-svn: 61406
-
- Dec 23, 2008
-
-
Douglas Gregor authored
DeclContext. Instead, just keep the list of currently-active declarations and only build the OverloadedFunctionDecl when we absolutely need it. This is a half-step toward eliminating the need to explicitly build OverloadedFunctionDecls that store sets of overloaded functions. This was suggested by Argiris a while back, and it's a good thing for several reasons: first, it eliminates the messy logic that currently tries to keep the OverloadedFunctionDecl in sync with the declarations that are being added. Second, it will (eventually) eliminate the need to allocate memory for overload sets, which could help performance. Finally, it helps set us up for when name lookup can return multiple (possibly ambiguous) results, as can happen with lookup of class members in C++. Next steps: make the IdentifierResolver store overloads as separate entries in its list rather than replacing them with an OverloadedFunctionDecl now, then see how far we can go toward eliminating OverloadedFunctionDecl entirely. llvm-svn: 61357
-
- Dec 22, 2008
-
-
Sebastian Redl authored
llvm-svn: 61346
-
Sebastian Redl authored
llvm-svn: 61337
-
- Dec 19, 2008
-
-
Douglas Gregor authored
warning. This matches GCC's behavior and addresses <rdar://problem/6458293>. llvm-svn: 61246
-
- Dec 17, 2008
-
-
Douglas Gregor authored
Make the injected-class-name of a C++ class a separate RecordDecl from the class itself, with a different scope. This eliminates some ownership issues, so that the RecordDecl only lives in a single context llvm-svn: 61140
-
Chris Lattner authored
Move Sema::ActOnDefs to SemaDeclObjC llvm-svn: 61126
-
Chris Lattner authored
llvm-svn: 61125
-
- Dec 16, 2008
-
-
Douglas Gregor authored
is completely defined (C++ [class.mem]p2). Reverse the order in which we process the definitions of member functions specified inline. This way, we'll get diagnostics in the order in which the member functions were declared in the class. llvm-svn: 61103
-
- Dec 15, 2008
-
-
Douglas Gregor authored
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
-
Douglas Gregor authored
half-solution; the real solution is coming when constructors and destructors are treated like all other functions by ActOnDeclarator. llvm-svn: 61037
-
- Dec 13, 2008
-
-
Sebastian Redl authored
llvm-svn: 60983
-
- Dec 12, 2008
-
-
Douglas Gregor authored
llvm-svn: 60947
-
- Dec 11, 2008
-
-
Douglas Gregor authored
llvm-svn: 60897
-
Douglas Gregor authored
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
-
- Dec 06, 2008
-
-
Anders Carlsson authored
llvm-svn: 60626
-
- Nov 24, 2008
-
-
Chris Lattner authored
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
-
Chris Lattner authored
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
-
Chris Lattner authored
"previously defined here" diagnostics all notes. llvm-svn: 59920
-
- Nov 23, 2008
-
-
Chris Lattner authored
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
-
- Nov 22, 2008
-
-
Sebastian Redl authored
Implement a %plural modifier for complex plural forms in diagnostics. Use it in the overload diagnostics. llvm-svn: 59871
-
- Nov 21, 2008
-
-
Chris Lattner authored
llvm-svn: 59805
-
Chris Lattner authored
strings. This allows us to have considerable flexibility in how these things are displayed and provides extra information that allows us to merge away diagnostics that are very similar. Diagnostic modifiers are a string of characters with the regex [-a-z]+ that occur between the % and digit. They may optionally have an argument that can parameterize them. For now, I've added two example modifiers. One is a very useful tool that allows you to factor commonality across diagnostics that need single words or phrases combined. Basically you can use %select{a|b|c}4 with with an integer argument that selects either a/b/c based on an integer value in the range [0..3). The second modifier is also an integer modifier, aimed to help English diagnostics handle plurality. "%s3" prints to 's' if integer argument #3 is not 1, otherwise it prints to nothing. I'm fully aware that 's' is an English concept and doesn't apply to all situations (mouse vs mice). However, this is very useful and we can add other crazy modifiers once we add support for polish! ;-) I converted a couple C++ diagnostics over to use this as an example, I'd appreciate it if others could merge the other likely candiates. If you have other modifiers that you want, lets talk on cfe-dev. llvm-svn: 59803
-
Douglas Gregor authored
llvm-svn: 59789
-
- Nov 20, 2008
-
-
Chris Lattner authored
llvm-svn: 59714
-
Chris Lattner authored
llvm-svn: 59713
-
Chris Lattner authored
llvm-svn: 59712
-
- Nov 19, 2008
-
-
Chris Lattner authored
llvm-svn: 59609
-
Chris Lattner authored
first. This should allow removal of a bunch of II->getName() calls. llvm-svn: 59601
-
Chris Lattner authored
llvm-svn: 59600
-
Chris Lattner authored
llvm-svn: 59589
-
Chris Lattner authored
__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
-
- Nov 18, 2008
-
-
Chris Lattner authored
llvm-svn: 59561
-
Sebastian Redl authored
llvm-svn: 59470
-
- Nov 17, 2008
-
-
Douglas Gregor authored
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
-
Douglas Gregor authored
llvm-svn: 59443
-
Douglas Gregor authored
llvm-svn: 59442
-