summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/mangle.cpp
Commit message (Collapse)AuthorAgeFilesLines
* More local mangling fixes.Eli Friedman2013-07-101-1/+14
| | | | | | | | | | | | Compute mangling numbers for externally visible local variables and tags. Change the mangler to consistently use discriminators where necessary. Tweak the scheme we use to number decls which are not externally visible to avoid unnecessary discriminators in common cases now that we request them more consistently. Fixes <rdar://problem/14204721>. llvm-svn: 185986
* Fix a crash when we were trying to compute the linkage too early.Rafael Espindola2013-05-281-0/+22
| | | | llvm-svn: 182773
* Use the target address space value when mangling names.Tanya Lattner2013-02-081-0/+3
| | | | llvm-svn: 174688
* Provide the correct mangling and linkage for certain unnamed nested classes.David Blaikie2012-11-141-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | This corrects the mangling and linkage of classes (& their member functions) in cases like this: struct foo { struct { void func() { ... } } x; }; we were accidentally giving this nested unnamed struct 'no' linkage where it should've had the linkage of the outer class. The mangling was incorrecty too, mangling as TU-wide unnamed type mangling of $_X rather than class-scoped mangling of UtX_. This also fixes -Wunused-member-function which would incorrectly diagnose 'func' as unused due to it having no linkage & thus appearing to be TU-local when in fact it might be correctly used in another TU. Similar mangling should be applied to function local classes in similar cases but I've deferred that for a subsequent patch. Review/discussion by Richard Smith, John McCall, & especially Eli Friedman. llvm-svn: 167906
* Revert r163829. The world (or libstdc++, at least) is not ready.Richard Smith2012-09-131-2/+2
| | | | llvm-svn: 163846
* Remove speculative fix for C++ core issue 1407, since it was resolved as NAD.Richard Smith2012-09-131-2/+2
| | | | llvm-svn: 163829
* Per discussion on cxx-abi-dev, don't drop leading zeroes from theJohn McCall2012-01-301-0/+8
| | | | | | | | | mangling of floating-point literals. I just went ahead and reimplemented toString() here; if someone wants to generalize the library routine to do this, or feels strongly that we should be post-processing, please feel free. llvm-svn: 149256
* constexpr: converted constant expression handling for enumerator values, caseRichard Smith2012-01-181-3/+0
| | | | | | | | | | values and non-type template arguments of integral and enumeration types. This change causes some legal C++98 code to no longer compile in C++11 mode, by enforcing the C++11 rule that narrowing integral conversions are not permitted in the final implicit conversion sequence for the above cases. llvm-svn: 148439
* Update all tests other than Driver/std.cpp to use -std=c++11 rather thanRichard Smith2011-10-131-1/+1
| | | | | | -std=c++0x. Patch by Ahmed Charles! llvm-svn: 141900
* Fix PR10531. Attach an initializer to anonymous unions, since the default ↵Richard Smith2011-09-181-11/+0
| | | | | | constructor might not be trivial (if there is an in-class initializer for some member) and might be deleted. llvm-svn: 139991
* Improve name mangling for instantiation-dependent types that are notDouglas Gregor2011-07-121-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | dependent. This covers an odd class of types such as int (&)[sizeof(sizeof(T() + T()))]; which involve template parameters but, because of some trick typically involving a form of expression that is never type-dependent, resolve down to a non-dependent type. Such types need to be mangled essentially as they were written in the source code (involving template parameters), rather than via their canonical type. In general, instantiation-dependent types should be mangled as they were written in the source. However, since we can't do that now without non-trivial refactoring of the AST (see the new FIXME), I've gone for this partial solution: only use the as-written-in-the-source mangling for these strange types that are instantiation-dependent but not dependent. This provides better compatibility with previous incarnations of Clang and with GCC. In the future, we'd like to get this right. Fixes <rdar://problem/9663282>. llvm-svn: 134984
* Implement name mangling for sizeof...(function parameter pack).Douglas Gregor2011-07-121-0/+10
| | | | llvm-svn: 134974
* Mangle dependent template names of unknown arityDouglas Gregor2011-07-121-0/+13
| | | | llvm-svn: 134967
* Implement the Itanium C++ ABI's mangling rule forDouglas Gregor2011-07-121-0/+16
| | | | | | non-instantiation-dependent sizeof and alignof expressions. llvm-svn: 134963
* Allow us to compute linkage et al for instantiation-dependent types.Douglas Gregor2011-07-111-0/+8
| | | | llvm-svn: 134932
* Just mangle substituted template parameter types as unresolved types.John McCall2011-07-011-0/+32
| | | | | | | This is kindof questionable but seems to do more-or-less the right thing. This is not a particularly friendly part of the ABI. llvm-svn: 134227
* Introduce the notion of instantiation dependence into Clang's AST. ADouglas Gregor2011-07-011-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Change the mangling of enclosing template template parametersJohn McCall2011-07-011-3/+1
| | | | | | | that serve as the base template name of an unresolved-name to be mangled as a substitution. llvm-svn: 134213
* Be more thorough about mangling unresolved types.John McCall2011-06-281-0/+42
| | | | llvm-svn: 134011
* Fix the mangling of dependent-scope decl ref expressions so that theyJohn McCall2011-06-211-5/+5
| | | | | | use the unresolved-name production correctly. llvm-svn: 133554
* Type prefixes of unresolved-names should only be mangled as unresolved-typesJohn McCall2011-05-041-4/+39
| | | | | | | | if they match that production, i.e. if they're template type parameters or decltypes (or, as an obvious case not yet described in the ABI document, if they're template template parameters applied to template arguments). llvm-svn: 130824
* t/clang/type-traitsJohn Wiegley2011-04-271-10/+10
| | | | | | | | | | Patch authored by John Wiegley. These type traits are used for parsing code that employs certain features of the Embarcadero C++ compiler. Several of these constructs are also desired by libc++, according to its project pages (such as __is_standard_layout). llvm-svn: 130342
* GCC seems to create address-of expression manglings when passing *any*John McCall2011-04-241-0/+12
| | | | | | | function as a template argument where a pointer to function is wanted. Just extend the existing hack. llvm-svn: 130084
* Update the mangler for some of the "new" unresolved-name manglings.John McCall2011-04-241-7/+10
| | | | | | | | | | I've sent off an email requesting clarification on a few things that I wasn't sure how to handle. This also necessitated making prefixes and unresolved-prefixes get mangled separately. llvm-svn: 130083
* The ABI settled on mangling float literals with lowercase hex dumps.John McCall2011-04-241-1/+1
| | | | | | | APInt::toString doesn't do those, but it's easy to postprocess that output, and that's probably better than adding another knob to that method. llvm-svn: 130081
* File-scope static functions need to be mangled with 'L' so thatJohn McCall2011-03-221-1/+15
| | | | | | | | they don't collide with file-scope extern functions from the same translation unit. This is basically a matter of applying the same logic to FunctionDecls as we were previously applying to VarDecls. llvm-svn: 128072
* When mangling a qualified array type, push the qualifiers down to theJohn McCall2011-01-261-0/+12
| | | | | | element type. Fixes rdar://problem/8913416. llvm-svn: 124315
* Mangle std::nullptr_t as specified by the Itanium C++ ABI.Anders Carlsson2010-11-041-0/+5
| | | | llvm-svn: 118236
* Fix a crash mangling decayed val argument-typed function.Fariborz Jahanian2010-11-021-0/+6
| | | | | | // rdar: //8620510 and PR7666 llvm-svn: 118019
* Mangle explicit template arguments in dependent or overloaded names.John McCall2010-08-201-3/+42
| | | | llvm-svn: 111591
* Contextual arity is a feature of mangling expressions; kill offJohn McCall2010-08-181-0/+28
| | | | | | | | mangleCallExpression. Also, operator names with unknown arity should be mangled as binary operators; this is actually covered by an oddly- positioned sentence in the ABI document. Fixes PR7891. llvm-svn: 111395
* Whoops. Don't fall through into the overload case when mangling aJohn McCall2010-08-171-0/+17
| | | | | | dependent call expression. llvm-svn: 111300
* Don't crash when mangling empty anonymous unions. We never actually *need*John McCall2010-08-051-0/+11
| | | | | | | these, but it's convenient to mangle them when deferring them (in the 99.99% case where it's not an anonymous union, of course). llvm-svn: 110381
* Mangle enum constant expressions. Fixes rdar://problem/8204122John McCall2010-07-241-0/+11
| | | | llvm-svn: 109315
* Fix mangling for static member variables of classes inside an extern "C"Eli Friedman2010-07-181-0/+11
| | | | | | | linkage specification. Not sure if this is the ideal fix, but I'm reasonably sure it's correct vs. gcc. llvm-svn: 108656
* Fix the mangling of template template arguments, which do not alwaysJohn McCall2010-07-141-1/+12
| | | | | | | | follow <name>; instead they follow <type>, which has <name> as a subset. Fixes PR7446. llvm-svn: 108326
* Correctly mangle unsigned integer literals where the high bit is set.Anders Carlsson2010-06-021-0/+7
| | | | llvm-svn: 105312
* Correctly mangle variadic functions that don't have any other parameters.Anders Carlsson2010-06-021-0/+12
| | | | llvm-svn: 105311
* Provide manglings for bool and character literal expressions. These areJohn McCall2010-04-091-0/+9
| | | | | | | | just integer-literal expressions with special case implementations in the AST. Fixes rdar://problem/7825453. llvm-svn: 100905
* Turn access control on by default in -cc1.John McCall2010-04-091-1/+1
| | | | | | | | Remove -faccess-control from -cc1; add -fno-access-control. Make the driver pass -fno-access-control by default. Update a bunch of tests to be correct under access control. llvm-svn: 100880
* Correctly mangle dependent TypenameType.Rafael Espindola2010-03-171-0/+15
| | | | | | Fixes PR6625. llvm-svn: 98707
* Give explicit template instantiations weak ODR linkage. FormerDouglas Gregor2010-03-131-10/+10
| | | | | | | | | iterations of this patch gave explicit template instantiation link-once ODR linkage, which permitted the back end to eliminate unused symbols. Weak ODR linkage still requires the symbols to be generated. llvm-svn: 98441
* Re-revert the explicit template instantiation linkage patch. I am beginning ↵Douglas Gregor2010-03-131-8/+8
| | | | | | to look incompetent llvm-svn: 98425
* Reinstate patch to turn explicit template instantiations into weak symbolsDouglas Gregor2010-03-131-8/+8
| | | | llvm-svn: 98424
* Revert the linkage change for explicit template instantiations; something is ↵Douglas Gregor2010-03-121-8/+8
| | | | | | amiss llvm-svn: 98332
* Give explicit template instantiations weak linkage (but don't deferDouglas Gregor2010-03-121-8/+8
| | | | | | them). Fixes PR6578. llvm-svn: 98328
* Correctly mangle address of member in template arguments. Fixes PR6460Rafael Espindola2010-03-111-0/+39
| | | | llvm-svn: 98254
* 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-1/+1
| | | | llvm-svn: 97479
* Revert the ctor/dtor alias optimization for now; the buildbots can detectJohn McCall2010-02-181-2/+1
| | | | | | some failure here that I can't. llvm-svn: 96612
OpenPOWER on IntegriCloud