summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/Mangle.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* When mangling member function pointers, fake adding a substitution ↵Anders Carlsson2010-06-021-6/+25
| | | | | | corresponding to the function type. llvm-svn: 105310
* Extract the ObjC and blocks manglers into their own class. No functionalityCharles Davis2010-05-261-41/+58
| | | | | | change. llvm-svn: 104715
* Be sure to use the standard substitutions when mangling the names ofDouglas Gregor2010-05-261-5/+11
| | | | | | vtables, VTTs, and construction vtables. Fixes PR7201. llvm-svn: 104675
* Improve name mangling for blocks and support mangling of static localDouglas Gregor2010-05-251-1/+43
| | | | | | | | | variables within blocks. We loosely follow GCC's mangling, but since these are always internal symbols the names don't really matter. I intend to revisit block mangling later, because GCC's mangling is rather verbose. <rdar://problem/8015719>. llvm-svn: 104610
* Modify this comment per Doug's suggestion: we don't need to mangle protocols.John McCall2010-05-151-2/+2
| | | | llvm-svn: 103875
* Substantially alter the design of the Objective C type AST by introducingJohn McCall2010-05-151-0/+6
| | | | | | | | | | | | | | | | | | | | | ObjCObjectType, which is basically just a pair of one of {primitive-id, primitive-Class, user-defined @class} with a list of protocols. An ObjCObjectPointerType is therefore just a pointer which always points to one of these types (possibly sugared). ObjCInterfaceType is now just a kind of ObjCObjectType which happens to not carry any protocols. Alter a rather large number of use sites to use ObjCObjectType instead of ObjCInterfaceType. Store an ObjCInterfaceType as a pointer on the decl rather than hashing them in a FoldingSet. Remove some number of methods that are no longer used, at least after this patch. By simplifying ObjCObjectPointerType, we are now able to easily remove and apply pointers to Objective-C types, which is crucial for a certain kind of ObjC++ metaprogramming common in WebKit. llvm-svn: 103870
* Reapplying patch to change StmtNodes.def to StmtNodes.td, this timeAlexis Hunt2010-05-051-1/+1
| | | | | | | with no whitespace. This will allow statements to be referred to in attribute TableGen files. llvm-svn: 103087
* Revert r103072; I accidentally ended up deleting a bunch of trailingAlexis Hunt2010-05-051-24/+24
| | | | | | | whitespace which makes this patch unreadable. Will recommit without the whitespace. llvm-svn: 103086
* Change StmtNodes.def to StmtNodes.td in anticipation of a rewrite of attributesAlexis Hunt2010-05-051-24/+24
| | | | llvm-svn: 103072
* Improve name mangling for dependent template names (e.g., typenameDouglas Gregor2010-04-281-15/+77
| | | | | | | | T::template apply<U>), handling a few cases where we previously failed and performing substitutions on such dependent names. Fixes a crash in Boost.PropertyTree. llvm-svn: 102490
* Make the InjectedClassNameType the canonical type of the current instantiationJohn McCall2010-04-271-0/+7
| | | | | | | | | | | | | | | | of a class template or class template partial specialization. That is to say, in template <class T> class A { ... }; or template <class T> class B<const T*> { ... }; make 'A<T>' and 'B<const T*>' sugar for the corresponding InjectedClassNameType when written inside the appropriate context. This allows us to track the current instantiation appropriately even inside AST routines. It also allows us to compute a DeclContext for a type much more efficiently, at some extra cost every time we write a template specialization (which can be optimized, but I've left it simple in this patch). llvm-svn: 102407
* Emit a lame diagnostic when we can't mangle operator namesDouglas Gregor2010-04-231-1/+5
| | | | llvm-svn: 102168
* Mangle dependent template names such as the nested-name-specifier inDouglas Gregor2010-04-231-6/+53
| | | | | | | | | T::apply <U>::type Fixes PR6899, although I want to dig a little deeper into the FIXME for dependent template names that refer to operators. llvm-svn: 102167
* Fixes a code gen. bug by removing an assert.Fariborz Jahanian2010-04-201-2/+0
| | | | | | | It is ok to have c++-ness inside extern "C" block. Fixes pr6644. llvm-svn: 101948
* Vtable -> VTable renames across the board.Anders Carlsson2010-04-171-2/+2
| | | | llvm-svn: 101666
* Add raw_ostream operators to NamedDecl for convenience. Switch over all ↵Benjamin Kramer2010-04-171-1/+1
| | | | | | | | users of getNameAsString on a stream. The next step is to print the name directly into the stream, avoiding a temporary std::string copy. llvm-svn: 101632
* A bunch of string-related microoptimizations in Mangler.Benjamin Kramer2010-04-101-22/+22
| | | | llvm-svn: 100928
* Doug pointed out that we have a perfectly reasonable expression here toJohn McCall2010-04-101-2/+4
| | | | | | serve as a source of source locations for the can't-yet-mangle diagnostic. llvm-svn: 100924
* Mangle some expressions with codegen implications but no mangling "overhead".John McCall2010-04-091-0/+12
| | | | llvm-svn: 100909
* Provide an extremely unsatisfactory diagnostic (instead of crashing) whenJohn McCall2010-04-091-1/+15
| | | | | | | mangling an unknown expression kind. Also conveniently tells the user what kind of expression they should add to the mangler! llvm-svn: 100907
* Provide manglings for bool and character literal expressions. These areJohn McCall2010-04-091-0/+13
| | | | | | | | just integer-literal expressions with special case implementations in the AST. Fixes rdar://problem/7825453. llvm-svn: 100905
* Rename CGVtable files to CGVTables.Anders Carlsson2010-04-081-1/+1
| | | | llvm-svn: 100778
* Extend DependentNameType with a keyword enum that specifies whetherDouglas Gregor2010-03-311-2/+3
| | | | | | | this was parsed as a typename-specifier, elaborated-type-specifier (including the kind), or just a dependent qualified type name. llvm-svn: 100039
* Rename TypenameType to DependentNameType in anticipation of someDouglas Gregor2010-03-311-2/+2
| | | | | | refactoring work in this area. llvm-svn: 100019
* Remove the old vtable layout code.Anders Carlsson2010-03-301-53/+0
| | | | llvm-svn: 99869
* Implement new mangling for vectors.Nick Lewycky2010-03-261-2/+7
| | | | llvm-svn: 99616
* More thunks scaffolding.Anders Carlsson2010-03-231-4/+55
| | | | llvm-svn: 99294
* Correctly mangle dependent TypenameType.Rafael Espindola2010-03-171-24/+21
| | | | | | Fixes PR6625. llvm-svn: 98707
* Use SmallString instead of SmallVectorKovarththanan Rajaratnam2010-03-131-52/+52
| | | | llvm-svn: 98436
* Correctly mangle address of member in template arguments. Fixes PR6460Rafael Espindola2010-03-111-20/+49
| | | | llvm-svn: 98254
* Don't turn off mangling in implicitly extern "C" system headers. GCCDouglas Gregor2010-03-071-6/+0
| | | | | | | | | doesn't do this on any of the major platforms, and we don't really support any of the platforms that do (nor will we actually handle those headers well). Fixes PR6217; see PR6530 for details on what we would need to do to support these platforms. llvm-svn: 97899
* Refactor local class name mangling and make itFariborz Jahanian2010-03-041-13/+8
| | | | | | ABI conforming. llvm-svn: 97702
* Implements mangling of local class names toFariborz Jahanian2010-03-031-13/+58
| | | | | | | | fix a code gen crash. This is WIP as not all ABI cases are covered (there is a FIXME to this effect). Fixes radar 7696748. llvm-svn: 97658
* Split out types that are non-canonical unless dependent as their ownJohn McCall2010-03-011-1/+39
| | | | | | | | | | | category. Use this in a few places to eliminate unnecessary TST cases and do some future-proofing. Provide terrible manglings for typeof. Mangle decltype with some hope of accuracy. Our manglings for some of the cases covered in the testcase are different from gcc's, which I've raised as an issue with the ABI list. llvm-svn: 97523
* The latest draft uses 'dt' to mangle member expressions, and now so do we.John McCall2010-03-011-9/+3
| | | | llvm-svn: 97479
* Improve name mangling for dependently-scoped declaration references.Douglas Gregor2010-02-281-1/+12
| | | | llvm-svn: 97422
* Add name mangling for DeclRefExprs that refer to external namesDouglas Gregor2010-02-281-2/+8
| | | | llvm-svn: 97418
* Make previous fix handle a few more edge cases.Eli Friedman2010-02-231-3/+3
| | | | llvm-svn: 96962
* PR6400: Handle an extreme edge case in mangling correctly.Eli Friedman2010-02-231-0/+3
| | | | llvm-svn: 96961
* Only append 'L' for internal variable declarations, not all declarations. ↵Anders Carlsson2010-02-061-3/+4
| | | | | | (Found by the mangle checker, yay) llvm-svn: 95485
* Assert when we try to mangle a dependent template name, rather thanDouglas Gregor2010-02-061-1/+3
| | | | | | crashing unceremoniously. llvm-svn: 95464
* Implement name mangling for template template parametersDouglas Gregor2010-02-051-2/+15
| | | | llvm-svn: 95427
* Check in a mangle checker that's turned off by default.Anders Carlsson2010-02-051-0/+18
| | | | llvm-svn: 95377
* Mangle member expressions. Also invented.John McCall2010-02-041-1/+57
| | | | llvm-svn: 95284
* Add a cautionary note about the mangling I just invented.John McCall2010-02-041-0/+3
| | | | llvm-svn: 95275
* Add mangling support for calls, sizeof/alignof, constructor calls,John McCall2010-02-041-29/+151
| | | | | | float literals, and unresolved lookups (which required hand-wavey extensions). llvm-svn: 95273
* When a function or variable somehow depends on a type or declarationDouglas Gregor2010-02-031-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that is in an anonymous namespace, give that function or variable internal linkage. This change models an oddity of the C++ standard, where names declared in an anonymous namespace have external linkage but, because anonymous namespace are really "uniquely-named" namespaces, the names cannot be referenced from other translation units. That means that they have external linkage for semantic analysis, but the only sensible implementation for code generation is to give them internal linkage. We now model this notion via the UniqueExternalLinkage linkage type. There are several changes here: - Extended NamedDecl::getLinkage() to produce UniqueExternalLinkage when the declaration is in an anonymous namespace. - Added Type::getLinkage() to determine the linkage of a type, which is defined as the minimum linkage of the types (when we're dealing with a compound type that is not a struct/class/union). - Extended NamedDecl::getLinkage() to consider the linkage of the template arguments and template parameters of function template specializations and class template specializations. - Taught code generation to rely on NamedDecl::getLinkage() when determining the linkage of variables and functions, also considering the linkage of the types of those variables and functions (C++ only). Map UniqueExternalLinkage to internal linkage, taking out the explicit checks for isInAnonymousNamespace(). This fixes much of PR5792, which, as discovered by Anders Carlsson, is actually the reason behind the pass-manager assertion that causes the majority of clang-on-clang regression test failures. With this fix, Clang-built-Clang+LLVM passes 88% of its regression tests (up from 67%). The specific numbers are: LLVM: Expected Passes : 4006 Expected Failures : 32 Unsupported Tests : 40 Unexpected Failures: 736 Clang: Expected Passes : 1903 Expected Failures : 14 Unexpected Failures: 75 Overall: Expected Passes : 5909 Expected Failures : 46 Unsupported Tests : 40 Unexpected Failures: 811 Still to do: - Improve testing - Check whether we should allow the presence of types with InternalLinkage (in addition to UniqueExternalLinkage) given variables/functions internal linkage in C++, as mentioned in PR5792. - Determine how expensive the getLinkage() calls are in practice; consider caching the result in NamedDecl. - Assess the feasibility of Chris's idea in comment #1 of PR5792. llvm-svn: 95216
* Remove abstract expression kinds from the StmtClass enum. Update a few usersJohn McCall2010-02-031-6/+23
| | | | | | appropriately. Call out a few missing cases in the expression mangler. llvm-svn: 95176
* Name mangling for cast expressions, from Matthias Schiffer! Fixes PR5876.Douglas Gregor2010-01-291-0/+18
| | | | llvm-svn: 94811
* Mangle static variables with an extra name to distinguish them from ↵Alexis Hunt2010-01-241-6/+11
| | | | | | | | non-static variables in the same TU. Fixes PR5966 for real this time; also reverts r92911, which had a incorrect fix. llvm-svn: 94352
OpenPOWER on IntegriCloud