summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclarationName.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement name lookup for conversion function template specializationsDouglas Gregor2010-01-111-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | (C++ [temp.mem]p5-6), which involves template argument deduction based on the type named, e.g., given struct X { template<typename T> operator T*(); } x; when we call x.operator int*(); we perform template argument deduction to determine that T=int. This template argument deduction is needed for template specialization and explicit instantiation, e.g., template<> X::operator float*() { /* ... */ } and when calling or otherwise naming a conversion function (as in the first example). This fixes PR5742 and PR5762, although there's some remaining ugliness that's causing out-of-line definitions of conversion function templates to fail. I'll look into that separately. llvm-svn: 93162
* move a few more symbols to .rodata/.data.rel.roNuno Lopes2009-12-231-1/+1
| | | | llvm-svn: 92012
* spread 'const' love to some variables. this considerably reduces the amount ↵Nuno Lopes2009-12-101-1/+1
| | | | | | of dirty data around. llvm-svn: 91002
* 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
* Fix a missing include from r88876.Chandler Carruth2009-11-151-0/+1
| | | | llvm-svn: 88879
* Add DeclarationName::dump().Anders Carlsson2009-11-151-0/+4
| | | | llvm-svn: 88876
* Give DeclarationName's operator< a more predictable, useful orderingDouglas Gregor2009-11-041-5/+45
| | | | llvm-svn: 86055
* PR5218: Replace IdentifierInfo::getName with StringRef version, now that clientsDaniel Dunbar2009-10-181-1/+1
| | | | | | are updated. llvm-svn: 84447
* Move misc clients to IdentifierInfo StringRef API.Daniel Dunbar2009-10-181-1/+1
| | | | | | | | | - strcmp -> == - OS.write(II->getName() ...) -> OS << II->getNameStr() - Avoid std::string concatenation - Use getNameStr().str() when an std::string is really needed. llvm-svn: 84437
* Write the preprocessor block after we write out types + declarations,Douglas Gregor2009-10-171-1/+1
| | | | | | | | so that we catch any macros used within the declarations and types. Also, properly store a NULL selector. llvm-svn: 84334
* Refactor the representation of qualifiers to bring ExtQualType out of theJohn McCall2009-09-241-2/+2
| | | | | | | | Type hierarchy. Demote 'volatile' to extended-qualifier status. Audit our use of qualifiers and fix a few places that weren't dealing with qualifiers quite right; many more remain. llvm-svn: 82705
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-15/+15
| | | | llvm-svn: 81346
* Introduce the canonical type smart pointers, and use them in a few places toDouglas Gregor2009-08-051-3/+1
| | | | | | tighten up the static type system. llvm-svn: 78164
* Change uses of:Ted Kremenek2009-07-291-3/+3
| | | | | | | | | | | | | | | | | | | | Type::getAsReferenceType() -> Type::getAs<ReferenceType>() Type::getAsRecordType() -> Type::getAs<RecordType>() Type::getAsPointerType() -> Type::getAs<PointerType>() Type::getAsBlockPointerType() -> Type::getAs<BlockPointerType>() Type::getAsLValueReferenceType() -> Type::getAs<LValueReferenceType>() Type::getAsRValueReferenceType() -> Type::getAs<RValueReferenceType>() Type::getAsMemberPointerType() -> Type::getAs<MemberPointerType>() Type::getAsReferenceType() -> Type::getAs<ReferenceType>() Type::getAsTagType() -> Type::getAs<TagType>() And remove Type::getAsReferenceType(), etc. This change is similar to one I made a couple weeks ago, but that was partly reverted pending some additional design discussion. With Doug's pending smart pointer changes for Types, it seemed natural to take this approach. llvm-svn: 77510
* Per offline discussion with Steve Naroff, add back Type::getAsXXXType() methodsTed Kremenek2009-07-171-3/+3
| | | | | | | | | until Doug Gregor's Type smart pointer code lands (or more discussion occurs). These methods just call the new Type::getAs<XXX> methods, so we still have reduced implementation redundancy. Having explicit getAsXXXType() methods makes it easier to set breakpoints in the debugger. llvm-svn: 76193
* Replaced Type::getAsLValueReferenceType(), Type::getAsRValueReferenceType(), ↵Ted Kremenek2009-07-171-3/+3
| | | | | | Type::getAsMemberPointerType(), Type::getAsTagType(), and Type::getAsRecordType() with their Type::getAs<XXX> equivalents. llvm-svn: 76139
* Make sure that we use the canonical type for the names of instantiatedDouglas Gregor2009-05-151-1/+2
| | | | | | | | | | constructors and destructors. This is a requirement of DeclarationNameTable::getCXXSpecialName that we weren't assert()'ing, so it should have been caught much earlier :( Big thanks to Anders for the test case. llvm-svn: 71895
* PCH support for all of the predefined Objective-C types, such as id,Douglas Gregor2009-04-231-0/+5
| | | | | | | | SEL, Class, Protocol, CFConstantString, and __objcFastEnumerationState. With this, we can now run the Objective-C methods and properties PCH tests. llvm-svn: 69932
* Remove the serialization code that predates precompiledDouglas Gregor2009-04-221-2/+1
| | | | | | | headers. Future approaches to (de-)serializing ASTs will be based on the PCH infrastructure. llvm-svn: 69828
* add an assertion for unreachable code.Chris Lattner2009-03-211-0/+1
| | | | llvm-svn: 67432
* Remove dead DeclarationName constructors that involving knowing about theTed Kremenek2009-03-141-0/+3
| | | | | | internal implementation of Selector. llvm-svn: 66996
* fix long lines.Chris Lattner2009-02-161-1/+1
| | | | llvm-svn: 64684
* Semantic analysis, ASTs, and unqualified name lookup support for C++Douglas Gregor2009-02-031-1/+17
| | | | | | using directives, from Piotr Rak! llvm-svn: 63646
* Make sure we don't name a constructor or destructor with a qualifiedDouglas Gregor2009-01-131-0/+2
| | | | | | type. It leads to very weird errors. llvm-svn: 62124
* dont call iterator::end() on every cycle and dont read already-deleted memoryNuno Lopes2008-12-141-3/+4
| | | | llvm-svn: 61015
* minor WS fix for the previous commitNuno Lopes2008-12-141-3/+2
| | | | llvm-svn: 61008
* fix leakage of CXXSpecialName objects in DeclarationNameTableNuno Lopes2008-12-141-1/+10
| | | | llvm-svn: 61007
* Unifies the name-lookup mechanisms used in various parts of the ASTDouglas Gregor2008-12-111-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Migrate some stuff from NamedDecl::getName() to Chris Lattner2008-11-241-3/+3
| | | | | | NamedDecl::getNameAsString() to make it more explicit. llvm-svn: 59937
* Rename Selector::getName() to Selector::getAsString(), and addChris Lattner2008-11-241-1/+1
| | | | | | | | | | | | | a new NamedDecl::getAsString() method. Change uses of Selector::getName() to just pass in a Selector where possible (e.g. to diagnostics) instead of going through an std::string. This also adds new formatters for objcinstance and objcclass as described in the dox. llvm-svn: 59933
* Extend DeclarationName to support C++ overloaded operators, e.g.,Douglas Gregor2008-11-181-2/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Eliminate all of the placeholder identifiers used for constructors,Douglas Gregor2008-11-171-0/+46
| | | | | | | | | 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
* Updated IdentifierResolver to deal with DeclarationNames. The names ofDouglas Gregor2008-11-171-0/+39
| | | | | | | | | | | | | | | | | | | | | 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
* Introduction the DeclarationName class, as a single, general method ofDouglas Gregor2008-11-171-0/+166
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
OpenPOWER on IntegriCloud