summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclarationName.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Simplify some users of DeclarationName::getNameKind. Fold ↵Benjamin Kramer2012-05-191-1/+1
| | | | | | getFETokenInfoAsVoid into its only caller. llvm-svn: 157116
* Synchronize the representations of DeclarationName and Selector soDouglas Gregor2012-05-041-45/+0
| | | | | | | | that bridging between the two is free. Saves ~4k of code size, although I don't see any measurable performance difference (unfortunately). llvm-svn: 156187
* Inline DenseMapInfo<clang::DeclarationName>::getHashValue() for a 0.4% ↵Douglas Gregor2012-05-031-6/+0
| | | | | | speedup on <rdar://problem/11004361> llvm-svn: 156129
* Split DeclarationName::getFETokenInfoAsVoid() into hot/cold paths andDouglas Gregor2012-05-031-2/+2
| | | | | | | (trivially) make DeclContext::lookup()'s const version inlinable. Good for 0.3% on <rdar://problem/11004361>. llvm-svn: 156126
* Literal operator suffixes and regular names live in separate namespaces.Richard Smith2012-03-091-3/+8
| | | | llvm-svn: 152395
* Revert my patches which removed Diagnostic.h includes by moving some ↵Benjamin Kramer2012-02-071-15/+0
| | | | | | | | | | | | | | | | | | operator overloads out of line. This seems to negatively affect compile time onsome ObjC tests (which use a lot of partial diagnostics I assume). I have to come up with a way to keep them inline without including Diagnostic.h everywhere. Now adding a new diagnostic requires a full rebuild of e.g. the static analyzer which doesn't even use those diagnostics. This reverts commit 6496bd10dc3a6d5e3266348f08b6e35f8184bc99. This reverts commit 7af19b817ba964ac560b50c1ed6183235f699789. This reverts commit fdd15602a42bbe26185978ef1e17019f6d969aa7. This reverts commit 00bd44d5677783527d7517c1ffe45e4d75a0f56f. This reverts commit ef9b60ffed980864a8db26ad30344be429e58ff5. llvm-svn: 150006
* Move various diagnostic operator<< overloads out of line and remove includes ↵Benjamin Kramer2012-02-041-0/+15
| | | | | | | | | of Diagnostic.h. Fix all the files that depended on transitive includes of Diagnostic.h. With this patch in place changing a diagnostic no longer requires a full rebuild of the StaticAnalyzer. llvm-svn: 149781
* More dead code removal (using -Wunreachable-code)David Blaikie2012-01-201-3/+2
| | | | llvm-svn: 148577
* Change operator<< for raw_ostream and NamedDecl to take a reference instead ↵Benjamin Kramer2011-10-141-3/+3
| | | | | | | | of a pointer. Passing a pointer was a bad idea as it collides with the overload for void*. llvm-svn: 141971
* Removing a bunch of dead returns/breaks after llvm_unreachables.David Blaikie2011-09-231-3/+0
| | | | llvm-svn: 140407
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-6/+6
| | | | llvm-svn: 140367
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-2/+2
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Introduce the notion of instantiation dependence into Clang's AST. ADouglas Gregor2011-07-011-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | type/expression/template argument/etc. is instantiation-dependent if it somehow involves a template parameter, even if it doesn't meet the requirements for the more common kinds of dependence (dependent type, type-dependent expression, value-dependent expression). When we see an instantiation-dependent type, we know we always need to perform substitution into that instantiation-dependent type. This keeps us from short-circuiting evaluation in places where we shouldn't, and lets us properly implement C++0x [temp.type]p2. In theory, this would also allow us to properly mangle instantiation-dependent-but-not-dependent decltype types per the Itanium C++ ABI, but we aren't quite there because we still mangle based on the canonical type in cases like, e.g., template<unsigned> struct A { }; template<typename T> void f(A<sizeof(sizeof(decltype(T() + T())))>) { } template void f<int>(A<sizeof(sizeof(int))>); and therefore get the wrong answer. llvm-svn: 134225
* Selector::getIdentifierInfoForSlot() can return NULL values, a factDouglas Gregor2011-02-181-4/+2
| | | | | | | | | | | | that was ignored in a few places (most notably, code completion). Introduce Selector::getNameForSlot() for the common case where we only care about the name. Audit all uses of getIdentifierInfoForSlot(), switching many over to getNameForSlot(), fixing a few crashers. Fixed <rdar://problem/8939352>, a code-completion crasher. llvm-svn: 125977
* PR3558: mark "logically const" accessor methods in ASTContext as const,Jay Foad2011-01-121-1/+1
| | | | | | | and mark the fields they use as mutable. This allows us to remove a few const_casts. llvm-svn: 123314
* Silence GCC warning about control reaching the end of the function and ↵Chandler Carruth2010-12-151-0/+2
| | | | | | explicitly mark that all cases are handled. llvm-svn: 121855
* Variadic templates: extend the Expr class with a bit that specifiesDouglas Gregor2010-12-151-0/+21
| | | | | | | | | | | | | | | | | | whether the expression contains an unexpanded parameter pack, in the same vein as the changes to the Type hierarchy. Compute this bit within all of the Expr subclasses. This change required a bunch of reshuffling of dependency calculations, mainly to consolidate them inside the constructors and to fuse multiple loops that iterate over arguments to determine type dependence, value dependence, and (now) containment of unexpanded parameter packs. Again, testing is painfully sparse, because all of the diagnostics will change and it is more important to test the to-be-written visitor that collects unexpanded parameter packs. llvm-svn: 121831
* Added locations and type source info for DeclarationName.Abramo Bagnara2010-08-111-0/+96
| | | | llvm-svn: 110860
* Make ASTContext always use the BumpPtrAllocator.Douglas Gregor2010-07-251-20/+0
| | | | llvm-svn: 109375
* Allocate most of DeclarationNamesTable using ASTContext's allcocator. The ↵Ted Kremenek2010-05-101-24/+22
| | | | | | | | only things that aren't allocated this way are the internal FoldingSets. llvm-svn: 103429
* Start converting pieces of DeclarationNameTable to be allocated using ↵Ted Kremenek2010-05-101-4/+10
| | | | | | | | | | ASTContext's allocator. While DeclarationNameTable doesn't leak, it uses 'malloc' too often. Start with having 'CXXLiteralOperatorNames' allocated using ASTContext's allocator and add a 'DoDestroy()' method to DeclarationNameTable that is called by ~ASTContext. llvm-svn: 103426
* Add printName to DeclarationName which prints the human-readable name on aBenjamin Kramer2010-04-171-24/+35
| | | | | | raw_ostream. Use it in getAsString and NamedDecl's raw_ostream operator. llvm-svn: 101633
* Switch the standard DeclarationName comparator to be a tri-valued comparator.John McCall2010-02-131-18/+29
| | | | | | | Use that while fixing a nasty misuse of qsort in vtable codegen which, somehow, has not actually caused a crash. llvm-svn: 96062
* Implement semantic checking for C++ literal operators.Alexis Hunt2010-01-131-6/+40
| | | | | | | This now rejects literal operators that don't meet the requirements. Templates are not yet checked for. llvm-svn: 93315
* 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
OpenPOWER on IntegriCloud