summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTReaderDecl.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Set a special flag in class metadata when an Objective-C classJohn McCall2012-10-171-0/+2
| | | | | | | | | has ivars that require destruction, but none that require anything except zero-initialization. This is common in ARC and (when true throughout a class hierarchy) permits the elimination of an unnecessary message-send during allocation. llvm-svn: 166088
* Rename ObjCMethodDecl::isSynthesized to isPropertyAccessor.Jordan Rose2012-10-101-1/+1
| | | | | | | | | | | | | This more accurately reflects its use: this flag is set when a method matches the getter or setter name for a property in the same class, and does not actually specify whether or not the definition of the method will be synthesized (either implicitly or explicitly with @synthesize). This renames the setter and backing field as well, and changes the (soon-to-be-obsolete?) XML dump format to use 'property_accessor' instead of 'synthesized'. llvm-svn: 165626
* When we load a function or method body from an AST file, we checkDouglas Gregor2012-10-091-14/+17
| | | | | | | | | | whether that function/method already has a body (loaded from some other AST file), as introduced in r165137. Delay this check until after the redeclaration chains have been wired up. While I'm here, make the loading of method bodies lazy. llvm-svn: 165513
* Fix r165005: The lexical DeclContext is not the right place to make a ↵Axel Naumann2012-10-041-4/+6
| | | | | | decision about whether we need to call tryAddTopLevelDecl or not. That call should be made when the DeclContext's redeclaration context is the translation unit. llvm-svn: 165215
* Remove ASTReader::needPendingInstantiation(), introduced in r164993,Douglas Gregor2012-10-031-57/+0
| | | | | | | which is neither correct nor necessary. The use of this routine was eliminated by r165137. llvm-svn: 165139
* Add some FIXMEs to the ASTReader codeDouglas Gregor2012-10-031-0/+2
| | | | llvm-svn: 165138
* Revert most of the functionality in r165001. Instead, make sure thatDouglas Gregor2012-10-031-11/+6
| | | | | | | the ASTReader doesn't attach a body to a function that is already defined elsewhere. llvm-svn: 165137
* [PCH] Fix serialization of an ImportDecl.Argyrios Kyrtzidis2012-10-031-0/+1
| | | | | | | | ImportDecl's module ID was not written out and the reader accepted as module ID the serialized: Record.push_back(!IdentifierLocs.empty()); llvm-svn: 165087
* Add redecls into their lexical DeclContext: this is what they assert on, and ↵Axel Naumann2012-10-021-1/+1
| | | | | | | | the merging should have set it correctly. This is especially relevant for templatedDecls that might be injected (and thus have their DeclContext set to) somewhere completely different. llvm-svn: 165005
* Only those InterestingDecls that got added to the AST should be passed to ↵Axel Naumann2012-10-021-2/+10
| | | | | | the ASTConsumer. llvm-svn: 165001
* Merge pending instantiations instead of overwriting existing ones.Axel Naumann2012-10-021-1/+58
| | | | | | | | | | | Check whether a pending instantiation needs to be instantiated (or whether an instantiation already exists). Verify the size of the PendingInstantiations record (was only checking size of existing PendingInstantiations). Migrate Obj-C++ part of redecl-merge into separate test, now that this is growing. templates.mm: test that CodeGen has seen exactly one definition of template instantiations. redecl-merge.m: use "@" specifier for expected-diagnostics. llvm-svn: 164993
* Also merge template redeclarations.Axel Naumann2012-10-011-7/+13
| | | | | | Don't require specializations (of existing and read template) to be unique. llvm-svn: 164931
* Bring ASTReader and Writer into sync for the case where a canonical template ↵Axel Naumann2012-10-011-7/+10
| | | | | | | | | specialization was written, which is non-canonical at the time of reading: force the reading of the ClassTemplateDecl if it was written. The easiest way out is to store whether the decl was canonical at the time of writing. Add test. llvm-svn: 164927
* [PCH] After deserializing a DeclContext, if it has external lexical decls ↵Argyrios Kyrtzidis2012-09-211-0/+3
| | | | | | | | | | | | | | but not external visible decls, call DeclContext::setMustBuildLookupTable so that the "lazy decls" bit of the LookupPtr is set. Previously, in non-C++, if there were no new declarations causing the "lazy decls" bit to be set, then DeclContext::lookups_begin() would fail to return the decls from the PCH. Fixes rdar://12316296. llvm-svn: 164351
* Serialize the 'IsConstexpr' bit of VarDecls. Fixes <rdar://problem/12328814>.Douglas Gregor2012-09-201-1/+2
| | | | llvm-svn: 164335
* Add the TypeSourceInfo for the lambda call operator to the lambda'sEli Friedman2012-09-191-1/+3
| | | | | | | | definition info; it needs to be there because the mangler needs to access it before we're finished defining the lambda class. PR12808. llvm-svn: 164186
* Remove an unused private field exposed by the recent LLVM_DELETED_FUNCTION ↵Craig Topper2012-09-181-5/+4
| | | | | | changes. llvm-svn: 164106
* Use LLVM_DELETED_FUNCTION in place of 'DO NOT IMPLEMENT' comments.Dmitri Gribenko2012-09-151-2/+2
| | | | llvm-svn: 163983
* [PCH] Add a null check to avoid crashing.Argyrios Kyrtzidis2012-09-101-2/+4
| | | | | | Unfortunately, no test case. rdar://11960120 llvm-svn: 163566
* PR9023: A template template parameter whose template parameter list contains anRichard Smith2012-09-071-5/+16
| | | | | | | | | | | | | unexpanded parameter pack is a pack expansion. Thus, as with a non-type template parameter which is a pack expansion, it needs to be expanded early into a fixed list of template parameters. Since the expanded list of template parameters is not itself a parameter pack, it is permitted to appear before the end of the template parameter list, so also remove that restriction (for both template template parameter pack expansions and non-type template parameter pack expansions). llvm-svn: 163369
* Normalize line endings of r163013 (part 2).Joao Matos2012-08-311-10/+10
| | | | llvm-svn: 163032
* Improved MSVC __interface support by adding first class support for it, ↵Joao Matos2012-08-311-8/+10
| | | | | | instead of aliasing to "struct" which had some incorrect behaviour. Patch by David Robins. llvm-svn: 163013
* Reduce duplicated hash map lookups.Benjamin Kramer2012-08-221-5/+2
| | | | llvm-svn: 162361
* Remove HasSynthBitfield and all callers/writers/etc. Also removeEric Christopher2012-07-191-2/+0
| | | | | | | | previous ResetObjCLayout calls since this is now handled in Sema. Part of rdar://11842763 llvm-svn: 160527
* Stop instantiating a class if we hit a static_assert failure. Also, if theRichard Smith2012-07-111-1/+2
| | | | | | | static_assert fails when parsing the template, don't diagnose it again on every instantiation. llvm-svn: 160088
* [AST/libclang] Fix the selector locations that are reported for aArgyrios Kyrtzidis2012-06-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | method definition that has its '{' attached to the method name without a space. With a method like: -(id)meth{ ..... } the logic in ObjCMethodDecl that determined the selector locations got confused because it was initialized based on an end location for '{' but that end location changed to '}' after the method was finished. Fix this by having an immutable end location for the declarator and for getLocEnd() get the end location from the body itself. Fixes rdar://11659739. llvm-svn: 158583
* Remove CXXRecordDecl flags which are unused after r158289.Richard Smith2012-06-101-4/+0
| | | | | | | | | | | | | | | | | | | | | We need an efficient mechanism to determine whether a defaulted default constructor is constexpr, in order to determine whether a class is a literal type, so keep the incrementally-built form on CXXRecordDecl. Remove the on-demand computation of same, so that we only have one method for determining whether a default constructor is constexpr. This doesn't affect correctness, since default constructor lookup is much simpler than selecting a constructor for copying or moving. We don't need a corresponding mechanism for defaulted copy or move constructors, since they can't affect whether a type is a literal type. Conversely, checking whether such functions are constexpr can require non-trivial effort, so we defer such checks until the copy or move constructor is required. Thus we now only compute whether a copy or move constructor is constexpr on demand, and only compute whether a default constructor is constexpr in advance. This is unfortunate, but seems like the best solution. llvm-svn: 158290
* PR13064: Store whether an in-class initializer uses direct or copyRichard Smith2012-06-101-6/+5
| | | | | | | initialization, and use that information to produce the right kind of initialization during template instantiation. llvm-svn: 158288
* Address minor FIXME in RedeclLink to contain a PointerIntPair instead of ↵David Blaikie2012-05-281-11/+10
| | | | | | | | derive from it. Use actual factory functions rather than derived classes acting as named constructors/factories. llvm-svn: 157588
* Fix ASTReader handling of ImportDecls, from Meador Inge!Douglas Gregor2012-05-161-1/+0
| | | | llvm-svn: 156923
* [AST/libclang] Speed up clang_getOverriddenCursors() considerably by ↵Argyrios Kyrtzidis2012-05-091-0/+1
| | | | | | | | | | | | | reserving a bit in ObjCMethodDecl to indicate whether the method does not override any other method, which is the majority of cases. That way we can avoid unnecessary work doing lookups, especially when PCH is involved. rdar://11360082 llvm-svn: 156476
* A union can have a constexpr defaulted default constructor, if it has anRichard Smith2012-05-071-0/+1
| | | | | | | | | in-class initializer for one of its fields. Value-initialization of such a type should use the in-class initializer! The former was just a bug, the latter is a (reported) standard defect. llvm-svn: 156274
* [PCH] Use DenseMap instead of std::map to keep track of SwitchCases.Argyrios Kyrtzidis2012-05-041-2/+2
| | | | | | Part of rdar://11353109. llvm-svn: 156185
* [PCH] Really, pinky swear, fix for PR12689Argyrios Kyrtzidis2012-05-041-2/+5
| | | | | | rdar://11353109 llvm-svn: 156145
* [PCH] Clear switch case IDs when deserializing a objc method body.Argyrios Kyrtzidis2012-05-031-0/+2
| | | | | | Fixes rdar://11353109 & http://llvm.org/bugs/show_bug.cgi?id=12689 llvm-svn: 156056
* Use forward declarations for ASTDeclContextNameLookupTable and add a missing ↵Benjamin Kramer2012-04-151-1/+4
| | | | | | | | delete. It would be nice to use OwningPtr here, but DeclContextInfo is stored in a DenseMap. llvm-svn: 154763
* Serialize and deserialize some missing bits from BlockDecl.John McCall2012-04-131-0/+4
| | | | llvm-svn: 154676
* Instantiating a class template should not instantiate the definition of anyRichard Smith2012-03-141-1/+7
| | | | | | | | scoped enumeration members. Later uses of an enumeration temploid as a nested name specifier should cause its instantiation. Plus some groundwork for explicit specialization of member enumerations of class templates. llvm-svn: 152750
* Unify naming of LangOptions variable/get function across the Clang stack ↵David Blaikie2012-03-111-1/+1
| | | | | | | | | | (Lex to AST). The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
* objective-c: provide fixit hint when atomic property does notFariborz Jahanian2012-02-291-0/+1
| | | | | | | have matching user defined setter/getter and a warning is issued. In this case, a fixit note is displayed. // rdar://10267155 llvm-svn: 151766
* Teach CXXRecordDecl::hasIrrelevantDestructor to check the base classes andRichard Smith2012-02-251-0/+8
| | | | | | | | | data members for deleted or user-provided destructors. Now it's computed in advance, serialize it, and in passing fix all the other record DefinitionData flags whose serialization was missing. llvm-svn: 151441
* Generate an AST for the conversion from a lambda closure type to aDouglas Gregor2012-02-221-2/+0
| | | | | | | | | | | | | | | block pointer that returns a block literal which captures (by copy) the lambda closure itself. Some aspects of the block literal are left unspecified, namely the capture variable (which doesn't actually exist) and the body (which will be filled in by IRgen because it can't be written as an AST). Because we're switching to this model, this patch also eliminates tracking the copy-initialization expression for the block capture of the conversion function, since that information is now embedded in the synthesized block literal. -1 side tables FTW. llvm-svn: 151131
* Improve our handling of lambda expressions that occur within defaultDouglas Gregor2012-02-211-1/+2
| | | | | | | | | | | | | | | | | | | arguments. There are two aspects to this: - Make sure that when marking the declarations referenced in a default argument, we don't try to mark local variables, both because it's a waste of time and because the semantics are wrong: we're not in a place where we could capture these variables again even if it did make sense. - When a lambda expression occurs in a default argument of a function template, make sure that the corresponding closure type is considered dependent, so that it will get properly instantiated. The second bit is a bit of a hack; to fix it properly, we may have to rearchitect our handling of default arguments, parsing them only after creating the function definition. However, I'd like to separate that work from the lambdas work. llvm-svn: 151076
* Implement name mangling for lambda expressions that occur within theDouglas Gregor2012-02-211-0/+1
| | | | | | | | | | | | | | | | default arguments of function parameters. This simple-sounding task is complicated greatly by two issues: (1) Default arguments aren't actually a real context, so we need to maintain extra state within lambda expressions to track when a lambda was actually in a default argument. (2) At the time that we parse a default argument, the FunctionDecl doesn't exist yet, so lambda closure types end up in the enclosing context. It's not clear that we ever want to change that, so instead we introduce the notion of the "effective" context of a declaration for the purposes of name mangling. llvm-svn: 151011
* modern objc translator. Finish off first cut of theFariborz Jahanian2012-02-201-0/+4
| | | | | | | modern meta-data translation by commenting out private ivar declarations in user source. Also, added several tests. llvm-svn: 150985
* Basic support for name mangling of C++11 lambda expressions. BecauseDouglas Gregor2012-02-201-0/+1
| | | | | | | | | | | | | | | name mangling in the Itanium C++ ABI for lambda expressions is so dependent on context, we encode the number used to encode each lambda as part of the lambda closure type, and maintain this value within Sema. Note that there are a several pieces still missing: - We still get the linkage of lambda expressions wrong - We aren't properly numbering or mangling lambda expressions that occur in default function arguments or in data member initializers. - We aren't (de-)serializing the lambda numbering tables llvm-svn: 150982
* Implicitly define a lambda's conversion functions (to functionDouglas Gregor2012-02-161-0/+2
| | | | | | | | | | | | | pointers and block pointers). We use dummy definitions to keep the invariant that an implicit, used definition has a body; IR generation will substitute the actual contents, since they can't be represented as C++. For the block pointer case, compute the copy-initialization needed to capture the lambda object in the block, which IR generation will need later. llvm-svn: 150645
* Implement AST (de-)serialization for lambda expressions.Douglas Gregor2012-02-141-1/+27
| | | | llvm-svn: 150491
* Represent C++ direct initializers as ParenListExprs before semantic analysisSebastian Redl2012-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instead of having a special-purpose function. - ActOnCXXDirectInitializer, which was mostly duplication of AddInitializerToDecl (leading e.g. to PR10620, which Eli fixed a few days ago), is dropped completely. - MultiInitializer, which was an ugly hack I added, is dropped again. - We now have the infrastructure in place to distinguish between int x = {1}; int x({1}); int x{1}; -- VarDecl now has getInitStyle(), which indicates which of the above was used. -- CXXConstructExpr now has a flag to indicate that it represents list- initialization, although this is not yet used. - InstantiateInitializer was renamed to SubstInitializer and simplified. - ActOnParenOrParenListExpr has been replaced by ActOnParenListExpr, which always produces a ParenListExpr. Placed that so far failed to convert that back to a ParenExpr containing comma operators have been fixed. I'm pretty sure I could have made a crashing test case before this. The end result is a (I hope) considerably cleaner design of initializers. More importantly, the fact that I can now distinguish between the various initialization kinds means that I can get the tricky generalized initializer test cases Johannes Schaub supplied to work. (This is not yet done.) This commit passed self-host, with the resulting compiler passing the tests. I hope it doesn't break more complicated code. It's a pretty big change, but one that I feel is necessary. llvm-svn: 150318
* [PCH] Add some comments, per Ted's request.Argyrios Kyrtzidis2012-02-091-0/+4
| | | | llvm-svn: 150162
OpenPOWER on IntegriCloud