aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/Mangle.cpp
AgeCommit message (Collapse)Author
2011-01-13Move name mangling support from CodeGen to AST. In thePeter Collingbourne
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
2011-01-13When your comments and your code are out-of-sync, the test case is wrong.Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123379 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-13Add tests for name mangling of variadic templates.Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123378 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-05Replace the representation of template template argument packDouglas Gregor
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
2011-01-04Implement name mangling for sizeof...(pack), to silence the last ofDouglas Gregor
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
2011-01-03Implement pack expansions whose pattern is a base-specifier.Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122782 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-03Implement support for pack expansions whose pattern is a non-typeDouglas Gregor
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
2010-12-25The -fshort-wchar option causes wchar_t to become unsigned, in addition to beingChris Lattner
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
2010-12-20Introduce a new type, PackExpansionType, to capture types that areDouglas Gregor
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
2010-12-08Remove the TypesCompatibleExprClass AST node. Merge its functionality into ↵Francois Pichet
BinaryTypeTraitExpr. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121298 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-07Type traits intrinsic implementation: __is_base_of(T, U)Francois Pichet
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
2010-12-06Rename CXXExprWithTemporaries -> ExprWithCleanups; there's no theoreticalJohn McCall
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
2010-12-02Simplify the ASTs by consolidating ObjCImplicitGetterSetterExpr and ↵John McCall
ObjCPropertyRefExpr into the latter. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120643 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-25Hide a bunch of symbols.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120153 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-18Refactoring of Diagnostic class.Argyrios Kyrtzidis
-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
2010-11-16Change CXXNameMangler::mangleNeonVectorType to require the vector type to beBob Wilson
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
2010-11-16Use getTypeSize() method.Bob Wilson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119297 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-15Add a new expression kind, OpaqueValueExpr, which is useful forJohn McCall
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
2010-11-12Use ASTContext::getTypeInfo to find the vector element size.Bob Wilson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118899 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-12Add a separate NeonPolyVector kind to distinguish polynomial vector types.Bob Wilson
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
2010-11-12Add special-case mangling for Neon vector types.Bob Wilson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118897 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-10Add a variant of GCC-style vector types for ARM NEON.Bob Wilson
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
2010-11-04Mangle std::nullptr_t as specified by the Itanium C++ ABI.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118236 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-02Fix a crash mangling decayed val argument-typed function.Fariborz Jahanian
// rdar: //8620510 and PR7666 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118019 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-18Fix some bugs in local class mangling brought up in PR8355.John McCall
Patch by Richard Smith! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116752 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-14Eliminate usage of ObjCSuperExpr used forFariborz Jahanian
'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
2010-09-10Define and implement CXXNoexceptExpr. Create it in Sema.Sebastian Redl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113623 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08Fix warnings caused by new CXXUuidofExprClass enumerator.Francois Pichet
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113444 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08Implement ARM static local initialization guards, which are more compact thanJohn McCall
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
2010-09-05No functional change. Replace Out << 'a' << 'b' with Out << "ab" and spellNick Lewycky
David Vandevoorde's name correctly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113103 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02Eliminate CXXBindReferenceExpr, which was used in a ton ofDouglas Gregor
well-intentioned but completely unused code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112868 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30Revert my user-defined literal commits - r1124{58,60,67} pendingSean Hunt
some issues being sorted out. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112493 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-29Implement C++0x user-defined string literals.Sean Hunt
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
2010-08-22Detabify.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111768 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-20Mangle explicit template arguments in dependent or overloaded names.John McCall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111591 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18Contextual arity is a feature of mangling expressions; kill offJohn McCall
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
2010-08-17Whoops. Don't fall through into the overload case when mangling aJohn McCall
dependent call expression. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111300 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05Don't crash when mangling empty anonymous unions. We never actually *need*John McCall
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
2010-07-24Mangle enum constant expressions. Fixes rdar://problem/8204122John McCall
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109315 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-18Fix mangling for static member variables of classes inside an extern "C"Eli Friedman
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
2010-07-15After some discussion, the ABI list settled on a much more sensible manglingJohn McCall
for string literals. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108464 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-14Fix the mangling of template template arguments, which do not alwaysJohn McCall
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
2010-07-14Remove a few mangling FIXMEs:John McCall
- 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
2010-07-14Implement the standard mangling for array-subscript expressions, and implementJohn McCall
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
2010-06-30Use isFunctionOrMethod for vars declared localllyFariborz Jahanian
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
2010-06-30extern variable declared locally to objective-c++ methodFariborz Jahanian
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-26Add function for mangling reference temporaries.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106948 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-24Patch to correctly mangle block helper functionsFariborz Jahanian
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-23improve altivec vector bool/pixel support, patch by Anton YartsevChris Lattner
with several tweaks by me. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106619 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-14Add name mangling for address spaces. We use the vendor-extensionDouglas Gregor
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