Commit Graph

106 Commits

Author SHA1 Message Date
Mike Stump 3b9176985d Finish off mangling for the VTT.
llvm-svn: 86647
2009-11-10 01:58:37 +00:00
Mike Stump ef15744092 Add mangling for the construction vtable.
llvm-svn: 86643
2009-11-10 01:41:59 +00:00
Anders Carlsson c0a3561f0f Always mangle functions with special names. Fixes PR5420.
llvm-svn: 86350
2009-11-07 07:15:03 +00:00
Anders Carlsson ce21431fc4 When looking up and adding substitutions to the substitution table, make sure to always use the canonical declaration. With tihs change, FileCheck compiles and links but crashes during startup.
llvm-svn: 86339
2009-11-07 04:26:04 +00:00
Anders Carlsson 9e4e0237e4 Handle ParenExprs in mangleExpression.
llvm-svn: 86218
2009-11-06 02:50:19 +00:00
Anders Carlsson 958c9f8524 Fix thinko, mangleCXXRtti should obviously take a QualType!
llvm-svn: 85565
2009-10-30 01:52:02 +00:00
Anders Carlsson 430046321b mangleCXXRtti obviously needs to take a type, what was I thinking...
llvm-svn: 85555
2009-10-30 01:26:12 +00:00
Douglas Gregor 05925031f7 Mangle based on the declaration we're given, not the canonical
declaration, since attributes that affect mangling may have been added
to subsequent declarations. However, to determine the linkage of the
declaration, we need to look at the canonical declaration. Fixes PR4412.

llvm-svn: 85400
2009-10-28 16:31:34 +00:00
Mike Stump 82d25e4e5e Add mangling for VTTs.
llvm-svn: 85363
2009-10-28 01:51:46 +00:00
John McCall fc93cf9777 When building types from declarators, instead of building two types (one for
the DeclaratorInfo, one for semantic analysis), just build a single type whose
canonical type will reflect the semantic analysis (assuming the type is
well-formed, of course).

To make that work, make a few changes to the type system:
* allow the nominal pointee type of a reference type to be a (possibly sugared)
  reference type.  Also, preserve the original spelling of the reference type.
  Both of these can be ignored on canonical reference types.
* Remove ObjCProtocolListType and preserve the associated source information on
  the various ObjC TypeLocs.  Preserve the spelling of protocol lists except in
  the canonical form.
* Preserve some level of source type structure on parameter types, but
  canonicalize on the canonical function type.  This is still a WIP.

Drops code size, makes strides towards accurate source location representation,
slight (~1.7%) progression on Cocoa.h because of complexity drop.

llvm-svn: 84907
2009-10-22 22:37:11 +00:00
Daniel Dunbar 07d0785dbb PR5218: Replace IdentifierInfo::getName with StringRef version, now that clients
are updated.

llvm-svn: 84447
2009-10-18 21:17:35 +00:00
Daniel Dunbar 70e7eadd15 Move misc clients to IdentifierInfo StringRef API.
- strcmp -> ==
 - OS.write(II->getName() ...) -> OS << II->getNameStr()
 - Avoid std::string concatenation
 - Use getNameStr().str() when an std::string is really needed.

llvm-svn: 84437
2009-10-18 20:26:27 +00:00
Anders Carlsson f847117ac8 Builtin types are subsitutable if they are qualified. Fixes PR5196.
llvm-svn: 84237
2009-10-16 02:06:06 +00:00
Anders Carlsson 2295f31810 Change mangleCXXVtable and mangleCXXRtti to take CXXRecordDecls instead of QualTypes.
llvm-svn: 83793
2009-10-11 21:24:51 +00:00
Anders Carlsson 3482b819db Mangle std::basic_ostream<char, std::char_traits<char>> as So.
llvm-svn: 83557
2009-10-08 17:20:26 +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 ff971e8bf4 Add a MangleContext and pass it to all mangle functions. It will be used for keeping state, such as identifiers assigned to anonymous structs as well as scope encoding.
llvm-svn: 83442
2009-10-07 01:06:45 +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
John McCall 4fa5342758 Anonymous namespaces, sema + codegen. A lot of semantics are still broken,
apparently because using directives aren't quite working correctly.

llvm-svn: 83184
2009-10-01 00:25:31 +00:00
Anders Carlsson 02bca738b4 Mangle dependent name expressions. Fixes PR5063.
llvm-svn: 82915
2009-09-27 20:11:34 +00:00
Anders Carlsson d122de5f32 Use mangleTemplatePrefix when we know that we're mangling a nested template name.
llvm-svn: 82912
2009-09-27 19:53:49 +00:00
Anders Carlsson 9bf787ad1f Look for substitutions when mangling TypenameTypes.
llvm-svn: 82885
2009-09-27 01:06:07 +00:00
Anders Carlsson e00745b285 Better template parameter type mangling.
llvm-svn: 82883
2009-09-27 00:38:53 +00:00
Anders Carlsson 2e5935241a Mangle std::basic_string<char, std::char_traits<char>, std::allocator<char> > as Ss.
llvm-svn: 82882
2009-09-27 00:12:57 +00:00
Anders Carlsson 853bb50382 Mangle ::std::basic_string as Sb.
llvm-svn: 82881
2009-09-26 23:14:39 +00:00
Anders Carlsson 872ce0dc31 Mangle ::std::allocator as Sa.
llvm-svn: 82880
2009-09-26 23:10:05 +00:00
Anders Carlsson 3e83c30c4c Handle substitutions in mangleTemplatePrefix.
llvm-svn: 82879
2009-09-26 22:18:22 +00:00
Anders Carlsson aa9e3c8793 Substitute "::std::" as "St".
llvm-svn: 82874
2009-09-26 20:53:44 +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 26e67afd1e mangleTemplatePrefix and mangleUnscopedTemplateName should take a TemplateDecl.
llvm-svn: 82871
2009-09-26 19:45:45 +00:00
Anders Carlsson 296f8dc52f Mangle record types as decls.
llvm-svn: 82843
2009-09-26 03:55:37 +00:00
Anders Carlsson 9f8e3d1929 Change isTemplate to return the actual template declaration.
llvm-svn: 82839
2009-09-26 03:24:57 +00:00
Anders Carlsson bdaaab4671 Improve mangling of typename types.
llvm-svn: 82833
2009-09-26 02:26:02 +00:00
John McCall 8ccfcb51ee Refactor the representation of qualifiers to bring ExtQualType out of the
Type hierarchy.  Demote 'volatile' to extended-qualifier status.  Audit our
use of qualifiers and fix a few places that weren't dealing with qualifiers
quite right;  many more remain.

llvm-svn: 82705
2009-09-24 19:53:00 +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
John McCall 9dd450bb78 Change all the Type::getAsFoo() methods to specializations of Type::getAs().
Several of the existing methods were identical to their respective
specializations, and so have been removed entirely.  Several more 'leaf'
optimizations were introduced.

The getAsFoo() methods which imposed extra conditions, like
getAsObjCInterfacePointerType(), have been left in place.

llvm-svn: 82501
2009-09-21 23:43:11 +00:00
Anders Carlsson a18322cea5 Start mangling expressions.
llvm-svn: 82423
2009-09-21 01:21:10 +00:00
Anders Carlsson 82b688e423 More mangling work.
llvm-svn: 82265
2009-09-18 20:11:09 +00:00
Anders Carlsson c3773bd669 Make the mangler conform even better to the grammar.
llvm-svn: 82262
2009-09-18 19:44:50 +00:00
Anders Carlsson 559d9741a8 More mangler mangling.
llvm-svn: 82250
2009-09-18 19:00:18 +00:00
Anders Carlsson caf4a646f8 Call mangleTemplatePrefix.
llvm-svn: 82247
2009-09-18 18:47:07 +00:00
Anders Carlsson c1370cb49b Change manglePrefix to return early if the DC is the translation unit.
llvm-svn: 82246
2009-09-18 18:39:58 +00:00
Anders Carlsson 2b5e1dda69 More mangling goodness.
llvm-svn: 82193
2009-09-18 04:29:09 +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 f96da57adb Revert r82123 for now.
llvm-svn: 82125
2009-09-17 05:31:47 +00:00
Anders Carlsson 49fe8b4f97 Treat an unqualified RecordType as a RecordDecl when substituting.
llvm-svn: 82123
2009-09-17 04:38:23 +00:00
Anders Carlsson 4245bf9e13 Substitution for prefixes.
llvm-svn: 82122
2009-09-17 04:16:28 +00:00
Anders Carlsson a2fb9bcd19 Substitute unscoped template names.
llvm-svn: 82119
2009-09-17 04:02:31 +00:00