aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/Mangle.cpp
AgeCommit message (Collapse)Author
2010-06-11Split DependentNameType into two types. DependentNameType represents theJohn McCall
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
2010-06-09Correctly handle > 257 substitutions in a single mangling, and don't introduceJohn McCall
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
2010-06-08Correctly mangle static variables of anonymous struct/union type.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105606 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-02Don't substitute 'St' for 'std' when the namespace is nested inside another ↵Anders Carlsson
namespace. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105330 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-02Correctly mangle unsigned integer literals where the high bit is set.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105312 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-02Correctly mangle variadic functions that don't have any other parameters.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105311 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-02When mangling member function pointers, fake adding a substitution ↵Anders Carlsson
corresponding to the function type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105310 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-26Extract the ObjC and blocks manglers into their own class. No functionalityCharles Davis
change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104715 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-26Be sure to use the standard substitutions when mangling the names ofDouglas Gregor
vtables, VTTs, and construction vtables. Fixes PR7201. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104675 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-25Improve name mangling for blocks and support mangling of static localDouglas Gregor
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
2010-05-15Modify this comment per Doug's suggestion: we don't need to mangle protocols.John McCall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103875 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-15Substantially alter the design of the Objective C type AST by introducingJohn McCall
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
2010-05-05Reapplying patch to change StmtNodes.def to StmtNodes.td, this timeSean Hunt
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
2010-05-05Revert r103072; I accidentally ended up deleting a bunch of trailingSean Hunt
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
2010-05-05Change StmtNodes.def to StmtNodes.td in anticipation of a rewrite of attributesSean Hunt
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103072 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-28Improve name mangling for dependent template names (e.g., typenameDouglas Gregor
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
2010-04-27Make the InjectedClassNameType the canonical type of the current instantiationJohn McCall
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
2010-04-23Emit a lame diagnostic when we can't mangle operator namesDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102168 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-23Mangle dependent template names such as the nested-name-specifier inDouglas Gregor
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
2010-04-20Fixes a code gen. bug by removing an assert.Fariborz Jahanian
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
2010-04-17Vtable -> VTable renames across the board.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101666 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17Add raw_ostream operators to NamedDecl for convenience. Switch over all ↵Benjamin Kramer
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
2010-04-10A bunch of string-related microoptimizations in Mangler.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100928 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-10Doug pointed out that we have a perfectly reasonable expression here toJohn McCall
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
2010-04-09Mangle some expressions with codegen implications but no mangling "overhead".John McCall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100909 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09Provide an extremely unsatisfactory diagnostic (instead of crashing) whenJohn McCall
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
2010-04-09Provide manglings for bool and character literal expressions. These areJohn McCall
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
2010-04-08Rename CGVtable files to CGVTables.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100778 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31Extend DependentNameType with a keyword enum that specifies whetherDouglas Gregor
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
2010-03-31Rename TypenameType to DependentNameType in anticipation of someDouglas Gregor
refactoring work in this area. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100019 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30Remove the old vtable layout code.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99869 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-26Implement new mangling for vectors.Nick Lewycky
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99616 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23More thunks scaffolding.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99294 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-17Correctly mangle dependent TypenameType.Rafael Espindola
Fixes PR6625. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98707 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13Use SmallString instead of SmallVectorKovarththanan Rajaratnam
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98436 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11Correctly mangle address of member in template arguments. Fixes PR6460Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98254 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-07Don't turn off mangling in implicitly extern "C" system headers. GCCDouglas Gregor
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
2010-03-04Refactor local class name mangling and make itFariborz Jahanian
ABI conforming. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97702 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03Implements mangling of local class names toFariborz Jahanian
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
2010-03-01Split out types that are non-canonical unless dependent as their ownJohn McCall
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
2010-03-01The latest draft uses 'dt' to mangle member expressions, and now so do we.John McCall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97479 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28Improve name mangling for dependently-scoped declaration references.Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97422 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28Add name mangling for DeclRefExprs that refer to external namesDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97418 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23Make previous fix handle a few more edge cases.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96962 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23PR6400: Handle an extreme edge case in mangling correctly.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96961 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-06Only append 'L' for internal variable declarations, not all declarations. ↵Anders Carlsson
(Found by the mangle checker, yay) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95485 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-06Assert when we try to mangle a dependent template name, rather thanDouglas Gregor
crashing unceremoniously. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95464 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05Implement name mangling for template template parametersDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95427 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-05Check in a mangle checker that's turned off by default.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95377 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-04Mangle member expressions. Also invented.John McCall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95284 91177308-0d34-0410-b5e6-96231b3b80d8