summaryrefslogtreecommitdiff
path: root/lib/CodeGen/Mangle.cpp
Commit message (Collapse)AuthorAge
...
* Split DependentNameType into two types. DependentNameType represents theJohn McCall2010-06-11
| | | | | | | | | | | | | | | | case of an elaborated-type-specifier like 'typename A<T>::foo', and DependentTemplateSpecializationType represents the case of an elaborated-type-specifier like 'typename A<T>::template B<T>'. The TypeLoc representation of a DependentTST conveniently exactly matches that of an ElaboratedType wrapping a TST. Kill off the explicit rebuild methods for RebuildInCurrentInstantiation; the standard implementations work fine because the nested name specifier is computable in the newly-entered context. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105801 91177308-0d34-0410-b5e6-96231b3b80d8
* Correctly handle > 257 substitutions in a single mangling, and don't introduceJohn McCall2010-06-09
| | | | | | | | | a spurious substitution for an unscoped dependent template-id after introducing a substitution for the scoped template-id. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105699 91177308-0d34-0410-b5e6-96231b3b80d8
* Correctly mangle static variables of anonymous struct/union type.Anders Carlsson2010-06-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105606 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't substitute 'St' for 'std' when the namespace is nested inside another ↵Anders Carlsson2010-06-02
| | | | | | namespace. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105330 91177308-0d34-0410-b5e6-96231b3b80d8
* Correctly mangle unsigned integer literals where the high bit is set.Anders Carlsson2010-06-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105312 91177308-0d34-0410-b5e6-96231b3b80d8
* Correctly mangle variadic functions that don't have any other parameters.Anders Carlsson2010-06-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105311 91177308-0d34-0410-b5e6-96231b3b80d8
* When mangling member function pointers, fake adding a substitution ↵Anders Carlsson2010-06-02
| | | | | | corresponding to the function type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105310 91177308-0d34-0410-b5e6-96231b3b80d8
* Extract the ObjC and blocks manglers into their own class. No functionalityCharles Davis2010-05-26
| | | | | | | change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104715 91177308-0d34-0410-b5e6-96231b3b80d8
* Be sure to use the standard substitutions when mangling the names ofDouglas Gregor2010-05-26
| | | | | | | vtables, VTTs, and construction vtables. Fixes PR7201. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104675 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve name mangling for blocks and support mangling of static localDouglas Gregor2010-05-25
| | | | | | | | | | 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>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104610 91177308-0d34-0410-b5e6-96231b3b80d8
* Modify this comment per Doug's suggestion: we don't need to mangle protocols.John McCall2010-05-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103875 91177308-0d34-0410-b5e6-96231b3b80d8
* Substantially alter the design of the Objective C type AST by introducingJohn McCall2010-05-15
| | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103870 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapplying patch to change StmtNodes.def to StmtNodes.td, this timeSean Hunt2010-05-05
| | | | | | | with no whitespace. This will allow statements to be referred to in attribute TableGen files. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103087 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r103072; I accidentally ended up deleting a bunch of trailingSean Hunt2010-05-05
| | | | | | | whitespace which makes this patch unreadable. Will recommit without the whitespace. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103086 91177308-0d34-0410-b5e6-96231b3b80d8
* Change StmtNodes.def to StmtNodes.td in anticipation of a rewrite of attributesSean Hunt2010-05-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103072 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve name mangling for dependent template names (e.g., typenameDouglas Gregor2010-04-28
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102490 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the InjectedClassNameType the canonical type of the current instantiationJohn McCall2010-04-27
| | | | | | | | | | | | | | | | | | 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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102407 91177308-0d34-0410-b5e6-96231b3b80d8
* Emit a lame diagnostic when we can't mangle operator namesDouglas Gregor2010-04-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102168 91177308-0d34-0410-b5e6-96231b3b80d8
* Mangle dependent template names such as the nested-name-specifier inDouglas Gregor2010-04-23
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102167 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixes a code gen. bug by removing an assert.Fariborz Jahanian2010-04-20
| | | | | | | | It is ok to have c++-ness inside extern "C" block. Fixes pr6644. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101948 91177308-0d34-0410-b5e6-96231b3b80d8
* Vtable -> VTable renames across the board.Anders Carlsson2010-04-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101666 91177308-0d34-0410-b5e6-96231b3b80d8
* Add raw_ostream operators to NamedDecl for convenience. Switch over all ↵Benjamin Kramer2010-04-17
| | | | | | | | | users of getNameAsString on a stream. The next step is to print the name directly into the stream, avoiding a temporary std::string copy. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101632 91177308-0d34-0410-b5e6-96231b3b80d8
* A bunch of string-related microoptimizations in Mangler.Benjamin Kramer2010-04-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100928 91177308-0d34-0410-b5e6-96231b3b80d8
* Doug pointed out that we have a perfectly reasonable expression here toJohn McCall2010-04-10
| | | | | | | | serve as a source of source locations for the can't-yet-mangle diagnostic. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100924 91177308-0d34-0410-b5e6-96231b3b80d8
* Mangle some expressions with codegen implications but no mangling "overhead".John McCall2010-04-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100909 91177308-0d34-0410-b5e6-96231b3b80d8
* Provide an extremely unsatisfactory diagnostic (instead of crashing) whenJohn McCall2010-04-09
| | | | | | | | | mangling an unknown expression kind. Also conveniently tells the user what kind of expression they should add to the mangler! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100907 91177308-0d34-0410-b5e6-96231b3b80d8
* Provide manglings for bool and character literal expressions. These areJohn McCall2010-04-09
| | | | | | | | | | just integer-literal expressions with special case implementations in the AST. Fixes rdar://problem/7825453. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100905 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename CGVtable files to CGVTables.Anders Carlsson2010-04-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100778 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend DependentNameType with a keyword enum that specifies whetherDouglas Gregor2010-03-31
| | | | | | | | this was parsed as a typename-specifier, elaborated-type-specifier (including the kind), or just a dependent qualified type name. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100039 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename TypenameType to DependentNameType in anticipation of someDouglas Gregor2010-03-31
| | | | | | | refactoring work in this area. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100019 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the old vtable layout code.Anders Carlsson2010-03-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99869 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement new mangling for vectors.Nick Lewycky2010-03-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99616 91177308-0d34-0410-b5e6-96231b3b80d8
* More thunks scaffolding.Anders Carlsson2010-03-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99294 91177308-0d34-0410-b5e6-96231b3b80d8
* Correctly mangle dependent TypenameType.Rafael Espindola2010-03-17
| | | | | | | | Fixes PR6625. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98707 91177308-0d34-0410-b5e6-96231b3b80d8
* Use SmallString instead of SmallVectorKovarththanan Rajaratnam2010-03-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98436 91177308-0d34-0410-b5e6-96231b3b80d8
* Correctly mangle address of member in template arguments. Fixes PR6460Rafael Espindola2010-03-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98254 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't turn off mangling in implicitly extern "C" system headers. GCCDouglas Gregor2010-03-07
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97899 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor local class name mangling and make itFariborz Jahanian2010-03-04
| | | | | | | | ABI conforming. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97702 91177308-0d34-0410-b5e6-96231b3b80d8
* Implements mangling of local class names toFariborz Jahanian2010-03-03
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97658 91177308-0d34-0410-b5e6-96231b3b80d8
* Split out types that are non-canonical unless dependent as their ownJohn McCall2010-03-01
| | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97523 91177308-0d34-0410-b5e6-96231b3b80d8
* The latest draft uses 'dt' to mangle member expressions, and now so do we.John McCall2010-03-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97479 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve name mangling for dependently-scoped declaration references.Douglas Gregor2010-02-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97422 91177308-0d34-0410-b5e6-96231b3b80d8
* Add name mangling for DeclRefExprs that refer to external namesDouglas Gregor2010-02-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97418 91177308-0d34-0410-b5e6-96231b3b80d8
* Make previous fix handle a few more edge cases.Eli Friedman2010-02-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96962 91177308-0d34-0410-b5e6-96231b3b80d8
* PR6400: Handle an extreme edge case in mangling correctly.Eli Friedman2010-02-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96961 91177308-0d34-0410-b5e6-96231b3b80d8
* Only append 'L' for internal variable declarations, not all declarations. ↵Anders Carlsson2010-02-06
| | | | | | (Found by the mangle checker, yay) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95485 91177308-0d34-0410-b5e6-96231b3b80d8
* Assert when we try to mangle a dependent template name, rather thanDouglas Gregor2010-02-06
| | | | | | | crashing unceremoniously. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95464 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement name mangling for template template parametersDouglas Gregor2010-02-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95427 91177308-0d34-0410-b5e6-96231b3b80d8
* Check in a mangle checker that's turned off by default.Anders Carlsson2010-02-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95377 91177308-0d34-0410-b5e6-96231b3b80d8
* Mangle member expressions. Also invented.John McCall2010-02-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95284 91177308-0d34-0410-b5e6-96231b3b80d8