Commit Graph

3032 Commits

Author SHA1 Message Date
Chris Lattner f6d1c9c7f0 This is a pretty big cleanup for how invalid decl/type are handle.
This gets rid of a bunch of random InvalidDecl bools in sema, changing
us to use the following approach:

1. When analyzing a declspec or declarator, if an error is found, we 
   set a bit in Declarator saying that it is invalid.
2. Once the Decl is created by sema, we immediately set the isInvalid
   bit on it from what is in the declarator.  From this point on, sema
   consistently looks at and sets the bit on the decl.

This gives a very clear separation of concerns and simplifies a bunch
of code.  In addition to this, this patch makes these changes:

1. it renames DeclSpec::getInvalidType() -> isInvalidType().
2. various "merge" functions no longer return bools: they just set the
   invalid bit on the dest decl if invalid.
3. The ActOnTypedefDeclarator/ActOnFunctionDeclarator/ActOnVariableDeclarator
   methods now set invalid on the decl returned instead of returning an
   invalid bit byref.
4. In SemaType, refering to a typedef that was invalid now propagates the
   bit into the resultant type.  Stuff declared with the invalid typedef
   will now be marked invalid.
5. Various methods like CheckVariableDeclaration now return void and set the
   invalid bit on the decl they check.


There are a few minor changes to tests with this, but the only major bad
result is test/SemaCXX/constructor-recovery.cpp.  I'll take a look at this
next.

llvm-svn: 70020
2009-04-25 08:06:05 +00:00
Chris Lattner 9af40c1e14 fix PR4049, a crash on invalid, by making sema install the right number of
parameters in a functiondecl, even if the decl is invalid and has a confusing
Declarator.  On the testcase, we now emit one beautiful diagnostic:

t.c:2:1: error: unknown type name 'unknown_type'
unknown_type f(void*)
^

GCC 4.0 produces:

t.c:2: error: syntax error before ‘f’
t.c: In function ‘f’:
t.c:2: error: parameter name omitted

and GCC 4.2:

t.c:2: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘f’

llvm-svn: 70016
2009-04-25 06:12:16 +00:00
Chris Lattner ae4ee5be22 in:
typedef void foo(void);

We get a typedef for a functiontypeproto with no arguments, not
one with one argument and type void.  This means the code being
removed in SemaDecl is dead.

llvm-svn: 70013
2009-04-25 05:51:56 +00:00
Daniel Dunbar ef2ffbc390 Fix pointer addressing and array subscripting of Objective-C interface
types.
 - I broke this in the switch to representing interfaces with opaque
   types.

 - <rdar://problem/6822660> clang crashes on subscript of interface in
   32-bit mode

llvm-svn: 70009
2009-04-25 05:08:32 +00:00
Ted Kremenek e75de95408 Hook up attribute 'objc_ownership_retain' to the analyzer. This attribute allows
users to specify that a method's argument is visibly retained (reference count
incremented).

llvm-svn: 70008
2009-04-25 01:21:50 +00:00
Ted Kremenek 2cfd264636 Add new checker-specific attribute 'objc_ownership_retain'. This isn't hooked up
to the checker yet, but essentially it allows a user to specify that an
Objective-C method or C function increments the reference count of a passed
object.

llvm-svn: 70005
2009-04-25 00:17:17 +00:00
Chris Lattner 12bdebbbf7 reject explicit pointer arithmetic on interface pointers in 64-bit objc ABI
llvm-svn: 70004
2009-04-24 23:50:08 +00:00
Ted Kremenek b97d093e16 Hook up __attribute__((objc_ownership_returns)) to the retain/release checker.
llvm-svn: 70002
2009-04-24 23:32:32 +00:00
Ted Kremenek 44e662cd4f Add new checker-specific attribute 'objc_ownership_returns'. This isn't hooked
up to the checker yet, but essentially it allows a user to specify that an
Objective-C method or C function returns an owned an Objective-C object.

llvm-svn: 70001
2009-04-24 23:09:54 +00:00
Ted Kremenek 6a966b2486 Fix the same false positive reported in PR 2542 and <rdar://problem/6793409>
involving an NSAnimation object delegating its release to a delegate method.

llvm-svn: 69992
2009-04-24 21:56:17 +00:00
Douglas Gregor c78d34699f PCH support for the global method pool (= instance and factory method
pools, combined). The methods in the global method pool are lazily
loaded from an on-disk hash table when Sema looks into its version of
the hash tables.

llvm-svn: 69989
2009-04-24 21:10:55 +00:00
Steve Naroff 3fa455a1aa Add PCH support for #import.
llvm-svn: 69987
2009-04-24 20:03:17 +00:00
Ted Kremenek 8a5ad39a46 retain/release checker:
- Fix summary lookup for class methods to now use the (optional)
  ObjCInterfaceDecl associated with a message expression. This removes a
  long-standing FIXME.
- Partial fix for <rdar://problem/6062730> by stop tracking objects that
  are passed to [NSObject performSelector].  These methods are often used
  for delegates, which the analyzer doesn't reason about well yet.

llvm-svn: 69982
2009-04-24 17:50:11 +00:00
Fariborz Jahanian 1dcb32260a Avoid issuing spurious errors as side-effect of diagnosing
application of sizeof on an interface.

llvm-svn: 69980
2009-04-24 17:34:33 +00:00
Chris Lattner 40493eb6eb fix rdar://6816766 - Crash with function-like macro test at end of directive.
llvm-svn: 69964
2009-04-24 07:15:46 +00:00
Daniel Dunbar c1b1b4b2c9 Don't run dsymutil when making a fat executable direct source.
- Otherwise, we will end up with stray .dSYM files which don't get
   lipo'ed or removed.

 - Ideally we would run dsymutil on the result, but we don't have the
   infrastructure for that yet. Note that gcc doesn't handle this case
   either.

 - <rdar://problem/6809621> [driver] clang leaves .dSYM files lying
   around in tmp.

llvm-svn: 69951
2009-04-24 03:03:52 +00:00
Daniel Dunbar 449354c761 Add a test case for a somewhat obscure scenario.
llvm-svn: 69947
2009-04-24 02:38:10 +00:00
Daniel Dunbar a2666fefd8 We don't accept this test anymore in a non-fragile ABI.
llvm-svn: 69944
2009-04-24 02:11:35 +00:00
Chris Lattner 62975a788e Fix rdar://6821047 - clang crashes on subscript of interface in 64-bit mode
Several changes here:
1. We change Type::isIncompleteType to realize that forward declared 
   interfaces are incomplete.  This eliminate special case code for this
   from the sizeof path, and starts us rejecting P[4] when P is a pointer
   to an incomplete interface.
2. Explicitly reject P[4] when P points to an interface in non-fragile ABI
   mode.
3. Switch the sizeof(interface) diagnostic back to an error instead of a 
   warning in non-fragile abi mode.

llvm-svn: 69943
2009-04-24 00:30:45 +00:00
Daniel Dunbar 838cbe19b7 Call ld, not collect2.
- <rdar://problem/6517382> [driver] call ld directly

llvm-svn: 69938
2009-04-23 23:17:23 +00:00
Douglas Gregor 512b077803 PCH support for all of the predefined Objective-C types, such as id,
SEL, Class, Protocol, CFConstantString, and
__objcFastEnumerationState. With this, we can now run the Objective-C
methods and properties PCH tests.

llvm-svn: 69932
2009-04-23 22:29:11 +00:00
Ted Kremenek 37467813c5 Further cleanups to isTrackedObjectType().
llvm-svn: 69929
2009-04-23 22:11:07 +00:00
Fariborz Jahanian 6f0f25b0d8 Diagnose if an implementation implements a forward class
declaration (and avoid issuing bogus error later on).

llvm-svn: 69928
2009-04-23 21:49:04 +00:00
Ted Kremenek 0a1f9c423f retain/release checker: Don't call isTrackedObject() with the canonical type.
This was preventing the checker from tracking return objects referenced by 'id'.

llvm-svn: 69922
2009-04-23 21:25:57 +00:00
Ted Kremenek d6ed5b7376 Temporarily remove expected warnings.
llvm-svn: 69917
2009-04-23 20:03:52 +00:00
Ted Kremenek f27110fc27 Per discussions with Ken Ferry and Paul Marks (<rdar://problem/6815234>) greatly
extend the number of objects tracked by the retain/release checker by assuming
that all class and instance methods should follow Cocoa object "getter" and
"alloc/new" conventions.

llvm-svn: 69908
2009-04-23 19:11:35 +00:00
Douglas Gregor 89c8e000cf Fix handling of C99 "extern inline" semantics when dealing with
multiple declarations of the function. Should fix PR3989 and
<rdar://problem/6818429>.

llvm-svn: 69905
2009-04-23 18:22:55 +00:00
Devang Patel a6acb390e7 Handle corner case where clang-cc is invoked directly to compile preprocessed source file without -main-file-name. In this case, CDDebugInfo is not able identify correct main source file becase SM.isFromMainFile() returns true for locations from header files as well as locations from main source file.
This patch takes conservative approach by not emitting more then one compile unit with isMain bit set.

llvm-svn: 69902
2009-04-23 18:09:16 +00:00
Ted Kremenek 9c03f68206 Fix PR 4033: the analyzer shouldn't crash on computed gotos involving symbolic
target addresses.

llvm-svn: 69900
2009-04-23 17:49:43 +00:00
Steve Naroff 0cbba990d7 More PushOnScopeChain() FIXME's.
llvm-svn: 69894
2009-04-23 16:00:56 +00:00
Steve Naroff 3c301dc573 Sema::ActOnStartClassInterface(): Use PushOnScopeChains().
This enables class recognition to work with PCH. I believe this means we can remove Sema::ObjCInterfaceDecls and it's usage within Sema::LookupName(). Will investigate.

llvm-svn: 69891
2009-04-23 15:15:40 +00:00
Steve Naroff 2ddea05bca Add PCH read/write support for Objective-C Selectors.
Note: This support is non-lazy. Once we get "Cocoa.h" humming, we can optimize this.
llvm-svn: 69884
2009-04-23 10:39:46 +00:00
Daniel Dunbar 4645707034 Add implicit definition of objc_msgSend.
- As with malloc and friends, this is important where the return type
   on a 64-bit platform would otherwise end up discarding the upper
   32-bits.

llvm-svn: 69874
2009-04-23 07:00:09 +00:00
Douglas Gregor 85e110828e PCH support for Objective-C property declarations (UNTESTED!)
llvm-svn: 69843
2009-04-22 23:20:34 +00:00
Douglas Gregor acfc76cc63 Support locally-declared external declarations in PCH files
llvm-svn: 69833
2009-04-22 22:18:58 +00:00
Douglas Gregor 2e43ab535b Clean up and de-XFAIL-ify PCH test for external definitions
llvm-svn: 69831
2009-04-22 22:09:39 +00:00
Chris Lattner 91cb0eea67 remove obsolete tests.
llvm-svn: 69830
2009-04-22 22:06:26 +00:00
Douglas Gregor d4df8657b4 Support tentative definitions in precompiled headers. This isn't likely
to happen (ever), but at least we'll do the right thing when it does.

llvm-svn: 69829
2009-04-22 22:02:47 +00:00
Eli Friedman d3a5a9d7fa Add handling for complex->int, int->complex float, and float->complex
int.  Note that constant int->complex float and float->complex int casts
were being miscompiled.

llvm-svn: 69821
2009-04-22 19:23:09 +00:00
Daniel Dunbar e4f25b706b Reapply r69771, with updates & fixes:
Rework the shadow struct that is layed out for Objective-C classes.

 - Superclasses are now always laid out in their shadow structure at
   the first field.

 - Prior to this, the entire class heirarchy was flattened into a
   single structure which meant that alignment, padding, and bitfields
   were incorrect (the ASTRecordLayout was correct however, which
   meant our debug info didn't coincide with ivar offsets, for
   example).

 - This is still very suboptimal (for example, ivar are looked up
   recursively, but I believe the ivar layout itself is now at least
   close to correct.

 - <rdar://problem/6773388> error: objc[29823]: layout bitmap sliding
   backwards

llvm-svn: 69811
2009-04-22 17:43:55 +00:00
Daniel Dunbar 6067720a41 Make sure this test runs on all 3 Objective-C implementations.
llvm-svn: 69786
2009-04-22 07:28:06 +00:00
Chris Lattner 587cbe1ef2 deserialization support for qualified interfaces
llvm-svn: 69782
2009-04-22 06:45:28 +00:00
Chris Lattner 6e054afc9e pch support for protocol qualified id's.
llvm-svn: 69781
2009-04-22 06:40:03 +00:00
Chris Lattner 8f0734972b add three new objc expression types. @selector doesn't work because we have no
way to serialize selectors yet.

llvm-svn: 69780
2009-04-22 06:29:42 +00:00
Chris Lattner 19cea4eeb4 implement serialization support for @encode,
fix a couple of bugs in reader support for ObjCInterfaceDecl,
and add support for reading ObjCInterfaceType.

llvm-svn: 69779
2009-04-22 05:57:30 +00:00
Chris Lattner 01146a5fa9 rename methods.* -> objc_methods.*
llvm-svn: 69778
2009-04-22 05:31:53 +00:00
Chris Lattner dc00437fa0 change implicit int warnings to point to the identifier, not the
start of the declspec.  The fixit still goes there, and we underline
the declspec.  This helps when the start of the declspec came from a
macro that expanded from a system header.  For example, we now produce:

t.c:2:8: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
static x;
~~~~~~ ^

llvm-svn: 69777
2009-04-22 05:27:59 +00:00
Daniel Dunbar 658ba85820 Revert r69771, I missed some (obvious) details. :/
llvm-svn: 69773
2009-04-22 04:39:47 +00:00
Daniel Dunbar 25b81ef847 Rework the shadow struct that is layed out for Objective-C classes.
- Superclasses are now always laid out their shadow structure at the
   first field.

 - Prior to this, the entire class heirarchy was flattened into a
   single structure which meant that alignment, padding, and bitfields
   weren't packed correctly (the ASTRecordLayout was correct however,
   which meant our debug info didn't coincide with ivar offsets, for
   example).

 - This is still very suboptimal, but I believe the ivar layout itself
   is now at least close to correct.

 - <rdar://problem/6773388> error: objc[29823]: layout bitmap sliding
   backwards

llvm-svn: 69771
2009-04-22 03:45:12 +00:00
Chris Lattner ed462a8d44 Fix rdar://6814950 - stdint.h isn't "-pedantic -std=c89" clean,
by marking the predefines buffer as a system header.  The problem 
with stdint is that it was getting problems like this:

/Volumes/Projects/cvs/llvm/Debug/lib/clang/1.0/include/stdint.h:43:9: warning: 'long long' is an extension when C99 mode is not enabled
typedef __INT64_TYPE__ int64_t;
        ^
<built-in>:73:29: note: instantiated from:
#define __INT64_TYPE__ long long
                            ^

We correctly silence warnings in system headers, but only if the 
spelling location of the token came from the system header.  This is
designed so that if you use a system macro in your code that you don't
get punished for its definition.  This is all cool except that the 
predefines buffer wasn't considered a system header.

llvm-svn: 69770
2009-04-22 03:42:19 +00:00
Chris Lattner d27f8d8c9f rename test
llvm-svn: 69761
2009-04-22 00:59:27 +00:00
Chris Lattner 934074cd5f Fix a problem with objc foreach loop. It turns out that objc mode changes
for scoping to match C99 even when in C89 mode.  This patch fixes this 
(eliminating a "redefinition of thisKey" error), and also prevents non-sensical
diagnostics in -pedantic mode like this:

t.m:7:8: warning: variable declaration in for loop is a C99-specific feature
  for (id thisKey in keys) ;
       ^

llvm-svn: 69760
2009-04-22 00:54:41 +00:00
Douglas Gregor 3ddc876758 Test PCH support for VLAs
llvm-svn: 69758
2009-04-22 00:21:21 +00:00
Douglas Gregor 13d247f7ec Eliminate a FIXME in one of the PCH test cases
llvm-svn: 69757
2009-04-22 00:17:41 +00:00
Chris Lattner f8dc07369a Fix some mishandling of the attr(gnu_inline) mode when used with
extern.  Previously we would warn about it and ignore the attribute.
This is incorrect, it should be handled as a c89 "extern inline" 
function.  Many thanks to Matthieu Castet for pointing this out and
beating me over the head until I got it.

PR3988: extern inline function are not externally visible
llvm-svn: 69756
2009-04-22 00:03:30 +00:00
Ted Kremenek fe95afd0bc Fix crash reported in PR 3991. The analyzer doesn't reason about ObjCKVCExpr.
llvm-svn: 69754
2009-04-21 23:53:32 +00:00
Chris Lattner ca515ccb49 apply Eli's patch to fix PR4008, with a testcase. Thanks Eli!
llvm-svn: 69750
2009-04-21 23:28:41 +00:00
Mike Stump 3cfd5614e7 Resolve merge conflict better.
llvm-svn: 69748
2009-04-21 23:03:34 +00:00
Chris Lattner 2f343dd5c8 fix PR4026: Clang can't codegen __func__ without implicit cast
llvm-svn: 69747
2009-04-21 23:00:09 +00:00
Mike Stump d79b5a85b0 Tighten up blocks type checking. This was discussed back in the
r56595 timeframe, but left undone.  Radar 6812711

llvm-svn: 69745
2009-04-21 22:51:42 +00:00
Douglas Gregor 195e9c5d18 Lazy deserialization of identifiers in PCH files fixed a problem with
name lookup of structures declared within other structures.

llvm-svn: 69744
2009-04-21 22:48:38 +00:00
Chris Lattner 41b8694777 Fix rdar://6814047, a crash on invalid in blocks code I noticed when
working on the previous fix.

llvm-svn: 69742
2009-04-21 22:38:46 +00:00
Ted Kremenek 35f875c136 Fix: <rdar://problem/6777209> false Dereference of null pointer in loop: pointer increment/decrement preserves non-nullness
When the StoreManager doesn't reason well about pointer-arithmetic, propagate
the non-nullness constraint on a pointer value when performing pointer
arithmetic uisng ++/--.

llvm-svn: 69741
2009-04-21 22:38:05 +00:00
Chris Lattner 497d7b0c8a fix marking of nested blocks with the "hasBlockDeclRefExprs" to
mark exactly the blocks which have references that are "live through".
This fixes a rejects valid: 
rdar://6808730 - [sema] [blocks] block rejected at global scope

llvm-svn: 69738
2009-04-21 22:26:47 +00:00
Douglas Gregor a868bbd392 Lazy deserialization of the declaration chains associated with
identifiers from a precompiled header.

This patch changes the primary name lookup method for entities within
a precompiled header. Previously, we would load all of the names of
declarations at translation unit scope into a large DenseMap (inside
the TranslationUnitDecl's DeclContext), and then perform a special
"last resort" lookup into this DeclContext when we knew there was a
PCH file (see Sema::LookupName). Now, when we see an identifier named
for the first time, we load all of the declarations with that name
that are visible from the translation unit into the IdentifierInfo's
chain of declarations. Thus, the explicit "look into the translation
unit's DeclContext" code is gone, and Sema effectively uses the same
IdentifierInfo-based name lookup mechanism whether we are using a PCH
file or not. 

This approach should help PCH scale with the size of the input program
rather than the size of the PCH file. The "Hello, World!" application
with Carbon.h as a PCH file now loads 20% of the identifiers in the
PCH file rather than 85% of the identifiers. 

90% of the 20% of identifiers loaded are actually loaded when we
deserialize the preprocessor state. The next step is to make the
preprocessor load macros lazily, which should drastically reduce the
number of types, declarations, and identifiers loaded for "Hello,
World".

llvm-svn: 69737
2009-04-21 22:25:48 +00:00
Chris Lattner 6750113d54 force a 32-bit triple.
llvm-svn: 69729
2009-04-21 21:42:41 +00:00
Daniel Dunbar d361c345c6 Force triple (test case fails for platforms with the non-fragile ABI).
llvm-svn: 69727
2009-04-21 21:17:29 +00:00
Daniel Dunbar 46285d8084 We no longer accept @defs with the non-fragile ABI.
llvm-svn: 69721
2009-04-21 21:16:23 +00:00
Chris Lattner a8c92540dd temporarily downgrade to a warning.
llvm-svn: 69720
2009-04-21 21:14:41 +00:00
Fariborz Jahanian ece1b2b0e1 Patch to diagnose use of objc's @defs in nonfragile abi.
llvm-svn: 69710
2009-04-21 20:28:41 +00:00
Ted Kremenek a8e8bc24b3 Added over-release test case.
llvm-svn: 69703
2009-04-21 20:01:03 +00:00
Chris Lattner 37920f5359 reject sizeof(itf) when itf is a forward declared interface, or when
in non-fragile abi mode.  rdar://6811884

llvm-svn: 69701
2009-04-21 19:55:16 +00:00
Douglas Gregor beecd58e21 Explictly track tentative definitions within Sema, then hand those
tentative definitions off to the ASTConsumer at the end of the
translation unit. 

Eliminate CodeGen's internal tracking of tentative definitions, and
instead hook into ASTConsumer::CompleteTentativeDefinition. Also,
tweak the definition-deferal logic for C++, where there are no
tentative definitions.

Fixes <rdar://problem/6808352>, and will make it much easier for
precompiled headers to cope with tentative definitions in the future.

llvm-svn: 69681
2009-04-21 17:11:58 +00:00
Daniel Dunbar 108098d56c Fix test typo.
llvm-svn: 69676
2009-04-21 16:03:31 +00:00
Daniel Dunbar 93c1914de3 Use an ASTRecordLayout to compute the sizeof an interface, not
addRecordToClass.
 - Among other things, this fixes a crash when applying sizeof to an
   interface with synthesized ivars, although things still aren't
   "correct" here.

llvm-svn: 69675
2009-04-21 15:48:54 +00:00
Chris Lattner 3501d43a10 implement semantic analysis for @synchronized, fixing a crash on invalid
rdar://6810940 - @synchronized has no sema checks

llvm-svn: 69670
2009-04-21 06:11:25 +00:00
Chris Lattner c70dd56477 add support for goto checking and @synchronized blocks,
rdar://6810106

llvm-svn: 69667
2009-04-21 06:01:00 +00:00
Chris Lattner 1f02e054a9 Fix PR4027 + rdar://6808859, we were rejecting implicit casts of
aggregates even though we already accept explicit ones.  Easy fix.

llvm-svn: 69661
2009-04-21 05:19:11 +00:00
Chris Lattner a9aeea9f27 use of predefined identifiers like __func__ at global scope warn in sema,
but crashed codegen.  Fix this to report the name of the llvm function.
This fixes rdar://6808051

llvm-svn: 69658
2009-04-21 04:41:23 +00:00
Daniel Dunbar 50b5c4ccaa Revert 69646, that was the precise inverse of what I wanted to commit.
llvm-svn: 69647
2009-04-21 01:19:10 +00:00
Daniel Dunbar 9df980b876 Kill ASTContext::[gs]etFieldForDecl, instead we just lookup things
when we need them -- which is exactly what some code was already
doing!
 - No intended functionality change.

llvm-svn: 69646
2009-04-21 01:18:01 +00:00
Mike Stump 3214d12325 Fixup codegen for write barriers for block variables. Radar 6786715
llvm-svn: 69642
2009-04-21 00:51:43 +00:00
Chris Lattner f4c68741d4 fix the second half of PR4006 and rdar://6807000 by treating
() as being either zero arguments or one empty argument depending
on situation.

llvm-svn: 69627
2009-04-20 21:08:10 +00:00
Chris Lattner ddf6ca0355 the __gnuc_inline__ attribute is actually named __gnu_inline__,
PR4023

llvm-svn: 69618
2009-04-20 19:12:28 +00:00
Devang Patel 45dfbd16b0 Add test case to check line number in debug info.
llvm-svn: 69617
2009-04-20 19:07:55 +00:00
Chris Lattner f9b00eb7dc clean up anonymous bitfield diagnostics, PR4017
llvm-svn: 69608
2009-04-20 17:29:38 +00:00
Steve Naroff 04f2d14d6a Add pch reader/writer support for ObjCMethodDecl.
Test will be enabled with ObjCInterfaceDecl is added.

llvm-svn: 69594
2009-04-20 15:06:07 +00:00
Eli Friedman 3a1e692fed Some cleanup and bug-fixing for address-of checking. This causes a couple of
minor accepts-invalid regressions, but we weren't really rejecting them for 
the right reason.  We really need a more general solution to detect all the 
cases of the promotion of arrays with a register storage class.

llvm-svn: 69586
2009-04-20 08:23:18 +00:00
Daniel Dunbar 75e909f5e0 Set a bit in IMAGE_INFO to indicate that we don't contain any
@synthesized ivars for superclasses.
 - <rdar://problem/6806371> [clang] Mark code without miscompiled
   @synthesized properties

llvm-svn: 69581
2009-04-20 07:11:47 +00:00
Daniel Dunbar caec0238bc Don't emit ivar offsets for unnamed bit fields.
Also, added assertion that the field matches what would be looked up.

llvm-svn: 69572
2009-04-20 05:53:40 +00:00
Eli Friedman bc633beda4 PR3247: Handle a couple of cases where we weren't emitting VLA sizes (and
subsequently crashed).

llvm-svn: 69567
2009-04-20 03:54:15 +00:00
Eli Friedman 3253e189c6 PR3248: Make sure the evaluate the operand of a sizeof when it has a VLA type.
Adapted from patch by Tim Northover.

llvm-svn: 69566
2009-04-20 03:21:44 +00:00
Chris Lattner ddddff4f41 Fix PR4007: clang doesn't know -Werror-foo is the same as -Werror=foo
llvm-svn: 69557
2009-04-19 22:07:21 +00:00
Chris Lattner df2226839f Warn about uses of #pragma STDC FENV_ACCESS ON, since we don't
support it.  I don't know what evaluation method we use for complex
arithmetic, so I don't know whether/if we should warn about use of
CX_LIMITED_RANGE.

This concludes my planned hacking on STDC pragmas, flame away :)

llvm-svn: 69556
2009-04-19 21:55:32 +00:00
Sebastian Redl 8ce189f9ce Conditional operator C++ checking complete. What issues remain are in more general code.
llvm-svn: 69555
2009-04-19 21:53:20 +00:00
Chris Lattner 02ef4e3dba diagnose invalid syntax of STDC pragmas.
llvm-svn: 69554
2009-04-19 21:50:08 +00:00
Eli Friedman daea3f62b5 Print an error for uses of __thread on targets which don't support it.
llvm-svn: 69553
2009-04-19 21:48:33 +00:00
Chris Lattner a0b1f76d10 reject invalid stuff in the STDC namespace.
llvm-svn: 69551
2009-04-19 21:25:37 +00:00
Chris Lattner 958ee04368 stub out STDC #pragmas.
llvm-svn: 69550
2009-04-19 21:20:35 +00:00
Sebastian Redl 0753c6f591 Bring member pointer operands of the conditional operator to a common type. We're getting there ...
llvm-svn: 69548
2009-04-19 21:15:26 +00:00