Commit Graph

24 Commits

Author SHA1 Message Date
Richard Smith 919ae5fc04 Fix mangling for dependent "type { expr-list }" expressions, and add mangling for designated initializers matching recent cxx-abi-dev discussion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311612 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-23 22:12:08 +00:00
Douglas Gregor f6b91e6f16 Itanium mangler: don't trip an assertion when unresolved members have implicit bases.
When we find a member of the current instantation, the base of the
unresolved member expression is implicit; use nullptr for such
bases. This is not a change in behavior: the AST already contains null
in such cases, so non-asserts builds do the right thing already. Fixes
rdar://problem/21020559.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@237929 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-21 18:28:18 +00:00
Richard Smith 7cb6bf2c0c PR22465: when performing list-initialization for a class type C, if we see an
initializer of the form {x}, where x is of type C or a type derived from C,
perform *non-list* initialization of the entity from x, but create a
CXXConstructExpr that knows that we used list-initialization syntax.

Plus some fixes to ensure we mangle correctly in this and related cases.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228276 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-05 07:02:11 +00:00
Richard Smith 789175b49a Various fixes to mangling of list-initialization.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228274 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-05 06:15:50 +00:00
Richard Smith e056d2629c When mangling member-expressions, skip implicit accesses of anonymous union
objects. This is consistent with GCC's behavior. Patch by Tomasz Miąsko!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222402 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-20 01:35:11 +00:00
David Majnemer 11f55130a0 AST: Mangle cast expression encoding more accurately
Don't mangle all casts in expressions as "cv", use the appropriate
encoding which corresponds to a specific cast.

This fixes PR21034.

Differential Revision: http://reviews.llvm.org/D5453

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218293 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-23 04:27:55 +00:00
Stephen Lin 93ab6bf534 CHECK-LABEL-ify some code gen tests to improve diagnostic experience when tests fail.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188447 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-15 06:47:53 +00:00
John McCall 9653ab52b9 Implement Mike Herrick's proposed noexcept mangling.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164593 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-25 09:10:17 +00:00
Sebastian Redl faf4ef62b6 Richard Smith pointed out that there already is a proposal for init list mangling.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151462 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-25 22:59:28 +00:00
Sebastian Redl b76ffc5667 Better mangling for new-expressions. Also, although we can't mangle arbitrary initializer lists yet (we will need this), turn the crash into a controlled error.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151455 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-25 20:51:07 +00:00
Richard Smith 41576d47d7 Implement name mangling for scalar value initialization. Reported on IRC by Xeo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149854 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-06 02:54:51 +00:00
Richard Smith 762bb9d0ad Update all tests other than Driver/std.cpp to use -std=c++11 rather than
-std=c++0x. Patch by Ahmed Charles!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141900 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-13 22:29:44 +00:00
Douglas Gregor 63f62df485 Add name mangling for expr .* expr. Fixes PR9983 / <rdar://problem/9486332>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132659 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-05 05:27:58 +00:00
John McCall fb44de956f Store a parameter index and function prototype depth in every
parameter node and use this to correctly mangle parameter
references in function template signatures.

A follow-up patch will improve the storage usage of these
fields;  here I've just done the lazy thing.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130669 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-01 22:35:37 +00:00
John McCall 5a7e6f781a Implement the mangling for non-ADL call expressions that we just
worked out.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130376 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-28 02:52:03 +00:00
Richard Smith 967ecd3bed Mangling of undeduced 'auto' types, as specified by Itanium C++ ABI.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126140 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 20:10:02 +00:00
Chris Lattner 117e3f4cd4 fix PR5179 and correctly fix PR5831 to not miscompile.
The X86-64 ABI code didn't handle the case when a struct
would get classified and turn up as "NoClass INTEGER" for
example.  This is perfectly possible when the first slot
is all padding (e.g. due to empty base classes).  In this
situation, the first 8-byte doesn't take a register at all,
only the second 8-byte does.

This fixes this by enhancing the x86-64 abi stuff to allow
and handle this case, reverts the broken fix for PR5831,
and enhances the target independent stuff to be able to 
handle an argument value in registers being accessed at an
offset from the memory value.

This is the last x86-64 calling convention related miscompile
that I'm aware of.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109848 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-30 04:02:24 +00:00
Chris Lattner 8ff296496d pass/return structs of char and short as i8/i16 to avoid
aweful through-memory coersion, just like we do for i32 now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107078 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-28 21:59:07 +00:00
Douglas Gregor 8f51a4f2d0 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98441 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13 18:23:07 +00:00
Douglas Gregor 34fd284e0a Re-revert the explicit template instantiation linkage patch. I am beginning to look incompetent
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98425 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13 03:49:57 +00:00
Douglas Gregor 8721360da5 Reinstate patch to turn explicit template instantiations into weak symbols
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98424 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13 03:14:19 +00:00
Douglas Gregor 4ea9006629 Revert the linkage change for explicit template instantiations; something is amiss
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98332 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 05:13:59 +00:00
Douglas Gregor e5e0c9deb1 Give explicit template instantiations weak linkage (but don't defer
them). Fixes PR6578.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98328 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-12 04:49:06 +00:00
Douglas Gregor 46287c7922 Name mangling for cast expressions, from Matthias Schiffer! Fixes PR5876.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94811 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 16:37:09 +00:00