summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Enforce access control for the destructor in a new[] expression and markJohn McCall2011-07-131-1/+11
| | | | | | | it as used. Otherwise, we can fail to instantiate or validate the destructor, which can lead to crashes in IR gen like PR10351. llvm-svn: 135073
* [arcmt] Add weak/unsafe_unretained for "@property (readonly)" when we are ↵Argyrios Kyrtzidis2011-07-131-1/+1
| | | | | | @synthesizing it. llvm-svn: 135067
* [arcmt] For properties rewrite 'assign' -> 'weak or unsafe_unretained', ↵Argyrios Kyrtzidis2011-07-133-135/+239
| | | | | | | | 'retain' -> 'strong', and add 'weak or unsafe_unretained' when 'assign' is missing. rdar://9496219&9602589. llvm-svn: 135065
* With -Wselector, don't warn about unimplemented optional methodFariborz Jahanian2011-07-131-5/+8
| | | | | | | used in @selector expression because, well, their implementation is optional. // rdar://9545564 llvm-svn: 135057
* Don't crash if defining -dealloc in a category.John McCall2011-07-131-3/+5
| | | | llvm-svn: 135054
* In debugger mode, make ObjC message sends to unknown selectors returnJohn McCall2011-07-133-6/+16
| | | | | | | | | | __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. llvm-svn: 135051
* objc++: Some level of covariance is allowed in ObjC properties.Fariborz Jahanian2011-07-131-6/+9
| | | | | | | Make it also available in ObjC++ propeties. Use common code for objc and objc++ so they don't diverge. // rdar://9740328 llvm-svn: 135050
* Re-relax conversion specifier checking for printf format strings and ↵Ted Kremenek2011-07-131-3/+4
| | | | | | conversion specifiers. My recent change was a mistake. llvm-svn: 135048
* Fix inversion in argument type checking for format strings with conversion ↵Ted Kremenek2011-07-131-2/+2
| | | | | | specifiers for character types. llvm-svn: 135046
* Okay, that rule about zero-length arrays applies to destroyingJohn McCall2011-07-133-53/+38
| | | | | | them, too. llvm-svn: 135038
* Arrays are permitted to be zero-length in some situations.John McCall2011-07-132-27/+27
| | | | llvm-svn: 135036
* Make the integer-range analysis recognize ^= correctly,John McCall2011-07-131-2/+11
| | | | | | | | | and (while I'm at it) teach it to grok the results of simple assignments. The first is PR10336. llvm-svn: 135034
* Convert the standard default-construction loops to use phis andJohn McCall2011-07-132-84/+103
| | | | | | partial destruction. llvm-svn: 135033
* per john's advice, speculatively lower uses of forward-declared enums toChris Lattner2011-07-131-5/+12
| | | | | | | i32. They almost always end up this way in the end anyway, and if we get lucky, this avoids generating some bitcasts. llvm-svn: 135032
* PR10337 reminds me that calls return values, lets handle them justChris Lattner2011-07-131-3/+9
| | | | | | like arguments. Thanks PR10337! :) llvm-svn: 135030
* Aggressive dead code elimination.John McCall2011-07-132-80/+0
| | | | llvm-svn: 135029
* Generalize the routine for destroying an object with staticJohn McCall2011-07-132-49/+55
| | | | | | | storage duration, then explicitly exempt ownership-qualified types from it. llvm-svn: 135028
* Eliminate an incomplete/incorrect attempt to provide support for C++0xDouglas Gregor2011-07-131-5/+2
| | | | | | | unrestricted unions, which ended up attempting to initialize objects in a union (which CodeGen isn't prepared for). Fixes PR9683. llvm-svn: 135027
* Silliness with commas, as reported at http://blog.regehr.org/archives/558 . ↵Eli Friedman2011-07-131-1/+5
| | | | | | 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. :( llvm-svn: 135026
* Switch delete[] IR-generation over to the destroy framework,John McCall2011-07-131-78/+38
| | | | | | which implicitly makes it EH-safe as well. llvm-svn: 135025
* When compiling ::delete for a class with a virtual destructor, callDouglas Gregor2011-07-131-4/+19
| | | | | | | | 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. llvm-svn: 135021
* Correctly set up the list of virtual base classes for a CXXRecordDecl. ↵Richard Smith2011-07-121-16/+2
| | | | | | Previously we got the source range wrong for everything in the virtual bases list. llvm-svn: 135011
* revert fix for // rdar://9740328Fariborz Jahanian2011-07-121-1/+1
| | | | llvm-svn: 135010
* Revert r134946Bruno Cardoso Lopes2011-07-121-8/+1
| | | | llvm-svn: 135004
* [arcmt] Also avoid 'weak' for forward references to objc classes.Argyrios Kyrtzidis2011-07-121-0/+2
| | | | llvm-svn: 135003
* [arcmt] Before applying '__weak' check whether the objc class is annotated ↵Argyrios Kyrtzidis2011-07-124-4/+62
| | | | | | | | | | with objc_arc_weak_reference_unavailable or is in a list of classes not supporting 'weak'. rdar://9489367. llvm-svn: 135002
* objc++: Some level of covariance is allowed in ObjC properties.Fariborz Jahanian2011-07-122-1/+5
| | | | | | Make it also available in ObjC++ propeties. // rdar://9740328 llvm-svn: 135001
* Generalize Cleanup::Emit's "isForEH" parameter into a setJohn McCall2011-07-1212-54/+89
| | | | | | of flags. No functionality change. llvm-svn: 134997
* Implement -MG. Fixes PR9613Peter Collingbourne2011-07-125-8/+53
| | | | llvm-svn: 134996
* Add more compiler workarounds. Should fix the build with old GCCs and MSVC.Benjamin Kramer2011-07-121-6/+10
| | | | llvm-svn: 134995
* In ARC mode, consider Objective-C lifetime types (object pointers andDouglas Gregor2011-07-121-2/+0
| | | | | | | | | | | | | | 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>. llvm-svn: 134993
* Fix a bug where a local variable named 'self' is causingFariborz Jahanian2011-07-125-23/+13
| | | | | | | implicit ivar accesses to go through the 'self' variable rather than the real 'self' for the method. // rdar://9730771 llvm-svn: 134992
* Ugh, use this compiler workaround again.John McCall2011-07-121-3/+5
| | | | llvm-svn: 134989
* Switch field destruction over to use the new destroyer-based APIJohn McCall2011-07-126-399/+185
| | | | | | and kill a lot of redundant code. llvm-svn: 134988
* Improve name mangling for instantiation-dependent types that are notDouglas Gregor2011-07-122-15/+71
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Pop block scope after reading from it.Benjamin Kramer2011-07-121-4/+4
| | | | | | Found by valgrind. llvm-svn: 134983
* Second attempt at de-constifying LLVM Types in FunctionType::get(),Jay Foad2011-07-121-6/+4
| | | | | | StructType::get() and TargetData::getIntPtrType(). llvm-svn: 134982
* Work around a problem with a static helper's formulation in releaseChandler Carruth2011-07-121-5/+5
| | | | | | | | | | | | | | | 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. llvm-svn: 134977
* Fix typo correction crash on overloaded functions, pr10283.Hans Wennborg2011-07-122-3/+3
| | | | | | | It would be cool if we could do overload resolution to suggest the right function, but at least this fixes the crashing. llvm-svn: 134976
* Implement name mangling for sizeof...(function parameter pack).Douglas Gregor2011-07-121-9/+2
| | | | llvm-svn: 134974
* Fix the desugaring of dependent decltype and typeof(expr) nodes. TheDouglas Gregor2011-07-121-1/+17
| | | | | | | | | | 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. llvm-svn: 134973
* Fix a problem Eli ran into where we now reject incomplete arrays of Chris Lattner2011-07-122-9/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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) } llvm-svn: 134972
* insert a bitcast in the 'expand' case of argument passing when needed. ThisChris Lattner2011-07-122-29/+40
| | | | | | fixes the -m32 build of oggenc. llvm-svn: 134971
* fix an unintended behavior change in the type system rewrite, which caused ↵Chris Lattner2011-07-121-4/+4
| | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 134969
* Mangle dependent template names of unknown arityDouglas Gregor2011-07-121-10/+4
| | | | llvm-svn: 134967
* fix PR10335 by watching out for IR type compatibility in call argument lists.Chris Lattner2011-07-121-1/+5
| | | | llvm-svn: 134966
* Implement the Itanium C++ ABI's mangling rule forDouglas Gregor2011-07-121-2/+23
| | | | | | non-instantiation-dependent sizeof and alignof expressions. llvm-svn: 134963
* add some aggressive assertions that call arguments match up to calleeChris Lattner2011-07-121-3/+40
| | | | | | expectations in EmitCall. Next patch will take this further. llvm-svn: 134962
* Centralize the getCanonicalType() calls in the Itanium C++ manglingDouglas Gregor2011-07-125-40/+36
| | | | | | code so that they only occur in a single place. No functionality change. llvm-svn: 134961
* [ARC] Complain about property without storage attribute when @synthesizing ↵Argyrios Kyrtzidis2011-07-121-20/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 134960
OpenPOWER on IntegriCloud