Commit Graph

64 Commits

Author SHA1 Message Date
John McCall 4f3b5f302c Fix the mangling of template template arguments, which do not always
follow <name>;  instead they follow <type>, which has <name> as a subset.

Fixes PR7446.

llvm-svn: 108326
2010-07-14 06:43:17 +00:00
Anders Carlsson d951a7ebf8 Correctly mangle unsigned integer literals where the high bit is set.
llvm-svn: 105312
2010-06-02 05:07:26 +00:00
Anders Carlsson 728fe444f1 Correctly mangle variadic functions that don't have any other parameters.
llvm-svn: 105311
2010-06-02 04:40:13 +00:00
John McCall 09277542f2 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.

llvm-svn: 100905
2010-04-09 21:48:08 +00:00
John McCall 3155f573f5 Turn access control on by default in -cc1.
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
2010-04-09 19:03:51 +00:00
Rafael Espindola cd7eef900f Correctly mangle dependent TypenameType.
Fixes PR6625.

llvm-svn: 98707
2010-03-17 04:28:11 +00:00
Douglas Gregor b14d123774 Give explicit template instantiations weak ODR linkage. Former
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
2010-03-13 18:23:07 +00:00
Douglas Gregor 17b76185f1 Re-revert the explicit template instantiation linkage patch. I am beginning to look incompetent
llvm-svn: 98425
2010-03-13 03:49:57 +00:00
Douglas Gregor 89cae0f224 Reinstate patch to turn explicit template instantiations into weak symbols
llvm-svn: 98424
2010-03-13 03:14:19 +00:00
Douglas Gregor 539bc40906 Revert the linkage change for explicit template instantiations; something is amiss
llvm-svn: 98332
2010-03-12 05:13:59 +00:00
Douglas Gregor ee3f72299c Give explicit template instantiations weak linkage (but don't defer
them). Fixes PR6578.

llvm-svn: 98328
2010-03-12 04:49:06 +00:00
Rafael Espindola 4d5c3d99e5 Correctly mangle address of member in template arguments. Fixes PR6460
llvm-svn: 98254
2010-03-11 14:07:00 +00:00
John McCall bd8d9bd39c 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.

llvm-svn: 97523
2010-03-01 23:49:17 +00:00
John McCall de9607bc6f The latest draft uses 'dt' to mangle member expressions, and now so do we.
llvm-svn: 97479
2010-03-01 19:12:25 +00:00
John McCall 334ce7c1c4 Revert the ctor/dtor alias optimization for now; the buildbots can detect
some failure here that I can't.

llvm-svn: 96612
2010-02-18 21:31:48 +00:00
John McCall 67cea74745 Emit complete constructors and destructors as aliases to base constructors
and destructors when the two entities are semantically identical, i.e. when
the class has no virtual base classes.  We only do this for linkage types
for which aliases are supported, i.e. internal and external, i.e. not linkonce.

llvm-svn: 96451
2010-02-17 03:52:49 +00:00
Anders Carlsson 2c4de4c31e Only append 'L' for internal variable declarations, not all declarations. (Found by the mangle checker, yay)
llvm-svn: 95485
2010-02-06 04:52:27 +00:00
Douglas Gregor a16b0cae9a Implement name mangling for template template parameters
llvm-svn: 95427
2010-02-05 20:45:00 +00:00
John McCall d061b4429e Mangle member expressions. Also invented.
llvm-svn: 95284
2010-02-04 02:56:29 +00:00
John McCall 09de8ecd88 Add mangling support for calls, sizeof/alignof, constructor calls,
float literals, and unresolved lookups (which required hand-wavey extensions).

llvm-svn: 95273
2010-02-04 01:42:13 +00:00
Alexis Hunt aecc45cb3c Mangle static variables with an extra name to distinguish them from non-static variables in the same TU.
Fixes PR5966 for real this time; also reverts r92911, which had a incorrect fix.

llvm-svn: 94352
2010-01-24 03:04:27 +00:00
Nuno Lopes 950d5b2cd3 fix PR5869: mangle static symbols like gcc does to make it easier to diff symbol tables
llvm-svn: 92911
2010-01-07 09:36:51 +00:00
Anders Carlsson a88d197284 Mangle block pointer types. Fixes PR5858.
llvm-svn: 92069
2009-12-23 22:31:44 +00:00
Anders Carlsson 910847c149 Mangle template template parameters. Fixes PR5861.
llvm-svn: 92030
2009-12-23 19:30:55 +00:00
Anders Carlsson 8a35c7982c Make sure that we mangle overloaded operators that are member functions correctly, giving them the correct arity.
With this seemingly insignificant fix, we are now able to build and link clang using clang itself! (LLVM still has to be built with gcc for the time being).

llvm-svn: 91893
2009-12-22 06:36:32 +00:00
Anders Carlsson b7e93e268f Mangle CXXOperatorCallExprs, fixes PR5796.
llvm-svn: 91507
2009-12-16 05:48:46 +00:00
Daniel Dunbar 8fbe78f6fc Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.
- This is designed to make it obvious that %clang_cc1 is a "test variable"
   which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it
   can be useful to redefine what gets run as 'clang -cc1' (for example, to set
   a default target).

llvm-svn: 91446
2009-12-15 20:14:24 +00:00
Anders Carlsson e66e2942fc Mangle unary, binary and ternary expressions correctly.
llvm-svn: 91257
2009-12-14 01:45:37 +00:00
Eli Friedman 75c9b97123 Make sure mangling doesn't crash in another case. Add some more tests.
llvm-svn: 91149
2009-12-11 20:21:38 +00:00
Eli Friedman 30e94d047e Fix for PR5706: let mangleName deal with mangling names without identifiers
correctly.

llvm-svn: 91136
2009-12-11 18:00:57 +00:00
Anders Carlsson 1f78b2bf62 Diagnose declarations of implicit member functions.
llvm-svn: 90605
2009-12-04 22:33:25 +00:00
Anders Carlsson 9e4e0237e4 Handle ParenExprs in mangleExpression.
llvm-svn: 86218
2009-11-06 02:50:19 +00:00
Anders Carlsson 1e39bd944b Mangle anonymous structs/unions correctly. Fixes PR5139.
llvm-svn: 83448
2009-10-07 01:45:02 +00:00
Anders Carlsson 11d00cf972 When mangling names, always use the canonical decl. Fixes PR5144.
llvm-svn: 83420
2009-10-06 21:58:01 +00:00
Anders Carlsson 02bca738b4 Mangle dependent name expressions. Fixes PR5063.
llvm-svn: 82915
2009-09-27 20:11:34 +00:00
Anders Carlsson e00745b285 Better template parameter type mangling.
llvm-svn: 82883
2009-09-27 00:38:53 +00:00
Anders Carlsson 3e83c30c4c Handle substitutions in mangleTemplatePrefix.
llvm-svn: 82879
2009-09-26 22:18:22 +00:00
Anders Carlsson 49232b9f42 Don't crash when trying to mangle function templates.
llvm-svn: 82872
2009-09-26 20:13:56 +00:00
Anders Carlsson bdaaab4671 Improve mangling of typename types.
llvm-svn: 82833
2009-09-26 02:26:02 +00:00
Anders Carlsson 1d3b6f62df CXXMethodDecls should always be mangled, even if they are inside an extern "C" block. Fixes PR5017.
llvm-svn: 82567
2009-09-22 20:33:31 +00:00
Anders Carlsson fc51cc968b Don't assert that linkage decls are always C++, it's not true. Fixes PR5019.
llvm-svn: 82557
2009-09-22 17:23:30 +00:00
Anders Carlsson a18322cea5 Start mangling expressions.
llvm-svn: 82423
2009-09-21 01:21:10 +00:00
Anders Carlsson 2b5e1dda69 More mangling goodness.
llvm-svn: 82193
2009-09-18 04:29:09 +00:00
Anders Carlsson adb08de4d9 Fix error in test.
llvm-svn: 82190
2009-09-18 02:51:58 +00:00
Anders Carlsson 7a8a74f704 Handle mangling of TemplateSpecializationType.
llvm-svn: 82189
2009-09-18 02:42:01 +00:00
Anders Carlsson ca51ef156b Ignore extern "C++" { } when mangling.
llvm-svn: 82146
2009-09-17 16:12:20 +00:00
Anders Carlsson a2fb9bcd19 Substitute unscoped template names.
llvm-svn: 82119
2009-09-17 04:02:31 +00:00
Anders Carlsson df644fb773 When mangling function template specialization, mangle the type encoding of the original function template. Also, port mangle.cpp and function-template-specialization.cpp over to using FileCheck.
llvm-svn: 82114
2009-09-17 03:46:43 +00:00
Anders Carlsson b3e533d9d0 Add a simple const mangling test.
llvm-svn: 82096
2009-09-16 23:53:19 +00:00
Anders Carlsson 23ca0b4869 Add support for converting member pointer types to LLVM types. Also mangle pointer to member functions correctly and add tests.
llvm-svn: 71981
2009-05-17 17:41:20 +00:00