summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ItaniumMangle.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix the mangling of class template arguments in a particularJohn McCall2012-01-061-2/+17
| | | | | | dependent case. Thanks to Jason Merrill for pointing this out. llvm-svn: 147653
* Fix mangling substitutions for address-space-qualified classDouglas Gregor2011-12-031-2/+9
| | | | | | types. Patch from Dmitri Rubinstein! llvm-svn: 145776
* Change the AST representation of operations on Objective-CJohn McCall2011-11-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | property references to use a new PseudoObjectExpr expression which pairs a syntactic form of the expression with a set of semantic expressions implementing it. This should significantly reduce the complexity required elsewhere in the compiler to deal with these kinds of expressions (e.g. IR generation's special l-value kind, the static analyzer's Message abstraction), at the lower cost of specifically dealing with the odd AST structure of these expressions. It should also greatly simplify efforts to implement similar language features in the future, most notably Managed C++'s properties and indexed properties. Most of the effort here is in dealing with the various clients of the AST. I've gone ahead and simplified the ObjC rewriter's use of properties; other clients, like IR-gen and the static analyzer, have all the old complexity *and* all the new complexity, at least temporarily. Many thanks to Ted for writing and advising on the necessary changes to the static analyzer. I've xfailed a small diagnostics regression in the static analyzer at Ted's request. llvm-svn: 143867
* Macro metaprogramming for builtin types.John McCall2011-10-181-4/+4
| | | | llvm-svn: 142420
* Add a new placeholder type to represent "unbridged"John McCall2011-10-171-0/+1
| | | | | | | | casts in ARC. No semantic analysis yet. llvm-svn: 142208
* Provide half floating point support as a storage only type.Anton Korobeynikov2011-10-141-1/+2
| | | | | | Lack of half FP was a regression compared to llvm-gcc. llvm-svn: 142016
* Initial implementation of __atomic_* (everything except __atomic_is_lock_free).Eli Friedman2011-10-111-0/+1
| | | | llvm-svn: 141632
* Constant expression evaluation refactoring:Richard Smith2011-10-101-1/+2
| | | | | | | | | | | - Remodel Expr::EvaluateAsInt to behave like the other EvaluateAs* functions, and add Expr::EvaluateKnownConstInt to capture the current fold-or-assert behaviour. - Factor out evaluation of bitfield bit widths. - Fix a few places which would evaluate an expression twice: once to determine whether it is a constant expression, then again to get the value. llvm-svn: 141561
* Support for C1x _Atomic specifier (see testcase). This is primarily being ↵Eli Friedman2011-10-061-0/+8
| | | | | | | | 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
* Rename Diagnostic to DiagnosticsEngine as per issue 5397David Blaikie2011-09-251-8/+8
| | | | llvm-svn: 140478
* Removing a bunch of dead returns/breaks after llvm_unreachables.David Blaikie2011-09-231-3/+0
| | | | llvm-svn: 140407
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-3/+3
| | | | llvm-svn: 140367
* Rename ExplicitTemplateArgumentList -> ASTTemplateArgumentListInfo, no ↵Argyrios Kyrtzidis2011-09-221-2/+2
| | | | | | functionality change. llvm-svn: 140330
* Extend the ASTContext constructor to delay the initialization ofDouglas Gregor2011-09-021-1/+1
| | | | | | | | builtin types (When requested). This is another step toward making ASTUnit build the ASTContext as needed when loading an AST file, rather than doing so after the fact. No actual functionality change (yet). llvm-svn: 138985
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-35/+35
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Create a new expression node, SubstNonTypeTemplateParmExpr,John McCall2011-07-151-0/+5
| | | | | | | | to represent a fully-substituted non-type template parameter. This should improve source fidelity, as well as being generically useful for diagnostics and such. llvm-svn: 135243
* Improve name mangling for instantiation-dependent types that are notDouglas Gregor2011-07-121-15/+51
| | | | | | | | | | | | | | | | | | | | | | | | | dependent. This covers an odd class of types such as int (&)[sizeof(sizeof(T() + T()))]; which involve template parameters but, because of some trick typically involving a form of expression that is never type-dependent, resolve down to a non-dependent type. Such types need to be mangled essentially as they were written in the source code (involving template parameters), rather than via their canonical type. In general, instantiation-dependent types should be mangled as they were written in the source. However, since we can't do that now without non-trivial refactoring of the AST (see the new FIXME), I've gone for this partial solution: only use the as-written-in-the-source mangling for these strange types that are instantiation-dependent but not dependent. This provides better compatibility with previous incarnations of Clang and with GCC. In the future, we'd like to get this right. Fixes <rdar://problem/9663282>. llvm-svn: 134984
* Implement name mangling for sizeof...(function parameter pack).Douglas Gregor2011-07-121-9/+2
| | | | llvm-svn: 134974
* Mangle dependent template names of unknown arityDouglas Gregor2011-07-121-10/+4
| | | | llvm-svn: 134967
* Implement the Itanium C++ ABI's mangling rule forDouglas Gregor2011-07-121-2/+23
| | | | | | non-instantiation-dependent sizeof and alignof expressions. llvm-svn: 134963
* Centralize the getCanonicalType() calls in the Itanium C++ manglingDouglas Gregor2011-07-121-9/+4
| | | | | | code so that they only occur in a single place. No functionality change. llvm-svn: 134961
* Just mangle substituted template parameter types as unresolved types.John McCall2011-07-011-10/+3
| | | | | | | This is kindof questionable but seems to do more-or-less the right thing. This is not a particularly friendly part of the ABI. llvm-svn: 134227
* Change the mangling of enclosing template template parametersJohn McCall2011-07-011-19/+73
| | | | | | | that serve as the base template name of an unresolved-name to be mangled as a substitution. llvm-svn: 134213
* No, actually, we do need to be able to mangle substituted template names.John McCall2011-06-301-3/+10
| | | | llvm-svn: 134195
* Preserve that a TemplateName was arrived at by substitutingJohn McCall2011-06-301-0/+4
| | | | | | | | | | | for a template template parameter. Uses to follow. I've also made the uniquing of SubstTemplateTemplateParmPacks use a ContextualFoldingSet as a minor space efficiency. llvm-svn: 134137
* Be more thorough about mangling unresolved types.John McCall2011-06-281-56/+101
| | | | llvm-svn: 134011
* Fix the mangling of dependent-scope decl ref expressions so that theyJohn McCall2011-06-211-20/+8
| | | | | | use the unresolved-name production correctly. llvm-svn: 133554
* Introduce a new AST node describing reference binding to temporaries.Douglas Gregor2011-06-211-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | MaterializeTemporaryExpr captures a reference binding to a temporary value, making explicit that the temporary value (a prvalue) needs to be materialized into memory so that its address can be used. The intended AST invariant here is that a reference will always bind to a glvalue, and MaterializeTemporaryExpr will be used to convert prvalues into glvalues for that binding to happen. For example, given const int& r = 1.0; The initializer of "r" will be a MaterializeTemporaryExpr whose subexpression is an implicit conversion from the double literal "1.0" to an integer value. IR generation benefits most from this new node, since it was previously guessing (badly) when to materialize temporaries for the purposes of reference binding. There are likely more refactoring and cleanups we could perform there, but the introduction of MaterializeTemporaryExpr fixes PR9565, a case where IR generation would effectively bind a const reference directly to a bitfield in a struct. Addresses <rdar://problem/9552231>. llvm-svn: 133521
* Objective-C++ ARC: do not mangle __unsafe_unretained lifetimeDouglas Gregor2011-06-171-2/+7
| | | | | | | | | | qualifiers, so that an __unsafe_unretained-qualified type T in ARC code will have the same mangling as T in non-ARC code, improving ABI interoperability. This works now because we infer or require a lifetime qualifier everywhere one can appear in an external interface. Another part of <rdar://problem/9595486>. llvm-svn: 133306
* Automatic Reference Counting.John McCall2011-06-151-2/+40
| | | | | | | | | | Language-design credit goes to a lot of people, but I particularly want to single out Blaine Garst and Patrick Beard for their contributions. Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself, in no particular order. llvm-svn: 133103
* Don't add objc method name mangling to locally declared function.Fariborz Jahanian2011-06-091-0/+6
| | | | | | // rdar://9566314 llvm-svn: 132791
* Add name mangling for expr .* expr. Fixes PR9983 / <rdar://problem/9486332>.Douglas Gregor2011-06-051-2/+6
| | | | llvm-svn: 132659
* Add support for builtin astype:Tanya Lattner2011-06-041-1/+3
| | | | | | | __builtin_astype(): Used to reinterpreted as another data type of the same size using for both scalar and vector data types. Added test case. llvm-svn: 132612
* Implement a new type node, UnaryTransformType, designed to represent aAlexis Hunt2011-05-241-0/+16
| | | | | | | | 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
* Type prefixes of unresolved-names should only be mangled as unresolved-typesJohn McCall2011-05-041-15/+92
| | | | | | | | if they match that production, i.e. if they're template type parameters or decltypes (or, as an obvious case not yet described in the ABI document, if they're template template parameters applied to template arguments). llvm-svn: 130824
* Store a parameter index and function prototype depth in everyJohn McCall2011-05-011-19/+143
| | | | | | | | | | 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. llvm-svn: 130669
* Implement the mangling for non-ADL call expressions that we justJohn McCall2011-04-281-2/+47
| | | | | | worked out. llvm-svn: 130376
* Implementation of Embarcadero array type traitsJohn Wiegley2011-04-281-0/+1
| | | | | | | | | | Patch authored by John Wiegley. These are array type traits used for parsing code that employs certain features of the Embarcadero C++ compiler: __array_rank(T) and __array_extent(T, Dim). llvm-svn: 130351
* Make yet another placeholder type, this one marking that an expression is a ↵John McCall2011-04-261-0/+1
| | | | | | | | | | | 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
* t/clang/expr-traitsJohn Wiegley2011-04-251-0/+1
| | | | | | | | | Patch authored by David Abrahams. These two expression traits (__is_lvalue_expr, __is_rvalue_expr) are used for parsing code that employs certain features of the Embarcadero C++ compiler. llvm-svn: 130122
* GCC seems to create address-of expression manglings when passing *any*John McCall2011-04-241-2/+1
| | | | | | | function as a template argument where a pointer to function is wanted. Just extend the existing hack. llvm-svn: 130084
* Update the mangler for some of the "new" unresolved-name manglings.John McCall2011-04-241-77/+206
| | | | | | | | | | I've sent off an email requesting clarification on a few things that I wasn't sure how to handle. This also necessitated making prefixes and unresolved-prefixes get mangled separately. llvm-svn: 130083
* The ABI settled on mangling float literals with lowercase hex dumps.John McCall2011-04-241-5/+18
| | | | | | | APInt::toString doesn't do those, but it's easy to postprocess that output, and that's probably better than adding another knob to that method. llvm-svn: 130081
* Support for C++11 (non-template) alias declarations.Richard Smith2011-04-151-1/+1
| | | | llvm-svn: 129567
* fix a bunch of comment typos found by codespell. Patch byChris Lattner2011-04-151-1/+1
| | | | | | Luis Felipe Strano Moraes! llvm-svn: 129559
* C1X: implement generic selectionsPeter Collingbourne2011-04-151-0/+1
| | | | | | | As an extension, generic selection support has been added for all supported languages. The syntax is the same as for C1X. llvm-svn: 129554
* Basic, untested implementation for an "unknown any" type requested by LLDB.John McCall2011-04-071-0/+1
| | | | | | | | | | | | 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
* Do not use IR marker for LLVM intrinsicsPeter Collingbourne2011-04-061-2/+3
| | | | llvm-svn: 129001
* File-scope static functions need to be mangled with 'L' so thatJohn McCall2011-03-221-4/+6
| | | | | | | | they don't collide with file-scope extern functions from the same translation unit. This is basically a matter of applying the same logic to FunctionDecls as we were previously applying to VarDecls. llvm-svn: 128072
* Add support for the OpenCL vec_step operator, by generalising andPeter Collingbourne2011-03-111-4/+16
| | | | | | | extending the existing support for sizeof and alignof. Original patch by Guy Benyei. llvm-svn: 127475
OpenPOWER on IntegriCloud