summaryrefslogtreecommitdiff
path: root/lib/CodeGen/Mangle.cpp
Commit message (Collapse)AuthorAge
* Move name mangling support from CodeGen to AST. In thePeter Collingbourne2011-01-13
| | | | | | | | | | | | | | process, perform a number of refactorings: - Move MiscNameMangler member functions to MangleContext - Remove GlobalDecl dependency from MangleContext - Make MangleContext abstract and move Itanium/Microsoft functionality to their own classes/files - Implement ASTContext::createMangleContext and have CodeGen use it No (intended) functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123386 91177308-0d34-0410-b5e6-96231b3b80d8
* When your comments and your code are out-of-sync, the test case is wrong.Douglas Gregor2011-01-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123379 91177308-0d34-0410-b5e6-96231b3b80d8
* Add tests for name mangling of variadic templates.Douglas Gregor2011-01-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123378 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace the representation of template template argument packDouglas Gregor2011-01-05
| | | | | | | | | | | | | | | expansions with something that is easier to use correctly: a new template argment kind, rather than a bit on an existing kind. Update all of the switch statements that deal with template arguments, fixing a few latent bugs in the process. I"m happy with this representation, now. And, oh look! Template instantiation and deduction work for template template argument pack expansions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122896 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement name mangling for sizeof...(pack), to silence the last ofDouglas Gregor2011-01-04
| | | | | | | | the switch-enum warnings. Test is forthcoming, once I've dealt with some template argument deduction issues. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122820 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement pack expansions whose pattern is a base-specifier.Douglas Gregor2011-01-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122782 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement support for pack expansions whose pattern is a non-typeDouglas Gregor2011-01-03
| | | | | | | | | | | | | | | | | | | template argument (described by an expression, of course). For example: template<int...> struct int_tuple { }; template<int ...Values> struct square { typedef int_tuple<(Values*Values)...> type; }; It also lays the foundation for pack expansions in an initializer-list. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122751 91177308-0d34-0410-b5e6-96231b3b80d8
* The -fshort-wchar option causes wchar_t to become unsigned, in addition to beingChris Lattner2010-12-25
| | | | | | | | 16-bits in size. Implement this by splitting WChar into two enums, like we have for char. This fixes a miscompmilation of XULRunner, PR8856. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122558 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce a new type, PackExpansionType, to capture types that areDouglas Gregor2010-12-20
| | | | | | | | | | | | | | | | | | | | | | pack expansions, e.g. given template<typename... Types> struct tuple; template<typename... Types> struct tuple_of_refs { typedef tuple<Types&...> types; }; the type of the "types" typedef is a PackExpansionType whose pattern is Types&. This commit introduces support for creating pack expansions for template type arguments, as above, but not for any other kind of pack expansion, nor for any form of instantiation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122223 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the TypesCompatibleExprClass AST node. Merge its functionality into ↵Francois Pichet2010-12-08
| | | | | | BinaryTypeTraitExpr. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121298 91177308-0d34-0410-b5e6-96231b3b80d8
* Type traits intrinsic implementation: __is_base_of(T, U)Francois Pichet2010-12-07
| | | | | | New AST node introduced: BinaryTypeTraitExpr; to be reused for more intrinsics. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121074 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename CXXExprWithTemporaries -> ExprWithCleanups; there's no theoreticalJohn McCall2010-12-06
| | | | | | | | reason this is limited to C++, and it's certainly not limited to temporaries. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120996 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify the ASTs by consolidating ObjCImplicitGetterSetterExpr and ↵John McCall2010-12-02
| | | | | | | | | | ObjCPropertyRefExpr into the latter. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120643 91177308-0d34-0410-b5e6-96231b3b80d8
* Hide a bunch of symbols.Benjamin Kramer2010-11-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120153 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactoring of Diagnostic class.Argyrios Kyrtzidis2010-11-18
| | | | | | | | | | | -Move the stuff of Diagnostic related to creating/querying diagnostic IDs into a new DiagnosticIDs class. -DiagnosticIDs can be shared among multiple Diagnostics for multiple translation units. -The rest of the state in Diagnostic object is considered related and tied to one translation unit. -Have Diagnostic point to the SourceManager that is related with. Diagnostic can now accept just a SourceLocation instead of a FullSourceLoc. -Reflect the changes to various interfaces. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119730 91177308-0d34-0410-b5e6-96231b3b80d8
* Change CXXNameMangler::mangleNeonVectorType to require the vector type to beBob Wilson2010-11-16
| | | | | | | one of the special Neon types. We'll check for invalid Neon vectors when they are created, so there's no point in handling them when mangling. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119299 91177308-0d34-0410-b5e6-96231b3b80d8
* Use getTypeSize() method.Bob Wilson2010-11-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119297 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a new expression kind, OpaqueValueExpr, which is useful forJohn McCall2010-11-15
| | | | | | | | | certain internal type-checking procedures as well as for representing certain implicitly-generated operations. Uses to follow. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119289 91177308-0d34-0410-b5e6-96231b3b80d8
* Use ASTContext::getTypeInfo to find the vector element size.Bob Wilson2010-11-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118899 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a separate NeonPolyVector kind to distinguish polynomial vector types.Bob Wilson2010-11-12
| | | | | | Add support for mangling those types according to ARM's ABI. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118898 91177308-0d34-0410-b5e6-96231b3b80d8
* Add special-case mangling for Neon vector types.Bob Wilson2010-11-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118897 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a variant of GCC-style vector types for ARM NEON.Bob Wilson2010-11-10
| | | | | | | | | NEON vector types need to be mangled in a special way to comply with ARM's ABI, similar to some of the AltiVec-specific vector types. This patch is mostly just renaming a bunch of "AltiVecSpecific" things, since they will no longer be specific to AltiVec. Besides that, it just adds the new "NeonVector" enum. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118724 91177308-0d34-0410-b5e6-96231b3b80d8
* Mangle std::nullptr_t as specified by the Itanium C++ ABI.Anders Carlsson2010-11-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118236 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a crash mangling decayed val argument-typed function.Fariborz Jahanian2010-11-02
| | | | | | | // rdar: //8620510 and PR7666 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118019 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some bugs in local class mangling brought up in PR8355.John McCall2010-10-18
| | | | | | | | Patch by Richard Smith! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116752 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate usage of ObjCSuperExpr used forFariborz Jahanian2010-10-14
| | | | | | | | | 'super' as receiver of property or a setter/getter methods. //rdar: //8525788 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116483 91177308-0d34-0410-b5e6-96231b3b80d8
* Define and implement CXXNoexceptExpr. Create it in Sema.Sebastian Redl2010-09-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113623 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix warnings caused by new CXXUuidofExprClass enumerator.Francois Pichet2010-09-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113444 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement ARM static local initialization guards, which are more compact thanJohn McCall2010-09-08
| | | | | | | | Itanium guards and use a slightly different compiled-in API. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113330 91177308-0d34-0410-b5e6-96231b3b80d8
* No functional change. Replace Out << 'a' << 'b' with Out << "ab" and spellNick Lewycky2010-09-05
| | | | | | | David Vandevoorde's name correctly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113103 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate CXXBindReferenceExpr, which was used in a ton ofDouglas Gregor2010-09-02
| | | | | | | well-intentioned but completely unused code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112868 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert my user-defined literal commits - r1124{58,60,67} pendingSean Hunt2010-08-30
| | | | | | some issues being sorted out. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112493 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement C++0x user-defined string literals.Sean Hunt2010-08-29
| | | | | | | | | | The extra data stored on user-defined literal Tokens is stored in extra allocated memory, which is managed by the PreprocessorLexer because there isn't a better place to put it that makes sure it gets deallocated, but only after it's used up. My testing has shown no significant slowdown as a result, but independent testing would be appreciated. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112458 91177308-0d34-0410-b5e6-96231b3b80d8
* Detabify.Eli Friedman2010-08-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111768 91177308-0d34-0410-b5e6-96231b3b80d8
* Mangle explicit template arguments in dependent or overloaded names.John McCall2010-08-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111591 91177308-0d34-0410-b5e6-96231b3b80d8
* Contextual arity is a feature of mangling expressions; kill offJohn McCall2010-08-18
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111395 91177308-0d34-0410-b5e6-96231b3b80d8
* Whoops. Don't fall through into the overload case when mangling aJohn McCall2010-08-17
| | | | | | | | dependent call expression. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111300 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't crash when mangling empty anonymous unions. We never actually *need*John McCall2010-08-05
| | | | | | | | | 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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110381 91177308-0d34-0410-b5e6-96231b3b80d8
* Mangle enum constant expressions. Fixes rdar://problem/8204122John McCall2010-07-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109315 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix mangling for static member variables of classes inside an extern "C"Eli Friedman2010-07-18
| | | | | | | | | linkage specification. Not sure if this is the ideal fix, but I'm reasonably sure it's correct vs. gcc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108656 91177308-0d34-0410-b5e6-96231b3b80d8
* After some discussion, the ABI list settled on a much more sensible manglingJohn McCall2010-07-15
| | | | | | | | for string literals. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108464 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the mangling of template template arguments, which do not alwaysJohn McCall2010-07-14
| | | | | | | | | | follow <name>; instead they follow <type>, which has <name> as a subset. Fixes PR7446. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108326 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove a few mangling FIXMEs:John McCall2010-07-14
| | | | | | | | | | - TSTs whose template is a template template parameter already work - we don't provide an imaginary type, so we can't mangle one - we don't need a generic FIXME for vendor type qualifiers git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108317 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement the standard mangling for array-subscript expressions, and implementJohn McCall2010-07-14
| | | | | | | | | the current proposals from David Vandervoorde for new, delete, throw, typeid, imaginary literals, string literals, and null literals. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108315 91177308-0d34-0410-b5e6-96231b3b80d8
* Use isFunctionOrMethod for vars declared localllyFariborz Jahanian2010-06-30
| | | | | | | | in method/blocks to decide not to mangle them. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107309 91177308-0d34-0410-b5e6-96231b3b80d8
* extern variable declared locally to objective-c++ methodFariborz Jahanian2010-06-30
| | | | | | | | 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
* Add function for mangling reference temporaries.Anders Carlsson2010-06-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106948 91177308-0d34-0410-b5e6-96231b3b80d8
* Patch to correctly mangle block helper functionsFariborz Jahanian2010-06-24
| | | | | | | | 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
* improve altivec vector bool/pixel support, patch by Anton YartsevChris Lattner2010-06-23
| | | | | | | with several tweaks by me. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106619 91177308-0d34-0410-b5e6-96231b3b80d8
* Add name mangling for address spaces. We use the vendor-extensionDouglas Gregor2010-06-14
| | | | | | | | 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