Commit Graph

209 Commits

Author SHA1 Message Date
Fariborz Jahanian 2fe13882a8 extern variable declared locally to objective-c++ method
should not be mangled either. Fixes radar 8016412.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107303 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-30 18:27:47 +00:00
Anders Carlsson 715edf2936 Add function for mangling reference temporaries.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106948 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-26 16:09:40 +00:00
Fariborz Jahanian 564360be45 Patch to correctly mangle block helper functions
when block literal is declared inside a ctor/dtor.
Fixes radr 8096995.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106700 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-24 00:08:06 +00:00
Chris Lattner 788b0fd67e improve altivec vector bool/pixel support, patch by Anton Yartsev
with several tweaks by me.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106619 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-23 06:00:24 +00:00
Douglas Gregor 56079f7dde Add name mangling for address spaces. We use the vendor-extension
mangling for types, where the <source-name> is ASxxx (xxx is the
address-space number).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105975 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-14 23:15:08 +00:00
John McCall 33500955d7 Split DependentNameType into two types. DependentNameType represents the
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-11 00:33:02 +00:00
John McCall 6ab30e0c02 Correctly handle > 257 substitutions in a single mangling, and don't introduce
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-09 07:26:17 +00:00
Anders Carlsson 6f7e2f4019 Correctly mangle static variables of anonymous struct/union type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105606 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-08 14:49:03 +00:00
Anders Carlsson c820f90ff1 Don't substitute 'St' for 'std' when the namespace is nested inside another namespace.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105330 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-02 15:58:27 +00:00
Anders Carlsson dfc0d1ff1a Correctly mangle unsigned integer literals where the high bit is set.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105312 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-02 05:07:26 +00:00
Anders Carlsson 93296683a7 Correctly mangle variadic functions that don't have any other parameters.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105311 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-02 04:40:13 +00:00
Anders Carlsson 9d85b7203b When mangling member function pointers, fake adding a substitution corresponding to the function type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105310 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-02 04:29:50 +00:00
Charles Davis 685b1d9e0d Extract the ObjC and blocks manglers into their own class. No functionality
change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104715 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-26 18:25:27 +00:00
Douglas Gregor 1b12a3bb4d Be sure to use the standard substitutions when mangling the names of
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-26 05:11:13 +00:00
Douglas Gregor 35415f5132 Improve name mangling for blocks and support mangling of static local
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-25 17:04:15 +00:00
John McCall c00c1f6638 Modify this comment per Doug's suggestion: we don't need to mangle protocols.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103875 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-15 17:06:29 +00:00
John McCall c12c5bba6c Substantially alter the design of the Objective C type AST by introducing
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-15 11:32:37 +00:00
Sean Hunt 4bfe196841 Reapplying patch to change StmtNodes.def to StmtNodes.td, this time
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-05 15:24:00 +00:00
Sean Hunt c302113179 Revert r103072; I accidentally ended up deleting a bunch of trailing
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-05 15:23:54 +00:00
Sean Hunt 9d90d62e16 Change StmtNodes.def to StmtNodes.td in anticipation of a rewrite of attributes
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103072 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-05 04:13:52 +00:00
Douglas Gregor 1e9268e297 Improve name mangling for dependent template names (e.g., typename
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-28 05:58:56 +00:00
John McCall 31f17ecbef Make the InjectedClassNameType the canonical type of the current instantiation
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-27 00:57:59 +00:00
Douglas Gregor f55e3fd5e3 Emit a lame diagnostic when we can't mangle operator names
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102168 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-23 03:19:53 +00:00
Douglas Gregor 20f0cc7a0f Mangle dependent template names such as the nested-name-specifier in
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-23 03:10:43 +00:00
Fariborz Jahanian 876681e706 Fixes a code gen. bug by removing an assert.
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-20 22:02:31 +00:00
Anders Carlsson 046c294a43 Vtable -> VTable renames across the board.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101666 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-17 20:15:18 +00:00
Benjamin Kramer 900fc6388e Add raw_ostream operators to NamedDecl for convenience. Switch over all 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-17 09:33:03 +00:00
Benjamin Kramer 35f59b64b4 A bunch of string-related microoptimizations in Mangler.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100928 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-10 16:03:31 +00:00
John McCall 739bf09fc6 Doug pointed out that we have a perfectly reasonable expression here to
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-10 09:39:25 +00:00
John McCall d93076038a Mangle some expressions with codegen implications but no mangling "overhead".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100909 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 22:54:09 +00:00
John McCall 6ae1f35ced Provide an extremely unsatisfactory diagnostic (instead of crashing) when
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-09 22:26:14 +00:00
John McCall de81063acd Provide manglings for bool and character literal expressions. These are
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-09 21:48:08 +00:00
Anders Carlsson 461e326e74 Rename CGVtable files to CGVTables.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100778 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08 16:30:25 +00:00
Douglas Gregor 4a2023f501 Extend DependentNameType with a keyword enum that specifies whether
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-31 20:19:30 +00:00
Douglas Gregor 4714c12a1a Rename TypenameType to DependentNameType in anticipation of some
refactoring work in this area.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100019 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-31 17:34:00 +00:00
Anders Carlsson bfb7a1d6eb Remove the old vtable layout code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99869 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-30 03:43:47 +00:00
Nick Lewycky 0e5f067da5 Implement new mangling for vectors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99616 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-26 07:18:04 +00:00
Anders Carlsson 19879c98d9 More thunks scaffolding.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99294 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-23 17:17:29 +00:00
Rafael Espindola 9b35b25db3 Correctly mangle dependent TypenameType.
Fixes PR6625.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98707 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-17 04:28:11 +00:00
Kovarththanan Rajaratnam 193575455e Use SmallString instead of SmallVector
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98436 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13 10:17:05 +00:00
Rafael Espindola d9800728cc Correctly mangle address of member in template arguments. Fixes PR6460
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98254 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-11 14:07:00 +00:00
Douglas Gregor 96df6cfd12 Don't turn off mangling in implicitly extern "C" system headers. GCC
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-07 05:10:40 +00:00
Fariborz Jahanian 4819ac44c0 Refactor local class name mangling and make it
ABI conforming.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97702 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-04 01:02:03 +00:00
Fariborz Jahanian 570585307e Implements mangling of local class names to
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-03 19:41:08 +00:00
John McCall ad5e738870 Split out types that are non-canonical unless dependent as their own
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-01 23:49:17 +00:00
John McCall e1e342f4a9 The latest draft uses 'dt' to mangle member expressions, and now so do we.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97479 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-01 19:12:25 +00:00
Douglas Gregor 4b2ccfc302 Improve name mangling for dependently-scoped declaration references.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97422 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 22:05:49 +00:00
Douglas Gregor 5ed1bc351f Add name mangling for DeclRefExprs that refer to external names
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97418 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-28 21:40:32 +00:00
Eli Friedman 5370ee2389 Make previous fix handle a few more edge cases.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96962 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 18:25:09 +00:00
Eli Friedman b1162f178f PR6400: Handle an extreme edge case in mangling correctly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96961 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-23 18:20:18 +00:00