| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
passed to it, and unknown selectors causing potential leak.
// rdar://9659270
llvm-svn: 134449
|
| |
|
|
|
|
| |
Tested by valgrind & Sema/asm.c.
llvm-svn: 134404
|
| |
|
|
|
|
|
| |
fprintf, and to be more consistent in formatting with the other stats
printing routines.
llvm-svn: 134374
|
| |
|
|
|
|
| |
fprintf. There is more cleanup to be done to the AST stats printing...
llvm-svn: 134373
|
| |
|
|
|
|
| |
context.
llvm-svn: 134320
|
| |
|
|
|
|
|
|
| |
-Remove unnecessary 'return'.
-Remove unnecessary 'if' check (llvm_unreachable make sure attrStr will be non-null)
-Add a test of transferring ownership to a reference cast type.
llvm-svn: 134285
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
ownership, if the
cast type has no ownership specified, implicitly "transfer" the ownership of the cast'ed type
to the cast type:
id x;
static_cast<NSString**>(&x); // Casting as (__strong NSString**).
This currently only works for C++ named casts, C casts to follow.
llvm-svn: 134273
|
| |
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
type/expression/template argument/etc. is instantiation-dependent if
it somehow involves a template parameter, even if it doesn't meet the
requirements for the more common kinds of dependence (dependent type,
type-dependent expression, value-dependent expression).
When we see an instantiation-dependent type, we know we always need to
perform substitution into that instantiation-dependent type. This
keeps us from short-circuiting evaluation in places where we
shouldn't, and lets us properly implement C++0x [temp.type]p2.
In theory, this would also allow us to properly mangle
instantiation-dependent-but-not-dependent decltype types per the
Itanium C++ ABI, but we aren't quite there because we still mangle
based on the canonical type in cases like, e.g.,
template<unsigned> struct A { };
template<typename T>
void f(A<sizeof(sizeof(decltype(T() + T())))>) { }
template void f<int>(A<sizeof(sizeof(int))>);
and therefore get the wrong answer.
llvm-svn: 134225
|
| |
|
|
|
|
|
| |
that serve as the base template name of an unresolved-name to
be mangled as a substitution.
llvm-svn: 134213
|
| |
|
|
| |
llvm-svn: 134195
|
| |
|
|
|
|
| |
This fixes PR10223.
llvm-svn: 134183
|
| |
|
|
| |
llvm-svn: 134139
|
| |
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
TemplateSpecializationType.
llvm-svn: 134120
|
| |
|
|
|
|
|
| |
a vector for collection. Use iterators where needed instead.
// rdar://6817577
llvm-svn: 134015
|
| |
|
|
| |
llvm-svn: 134011
|
| |
|
|
|
|
| |
aren't completely off, roughly a 1% speedup on SingleSource/UnitTests/ObjC/trivial-interface.m .
llvm-svn: 133968
|
| |
|
|
|
|
| |
for explicit specializations with their own explicit visibility.
llvm-svn: 133958
|
| |
|
|
|
|
|
|
| |
'ownership', not 'lifetime'.
rdar://9477613.
llvm-svn: 133779
|
| |
|
|
|
|
|
|
| |
works in a 'while(false)' loop. Simplify this code; it was
complicated only in anticipation of C++0x lambdas, and it can
become complicated again when those happen. :)
llvm-svn: 133761
|
| |
|
|
|
|
| |
to its header to avoid an explicit instantiation.
llvm-svn: 133753
|
| |
|
|
| |
llvm-svn: 133731
|
| |
|
|
|
|
| |
same declaration. Templatize dropAttr for general use.
llvm-svn: 133724
|
| |
|
|
|
|
| |
// rdar://9538608
llvm-svn: 133721
|
| |
|
|
|
|
|
| |
Removes dead code found in the process.
Adds a test to verify that ParenListExprs do not have NULL types.
llvm-svn: 133637
|
| |
|
|
| |
llvm-svn: 133577
|
| |
|
|
|
|
| |
use the unresolved-name production correctly.
llvm-svn: 133554
|
| |
|
|
| |
llvm-svn: 133528
|
| |
|
|
|
|
|
| |
expression of '?:'. Add a test case for this pattern, and also test the
code that led to the crash in a "working" case as well.
llvm-svn: 133523
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
use the deprecated forms of llvm::StringMap::GetOrCreateValue().
llvm-svn: 133515
|
| |
|
|
|
|
|
|
|
|
|
| |
This makes 'isPointerLikeType' a little less confusing, and pulls the
decay check into a separate interface that is much more clear and
concrete. Also, just implement these as logical wrappers around other
predicates. Having a switch based implementation isn't likely to be
necessary. We can try to optimize them later if they show up on
a profile.
llvm-svn: 133405
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Trieu, and fix them by checking for array and function types as well as
pointer types.
I've added a predicate method on Type to bundle together the logic we're
using here: isPointerLikeType(). I'd welcome better names for this
predicate, this is the best I came up with. It's implemented as a switch
to be a touch lighter weight than all the chained isa<...> casts that
would result otherwise.
llvm-svn: 133383
|
| |
|
|
| |
llvm-svn: 133312
|
| |
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ownership-unqualified retainable object type as __strong. This allows
us to write, e.g.,
std::vector<id>
and we'll infer that the vector's element types have __strong
ownership semantics, which is far nicer than requiring:
std::vector<__strong id>
Note that we allow one to override the ownership qualifier of a
substituted template type parameter, e.g., given
template<typename T>
struct X {
typedef __weak T type;
};
X<id> is treated the same as X<__strong id>. At instantiation type,
the __weak in "__weak T" overrides the (inferred or specified)
__strong on the template argument type, so that we can still provide
metaprogramming transformations.
This is part of <rdar://problem/9595486>.
llvm-svn: 133303
|
| |
|
|
|
|
|
|
|
|
|
|
| |
they should still be officially __strong for the purposes of errors,
block capture, etc. Make a new bit on variables, isARCPseudoStrong(),
and set this for 'self' and these enumeration-loop variables. Change
the code that was looking for the old patterns to look for this bit,
and change IR generation to find this bit and treat the resulting
variable as __unsafe_unretained for the purposes of init/destroy in
the two places it can come up.
llvm-svn: 133243
|
| |
|
|
|
|
| |
getLVForNamespaceScopeDecl(). // rdar://9609649
llvm-svn: 133182
|
| |
|
|
|
|
|
|
|
|
|
|
| |
a ConstStmtVisitor. This also required adding some const iteration
support for designated initializers and making some of the getters on
the designators const.
It also made the formatting of StmtProfile.cpp rather awkward. I'm happy
to adjust any of the formatting if folks have suggestions. I've at least
fitted it all within 80 columns.
llvm-svn: 133152
|
| |
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
include a specific variable.
llvm-svn: 133102
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
were just punting on template argument deduction for a number of type
nodes. Most of them, obviously, didn't matter.
As a consequence of this, make extended vector types (via the
ext_vector_type attribute) actually work properly for several
important cases:
- If the attribute appears in a type-id (i.e, not attached to a
typedef), actually build a proper vector type
- Build ExtVectorType whenever the size is constant; previously, we
were building DependentSizedExtVectorType when the size was constant
but the type was dependent, which makes no sense at all.
- Teach template argument deduction to handle
ExtVectorType/DependentSizedExtVectorType.
llvm-svn: 133060
|
| |
|
|
|
|
|
|
|
|
| |
in a noexcept exception specification because it isn't part of the
canonical type. This ensures that we keep the exact expression written
in the noexcept exception specification, rather than accidentally
"adopting" a previously-written and canonically "equivalent" function
prototype. Fixes PR10087.
llvm-svn: 132998
|
| |
|
|
| |
llvm-svn: 132879
|
| |
|
|
| |
llvm-svn: 132878
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Related result types apply Cocoa conventions to the type of message
sends and property accesses to Objective-C methods that are known to
always return objects whose type is the same as the type of the
receiving class (or a subclass thereof), such as +alloc and
-init. This tightens up static type safety for Objective-C, so that we
now diagnose mistakes like this:
t.m:4:10: warning: incompatible pointer types initializing 'NSSet *'
with an
expression of type 'NSArray *' [-Wincompatible-pointer-types]
NSSet *array = [[NSArray alloc] init];
^ ~~~~~~~~~~~~~~~~~~~~~~
/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:72:1:
note:
instance method 'init' is assumed to return an instance of its
receiver
type ('NSArray *')
- (id)init;
^
It also means that we get decent type inference when writing code in
Objective-C++0x:
auto array = [[NSMutableArray alloc] initWithObjects:@"one", @"two",nil];
// ^ now infers NSMutableArray* rather than id
llvm-svn: 132868
|
| |
|
|
|
|
|
|
| |
determine whether the vtable should be externally visible, instead of a rough approximation of it which messes up with templates.
While I'm here, zap the other user of isInAnonymousNamespace outside of Decl.cpp.
llvm-svn: 132861
|
| |
|
|
|
|
| |
// rdar://9566314
llvm-svn: 132791
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a follow-up to r132565, and should address the rest of PR9969:
Warn about cases such as
int foo(A a, bool b) {
return a + b ? 1 : 2; // user probably meant a + (b ? 1 : 2);
}
also when + is an overloaded operator call.
llvm-svn: 132784
|