summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
* Make the type of the Decl referred to by a MemberExpr a bit more precise.Eli Friedman2009-12-041-2/+2
| | | | llvm-svn: 90549
* Make sure that overridden method decls are always canonical.Anders Carlsson2009-12-041-0/+2
| | | | llvm-svn: 90542
* Fix for PR5447: teach Evaluate to deal with floating-point conditionals.Eli Friedman2009-12-041-2/+10
| | | | llvm-svn: 90521
* Add recursion guards to ice-checking and evaluation for declrefs, so weEli Friedman2009-12-032-7/+21
| | | | | | don't infinitely recurse for cases we can't evaluate. llvm-svn: 90480
* A new helper function to set various bits in the class whenFariborz Jahanian2009-12-031-0/+12
| | | | | | | a new virtual function is declared/instantiated. it is used in couple of places. llvm-svn: 90470
* Kill a few more random stderr uses.Daniel Dunbar2009-12-031-3/+2
| | | | llvm-svn: 90441
* Convert StmtDumper to raw_ostream. I forget why.Daniel Dunbar2009-12-031-129/+121
| | | | llvm-svn: 90435
* Introduce the notion of literal types, as specified in C++0x.Sebastian Redl2009-12-032-0/+35
| | | | llvm-svn: 90361
* Improve source location information for C++ member initializers in aDouglas Gregor2009-12-021-22/+56
| | | | | | | constructor, by keeping the DeclaratorInfo* rather than just the type and a single location. llvm-svn: 90355
* In Sema, whenever we think that a function is going to cause a vtable to be ↵Anders Carlsson2009-12-022-3/+7
| | | | | | generated, we mark any virtual implicit member functions as referenced. llvm-svn: 90327
* r90313, in which OverloadedFunctionDecl is removed and never spoken of again.John McCall2009-12-025-75/+1
| | | | llvm-svn: 90313
* Push overloaded function templates through the parser using a totally differentJohn McCall2009-12-022-65/+26
| | | | | | | leaked data structure than before. This kills off the last remaining explicit uses of OverloadedFunctionDecl in Sema. llvm-svn: 90306
* Rework how we support C++ implicit member accesses. If we can resolve anJohn McCall2009-12-013-31/+48
| | | | | | | | | | | | | | | implicit member access to a specific declaration, go ahead and create it as a DeclRefExpr or a MemberExpr (with implicit CXXThisExpr base) as appropriate. Otherwise, create an UnresolvedMemberExpr or DependentScopeMemberExpr with a null base expression. By representing implicit accesses directly in the AST, we get the ability to correctly delay the decision about whether it's actually an instance member access or not until resolution is complete. This permits us to correctly avoid diagnosing the 'problem' of 'MyType::foo()' where the relationship to the type isn't really known until instantiation. llvm-svn: 90266
* Allocate MultipleDC objects using the allocator associated withTed Kremenek2009-12-011-5/+5
| | | | | | | | | | ASTContext instead of malloc. Besides reducing malloc traffic, this also removes a source of memory leaks when using a BumpPtrAllocator for the allocator of ASTContext. There are still leaks when using MallocAllocator because Decl::Destroy() isn't fully finished. Fixes: <rdar://problem/7431556> llvm-svn: 90174
* Have ASTRecordLayout keep track of the key function, in preparation of ↵Anders Carlsson2009-11-301-1/+29
| | | | | | fixing a synthetic ctor/dtor bug. llvm-svn: 90168
* Eliminate the use of OverloadedFunctionDecl in member expressions.John McCall2009-11-304-0/+81
| | | | | | | | Create a new UnresolvedMemberExpr for these lookups. Assorted hackery around qualified member expressions; this will all go away when we implement the correct (i.e. extremely delayed) implicit-member semantics. llvm-svn: 90161
* Add const to accessors that don't modify the object.Mike Stump2009-11-301-1/+1
| | | | llvm-svn: 90153
* Fix a crash when ivar type is a __strong SEL. Fallout fromFariborz Jahanian2009-11-301-5/+5
| | | | | | recent change to make SEL a builtin type (fixes radar 7425510). llvm-svn: 90145
* Adapt to the DOTGraphTraits changes in LLVM.Tobias Grosser2009-11-301-2/+3
| | | | llvm-svn: 90137
* Streamline Stmt::CollectingStats() and Decl::CollectingStats(). No ↵Kovarththanan Rajaratnam2009-11-292-4/+3
| | | | | | functionality change. llvm-svn: 90078
* Add DeclarationName support for C++0x operator literals. They should now work asAlexis Hunt2009-11-291-0/+44
| | | | | | | function names outside of templates - they'll probably cause some damage there as they're largely untested. llvm-svn: 90064
* Remove VISIBILITY_HIDDEN from lib/AST.Benjamin Kramer2009-11-285-17/+11
| | | | llvm-svn: 90043
* Use a PointerIntPair for the PrimaryBaseInfo. Yay for clever LLVM data ↵Anders Carlsson2009-11-271-12/+13
| | | | | | structures! llvm-svn: 90020
* Add a new PrimaryBaseInfo struct that combines the record decl of a primary ↵Anders Carlsson2009-11-272-33/+36
| | | | | | base with whether it's virtual or not. llvm-svn: 90018
* Slight tweak to the algorithm for getLinkage().Eli Friedman2009-11-261-1/+1
| | | | llvm-svn: 89932
* Allow user re-definition of SEL as well as accessing its fields.Fariborz Jahanian2009-11-251-1/+1
| | | | | | This fixes pr5611. llvm-svn: 89895
* Implement the rules in C++ [basic.link] and C99 6.2.2 for computingDouglas Gregor2009-11-251-7/+198
| | | | | | | | | | | the linkage of a declaration. Switch the lame (and completely wrong) NamedDecl::hasLinkage() over to using the new NamedDecl::getLinkage(), along with the "can this declaration be a template argument?" check that started all of this. Fixes -fsyntax-only for PR5597. llvm-svn: 89891
* Eliminate CXXConditionDeclExpr with extreme prejudice.Douglas Gregor2009-11-254-20/+3
| | | | | | | | | | | | | | | | | All statements that involve conditions can now hold on to a separate condition declaration (a VarDecl), and will use a DeclRefExpr referring to that VarDecl for the condition expression. ForStmts now have such a VarDecl (I'd missed those in previous commits). Also, since this change reworks the Action interface for if/while/switch/for, use FullExprArg for the full expressions in those expressions, to ensure that we're emitting Note that we are (still) not generating the right cleanups for condition variables in for statements. That will be a follow-on commit. llvm-svn: 89817
* Rip out TemplateIdRefExpr and make UnresolvedLookupExpr and John McCall2009-11-244-84/+75
| | | | | | | | | | | | DependentScopeDeclRefExpr support storing templateids. Unite the common code paths between ActOnDeclarationNameExpr and ActOnTemplateIdExpr. This gets us to a point where we don't need to store function templates in the AST using TemplateNames, which is critical to ripping out OverloadedFunction. Also resolves a few FIXMEs. llvm-svn: 89785
* Helper function for turning a TemplateName into a DeclarationName.John McCall2009-11-241-0/+16
| | | | llvm-svn: 89782
* Teach Evaluate to handle member expressions referring to enum constants andEli Friedman2009-11-241-8/+21
| | | | | | | | static member constants. No significant visible difference at the moment because it conservatively assumes the base has side effects. I'm planning to use this for CodeGen. llvm-svn: 89738
* Fixe a crash in encoding of SEL type caused by recent changes.Fariborz Jahanian2009-11-231-4/+5
| | | | llvm-svn: 89696
* Handle converting member pointers to bool.Anders Carlsson2009-11-231-0/+2
| | | | llvm-svn: 89692
* Make 'SEL' pointer to a builtin type and not anFariborz Jahanian2009-11-231-0/+1
| | | | | | | objective-c pointer type. This was a serious mishap and luckily, Ted's test caught that (and patch fixes the test case). llvm-svn: 89680
* Intercept sizeof and alignof references before they get into ASTContext ↵Sebastian Redl2009-11-232-13/+34
| | | | | | methods. This fixes a crash when writing sizeof(Incomplete&), and lets ASTContext's methods do the right thing for CodeGen, which fixes PR5590. llvm-svn: 89668
* Let using directives refer to namespace aliases. Fixes PR5479.Sebastian Redl2009-11-232-2/+13
| | | | llvm-svn: 89657
* Canonical template arguments that are template template parameters byDouglas Gregor2009-11-231-2/+12
| | | | | | | their template parameter depth and position, so that we can match redeclarations appropriately. Fixes PR5527 and PR5528. llvm-svn: 89654
* Centralize and complete the computation of value- and type-dependence for ↵Douglas Gregor2009-11-232-17/+59
| | | | | | DeclRefExprs llvm-svn: 89649
* Encapsulate "an array of TemplateArgumentLocs and two angle bracket ↵John McCall2009-11-236-111/+85
| | | | | | | | | | locations" into a new class. Use it pervasively throughout Sema. My fingers hurt. llvm-svn: 89638
* When laying out bitfields, make sure that the data size is always aligned to ↵Anders Carlsson2009-11-222-11/+28
| | | | | | a byte. This fixes PR5580. llvm-svn: 89611
* Move bit-field layout out into a separate function. No functionality change.Anders Carlsson2009-11-222-69/+87
| | | | llvm-svn: 89604
* This patch implements objective-c's 'SEL' type as a built-inFariborz Jahanian2009-11-212-16/+7
| | | | | | | | | | | | | | | | | | type and fixes a long-standing code gen. crash reported in at least two PRs and a radar. (radar 7405040 and pr5025). There are couple of remaining issues that I would like for Ted. and Doug to look at: Ted, please look at failure in Analysis/MissingDealloc.m. I have temporarily added an expected-warning to make the test pass. This tests has a declaration of 'SEL' type which may not co-exist with the new changes. Doug, please look at a FIXME in PCHWriter.cpp/PCHReader.cpp. I think the changes which I have ifdef'ed out are correct. They need be considered for in a few Indexer/PCH test cases. llvm-svn: 89561
* DeclPrinter: Indent access specifiers.Daniel Dunbar2009-11-211-3/+6
| | | | llvm-svn: 89552
* Add 1+2 consts.Daniel Dunbar2009-11-211-1/+1
| | | | llvm-svn: 89546
* "Incremental" progress on using expressions, by which I mean totally rippingJohn McCall2009-11-215-30/+24
| | | | | | | | | | | | | | | | | | | | | | into pretty much everything about overload resolution in order to wean BuildDeclarationNameExpr off LookupResult::getAsSingleDecl(). Replace UnresolvedFunctionNameExpr with UnresolvedLookupExpr, which generalizes the idea of a non-member lookup that we haven't totally resolved yet, whether by overloading, argument-dependent lookup, or (eventually) the presence of a function template in the lookup results. Incidentally fixes a problem with argument-dependent lookup where we were still performing ADL even when the lookup results contained something from a block scope. Incidentally improves a diagnostic when using an ObjC ivar from a class method. This just fell out from rewriting BuildDeclarationNameExpr's interaction with lookup, and I'm too apathetic to break it out. The only remaining uses of OverloadedFunctionDecl that I know of are in TemplateName and MemberExpr. llvm-svn: 89544
* Added rudimentary C++0x attribute support.Alexis Hunt2009-11-212-8/+11
| | | | | | | | | | | | | | The following attributes are currently supported in C++0x attribute lists (and in GNU ones as well): - align() - semantics believed to be conformant to n3000, except for redeclarations and what entities it may apply to - final - semantics believed to be conformant to CWG issue 817's proposed wording, except for redeclarations - noreturn - semantics believed to be conformant to n3000, except for redeclarations - carries_dependency - currently ignored (this is an optimization hint) llvm-svn: 89543
* Deduce a ConstantArrayType from a value-dependent initializer listDouglas Gregor2009-11-191-5/+10
| | | | | | | rather than punting to a DependentSizedArrayType, tightening up our type checking for template definitions. Thanks, John! llvm-svn: 89407
* Draw a brighter line between "unresolved" expressions, where we have done theJohn McCall2009-11-194-19/+23
| | | | | | | | appropriate lookup and simply can't resolve the referrent yet, and "dependent scope" expressions, where we can't do the lookup yet because the entity we need to look into is a dependent type. llvm-svn: 89402
* Cope with an amusingly little anomaly with dependent types andDouglas Gregor2009-11-191-8/+18
| | | | | | | | | | | | | | | | | | incomplete array initialization, where we have the following in a template: int a[] = { 1, 2, something-value-dependent }; // ... sizeof(a); The type of "a" appears to be a non-dependent IncompleteArrayType, but treating it as such makes the sizeof(a) fail at template definition time. We now correctly handle this by morphing the IncompleteArrayType into a DependentSizedArrayType with a NULL expression, indicating that its size has no corresponding expression (and, therefore, the type is distinct from others). llvm-svn: 89366
* Incremental progress on using declarations. Split UnresolvedUsingDecl intoJohn McCall2009-11-184-17/+44
| | | | | | | | | | two classes, one for typenames and one for values; this seems to have some support from Doug if not necessarily from the extremely-vague-on-this-point standard. Track the location of the 'typename' keyword in a using-typename decl. Make a new lookup result for unresolved values and deal with it in most places. llvm-svn: 89184
OpenPOWER on IntegriCloud