Nico Weber
90a415e7ca
When mangling an APSInt with the ms abi, make sure to look at all nibbles.
...
Currently, it's ignored if the number of set bits isn't divisible by 4.
llvm-svn: 165116
2012-10-03 13:39:49 +00:00
Nico Weber
7dfc8be995
While I'm here, resync a %select with the enum definition it selects on.
...
* nullptr used to be mapped to ERROR, now mapped to nullptr
* integral was missing
* expressions now have their own error message, so they won't reach
this. Map them to ERROR.
Note that clang usually crashes before emitting this diagnostic anyway
(see PR13984), so this change alone doesn't have an observable effect.
It makes the code more correct though.
llvm-svn: 165095
2012-10-03 06:57:02 +00:00
Nico Weber
a682681058
Move expression mangling in the microsoft mangler to its own function.
...
This matches what's done in ItaniumMangle and makes it a bit easier
to implement mangling for more expressions. Also use the slightly nicer
"not yet implemented" error message from there.
No functionality change (except for the different error message).
llvm-svn: 165093
2012-10-03 06:46:47 +00:00
Nico Weber
1dc7e03047
Replace a default: with an explicit list of cases. No functionality change.
...
llvm-svn: 165091
2012-10-03 06:12:27 +00:00
Timur Iskhodzhanov
27b6edf839
Fix PR13444 - wrong mangling of "const char * const *" and friends with "-cxx-abi microsoft"
...
llvm-svn: 163110
2012-09-03 09:08:10 +00:00
Joao Matos
e9a3ed4d71
Normalize line endings of r163013 (part 2).
...
llvm-svn: 163032
2012-08-31 22:18:20 +00:00
Joao Matos
dc86f94f62
Improved MSVC __interface support by adding first class support for it, instead of aliasing to "struct" which had some incorrect behaviour. Patch by David Robins.
...
llvm-svn: 163013
2012-08-31 18:45:21 +00:00
John McCall
64044c3a81
Use cast<> instead of static_cast. Patch by Timur Iskhodzhanov!
...
llvm-svn: 162683
2012-08-27 18:12:29 +00:00
John McCall
3351dc397b
Fix the mangling of function pointers in the MS ABI.
...
Patch by Timur Iskhodzhanov!
llvm-svn: 162638
2012-08-25 01:12:56 +00:00
Timur Iskhodzhanov
3c80d5aa15
Remove an outdated comment; add one test to compare function pointer and block mangling
...
llvm-svn: 160783
2012-07-26 13:41:30 +00:00
Timur Iskhodzhanov
25fabdbace
Fix PR13389 (Wrong mangling of return type qualifiers with -cxx-abi microsoft)
...
llvm-svn: 160780
2012-07-26 10:41:15 +00:00
Timur Iskhodzhanov
ff7ff3f30b
Add a FIXME to revisit the performance of BackRefMap later
...
llvm-svn: 160709
2012-07-25 08:16:41 +00:00
Timur Iskhodzhanov
bf0f663bca
Fix PR13207 (Mangling of templates with back references when using -cxx-abi microsoft)
...
llvm-svn: 160667
2012-07-24 09:37:54 +00:00
Timur Iskhodzhanov
c5098ad371
[Windows] Use thiscall as the default calling convention for class methods. PR12785
...
llvm-svn: 160121
2012-07-12 09:50:54 +00:00
Timur Iskhodzhanov
1b1d630e0c
[Windows] Improve mangling of templates when back references are present
...
llvm-svn: 159234
2012-06-26 22:29:50 +00:00
Timur Iskhodzhanov
9137c399bd
[Windows] Fix mangling of repeated types in the presence of bool and function pointers PR13176,PR13177
...
llvm-svn: 159059
2012-06-23 00:54:17 +00:00
Charles Davis
de2e5ed4aa
MicrosoftMangle: Fix mangling of integral constant non-type template arguments in a class specialization.
...
llvm-svn: 159056
2012-06-23 00:27:49 +00:00
Richard Smith
73af5c6dda
MS: Mangle rvalue references and nullptr_t, and produce back-references when
...
appropriate. Patch by João Matos!
llvm-svn: 158895
2012-06-21 02:52:27 +00:00
Kaelyn Uhrain
c1244ae6a0
Remove the trailing backslash from the comment to remove the warning about
...
a multi-line comment, fixing builds with e.g. -Werror=comment enabled.
llvm-svn: 158406
2012-06-13 17:05:13 +00:00
Charles Davis
a81618db44
Grab bag of Microsoft Mangler fixes:
...
- Support mangling virtual function tables (base tables need work on the
ManglerContext interface).
- Correct mangling of local scopes (i.e. functions and C++ methods).
- Replace every llvm_unreachable() for actually-reachable code with a
diagnostic.
llvm-svn: 158376
2012-06-13 00:18:14 +00:00
Richard Smith
f76568591c
PR13047: Fix various abuses of clang::Type in the MS mangler, to make it work
...
in the presence of type sugar.
llvm-svn: 158184
2012-06-08 00:37:04 +00:00
Benjamin Kramer
6003ad5848
Plug a long standing memory leak in TemplateArgument.
...
The integral APSInt value is now stored in a decomposed form and the backing
store for large values is allocated via the ASTContext. This way its not
leaked as TemplateArguments are never destructed when they are allocated in
the ASTContext. Since the integral data is immutable it is now shared between
instances, making copying TemplateArguments a trivial operation.
Currently getting the integral data out of a TemplateArgument requires creating
a new APSInt object. This is cheap when the value is small but can be expensive
if it's not. If this turns out to be an issue a more efficient accessor could
be added.
llvm-svn: 158150
2012-06-07 15:09:51 +00:00
Richard Smith
50fba8f0a9
PR13022: cope with parenthesized function types in MS name mangling.
...
llvm-svn: 157959
2012-06-04 22:46:59 +00:00
Charles Davis
e8ccc1134b
Use fewer temporaries mangling APSInt objects. The performance difference
...
is negligible, but it makes the code clearer. Based on a suggestion by
Jordy Rose.
llvm-svn: 157601
2012-05-29 07:01:45 +00:00
Charles Davis
6770dea704
Fix mangling of integral template arguments between 1 and 10. Add a test case
...
for this. Reported by Timur Iskhodzhanov.
llvm-svn: 157583
2012-05-28 16:53:33 +00:00
Charles Davis
ee855f06e7
Fix Lang's fix. This should fix the tests for +Asserts builds.
...
llvm-svn: 157561
2012-05-28 03:54:22 +00:00
Lang Hames
6ccb51130e
Fix call to APSInt constructor - it doesn't take an initial value, just a
...
bitwidth and signedness. Also rename the variable to reflect its purpose.
No test case - discovered during random code exploration.
llvm-svn: 157547
2012-05-27 21:39:49 +00:00
Charles Davis
5511dfb399
Mangle template instantiations properly (as of VC 7.x) when compiling for
...
the Microsoft Visual C++ ABI. Currently limited to type and integral
non-type arguments. Based on a patch by Timur Iskhodzhanov!
llvm-svn: 157524
2012-05-26 23:12:19 +00:00
John McCall
23dfaa1cef
When mangling a synthetic function declaration, we might not have
...
type-source information for its parameters. Don't crash when
mangling them in the MS C++ ABI. Patch by Timur Iskhodzhanov!
llvm-svn: 155879
2012-05-01 02:33:44 +00:00
David Blaikie
bbafb8a745
Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST).
...
The member variable is always "LangOpts" and the member function is always "getLangOpts".
Reviewed by Chris Lattner
llvm-svn: 152536
2012-03-11 07:00:24 +00:00
Michael J. Spencer
0567b8ec58
Add Microsoft mangling of constructors and destructors. Patch by Dmitry!
...
llvm-svn: 145581
2011-12-01 09:55:00 +00:00
John McCall
e314e27c58
Macro metaprogramming for builtin types.
...
llvm-svn: 142420
2011-10-18 21:02:43 +00:00
John McCall
8a6b59ad97
Add a new placeholder type to represent "unbridged"
...
casts in ARC.
No semantic analysis yet.
llvm-svn: 142208
2011-10-17 18:09:15 +00:00
Anton Korobeynikov
f0c267e6e0
Provide half floating point support as a storage only type.
...
Lack of half FP was a regression compared to llvm-gcc.
llvm-svn: 142016
2011-10-14 23:23:15 +00:00
Eli Friedman
0dfb889575
Support for C1x _Atomic specifier (see testcase). This is primarily being committed at the moment to help support C++0x <atomic>, but it should be a solid base for implementing the full specification of C1x _Atomic.
...
Thanks to Jeffrey Yasskin for the thorough review!
llvm-svn: 141330
2011-10-06 23:00:33 +00:00
David Blaikie
9c902b5502
Rename Diagnostic to DiagnosticsEngine as per issue 5397
...
llvm-svn: 140478
2011-09-25 23:23:43 +00:00
David Blaikie
aa347f9392
Removing a bunch of dead returns/breaks after llvm_unreachables.
...
llvm-svn: 140407
2011-09-23 20:26:49 +00:00
David Blaikie
83d382b1ca
Switch assert(0/false) llvm_unreachable.
...
llvm-svn: 140367
2011-09-23 05:06:16 +00:00
Chris Lattner
0e62c1cc0b
remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports
...
them into the clang namespace.
llvm-svn: 135852
2011-07-23 10:55:15 +00:00
Alexis Hunt
e852b100e2
Implement a new type node, UnaryTransformType, designed to represent a
...
type that turns one type into another. This is used as the basis to
implement __underlying_type properly - with TypeSourceInfo and proper
behavior in the face of templates.
llvm-svn: 132017
2011-05-24 22:41:36 +00:00
Charles Davis
6c488f14f6
Remove comments about __int8 and friends from the mangler. Turns out we don't
...
actually have to implement them, since in modern versions of MSVC they're
aliases to the standard C types.
llvm-svn: 130509
2011-04-29 15:50:52 +00:00
John McCall
0009fcc39e
Make yet another placeholder type, this one marking that an expression is a bound
...
member function, i.e. something of the form 'x.f' where 'f' is a non-static
member function. Diagnose this in the general case. Some of the new diagnostics
are probably worse than the old ones, but we now get this right much more
universally, and there's certainly room for improvement in the diagnostics.
llvm-svn: 130239
2011-04-26 20:42:42 +00:00
Richard Smith
dda56e4b4a
Support for C++11 (non-template) alias declarations.
...
llvm-svn: 129567
2011-04-15 14:24:37 +00:00
Chris Lattner
57540c5be0
fix a bunch of comment typos found by codespell. Patch by
...
Luis Felipe Strano Moraes!
llvm-svn: 129559
2011-04-15 05:22:18 +00:00
Anton Korobeynikov
231e875b5c
Implement ARM pcs attribute. Basically it's another way of calling convention selection (AAPCS or
...
AAPCS+VFP), similar to fastcall / stdcall / whatevercall seen on x86.
In particular, all library functions should always be AAPCS regardless of floating point ABI used.
llvm-svn: 129534
2011-04-14 20:06:49 +00:00
John McCall
319963434c
Basic, untested implementation for an "unknown any" type requested by LLDB.
...
The idea is that you can create a VarDecl with an unknown type, or a
FunctionDecl with an unknown return type, and it will still be valid to
access that object as long as you explicitly cast it at every use. I'm
still going back and forth about how I want to test this effectively, but
I wanted to go ahead and provide a skeletal implementation for the LLDB
folks' benefit and because it also improves some diagnostic goodness for
placeholder expressions.
llvm-svn: 129065
2011-04-07 08:22:57 +00:00
Tilmann Scheller
99cc30c371
Revert "Add CC_Win64ThisCall and set it in the necessary places."
...
This reverts commit 126863.
llvm-svn: 126886
2011-03-02 21:36:49 +00:00
Tilmann Scheller
454464b491
Add CC_Win64ThisCall and set it in the necessary places.
...
llvm-svn: 126863
2011-03-02 19:36:23 +00:00
Richard Smith
30482bc786
Implement the C++0x deduced 'auto' feature.
...
This fixes PR 8738, 9060 and 9132.
llvm-svn: 126069
2011-02-20 03:19:35 +00:00
Rafael Espindola
3968cd0f7b
For consistency, use llvm::raw_ostream in the rest of the mangle api.
...
llvm-svn: 125360
2011-02-11 02:52:17 +00:00