]> granicus.if.org Git - clang/log
clang
13 years agoReapply r134946 with fixes. Tested on Benjamin testcase and other test-suite failures.
Bruno Cardoso Lopes [Wed, 13 Jul 2011 21:58:55 +0000 (21:58 +0000)]
Reapply r134946 with fixes. Tested on Benjamin testcase and other test-suite failures.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135091 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd 'mutable' to the function declarator chunk, to be used when
Douglas Gregor [Wed, 13 Jul 2011 21:47:47 +0000 (21:47 +0000)]
Add 'mutable' to the function declarator chunk, to be used when
parsing lambda expressions, from John Freeman!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135090 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix an incorrect namespace typo-correction diagnostic, from Kaelyn
Douglas Gregor [Wed, 13 Jul 2011 21:36:26 +0000 (21:36 +0000)]
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

13 years agoEmit debug info for extended vectors.
Devang Patel [Wed, 13 Jul 2011 21:23:30 +0000 (21:23 +0000)]
Emit debug info for extended vectors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135083 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoformat string checking: long and int have the same widths on 32-bit, so we shouldn...
Ted Kremenek [Wed, 13 Jul 2011 20:20:58 +0000 (20:20 +0000)]
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

13 years agoEnforce access control for the destructor in a new[] expression and mark
John McCall [Wed, 13 Jul 2011 20:12:57 +0000 (20:12 +0000)]
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

13 years ago[arcmt] Add weak/unsafe_unretained for "@property (readonly)" when we are @synthesizi...
Argyrios Kyrtzidis [Wed, 13 Jul 2011 19:47:57 +0000 (19:47 +0000)]
[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

13 years ago[arcmt] For properties rewrite 'assign' -> 'weak or unsafe_unretained', 'retain'...
Argyrios Kyrtzidis [Wed, 13 Jul 2011 19:22:00 +0000 (19:22 +0000)]
[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

13 years agoWith -Wselector, don't warn about unimplemented optional method
Fariborz Jahanian [Wed, 13 Jul 2011 19:05:43 +0000 (19:05 +0000)]
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

13 years agoDon't crash if defining -dealloc in a category.
John McCall [Wed, 13 Jul 2011 18:26:47 +0000 (18:26 +0000)]
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

13 years agoIn debugger mode, make ObjC message sends to unknown selectors return
John McCall [Wed, 13 Jul 2011 17:56:40 +0000 (17:56 +0000)]
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

13 years agoobjc++: Some level of covariance is allowed in ObjC properties.
Fariborz Jahanian [Wed, 13 Jul 2011 17:55:01 +0000 (17:55 +0000)]
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

13 years agoRe-relax conversion specifier checking for printf format strings and conversion speci...
Ted Kremenek [Wed, 13 Jul 2011 17:35:14 +0000 (17:35 +0000)]
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

13 years agoFix inversion in argument type checking for format strings with conversion specifiers...
Ted Kremenek [Wed, 13 Jul 2011 17:25:47 +0000 (17:25 +0000)]
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

13 years agoOkay, that rule about zero-length arrays applies to destroying
John McCall [Wed, 13 Jul 2011 08:09:46 +0000 (08:09 +0000)]
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

13 years agoArrays are permitted to be zero-length in some situations.
John McCall [Wed, 13 Jul 2011 07:37:11 +0000 (07:37 +0000)]
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

13 years agoMake the integer-range analysis recognize ^= correctly,
John McCall [Wed, 13 Jul 2011 06:35:24 +0000 (06:35 +0000)]
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

13 years agoConvert the standard default-construction loops to use phis and
John McCall [Wed, 13 Jul 2011 06:10:41 +0000 (06:10 +0000)]
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

13 years agoper john's advice, speculatively lower uses of forward-declared enums to
Chris Lattner [Wed, 13 Jul 2011 05:31:19 +0000 (05:31 +0000)]
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

13 years agoPR10337 reminds me that calls return values, lets handle them just
Chris Lattner [Wed, 13 Jul 2011 03:59:32 +0000 (03:59 +0000)]
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

13 years agoAggressive dead code elimination.
John McCall [Wed, 13 Jul 2011 03:03:51 +0000 (03:03 +0000)]
Aggressive dead code elimination.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135029 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoGeneralize the routine for destroying an object with static
John McCall [Wed, 13 Jul 2011 03:01:35 +0000 (03:01 +0000)]
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

13 years agoEliminate an incomplete/incorrect attempt to provide support for C++0x
Douglas Gregor [Wed, 13 Jul 2011 02:14:02 +0000 (02:14 +0000)]
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

13 years agoSilliness with commas, as reported at http://blog.regehr.org/archives/558 . As it...
Eli Friedman [Wed, 13 Jul 2011 02:05:57 +0000 (02:05 +0000)]
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

13 years agoSwitch delete[] IR-generation over to the destroy framework,
John McCall [Wed, 13 Jul 2011 01:41:37 +0000 (01:41 +0000)]
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

13 years agoWhen compiling ::delete for a class with a virtual destructor, call
Douglas Gregor [Wed, 13 Jul 2011 00:54:47 +0000 (00:54 +0000)]
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

13 years agoCorrectly set up the list of virtual base classes for a CXXRecordDecl. Previously...
Richard Smith [Tue, 12 Jul 2011 23:49:11 +0000 (23:49 +0000)]
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

13 years agorevert fix for // rdar://9740328
Fariborz Jahanian [Tue, 12 Jul 2011 23:20:13 +0000 (23:20 +0000)]
revert fix for // rdar://9740328

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135010 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRevert r134946
Bruno Cardoso Lopes [Tue, 12 Jul 2011 22:30:58 +0000 (22:30 +0000)]
Revert r134946

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135004 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[arcmt] Also avoid 'weak' for forward references to objc classes.
Argyrios Kyrtzidis [Tue, 12 Jul 2011 22:16:25 +0000 (22:16 +0000)]
[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

13 years ago[arcmt] Before applying '__weak' check whether the objc class is annotated with objc_...
Argyrios Kyrtzidis [Tue, 12 Jul 2011 22:05:17 +0000 (22:05 +0000)]
[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

13 years agoobjc++: Some level of covariance is allowed in ObjC properties.
Fariborz Jahanian [Tue, 12 Jul 2011 22:05:16 +0000 (22:05 +0000)]
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

13 years agoFix another typo (int -> id for captured_obj).
David Chisnall [Tue, 12 Jul 2011 20:34:06 +0000 (20:34 +0000)]
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

13 years agoGeneralize Cleanup::Emit's "isForEH" parameter into a set
John McCall [Tue, 12 Jul 2011 20:27:29 +0000 (20:27 +0000)]
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

13 years agoImplement -MG. Fixes PR9613
Peter Collingbourne [Tue, 12 Jul 2011 19:35:15 +0000 (19:35 +0000)]
Implement -MG.  Fixes PR9613

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134996 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd more compiler workarounds. Should fix the build with old GCCs and MSVC.
Benjamin Kramer [Tue, 12 Jul 2011 18:37:23 +0000 (18:37 +0000)]
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

13 years agoIn ARC mode, consider Objective-C lifetime types (object pointers and
Douglas Gregor [Tue, 12 Jul 2011 17:28:52 +0000 (17:28 +0000)]
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

13 years agoFix a bug where a local variable named 'self' is causing
Fariborz Jahanian [Tue, 12 Jul 2011 17:16:56 +0000 (17:16 +0000)]
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

13 years agoUgh, use this compiler workaround again.
John McCall [Tue, 12 Jul 2011 16:53:04 +0000 (16:53 +0000)]
Ugh, use this compiler workaround again.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134989 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoSwitch field destruction over to use the new destroyer-based API
John McCall [Tue, 12 Jul 2011 16:41:08 +0000 (16:41 +0000)]
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

13 years agoImprove name mangling for instantiation-dependent types that are not
Douglas Gregor [Tue, 12 Jul 2011 15:18:55 +0000 (15:18 +0000)]
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

13 years agoPop block scope after reading from it.
Benjamin Kramer [Tue, 12 Jul 2011 14:11:05 +0000 (14:11 +0000)]
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

13 years agoSecond attempt at de-constifying LLVM Types in FunctionType::get(),
Jay Foad [Tue, 12 Jul 2011 14:06:48 +0000 (14:06 +0000)]
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

13 years agoWork around a problem with a static helper's formulation in release
Chandler Carruth [Tue, 12 Jul 2011 08:58:26 +0000 (08:58 +0000)]
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

13 years agoFix typo correction crash on overloaded functions, pr10283.
Hans Wennborg [Tue, 12 Jul 2011 08:45:31 +0000 (08:45 +0000)]
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

13 years agoImplement name mangling for sizeof...(function parameter pack).
Douglas Gregor [Tue, 12 Jul 2011 07:03:48 +0000 (07:03 +0000)]
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

13 years agoFix the desugaring of dependent decltype and typeof(expr) nodes. The
Douglas Gregor [Tue, 12 Jul 2011 06:55:29 +0000 (06:55 +0000)]
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

13 years agoFix a problem Eli ran into where we now reject incomplete arrays of
Chris Lattner [Tue, 12 Jul 2011 06:52:18 +0000 (06:52 +0000)]
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

13 years agoinsert a bitcast in the 'expand' case of argument passing when needed. This
Chris Lattner [Tue, 12 Jul 2011 06:29:11 +0000 (06:29 +0000)]
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

13 years agofix an unintended behavior change in the type system rewrite, which caused us to...
Chris Lattner [Tue, 12 Jul 2011 05:53:08 +0000 (05:53 +0000)]
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

13 years agoMangle dependent template names of unknown arity
Douglas Gregor [Tue, 12 Jul 2011 05:06:05 +0000 (05:06 +0000)]
Mangle dependent template names of unknown arity

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134967 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agofix PR10335 by watching out for IR type compatibility in call argument lists.
Chris Lattner [Tue, 12 Jul 2011 04:53:39 +0000 (04:53 +0000)]
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

13 years agoMove OBJC_PR_NumBits out of PropertyAttributeKind enum, to its own NumPropertyAttrsBits.
Argyrios Kyrtzidis [Tue, 12 Jul 2011 04:52:08 +0000 (04:52 +0000)]
Move OBJC_PR_NumBits out of PropertyAttributeKind enum, to its own NumPropertyAttrsBits.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134965 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agomake test name less specific
Chris Lattner [Tue, 12 Jul 2011 04:51:05 +0000 (04:51 +0000)]
make test name less specific

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134964 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoImplement the Itanium C++ ABI's mangling rule for
Douglas Gregor [Tue, 12 Jul 2011 04:47:20 +0000 (04:47 +0000)]
Implement the Itanium C++ ABI's mangling rule for
non-instantiation-dependent sizeof and alignof expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134963 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoadd some aggressive assertions that call arguments match up to callee
Chris Lattner [Tue, 12 Jul 2011 04:46:18 +0000 (04:46 +0000)]
add some aggressive assertions that call arguments match up to callee
expectations in EmitCall.  Next patch will take this further.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134962 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCentralize the getCanonicalType() calls in the Itanium C++ mangling
Douglas Gregor [Tue, 12 Jul 2011 04:42:08 +0000 (04:42 +0000)]
Centralize the getCanonicalType() calls in the Itanium C++ mangling
code so that they only occur in a single place. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134961 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[ARC] Complain about property without storage attribute when @synthesizing it, not...
Argyrios Kyrtzidis [Tue, 12 Jul 2011 04:30:16 +0000 (04:30 +0000)]
[ARC] Complain about property without storage attribute when @synthesizing it, not at its declaration.

For this sample:

@interface Foo
@property id x;
@end

we get:

t.m:2:1: error: ARC forbids properties of Objective-C objects with unspecified storage attribute
@property  id x;
^
1 error generated.

The error should be imposed on the implementor of the interface, not the user. If the user uses
a header of a non-ARC library whose source code he does not have, we are basically asking him to
go change the header of the library (bad in general), possible overriding how the property is
implemented if he gets confused and says "Oh I'll just add 'copy' then" (even worse).

Second issue is that we don't emit any error for 'readonly' properties, e.g:

@interface Foo
@property (readonly) id x; // no error  here
@end

@implementation Foo
@synthesize x; // no error here too
@end

We should give an error when the implementor is @synthesizing a property which doesn't have
any storage specifier; this is when the explicit specifier is important, because we are
going to create an ivar and we want its ownership to be explicit.

Related improvements:
-OBJC_PR_unsafe_unretained turned out to not fit in ObjCPropertyDecl's bitfields, fix it.
-For properties of extension classes don't drop PropertyAttributesAsWritten values.
-Have PropertyAttributesAsWritten actually only reflect what the user wrote

rdar://9756610.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134960 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix a typo!
Bruno Cardoso Lopes [Tue, 12 Jul 2011 02:47:38 +0000 (02:47 +0000)]
Fix a typo!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134952 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDo the same as r134946 for arrays. Add more testcases for avx x86_64 arg
Bruno Cardoso Lopes [Tue, 12 Jul 2011 01:27:38 +0000 (01:27 +0000)]
Do the same as r134946 for arrays. Add more testcases for avx x86_64 arg
passing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134951 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRevert r134888 (and related patches in other trees). It was causing
Bill Wendling [Tue, 12 Jul 2011 01:16:47 +0000 (01:16 +0000)]
Revert r134888 (and related patches in other trees). It was causing
an assert on Darwin llvm-gcc builds.

Assertion failed: (castIsValid(op, S, Ty) && "Invalid cast!"), function Create, file /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.llvm-gcc-i386-darwin9-RA/llvm.src/lib/VMCore/Instructions.cpp, line 2067.
etc.

http://smooshlab.apple.com:8013/builders/llvm-gcc-i386-darwin9-RA/builds/2354

--- Reverse-merging r134888 into '.':
U    lib/CodeGen/CodeGenModule.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134950 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix one x86_64 abi issue and the test to actually look for the right thing,
Bruno Cardoso Lopes [Tue, 12 Jul 2011 00:30:27 +0000 (00:30 +0000)]
Fix one x86_64 abi issue and the test to actually look for the right thing,
which is: { <4 x float>, <4 x float> } should continue to go through memory.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134946 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDo full-expression cleanups in a much more sensible way that still lets
John McCall [Tue, 12 Jul 2011 00:15:30 +0000 (00:15 +0000)]
Do full-expression cleanups in a much more sensible way that still lets
people write useful cleanup classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134942 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDisable avx feature from corei7-avx, and use -mavx for now. Right now, if -mavx is
Bruno Cardoso Lopes [Mon, 11 Jul 2011 23:33:46 +0000 (23:33 +0000)]
Disable avx feature from corei7-avx, and use -mavx for now. Right now, if -mavx is
specified, 128 avx code is used and we're not sure yet if this the behavior
we want (and if it does, some improvements are needed before relying on it).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134939 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoStyle tweak to the more idiomatic 'assert(!bad_state())'.
Chandler Carruth [Mon, 11 Jul 2011 23:33:05 +0000 (23:33 +0000)]
Style tweak to the more idiomatic 'assert(!bad_state())'.

Patch by Caitlin Sadowski.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134938 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoHoist the logic for checking the number of arguments to an attribute
Chandler Carruth [Mon, 11 Jul 2011 23:30:35 +0000 (23:30 +0000)]
Hoist the logic for checking the number of arguments to an attribute
into a static helper.

Original patch by Caitlin Sadowski, style tweaks by me.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134937 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoEnable "avx" feature, so it can be seen by llvm
Bruno Cardoso Lopes [Mon, 11 Jul 2011 22:50:13 +0000 (22:50 +0000)]
Enable "avx" feature, so it can be seen by llvm

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134935 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoReapply r134754, which turns out to be working correctly and also
Bruno Cardoso Lopes [Mon, 11 Jul 2011 22:41:29 +0000 (22:41 +0000)]
Reapply r134754, which turns out to be working correctly and also
add one more testcase.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134934 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAllow us to compute linkage et al for instantiation-dependent types.
Douglas Gregor [Mon, 11 Jul 2011 22:38:07 +0000 (22:38 +0000)]
Allow us to compute linkage et al for instantiation-dependent types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134932 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoRevert r134898, "test/Frontend/dependency-gen.c: Mark XFAIL: mingw due to PR10331...
NAKAMURA Takumi [Mon, 11 Jul 2011 22:34:14 +0000 (22:34 +0000)]
Revert r134898, "test/Frontend/dependency-gen.c: Mark XFAIL: mingw due to PR10331. to appease mingw-target (and non-mingw-host) builds.

PR10331 is still alive I suppose.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134931 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoReenable test.
Argyrios Kyrtzidis [Mon, 11 Jul 2011 21:58:47 +0000 (21:58 +0000)]
Reenable test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134928 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd missing header file for the test.
Argyrios Kyrtzidis [Mon, 11 Jul 2011 21:58:44 +0000 (21:58 +0000)]
Add missing header file for the test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134927 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdd diagnostic for constructs like "va_arg(l, float)" which have undefined behavior...
Eli Friedman [Mon, 11 Jul 2011 21:45:59 +0000 (21:45 +0000)]
Add diagnostic for constructs like "va_arg(l, float)" which have undefined behavior. PR10201.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134926 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTest is broken; XFAIL it until Argyrios gets a chance to look at it.
Eli Friedman [Mon, 11 Jul 2011 21:44:14 +0000 (21:44 +0000)]
Test is broken; XFAIL it until Argyrios gets a chance to look at it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134925 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDon't warn for unused macro when undef'ing it, if it comes from an included file...
Argyrios Kyrtzidis [Mon, 11 Jul 2011 20:39:47 +0000 (20:39 +0000)]
Don't warn for unused macro when undef'ing it, if it comes from an included file. rdar://9745065

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134919 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix CMake.
Argyrios Kyrtzidis [Mon, 11 Jul 2011 20:28:59 +0000 (20:28 +0000)]
Fix CMake.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134918 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[arcmt] Move the remapping functions to clang-c/Index.h and change 'arcmt_' prefix...
Argyrios Kyrtzidis [Mon, 11 Jul 2011 20:15:00 +0000 (20:15 +0000)]
[arcmt] Move the remapping functions to clang-c/Index.h and change 'arcmt_' prefix to 'clang_'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134916 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoEmit partial destruction of structs with initializer lists.
John McCall [Mon, 11 Jul 2011 19:35:02 +0000 (19:35 +0000)]
Emit partial destruction of structs with initializer lists.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134913 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoobjc-arc: Diagnose when captured variable in block literals
Fariborz Jahanian [Mon, 11 Jul 2011 18:04:54 +0000 (18:04 +0000)]
objc-arc: Diagnose when captured variable in block literals
require destruction and there is possibility of that without
construction. Thanks Johnm for review and suggestions offline.
// rdar://9535237.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134906 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoApply patch from Richard Trieu to fix PR9548:
Chandler Carruth [Mon, 11 Jul 2011 17:49:21 +0000 (17:49 +0000)]
Apply patch from Richard Trieu to fix PR9548:

When two different types has the same text representation in the same
diagnostic message, print an a.k.a. after the type if the a.k.a. gives extra
information about the type.

class versa_string;

typedef versa_string string;

namespace std {template <typename T> class vector;}

using std::vector;

void f(vector<string> v);

namespace std {
class basic_string;
typedef basic_string string;
template <typename T> class vector {};
void g() {
  vector<string> v;
  f(v);
}
}

Old message:
----------------
test.cc:15:3: error: no matching function for call to 'f'
  f(&v);
  ^
test.cc:7:6: note: candidate function not viable: no known conversion from
      'vector<string>' to 'vector<string>' for 1st argument
void f(vector<string> v);
     ^
1 error generated.

New message:
---------------
test.cc:15:3: error: no matching function for call to 'f'
  f(v);
  ^
test.cc:7:6: note: candidate function not viable: no known conversion from
      'vector<string>' (aka 'std::vector<std::basic_string>') to
      'vector<string>' (aka 'std::vector<versa_string>') for 1st argument
void f(vector<string> v);
     ^
1 error generated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134904 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoTweak two tests with MSYS-bash tolerant.
NAKAMURA Takumi [Mon, 11 Jul 2011 16:21:34 +0000 (16:21 +0000)]
Tweak two tests with MSYS-bash tolerant.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134899 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agotest/Frontend/dependency-gen.c: Mark XFAIL: mingw due to PR10331.
NAKAMURA Takumi [Mon, 11 Jul 2011 16:21:28 +0000 (16:21 +0000)]
test/Frontend/dependency-gen.c: Mark XFAIL: mingw due to PR10331.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134898 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDon't complain about missing return statements for naked
Douglas Gregor [Mon, 11 Jul 2011 15:24:01 +0000 (15:24 +0000)]
Don't complain about missing return statements for naked
functions. Fixes <rdar://problem/9731999>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134897 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agotest/Preprocessor/include-directive2.c: Get rid of using <float.h> to avoid #include_...
NAKAMURA Takumi [Mon, 11 Jul 2011 14:53:27 +0000 (14:53 +0000)]
test/Preprocessor/include-directive2.c: Get rid of using <float.h> to avoid #include_next on mingw.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134896 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDe-constify Types in StructType::get() and TargetData::getIntPtrType().
Jay Foad [Mon, 11 Jul 2011 09:56:20 +0000 (09:56 +0000)]
De-constify Types in StructType::get() and TargetData::getIntPtrType().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134893 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFixed PR10243.
Abramo Bagnara [Mon, 11 Jul 2011 08:52:40 +0000 (08:52 +0000)]
Fixed PR10243.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134892 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoAdded removeBitWidth method.
Abramo Bagnara [Mon, 11 Jul 2011 08:43:20 +0000 (08:43 +0000)]
Added removeBitWidth method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134891 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix a lot of problems with the partial destruction of arrays:
John McCall [Mon, 11 Jul 2011 08:38:19 +0000 (08:38 +0000)]
Fix a lot of problems with the partial destruction of arrays:
 - an off-by-one error in emission of irregular array limits for
   InitListExprs
 - use an EH partial-destruction cleanup within the normal
   array-destruction cleanup
 - get the branch destinations right for the empty check
Also some refactoring which unfortunately obscures these changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134890 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoDe-constify Types in FunctionType::get().
Jay Foad [Mon, 11 Jul 2011 07:56:41 +0000 (07:56 +0000)]
De-constify Types in FunctionType::get().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134888 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoMatch createCodeEmitter change.
Evan Cheng [Mon, 11 Jul 2011 04:24:19 +0000 (04:24 +0000)]
Match createCodeEmitter change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134885 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUse cached types; no functionality change.
John McCall [Sun, 10 Jul 2011 20:11:30 +0000 (20:11 +0000)]
Use cached types;  no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134880 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoFix ARCMT/migrate.m on MSVC.
Francois Pichet [Sun, 10 Jul 2011 19:48:34 +0000 (19:48 +0000)]
Fix ARCMT/migrate.m on MSVC.
Solution is to set output stdout to binary mode to prevent newline conversion (\n => \r\n).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134879 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoUnbreak -cc1as mode after MC subtarget changes
Joerg Sonnenberger [Sun, 10 Jul 2011 19:16:25 +0000 (19:16 +0000)]
Unbreak -cc1as mode after MC subtarget changes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134877 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[arcmt] Remove redundant has_error() check.
Argyrios Kyrtzidis [Sun, 10 Jul 2011 18:57:18 +0000 (18:57 +0000)]
[arcmt] Remove redundant has_error() check.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134876 91177308-0d34-0410-b5e6-96231b3b80d8

13 years ago[arcmt] Try fixing test/ARCMT/migrate.m for windows hosts.
Argyrios Kyrtzidis [Sun, 10 Jul 2011 18:57:15 +0000 (18:57 +0000)]
[arcmt] Try fixing test/ARCMT/migrate.m for windows hosts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134875 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agotest/CMakeLists.txt: clang-test may depend on llc when LLVM is built together.
NAKAMURA Takumi [Sun, 10 Jul 2011 17:45:28 +0000 (17:45 +0000)]
test/CMakeLists.txt: clang-test may depend on llc when LLVM is built together.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134874 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agotest/CMakeLists.txt: Fix ClangUnitTests to be built with clang-test and check-all.
NAKAMURA Takumi [Sun, 10 Jul 2011 17:45:23 +0000 (17:45 +0000)]
test/CMakeLists.txt: Fix ClangUnitTests to be built with clang-test and check-all.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134873 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agotools/c-arcmt-test/Makefile: Add clangARCMigrate.a clangRewrite.a to USEDLIBS to...
NAKAMURA Takumi [Sun, 10 Jul 2011 15:50:19 +0000 (15:50 +0000)]
tools/c-arcmt-test/Makefile: Add clangARCMigrate.a clangRewrite.a to USEDLIBS to satisfy linking on cygming.

FIXME: tools/c-*.exe should be linked to clang.dll on cygming. llvm/Makefile.rules is not aware of bin/clang.dll.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134871 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agorelax this test a bit to hopefully work with VC++
Chris Lattner [Sun, 10 Jul 2011 14:52:52 +0000 (14:52 +0000)]
relax this test a bit to hopefully work with VC++

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134870 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoChange __debugbreak signature to void __debugbreak(void); MSVC compatibility.
Francois Pichet [Sun, 10 Jul 2011 14:15:07 +0000 (14:15 +0000)]
Change __debugbreak signature to void __debugbreak(void); MSVC compatibility.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134869 91177308-0d34-0410-b5e6-96231b3b80d8