Граф коммитов

30006 Коммитов

Автор SHA1 Сообщение Дата
Douglas Gregor 1255aaf102 Fix an incorrect namespace typo-correction diagnostic, from Kaelyn
Uhrain! Fixes PR10318.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135086 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 21:36:26 +00:00
Devang Patel d15608e986 Emit debug info for extended vectors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135083 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 21:23:30 +00:00
Ted Kremenek 8da9316c5a format string checking: long and int have the same widths on 32-bit, so we shouldn't warn about using
an "int" format specifier with a "long" type in 32-bit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135075 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 20:20:58 +00:00
John McCall 84ff0fccb1 Enforce access control for the destructor in a new[] expression and mark
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
2011-07-13 20:12:57 +00:00
Argyrios Kyrtzidis 968860904a [arcmt] Add weak/unsafe_unretained for "@property (readonly)" when we are @synthesizing it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135067 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 19:47:57 +00:00
Argyrios Kyrtzidis 14c4b4405f [arcmt] For properties rewrite 'assign' -> 'weak or unsafe_unretained', 'retain' -> 'strong', and add
'weak or unsafe_unretained' when 'assign' is missing. rdar://9496219&9602589.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135065 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 19:22:00 +00:00
Fariborz Jahanian 4c91d89453 With -Wselector, don't warn about unimplemented optional method
used in @selector expression because, well, their implementation 
is optional. // rdar://9545564


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135057 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 19:05:43 +00:00
John McCall 799d34e950 Don't crash if defining -dealloc in a category.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135054 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 18:26:47 +00:00
John McCall 48218c60d6 In debugger mode, make ObjC message sends to unknown selectors return
__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
2011-07-13 17:56:40 +00:00
Fariborz Jahanian 8beb6a2426 objc++: Some level of covariance is allowed in ObjC properties.
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
2011-07-13 17:55:01 +00:00
Ted Kremenek dc00d8158d Re-relax conversion specifier checking for printf format strings and conversion specifiers. My recent change was a mistake.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135048 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 17:35:14 +00:00
Ted Kremenek 45eb7022ff Fix inversion in argument type checking for format strings with conversion specifiers for character types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135046 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 17:25:47 +00:00
John McCall fbf780a9d1 Okay, that rule about zero-length arrays applies to destroying
them, too.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135038 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 08:09:46 +00:00
John McCall dd376cae98 Arrays are permitted to be zero-length in some situations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135036 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 07:37:11 +00:00
John McCall 862ff87c0d Make the integer-range analysis recognize ^= correctly,
and (while I'm at it) teach it to grok the results of simple
assignments.

The first is PR10336.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135034 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 06:35:24 +00:00
John McCall c3c0766277 Convert the standard default-construction loops to use phis and
partial destruction.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135033 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 06:10:41 +00:00
Chris Lattner 2045b2dd6a per john's advice, speculatively lower uses of forward-declared enums to
i32.  They almost always end up this way in the end anyway, and if we get
lucky, this avoids generating some bitcasts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135032 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 05:31:19 +00:00
Chris Lattner 6af13f3a35 PR10337 reminds me that calls return values, lets handle them just
like arguments.  Thanks PR10337! :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135030 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 03:59:32 +00:00
John McCall 8f62992730 Aggressive dead code elimination.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135029 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 03:03:51 +00:00
John McCall a91f6661c4 Generalize the routine for destroying an object with static
storage duration, then explicitly exempt ownership-qualified
types from it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135028 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 03:01:35 +00:00
Douglas Gregor e7003b72e6 Eliminate an incomplete/incorrect attempt to provide support for C++0x
unrestricted unions, which ended up attempting to initialize objects
in a union (which CodeGen isn't prepared for). Fixes PR9683.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135027 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 02:14:02 +00:00
Eli Friedman 42068e9d42 Silliness with commas, as reported at http://blog.regehr.org/archives/558 . As it turns out, this is my fault for not noticing this was an issue when I was looking at this a long time ago. :(
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135026 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 02:05:57 +00:00
John McCall 7cfd76cb5c Switch delete[] IR-generation over to the destroy framework,
which implicitly makes it EH-safe as well.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135025 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 01:41:37 +00:00
Douglas Gregor a8b20f70d5 When compiling ::delete for a class with a virtual destructor, call
the complete destructor and then invoke the global delete
operator. Previously, we would invoke the deleting destructor, which
calls the wrong delete operator. Fixes PR10341.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135021 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-13 00:54:47 +00:00
Richard Smith 9f8ee2ea0a Correctly set up the list of virtual base classes for a CXXRecordDecl. Previously we got the source range wrong for everything in the virtual bases list.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135011 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 23:49:11 +00:00
Fariborz Jahanian 82378391df revert fix for // rdar://9740328
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135010 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 23:20:13 +00:00
Bruno Cardoso Lopes 548e478b8b Revert r134946
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135004 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 22:30:58 +00:00
Argyrios Kyrtzidis 5363e8df5d [arcmt] Also avoid 'weak' for forward references to objc classes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135003 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 22:16:25 +00:00
Argyrios Kyrtzidis 86625b5650 [arcmt] Before applying '__weak' check whether the objc class is annotated with objc_arc_weak_reference_unavailable
or is in a list of classes not supporting 'weak'.

rdar://9489367.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135002 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 22:05:17 +00:00
Fariborz Jahanian c286f3835e objc++: Some level of covariance is allowed in ObjC properties.
Make it also available in ObjC++ propeties. // rdar://9740328


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135001 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 22:05:16 +00:00
David Chisnall c51af6ce4c Fix another typo (int -> id for captured_obj).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134998 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 20:34:06 +00:00
John McCall ad346f4f67 Generalize Cleanup::Emit's "isForEH" parameter into a set
of flags.  No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134997 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 20:27:29 +00:00
Peter Collingbourne bb52786da8 Implement -MG. Fixes PR9613
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134996 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 19:35:15 +00:00
Benjamin Kramer 0d516767a3 Add more compiler workarounds. Should fix the build with old GCCs and MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134995 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 18:37:23 +00:00
Douglas Gregor f96e904783 In ARC mode, consider Objective-C lifetime types (object pointers and
block pointers) that don't have any qualification to be POD types. We
were previously considering them to be non-POD types, because this was
convenient in C++ for is_pod-like traits. However, we now end up
inferring lifetime in such cases (template arguments infer __strong),
so it is not necessary.

Moreover, we want rvalues of object type (which have their lifetime
stripped) to be PODs to allow, e.g., va_arg(arglist, id) to function
properly. Fixes <rdar://problem/9758798>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134993 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 17:28:52 +00:00
Fariborz Jahanian 98a5403ecf Fix a bug where a local variable named 'self' is causing
implicit ivar accesses to go through the 'self' variable
rather than the real 'self' for the method. // rdar://9730771


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134992 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 17:16:56 +00:00
John McCall 5bcd95efc3 Ugh, use this compiler workaround again.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134989 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 16:53:04 +00:00
John McCall 9928c4805a Switch field destruction over to use the new destroyer-based API
and kill a lot of redundant code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134988 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 16:41:08 +00:00
Douglas Gregor f1588660c1 Improve name mangling for instantiation-dependent types that are not
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>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134984 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 15:18:55 +00:00
Benjamin Kramer d248619cd1 Pop block scope after reading from it.
Found by valgrind.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134983 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 14:11:05 +00:00
Jay Foad df983a8bcb Second attempt at de-constifying LLVM Types in FunctionType::get(),
StructType::get() and TargetData::getIntPtrType().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134982 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 14:06:48 +00:00
Chandler Carruth a98742c32c Work around a problem with a static helper's formulation in release
builds introduced in r134972:

lib/CodeGen/CGExpr.cpp:1294:7: error: no matching function for call to 'EmitBitCastOfLValueToProperType'
lib/CodeGen/CGExpr.cpp:1278:1: note: candidate function not viable: no known conversion from 'CGBuilderTy' (aka 'IRBuilder<false>') to 'llvm::IRBuilder<> &' for 1st argument

This fixes the issue by passing CodeGenFunction on down, and using its
builder directly rather than passing just the builder down.

This may not be the best / cleanest fix, Chris please review. It at
least fixes builds.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134977 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 08:58:26 +00:00
Hans Wennborg 701d1e77ac Fix typo correction crash on overloaded functions, pr10283.
It would be cool if we could do overload resolution to suggest
the right function, but at least this fixes the crashing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134976 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 08:45:31 +00:00
Douglas Gregor 91832368ef Implement name mangling for sizeof...(function parameter pack).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134974 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 07:03:48 +00:00
Douglas Gregor 6af9f3ca25 Fix the desugaring of dependent decltype and typeof(expr) nodes. The
isSugared() and desugar() routines previously provided were never
actually called, since the corresponding types
(DependentTypeOfExprType, DependentDecltypeType) don't have
corresponding type classes. Outside of the current (incomplete) patch
I'm working on, I haven't found a way to trigger this problem.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134973 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 06:55:29 +00:00
Chris Lattner 3a2b657088 Fix a problem Eli ran into where we now reject incomplete arrays of
uncompleted struct types.  We now do what llvm-gcc does and compile
them into [i8 x 0].  If the type is later completed, we make sure that
it is appropriately cast.

We compile the terrible example to something like this now:

%struct.A = type { i32, i32, i32 }

@g = external global [0 x i8]

define void @_Z1fv() nounwind {
entry:
  call void @_Z3fooP1A(%struct.A* bitcast ([0 x i8]* @g to %struct.A*))
  ret void
}

declare void @_Z3fooP1A(%struct.A*)

define %struct.A* @_Z2f2v() nounwind {
entry:
  ret %struct.A* getelementptr inbounds ([0 x %struct.A]* bitcast ([0 x i8]* @g to [0 x %struct.A]*), i32 0, i64 1)
}





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134972 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 06:52:18 +00:00
Chris Lattner 811bf3669f insert a bitcast in the 'expand' case of argument passing when needed. This
fixes the -m32 build of oggenc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134971 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 06:29:11 +00:00
Chris Lattner cd87d1e4d1 fix an unintended behavior change in the type system rewrite, which caused us to compile
stuff like this:

typedef struct {
 int x, y, z; 
} foo_t;

foo_t g;

into:
%"struct.<anonymous>" = type { i32, i32, i32 }
we now get:
%struct.foo_t = type { i32, i32, i32 }

This doesn't change the behavior of the compiler, but makes the IR much easier to read.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134969 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 05:53:08 +00:00
Douglas Gregor 1961791626 Mangle dependent template names of unknown arity
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134967 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 05:06:05 +00:00
Chris Lattner 21ca1fdb25 fix PR10335 by watching out for IR type compatibility in call argument lists.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134966 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-12 04:53:39 +00:00