summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
* More work on the FullExpr class.Anders Carlsson2009-12-161-18/+34
| | | | llvm-svn: 91513
* Check in a rudimentary FullExpr class that isn't used anywhere yet. Rename ↵Anders Carlsson2009-12-162-0/+43
| | | | | | Action::FullExpr to Action::MakeFullExpr to avoid name clashes. llvm-svn: 91494
* Switch the C++ new expression over to InitializationSequence, ratherDouglas Gregor2009-12-161-5/+7
| | | | | | | | | | | | | | | | | | | | | than using its own partial implementation of initialization. Switched CheckInitializerTypes over to InitializedEntity/InitializationKind, to help move us closer to InitializationSequence. Added InitializedEntity::getName() to retrieve the name of the entity, for diagnostics that care about such things. Implemented support for default initialization in InitializationSequence. Clean up the determination of the "source expressions" for an initialization sequence in InitializationSequence::Perform. Taught CXXConstructExpr to store more location information. llvm-svn: 91492
* Diagnose attempting to assign to a sub-structure of an ivarFariborz Jahanian2009-12-151-4/+14
| | | | | | using objective-c property. (fixes radar 7449707) llvm-svn: 91474
* ShouldDestroyTemporaries? I don't think so.Anders Carlsson2009-12-152-9/+4
| | | | llvm-svn: 91450
* If a ParmVarDecl's default argument is a CXXExprWithTemporaries, return the ↵Anders Carlsson2009-12-151-0/+29
| | | | | | underlying expr instead. Add getNumDefaultArgTemporaries and getDefaultArgTemporary which returns the temporaries a default arg creates. llvm-svn: 91439
* Elaborated types are specifier types, based on a patch from CorneliusDouglas Gregor2009-12-151-0/+1
| | | | llvm-svn: 91431
* Improve template instantiation for object constructions in several ways:Douglas Gregor2009-12-141-0/+31
| | | | | | | | | | | | | - During instantiation, drop default arguments from constructor and call expressions; they'll be recomputed anyway, and we don't want to instantiate them twice. - Rewrote the instantiation of variable initializers to cope with non-dependent forms properly. Together, these fix a handful of problems I introduced with the switch to always rebuild expressions from the source code "as written." llvm-svn: 91315
* Rename dump to dumpDeclContext, so that call RD->dump() won't dump the decl ↵Anders Carlsson2009-12-141-1/+1
| | | | | | context by default. llvm-svn: 91256
* More improvements to checking allocation and deallocation functions.Anders Carlsson2009-12-131-2/+2
| | | | llvm-svn: 91244
* Un-namespace-qualify llvm_unreachable. It's a macro, so the qualification gaveJeffrey Yasskin2009-12-122-2/+2
| | | | | | no extra safety anyway. llvm-svn: 91207
* Factor operator new declaration checking out into a separate function.Anders Carlsson2009-12-121-1/+1
| | | | llvm-svn: 91189
* Patch to allow C-style cast from 'void *' to block pointer type.Fariborz Jahanian2009-12-111-0/+2
| | | | | | (fixes radar 7465023). llvm-svn: 91171
* StmtDumper::VisitUnresolvedLookupExprJohn McCall2009-12-111-0/+14
| | | | llvm-svn: 91163
* Use StringRef.getAsInteger instead of temporary string + strtol. No intended ↵Benjamin Kramer2009-12-111-9/+3
| | | | | | functionality change. llvm-svn: 91118
* Patch to fix a crash trying to access a category name inFariborz Jahanian2009-12-111-2/+2
| | | | | | | objective-c++ mode and also removed dead-code in this area. (fixes radar 7456710). llvm-svn: 91081
* Clean up enum constants so that they're finally sane. Fixes PR3173 and aEli Friedman2009-12-102-11/+3
| | | | | | recently introduced crash. llvm-svn: 91070
* Implement redeclaration checking and hiding semantics for using ↵John McCall2009-12-101-0/+40
| | | | | | | | | | | declarations. There are a couple of O(n^2) operations in this, some analogous to the usual O(n^2) redeclaration problem and some not. In particular, retroactively removing shadow declarations when they're hidden by later decls is pretty unfortunate. I'm not yet convinced it's worse than the alternative, though. llvm-svn: 91045
* spread 'const' love to some variables. this considerably reduces the amount ↵Nuno Lopes2009-12-101-1/+1
| | | | | | of dirty data around. llvm-svn: 91002
* Code gen for ObjCIsaExpr AST used as lvalue.Fariborz Jahanian2009-12-091-0/+1
| | | | | | (fixes radar 7457534). llvm-svn: 90995
* Reimplement reference initialization (C++ [dcl.init.ref]) using theDouglas Gregor2009-12-091-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | new notion of an "initialization sequence", which encapsulates the computation of the initialization sequence along with diagnostic information and the capability to turn the computed sequence into an expression. At present, I've only switched one CheckReferenceInit callers over to this new mechanism; more will follow. Aside from (hopefully) being much more true to the standard, the diagnostics provided by this reference-initialization code are a bit better than before. Some examples: p5-var.cpp:54:12: error: non-const lvalue reference to type 'struct Derived' cannot bind to a value of unrelated type 'struct Base' Derived &dr2 = b; // expected-error{{non-const lvalue reference to ... ^ ~ p5-var.cpp:55:9: error: binding of reference to type 'struct Base' to a value of type 'struct Base const' drops qualifiers Base &br3 = bc; // expected-error{{drops qualifiers}} ^ ~~ p5-var.cpp:57:15: error: ambiguous conversion from derived class 'struct Diamond' to base class 'struct Base': struct Diamond -> struct Derived -> struct Base struct Diamond -> struct Derived2 -> struct Base Base &br5 = diamond; // expected-error{{ambiguous conversion from ... ^~~~~~~ p5-var.cpp:59:9: error: non-const lvalue reference to type 'long' cannot bind to a value of unrelated type 'int' long &lr = i; // expected-error{{non-const lvalue reference to type ... ^ ~ p5-var.cpp:74:9: error: non-const lvalue reference to type 'struct Base' cannot bind to a temporary of type 'struct Base' Base &br1 = Base(); // expected-error{{non-const lvalue reference to ... ^ ~~~~~~ p5-var.cpp:102:9: error: non-const reference cannot bind to bit-field 'i' int & ir1 = (ib.i); // expected-error{{non-const reference cannot ... ^ ~~~~~~ p5-var.cpp:98:7: note: bit-field is declared here int i : 17; // expected-note{{bit-field is declared here}} ^ llvm-svn: 90992
* Add DeclContext::dump.Anders Carlsson2009-12-091-0/+11
| | | | llvm-svn: 90974
* First pass at implementing C++ enum semantics: calculate (and store) anJohn McCall2009-12-092-2/+11
| | | | | | | | | | | | "integer promotion" type associated with an enum decl, and use this type to determine which type to promote to. This type obeys C++ [conv.prom]p2 and is therefore generally signed unless the range of the enumerators forces it to be unsigned. Kills off a lot of false positives from -Wsign-compare in C++, addressing rdar://7455616 llvm-svn: 90965
* In CXXRecordDecl::forallBases, add the base to the "queue", so we walk more ↵Anders Carlsson2009-12-091-2/+4
| | | | | | than one heirarchy of classes. John, please review. llvm-svn: 90948
* Implemented an implicit conversion from "noreturn" function types (andDouglas Gregor2009-12-091-20/+30
| | | | | | | | | | | | | | pointers thereof) to their corresponding non-noreturn function types. This conversion is considered an exact match for overload-resolution purposes. Note that we are a little more strict that GCC is, because we encode noreturn in the type system, but that's a Good Thing (TM) because it does not allow us to pretend that potentially-returning function pointers are non-returning function pointers. Fxies PR5620. llvm-svn: 90913
* Added a missing case to a switch statement.Fariborz Jahanian2009-12-081-0/+2
| | | | llvm-svn: 90902
* Implement template instantiation for exception specifications. Also,Douglas Gregor2009-12-082-0/+35
| | | | | | | | | | | | | | print exception specifications on function types and declarations. Fixes <rdar://problem/7450999>. There is some poor source-location information here, because we don't track locations of the types in exception specifications. Filed PR5719. Failures during template instantiation of the signature of a function or function template have wrong point-of-instantiation location information. I'll tackle that with a separate commit. llvm-svn: 90863
* DeclRefExpr stores a ValueDecl internally.John McCall2009-12-081-2/+2
| | | | | | Template instantiation can re-use DeclRefExprs. llvm-svn: 90848
* Add CXXRecordDecl::forallBases to walk an inheritance hierarchy with non-lookupJohn McCall2009-12-081-0/+49
| | | | | | | semantics and CXXRecordDecl::isProvablyNotDerivedFrom to assist with pre-instantiation diagnostics. llvm-svn: 90842
* Fix for PR5710: make sure to put function template specializations into theEli Friedman2009-12-081-0/+3
| | | | | | | | | | DeclContext, so they don't completely disappear from the AST. I don't particularly like this fix, but I don't see any obviously better way to deal with it, and I think it's pretty clearly an improvement; comments welcome. llvm-svn: 90835
* Misc key function fixes.Eli Friedman2009-12-081-1/+10
| | | | llvm-svn: 90831
* Instantiated or specialized class templates never have a key function. This ↵Anders Carlsson2009-12-071-0/+5
| | | | | | (and the previous check-in) fixes PR5557. llvm-svn: 90753
* getTemplateSpecializationKind should be const.Anders Carlsson2009-12-071-2/+2
| | | | llvm-svn: 90750
* Move key functions to a separate map.Anders Carlsson2009-12-073-33/+50
| | | | llvm-svn: 90745
* DeclaratorInfo -> TypeSourceInfo. Makes an effort to rename associated ↵John McCall2009-12-076-44/+44
| | | | | | | | | | | | | | | | | | | | | variables, but the results are imperfect. For posterity, I did: cat <<EOF > $cmdfile s/DeclaratorInfo/TypeSourceInfo/g s/DInfo/TInfo/g s/TypeTypeSourceInfo/TypeSourceInfo/g s/SourceTypeSourceInfo/TypeSourceInfo/g EOF find lib -name '*.cpp' -not -path 'lib/Parse/*' -exec sed -i '' -f $cmdfile '{}' \; find lib -name '*.h' -exec sed -i '' -f $cmdfile '{}' \; find include -name '*.h' -not -path 'include/clang/Parse/*' -not -path 'include/clang/Basic/*' -exec sed -i '' -f $cmdfile '{}' \; llvm-svn: 90743
* Don't print a void return type for C++ constructors and destructors when ↵Sam Weinig2009-12-061-1/+2
| | | | | | generating a predefined expr for them. llvm-svn: 90725
* Move helper onto CXXMethodDecl.Eli Friedman2009-12-062-17/+21
| | | | llvm-svn: 90716
* Add rudimentary support for member pointers to CGDebugInfo.Anders Carlsson2009-12-061-4/+0
| | | | llvm-svn: 90711
* Tweak "key function" rules so that they work for templates with virtualEli Friedman2009-12-051-1/+15
| | | | | | inline functions. llvm-svn: 90645
* Fix "using typename" and the instantiation of non-dependent using declarations.John McCall2009-12-043-11/+68
| | | | llvm-svn: 90614
* Be a little more clever about inline member functions that are marked inline ↵Anders Carlsson2009-12-041-1/+13
| | | | | | | | | | | | | | in the inline class declaration but not in the actual definition: class A { inline void f(); } void A::f() { } This is not the most ideal solution, since it doesn't work 100% with regular functions (as my FIXME comment states). llvm-svn: 90607
* Fix for PR5650 - Revised vector_size attribute handling to be done earlier ↵John Thompson2009-12-041-4/+5
| | | | | | before declaration is finalized. llvm-svn: 90600
* 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
OpenPOWER on IntegriCloud