add __attribute__((objc_precise_lifetime)) to make sure that the object
(and its data) will not get released before the var goes out-of-scope.
rdar://9206226
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135382 91177308-0d34-0410-b5e6-96231b3b80d8
patch, we actually move the state-machine for the value set backwards
one step. This can pretty easily lead to infinite loops where we
continually try to propagate a bit, succeed for one iteration, but then
back up because we find an uninitialized use.
A reduced test case from PR10379 is included.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135359 91177308-0d34-0410-b5e6-96231b3b80d8
that, after migration, the object that was passed to 'setDelegate:' will not be properly retained, e.g:
-whatever {
id x = [[MyDoHicky alloc] init];
[someivar setDelegate: x]; // x won't get retained in ARC.
}
-dealloc {
[[someivar delegate] release]; // give migration error here.
}
rdar://8858009
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135327 91177308-0d34-0410-b5e6-96231b3b80d8
id x = ...
@try {
...
} @finally {
[x release];
}
Migrator will drop the release. It's better to change it to "x = 0" in a @finally to avoid leak when exception is thrown.
rdar://9398256
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135301 91177308-0d34-0410-b5e6-96231b3b80d8
which is required given the current setup for template
argument deduction substitution validation, and add a test
case to make sure we don't break it in the future.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135262 91177308-0d34-0410-b5e6-96231b3b80d8
types. Fore xample, we used to lower:
struct bar { int a; };
struct foo {
void (*FP)(struct bar);
} G;
to:
%struct.foo = type { {}* }
since the function pointer would cause recursive translation of bar and
we didn't know if that would get us into trouble. We are now smart enough
to know that it is fine, so we get this type instead:
%struct.foo = type { void (i32)* }
Codegen still needs to be prepared for uncooperative types at any place,
which is why I let the maximally uncooperative code sit around for awhile to
help shake out the bugs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135244 91177308-0d34-0410-b5e6-96231b3b80d8
template<unsigned int A, unsigned int B> struct S {
int foo() {
int x = A && B;
}
}
will not warn on A && B on every instantiation. This will still warn on other cases inside templates, which will be caught on checking the template definition.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135222 91177308-0d34-0410-b5e6-96231b3b80d8
Revert "For C++11, do more checking of initializer lists up-front, enabling some subset of the final functionality. C just leaves the function early. C++98 runs through the same code path, but has no changed functionality either."
This reverts commit ac420c5053.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135210 91177308-0d34-0410-b5e6-96231b3b80d8
template<typename T> struct S { } f() { return 0; }
This case now produces a missing ';' diagnostic, since that seems like a much more likely error than an attempt to declare a function or variable in addition to the class template.
Treat this
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135195 91177308-0d34-0410-b5e6-96231b3b80d8
An unused autorelease is badness. If we remove it the receiver
will likely die immediately while previously it was kept alive
by the autorelease pool. This is bad practice in general, so leave it
and emit an error to force the user to restructure his code.
rdar://9599884
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135193 91177308-0d34-0410-b5e6-96231b3b80d8
This is a first baby step towards supporting generalized initializer lists. This also removes an aggregate
test case that was just plain wrong, assuming that non-aggregates couldn't be initialized with initializer lists
in C++11 mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135177 91177308-0d34-0410-b5e6-96231b3b80d8
MacroInstantiation -> MacroExpansion rename. Internally, everything is
switched.
Introduce a new cursor kind enum with the new name, but retain the old
name as an alias so that we don't break backwards compatibility.
Also update the debug printing routine to use 'macro expansions' as its
explicitly not guaranteed to be stable, and mechanically switch the test
cases over to that.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135140 91177308-0d34-0410-b5e6-96231b3b80d8
and 'expansions' rather than 'instantiated' and 'contexts'.
This is the first of several patches migrating Clang's terminology
surrounding macros from 'instantiation' to 'expansion'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135135 91177308-0d34-0410-b5e6-96231b3b80d8
is still terrible here because typo correction is not behaving well in
the presence of overloaded functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135128 91177308-0d34-0410-b5e6-96231b3b80d8
it as used. Otherwise, we can fail to instantiate or validate the destructor,
which can lead to crashes in IR gen like PR10351.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135073 91177308-0d34-0410-b5e6-96231b3b80d8
__unknown_anytype, and rewrite such message sends correctly.
I had to bite the bullet and actually add a debugger support mode for this
one, which is a bit unfortunate, but there really isn't anything else
I could imagine doing; this is clearly just debugger-specific behavior.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135051 91177308-0d34-0410-b5e6-96231b3b80d8
Make it also available in ObjC++ propeties. Use common code for
objc and objc++ so they don't diverge. // rdar://9740328
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135050 91177308-0d34-0410-b5e6-96231b3b80d8