summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/Mangle.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Add a cautionary note about the mangling I just invented.John McCall2010-02-041-0/+3
| | | | llvm-svn: 95275
* Add mangling support for calls, sizeof/alignof, constructor calls,John McCall2010-02-041-29/+151
| | | | | | float literals, and unresolved lookups (which required hand-wavey extensions). llvm-svn: 95273
* When a function or variable somehow depends on a type or declarationDouglas Gregor2010-02-031-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that is in an anonymous namespace, give that function or variable internal linkage. This change models an oddity of the C++ standard, where names declared in an anonymous namespace have external linkage but, because anonymous namespace are really "uniquely-named" namespaces, the names cannot be referenced from other translation units. That means that they have external linkage for semantic analysis, but the only sensible implementation for code generation is to give them internal linkage. We now model this notion via the UniqueExternalLinkage linkage type. There are several changes here: - Extended NamedDecl::getLinkage() to produce UniqueExternalLinkage when the declaration is in an anonymous namespace. - Added Type::getLinkage() to determine the linkage of a type, which is defined as the minimum linkage of the types (when we're dealing with a compound type that is not a struct/class/union). - Extended NamedDecl::getLinkage() to consider the linkage of the template arguments and template parameters of function template specializations and class template specializations. - Taught code generation to rely on NamedDecl::getLinkage() when determining the linkage of variables and functions, also considering the linkage of the types of those variables and functions (C++ only). Map UniqueExternalLinkage to internal linkage, taking out the explicit checks for isInAnonymousNamespace(). This fixes much of PR5792, which, as discovered by Anders Carlsson, is actually the reason behind the pass-manager assertion that causes the majority of clang-on-clang regression test failures. With this fix, Clang-built-Clang+LLVM passes 88% of its regression tests (up from 67%). The specific numbers are: LLVM: Expected Passes : 4006 Expected Failures : 32 Unsupported Tests : 40 Unexpected Failures: 736 Clang: Expected Passes : 1903 Expected Failures : 14 Unexpected Failures: 75 Overall: Expected Passes : 5909 Expected Failures : 46 Unsupported Tests : 40 Unexpected Failures: 811 Still to do: - Improve testing - Check whether we should allow the presence of types with InternalLinkage (in addition to UniqueExternalLinkage) given variables/functions internal linkage in C++, as mentioned in PR5792. - Determine how expensive the getLinkage() calls are in practice; consider caching the result in NamedDecl. - Assess the feasibility of Chris's idea in comment #1 of PR5792. llvm-svn: 95216
* Remove abstract expression kinds from the StmtClass enum. Update a few usersJohn McCall2010-02-031-6/+23
| | | | | | appropriately. Call out a few missing cases in the expression mangler. llvm-svn: 95176
* Name mangling for cast expressions, from Matthias Schiffer! Fixes PR5876.Douglas Gregor2010-01-291-0/+18
| | | | llvm-svn: 94811
* Mangle static variables with an extra name to distinguish them from ↵Alexis Hunt2010-01-241-6/+11
| | | | | | | | non-static variables in the same TU. Fixes PR5966 for real this time; also reverts r92911, which had a incorrect fix. llvm-svn: 94352
* fix PR5869: mangle static symbols like gcc does to make it easier to diff ↵Nuno Lopes2010-01-071-1/+4
| | | | | | symbol tables llvm-svn: 92911
* Get rid of FixedWidthIntType, as suggested by Chris and Eli.Anders Carlsson2009-12-291-4/+0
| | | | llvm-svn: 92246
* Mangle block pointer types. Fixes PR5858.Anders Carlsson2009-12-231-1/+2
| | | | llvm-svn: 92069
* There is no such thing as typeinfo for a cv-qualified type. AssertDouglas Gregor2009-12-231-0/+1
| | | | | | | | that this is true when mangling, then fix up the various places in Sema and/or CodeGen that need to remove qualifiers. Addresses a linking issue when building LLVM with Clang. llvm-svn: 92064
* Mangle template template parameters. Fixes PR5861.Anders Carlsson2009-12-231-9/+12
| | | | llvm-svn: 92030
* Make sure that we mangle overloaded operators that are member functions ↵Anders Carlsson2009-12-221-7/+22
| | | | | | | | 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
* Mangle CXXOperatorCallExprs, fixes PR5796.Anders Carlsson2009-12-161-0/+10
| | | | llvm-svn: 91507
* Mangle unary, binary and ternary expressions correctly.Anders Carlsson2009-12-141-18/+58
| | | | llvm-svn: 91257
* Un-namespace-qualify llvm_unreachable. It's a macro, so the qualification gaveJeffrey Yasskin2009-12-121-2/+2
| | | | | | no extra safety anyway. llvm-svn: 91207
* Make sure mangling doesn't crash in another case. Add some more tests.Eli Friedman2009-12-111-1/+1
| | | | llvm-svn: 91149
* Fix for PR5706: let mangleName deal with mangling names without identifiersEli Friedman2009-12-111-4/+1
| | | | | | correctly. llvm-svn: 91136
* Mangle static variables inside Objective-C methods in Objective-C++. We ↵Anders Carlsson2009-12-101-3/+24
| | | | | | currently mangle them the same way as gcc does. llvm-svn: 91042
* Mangle basic_ostream and basic_iostream specializations.Anders Carlsson2009-12-071-12/+34
| | | | llvm-svn: 90794
* Fix "using typename" and the instantiation of non-dependent using declarations.John McCall2009-12-041-0/+6
| | | | llvm-svn: 90614
* Put in FIXME that this mangling is not official in.Alexis Hunt2009-12-041-1/+1
| | | | llvm-svn: 90594
* Switch mangling of literal operator names to a string that'sAlexis Hunt2009-12-041-1/+1
| | | | | | | | | | a) legal b) likely to be chosen as the official mangling This will break ABI compatibility with all literal operator names, so you may need to recompile any such code. Sorry. llvm-svn: 90587
* Correctly mangle the 'std' namespace inside extern "C++" blocks.Anders Carlsson2009-12-041-13/+23
| | | | llvm-svn: 90544
* Note a failure I saw from the g++ testsuite:Mike Stump2009-12-031-0/+1
| | | | | | FAIL: g++.old-deja/g++.mike/eh23.C (test for excess errors) llvm-svn: 90374
* Work-in-progress: teach mangler how to mangle thunks for destructors.Eli Friedman2009-12-031-3/+13
| | | | llvm-svn: 90360
* Fix for PR5522 and PR5666: fix a bunch of mangling issues with extern variablesEli Friedman2009-12-021-11/+25
| | | | | | and funcctions declared locally within a function. llvm-svn: 90344
* Change rtti/Rtti to RTTI, as it is an acronym.Mike Stump2009-12-021-2/+2
| | | | llvm-svn: 90334
* Add DeclarationName support for C++0x operator literals. They should now work asAlexis Hunt2009-11-291-0/+6
| | | | | | | function names outside of templates - they'll probably cause some damage there as they're largely untested. llvm-svn: 90064
* Remove remaining VISIBILITY_HIDDEN from anonymous namespaces.Benjamin Kramer2009-11-281-1/+0
| | | | llvm-svn: 90044
* Add a CovariantThunkAdjustment struct that represents the adjustments needed ↵Anders Carlsson2009-11-261-5/+6
| | | | | | for a covariant thunk. llvm-svn: 89933
* Move the mangler into the CodeGen namespace. Change mangleThunk to take a ↵Anders Carlsson2009-11-261-13/+12
| | | | | | ThunkAdjustment. llvm-svn: 89930
* Add a ThunkAdjustment struct which holds a non-virtual and a virtual ↵Anders Carlsson2009-11-261-28/+33
| | | | | | adjustment offset. Start using it. General cleanup in Mangle.cpp. llvm-svn: 89925
* When mangling a ctor/dtor we need to take into consideration whether it's a ↵Anders Carlsson2009-11-241-2/+17
| | | | | | member template. llvm-svn: 89741
* This patch implements objective-c's 'SEL' type as a built-inFariborz Jahanian2009-11-211-0/+1
| | | | | | | | | | | | | | | | | | type and fixes a long-standing code gen. crash reported in at least two PRs and a radar. (radar 7405040 and pr5025). There are couple of remaining issues that I would like for Ted. and Doug to look at: Ted, please look at failure in Analysis/MissingDealloc.m. I have temporarily added an expected-warning to make the test pass. This tests has a declaration of 'SEL' type which may not co-exist with the new changes. Doug, please look at a FIXME in PCHWriter.cpp/PCHReader.cpp. I think the changes which I have ifdef'ed out are correct. They need be considered for in a few Indexer/PCH test cases. llvm-svn: 89561
* Mangler: Sketch mangling for TemplateArgument::Declaration kind.Daniel Dunbar2009-11-211-27/+32
| | | | | | - Several important FIXMEs related to whether arguments are expressions or external names, and the mangling of extern "C" names (c.f., PR5522). llvm-svn: 89556
* Mangler: Lift shouldMangleDeclName predicate out of CXXNameMangler::mangle.Daniel Dunbar2009-11-211-36/+44
| | | | | | | | - Sometimes we have to mangle things we wouldn't normally (e.g., because they appear in a template expression). - This also tidies up the predicate to be more obvious what is getting mangled. llvm-svn: 89555
* Mangler: Strengthen invariants, MangleContext::mangleName should only be ↵Daniel Dunbar2009-11-211-15/+12
| | | | | | called on var or function decls. llvm-svn: 89554
* Mangler: Inline a bunch of functions into their sole caller, not that I ↵Daniel Dunbar2009-11-211-106/+56
| | | | | | don't love typing for typings sake, but... llvm-svn: 89553
* Remove dead variable.Daniel Dunbar2009-11-211-1/+0
| | | | llvm-svn: 89551
* Mangler: Split isStdNamespace for when the caller already has a NamespaceDecl.Daniel Dunbar2009-11-211-5/+6
| | | | llvm-svn: 89550
* IRgen: Eliminate CXXNameMangler::mangleCXX{C,D}tor.Daniel Dunbar2009-11-211-24/+10
| | | | llvm-svn: 89549
* IRgen: Switch the C++ mangler interfaces to take the SmallVector to write into,Daniel Dunbar2009-11-211-48/+29
| | | | | | | instead of requiring clients to make a raw_svector_ostream, which is just an implementation detail. llvm-svn: 89548
* Sink free mangle* methods into MangleContext.Daniel Dunbar2009-11-211-178/+175
| | | | llvm-svn: 89547
* Delete trailing space.Daniel Dunbar2009-11-211-85/+85
| | | | llvm-svn: 89545
* Draw a brighter line between "unresolved" expressions, where we have done theJohn McCall2009-11-191-2/+2
| | | | | | | | appropriate lookup and simply can't resolve the referrent yet, and "dependent scope" expressions, where we can't do the lookup yet because the entity we need to look into is a dependent type. llvm-svn: 89402
* First part of changes to eliminate problems with cv-qualifiers andDouglas Gregor2009-11-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sugared types. The basic problem is that our qualifier accessors (getQualifiers, getCVRQualifiers, isConstQualified, etc.) only look at the current QualType and not at any qualifiers that come from sugared types, meaning that we won't see these qualifiers through, e.g., typedefs: typedef const int CInt; typedef CInt Self; Self.isConstQualified() currently returns false! Various bugs (e.g., PR5383) have cropped up all over the front end due to such problems. I'm addressing this problem by splitting each qualifier accessor into two versions: - the "local" version only returns qualifiers on this particular QualType instance - the "normal" version that will eventually combine qualifiers from this QualType instance with the qualifiers on the canonical type to produce the full set of qualifiers. This commit adds the local versions and switches a few callers from the "normal" version (e.g., isConstQualified) over to the "local" version (e.g., isLocalConstQualified) when that is the right thing to do, e.g., because we're printing or serializing the qualifiers. Also, switch a bunch of Context.getCanonicalType(T1).getUnqualifiedType() == Context.getCanonicalType(T2).getQualifiedType() expressions over to Context.hasSameUnqualifiedType(T1, T2) llvm-svn: 88969
* Implement typeid for class types.Mike Stump2009-11-151-0/+2
| | | | llvm-svn: 88843
* Mangling support for typeinfo names.Mike Stump2009-11-141-0/+16
| | | | llvm-svn: 88726
* Finish off mangling for the VTT.Mike Stump2009-11-101-0/+8
| | | | llvm-svn: 86647
* Add mangling for the construction vtable.Mike Stump2009-11-101-0/+22
| | | | llvm-svn: 86643
OpenPOWER on IntegriCloud