]> granicus.if.org Git - clang/log
clang
15 years agoWhen we de-serialize an Objective-C protocol, hand it to the AST consumer so that...
Douglas Gregor [Fri, 24 Apr 2009 23:42:14 +0000 (23:42 +0000)]
When we de-serialize an Objective-C protocol, hand it to the AST consumer so that we can create metadata

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

15 years agoHook up __attribute__((objc_ownership_returns)) to the retain/release checker.
Ted Kremenek [Fri, 24 Apr 2009 23:32:32 +0000 (23:32 +0000)]
Hook up __attribute__((objc_ownership_returns)) to the retain/release checker.

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

15 years agoAdd new checker-specific attribute 'objc_ownership_returns'. This isn't hooked
Ted Kremenek [Fri, 24 Apr 2009 23:09:54 +0000 (23:09 +0000)]
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.

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

15 years agoAdd CXXExprWithCleanup
Anders Carlsson [Fri, 24 Apr 2009 22:47:04 +0000 (22:47 +0000)]
Add CXXExprWithCleanup

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

15 years agofix the sizeof error recovery issue (sizeof-interface.m:attributeRuns)
Chris Lattner [Fri, 24 Apr 2009 22:30:50 +0000 (22:30 +0000)]
fix the sizeof error recovery issue (sizeof-interface.m:attributeRuns)
by correctly propagating the fact that the type was invalid up to the
attributeRuns decl, then returning an ExprError when attributeRuns is
formed (like we do for normal declrefexprs).

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

15 years agoFix a pasto in the lookup of instance methods in the global pool
Douglas Gregor [Fri, 24 Apr 2009 22:23:41 +0000 (22:23 +0000)]
Fix a pasto in the lookup of instance methods in the global pool

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

15 years agoOnce the protocol list has been loaded from the PCH file, add it to
Douglas Gregor [Fri, 24 Apr 2009 22:01:00 +0000 (22:01 +0000)]
Once the protocol list has been loaded from the PCH file, add it to
the Objective-C interface.

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

15 years agoFix the same false positive reported in PR 2542 and <rdar://problem/6793409>
Ted Kremenek [Fri, 24 Apr 2009 21:56:17 +0000 (21:56 +0000)]
Fix the same false positive reported in PR 2542 and <rdar://problem/6793409>
involving an NSAnimation object delegating its release to a delegate method.

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

15 years agoFix two small but very nasty bugs in the PCH writer for method pools:
Douglas Gregor [Fri, 24 Apr 2009 21:49:02 +0000 (21:49 +0000)]
Fix two small but very nasty bugs in the PCH writer for method pools:
  (1) Make sure to pad on-disk hash tables with 4 bytes, not 2, since
  the reader assumes that bucket data is aligned on 4-byte
  boundaries.
  (2) Don't emit the number of factory methods twice. This was
  throwing off the data counts and therefore causing lookups to
  fail. I've added asserts so that this class of error cannot happen
  again.

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

15 years agoPCH support for the global method pool (= instance and factory method
Douglas Gregor [Fri, 24 Apr 2009 21:10:55 +0000 (21:10 +0000)]
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.

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

15 years agoMinor refactoring. No intended change in behavior.
Fariborz Jahanian [Fri, 24 Apr 2009 21:07:43 +0000 (21:07 +0000)]
Minor refactoring. No intended change in behavior.

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

15 years agoAdd PCH support for #import.
Steve Naroff [Fri, 24 Apr 2009 20:03:17 +0000 (20:03 +0000)]
Add PCH support for #import.

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

15 years agoMinor refactoring: pass selector to getCommonMethodSummary(). No functionality
Ted Kremenek [Fri, 24 Apr 2009 18:19:07 +0000 (18:19 +0000)]
Minor refactoring: pass selector to getCommonMethodSummary(). No functionality
change.

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

15 years agoretain/release checker: more hacks to workaround false positives cause by
Ted Kremenek [Fri, 24 Apr 2009 18:00:17 +0000 (18:00 +0000)]
retain/release checker: more hacks to workaround false positives cause by
delegates. When a reference counted object is passed as to a 'void*' argument to
a method stop tracking the reference count.

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

15 years agoSentence case bug name.
Ted Kremenek [Fri, 24 Apr 2009 17:51:19 +0000 (17:51 +0000)]
Sentence case bug name.

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

15 years agoretain/release checker:
Ted Kremenek [Fri, 24 Apr 2009 17:50:11 +0000 (17:50 +0000)]
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.

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

15 years agoMake CXXTemporaryObjectExpr inherit from CXXConstructExpr.
Anders Carlsson [Fri, 24 Apr 2009 17:34:38 +0000 (17:34 +0000)]
Make CXXTemporaryObjectExpr inherit from CXXConstructExpr.

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

15 years agoAvoid issuing spurious errors as side-effect of diagnosing
Fariborz Jahanian [Fri, 24 Apr 2009 17:34:33 +0000 (17:34 +0000)]
Avoid issuing spurious errors as side-effect of diagnosing
application of sizeof on an interface.

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

15 years agoMinor refactoring. No change in functionality.
Fariborz Jahanian [Fri, 24 Apr 2009 17:15:27 +0000 (17:15 +0000)]
Minor refactoring. No change in functionality.

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

15 years agoUse cast_or_null instead of ternary operator (suggested by Doug).
Steve Naroff [Fri, 24 Apr 2009 16:59:10 +0000 (16:59 +0000)]
Use cast_or_null instead of ternary operator (suggested by Doug).

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

15 years agoSome code clean up of objc2's bitmap layout.
Fariborz Jahanian [Fri, 24 Apr 2009 16:17:09 +0000 (16:17 +0000)]
Some code clean up of objc2's bitmap layout.

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

15 years agoAllow the next catoregory slot to be null.
Steve Naroff [Fri, 24 Apr 2009 16:08:42 +0000 (16:08 +0000)]
Allow the next catoregory slot to be null.

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

15 years agofix rdar://6816766 - Crash with function-like macro test at end of directive.
Chris Lattner [Fri, 24 Apr 2009 07:15:46 +0000 (07:15 +0000)]
fix rdar://6816766 - Crash with function-like macro test at end of directive.

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

15 years agosimplification and speedup
Chris Lattner [Fri, 24 Apr 2009 07:15:22 +0000 (07:15 +0000)]
simplification and speedup

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

15 years agoFix assert.
Anders Carlsson [Fri, 24 Apr 2009 06:06:07 +0000 (06:06 +0000)]
Fix assert.

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

15 years agoCXXTempVarDecls aren't looked up. Fixes tests.
Anders Carlsson [Fri, 24 Apr 2009 06:02:55 +0000 (06:02 +0000)]
CXXTempVarDecls aren't looked up. Fixes tests.

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

15 years agoAdd an ASTContext parameter to CXXTemporaryObjectExpr.
Anders Carlsson [Fri, 24 Apr 2009 05:44:25 +0000 (05:44 +0000)]
Add an ASTContext parameter to CXXTemporaryObjectExpr.

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

15 years agoAdd a VarDecl parameter to the CXXTemporaryObjectExpr constructor. It's unused for...
Anders Carlsson [Fri, 24 Apr 2009 05:23:13 +0000 (05:23 +0000)]
Add a VarDecl parameter to the CXXTemporaryObjectExpr constructor. It's unused for now, so no functionality change yet. Also, create CXXTempVarDecls to pass to the CXXTemporaryObjectExpr ctor.

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

15 years agoCreate a CXXConstructExpr instead of a CXXTemporaryObjectExpr in InitializeVarWithCon...
Anders Carlsson [Fri, 24 Apr 2009 05:16:06 +0000 (05:16 +0000)]
Create a CXXConstructExpr instead of a CXXTemporaryObjectExpr in InitializeVarWithConstructor.

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

15 years agoMake sure that ObjCCompatibleAlias and ObjCImplementation decls are considered NamedDecls
Douglas Gregor [Fri, 24 Apr 2009 05:15:35 +0000 (05:15 +0000)]
Make sure that ObjCCompatibleAlias and ObjCImplementation decls are considered NamedDecls

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

15 years agoMake the CXXConstructExpr public and add a StmtClass to it. No functionality change.
Anders Carlsson [Fri, 24 Apr 2009 05:04:04 +0000 (05:04 +0000)]
Make the CXXConstructExpr public and add a StmtClass to it. No functionality change.

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

15 years agoMove the CXXConstructExpr before the CXXTemporaryObjectExpr so that the temporary...
Anders Carlsson [Fri, 24 Apr 2009 04:57:02 +0000 (04:57 +0000)]
Move the CXXConstructExpr before the CXXTemporaryObjectExpr so that the temporary object expr can inherit from the construct expr. No functionality change.

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

15 years agoDon't run dsymutil when making a fat executable direct source.
Daniel Dunbar [Fri, 24 Apr 2009 03:03:52 +0000 (03:03 +0000)]
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.

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

15 years agoEliminate Sema::ObjCAliasDecls. This is based on Steve's fix, but also
Douglas Gregor [Fri, 24 Apr 2009 02:57:34 +0000 (02:57 +0000)]
Eliminate Sema::ObjCAliasDecls. This is based on Steve's fix, but also
updates name lookup so that we see through @compatibility_alias
declarations to their underlying interfaces.

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

15 years agoClang part of r69947. Reverting back 69574 as it is no longer needed.
Sanjiv Gupta [Fri, 24 Apr 2009 02:40:57 +0000 (02:40 +0000)]
Clang part of r69947. Reverting back 69574 as it is no longer needed.

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

15 years agoAdd a test case for a somewhat obscure scenario.
Daniel Dunbar [Fri, 24 Apr 2009 02:38:10 +0000 (02:38 +0000)]
Add a test case for a somewhat obscure scenario.

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

15 years agoFix Objective-C crashes
Douglas Gregor [Fri, 24 Apr 2009 02:15:36 +0000 (02:15 +0000)]
Fix Objective-C crashes

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

15 years agoWe don't accept this test anymore in a non-fragile ABI.
Daniel Dunbar [Fri, 24 Apr 2009 02:11:35 +0000 (02:11 +0000)]
We don't accept this test anymore in a non-fragile ABI.

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

15 years agoFix rdar://6821047 - clang crashes on subscript of interface in 64-bit mode
Chris Lattner [Fri, 24 Apr 2009 00:30:45 +0000 (00:30 +0000)]
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.

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

15 years agoEliminate Sema::ObjCInterfaceDecls
Douglas Gregor [Fri, 24 Apr 2009 00:16:12 +0000 (00:16 +0000)]
Eliminate Sema::ObjCInterfaceDecls

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

15 years agoEliminate Sema::ObjCImplementations, relying instead on name lookup. What's good...
Douglas Gregor [Fri, 24 Apr 2009 00:11:27 +0000 (00:11 +0000)]
Eliminate Sema::ObjCImplementations, relying instead on name lookup. What's good for uniformity is good for PCH (or is it the other way around?).

As part of this, make ObjCImplDecl inherit from NamedDecl (since
ObjCImplementationDecls now need to have names so that they can be
found). This brings ObjCImplDecl very, very close to
ObjCContainerDecl; we may be able to merge them soon.

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

15 years agoUpdate checker build.
Ted Kremenek [Thu, 23 Apr 2009 23:42:21 +0000 (23:42 +0000)]
Update checker build.

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

15 years agoEliminate Sema::ObjCProtocols. Instead, we place ObjCProtocolDecls in
Douglas Gregor [Thu, 23 Apr 2009 23:18:26 +0000 (23:18 +0000)]
Eliminate Sema::ObjCProtocols. Instead, we place ObjCProtocolDecls in
their own namespace (IDNS_Protocol) and use the normal name-lookup
routines to find them. Aside from the simplification this provides
(one less DenseMap!), it means that protocols will be lazily
deserialized from PCH files.

Make the code size of the selector table block match the code size of
the type and decl blocks.

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

15 years agoCall ld, not collect2.
Daniel Dunbar [Thu, 23 Apr 2009 23:17:23 +0000 (23:17 +0000)]
Call ld, not collect2.
 - <rdar://problem/6517382> [driver] call ld directly

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

15 years agoRefactor common logic in getMethodSummary() and getClassMethodSummary(). No
Ted Kremenek [Thu, 23 Apr 2009 23:08:22 +0000 (23:08 +0000)]
Refactor common logic in getMethodSummary() and getClassMethodSummary(). No
functionality change.

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

15 years agoPCH support for categories in Objective-C interfaces.
Douglas Gregor [Thu, 23 Apr 2009 22:34:55 +0000 (22:34 +0000)]
PCH support for categories in Objective-C interfaces.

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

15 years agoPCH support for all of the predefined Objective-C types, such as id,
Douglas Gregor [Thu, 23 Apr 2009 22:29:11 +0000 (22:29 +0000)]
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.

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

15 years agoFurther cleanups to isTrackedObjectType().
Ted Kremenek [Thu, 23 Apr 2009 22:11:07 +0000 (22:11 +0000)]
Further cleanups to isTrackedObjectType().

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

15 years agoDiagnose if an implementation implements a forward class
Fariborz Jahanian [Thu, 23 Apr 2009 21:49:04 +0000 (21:49 +0000)]
Diagnose if an implementation implements a forward class
declaration (and avoid issuing bogus error later on).

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

15 years agoretain/release checker: Don't call isTrackedObject() with the canonical type.
Ted Kremenek [Thu, 23 Apr 2009 21:25:57 +0000 (21:25 +0000)]
retain/release checker: Don't call isTrackedObject() with the canonical type.
This was preventing the checker from tracking return objects referenced by 'id'.

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

15 years agoTemporarily remove expected warnings.
Ted Kremenek [Thu, 23 Apr 2009 20:03:52 +0000 (20:03 +0000)]
Temporarily remove expected warnings.

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

15 years agoretain/release checker: For class methods, only treat return values that are
Ted Kremenek [Thu, 23 Apr 2009 20:02:30 +0000 (20:02 +0000)]
retain/release checker: For class methods, only treat return values that are
object references as tracked objects.

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

15 years agoaccept and ignore -Wconversion
Chris Lattner [Thu, 23 Apr 2009 19:54:39 +0000 (19:54 +0000)]
accept and ignore -Wconversion

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

15 years agoPer discussions with Ken Ferry and Paul Marks (<rdar://problem/6815234>) greatly
Ted Kremenek [Thu, 23 Apr 2009 19:11:35 +0000 (19:11 +0000)]
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.

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

15 years agoFix handling of C99 "extern inline" semantics when dealing with
Douglas Gregor [Thu, 23 Apr 2009 18:22:55 +0000 (18:22 +0000)]
Fix handling of C99 "extern inline" semantics when dealing with
multiple declarations of the function. Should fix PR3989 and
<rdar://problem/6818429>.

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

15 years agoHandle corner case where clang-cc is invoked directly to compile preprocessed source...
Devang Patel [Thu, 23 Apr 2009 18:09:16 +0000 (18:09 +0000)]
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.

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

15 years agoFix PR 4033: the analyzer shouldn't crash on computed gotos involving symbolic
Ted Kremenek [Thu, 23 Apr 2009 17:49:43 +0000 (17:49 +0000)]
Fix PR 4033: the analyzer shouldn't crash on computed gotos involving symbolic
target addresses.

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

15 years agoRemove @compatibility_alias regression.
Steve Naroff [Thu, 23 Apr 2009 17:46:47 +0000 (17:46 +0000)]
Remove @compatibility_alias regression.

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

15 years agoBugReporter (extensive diagnostics): Recursively adjust the referred expression
Ted Kremenek [Thu, 23 Apr 2009 16:44:22 +0000 (16:44 +0000)]
BugReporter (extensive diagnostics): Recursively adjust the referred expression
when popping location contexts.

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

15 years agoFix rdar://6819438 - -Wmissing-noreturn not recognised by clang,
Chris Lattner [Thu, 23 Apr 2009 16:38:59 +0000 (16:38 +0000)]
Fix rdar://6819438 - -Wmissing-noreturn not recognised by clang,
by accepting and ignoring it for now.

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

15 years agoRemoved bunch of FIXMEs no longer needed.
Fariborz Jahanian [Thu, 23 Apr 2009 16:27:20 +0000 (16:27 +0000)]
Removed bunch of FIXMEs no longer needed.

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

15 years agoBugReporter (extensive diagnostics): Ignore parentheses when added control-flow
Ted Kremenek [Thu, 23 Apr 2009 16:19:29 +0000 (16:19 +0000)]
BugReporter (extensive diagnostics): Ignore parentheses when added control-flow
pieces for location contexts.

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

15 years agoMore PushOnScopeChain() FIXME's.
Steve Naroff [Thu, 23 Apr 2009 16:00:56 +0000 (16:00 +0000)]
More PushOnScopeChain() FIXME's.

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

15 years agoSema::ActOnStartClassInterface(): Use PushOnScopeChains().
Steve Naroff [Thu, 23 Apr 2009 15:15:40 +0000 (15:15 +0000)]
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.

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

15 years agoAdd PCH read/write support for Objective-C Selectors.
Steve Naroff [Thu, 23 Apr 2009 10:39:46 +0000 (10:39 +0000)]
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.

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

15 years agoMark IMAGE_INFO as constant on x86_64-darwin.
Daniel Dunbar [Thu, 23 Apr 2009 08:03:21 +0000 (08:03 +0000)]
Mark IMAGE_INFO as constant on x86_64-darwin.
 - This shouldn't change anything, we never actually access it, but
   this is consistent with llvm-gcc (and 32-bit)

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

15 years agofix a problem producing debug info with global blocks.
Chris Lattner [Thu, 23 Apr 2009 07:18:56 +0000 (07:18 +0000)]
fix a problem producing debug info with global blocks.

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

15 years agoAdd implicit definition of objc_msgSend.
Daniel Dunbar [Thu, 23 Apr 2009 07:00:09 +0000 (07:00 +0000)]
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.

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

15 years agoimplement debug info for _Complex.
Chris Lattner [Thu, 23 Apr 2009 06:13:01 +0000 (06:13 +0000)]
implement debug info for _Complex.

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

15 years agothe logic for computing __func__ and friends is really broken:
Chris Lattner [Thu, 23 Apr 2009 05:30:27 +0000 (05:30 +0000)]
the logic for computing __func__ and friends is really broken:
the type assigned by sema (and is visible with sizeof(__func__) for
example) has nothing to do with what codegen ends up producing.
We should eventually add a method on PredefinedExpr to handle this.
In the meantime, just set up some framework and add some fixme's.

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

15 years agoremove some gone files
Chris Lattner [Thu, 23 Apr 2009 05:29:03 +0000 (05:29 +0000)]
remove some gone files

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

15 years agoDon't build error/warning/assertion detection in the testing script.
Daniel Dunbar [Thu, 23 Apr 2009 05:03:44 +0000 (05:03 +0000)]
Don't build error/warning/assertion detection in the testing script.
 - This wasn't actually all that useful and isn't worth the extra
   (hard)code.

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

15 years agosome arm triples have weird characters in them, just fuzzy match
Chris Lattner [Thu, 23 Apr 2009 04:22:04 +0000 (04:22 +0000)]
some arm triples have weird characters in them, just fuzzy match
on armv* to be more compatible

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

15 years agoSilence warnings about common forms of -Wstrict-aliasing etc.
Chris Lattner [Thu, 23 Apr 2009 04:12:10 +0000 (04:12 +0000)]
Silence warnings about common forms of -Wstrict-aliasing etc.

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

15 years agoPCH (de-)serialization of the protocols in an ObjCInterfaceDecl
Douglas Gregor [Thu, 23 Apr 2009 03:59:07 +0000 (03:59 +0000)]
PCH (de-)serialization of the protocols in an ObjCInterfaceDecl

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

15 years agoAdd the PCH reader stub for ObjCCompatibleAliasDecl
Douglas Gregor [Thu, 23 Apr 2009 03:51:49 +0000 (03:51 +0000)]
Add the PCH reader stub for ObjCCompatibleAliasDecl

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

15 years agoPCH support for ObjCPropertyImplDecl
Douglas Gregor [Thu, 23 Apr 2009 03:43:53 +0000 (03:43 +0000)]
PCH support for ObjCPropertyImplDecl

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

15 years agoThe ivars in an ObjCImplementationDecl are now stored in the
Douglas Gregor [Thu, 23 Apr 2009 03:23:08 +0000 (03:23 +0000)]
The ivars in an ObjCImplementationDecl are now stored in the
DeclContext rather than in a separate list. This makes PCH
(de-)serialization trivial, so that ivars can be loaded lazily.

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

15 years agoPCH support for ObjCCategoryImplDecl (which can't be tested now).
Douglas Gregor [Thu, 23 Apr 2009 02:53:57 +0000 (02:53 +0000)]
PCH support for ObjCCategoryImplDecl (which can't be tested now).

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

15 years agoPCH (de-)serialization for ObjCImplDecl. This can't be tested yet.
Douglas Gregor [Thu, 23 Apr 2009 02:42:49 +0000 (02:42 +0000)]
PCH (de-)serialization for ObjCImplDecl. This can't be tested yet.

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

15 years agoAdd a CXXConstructExpr that represents an implicit call to a C++ constructor. I think...
Anders Carlsson [Thu, 23 Apr 2009 02:32:43 +0000 (02:32 +0000)]
Add a CXXConstructExpr that represents an implicit call to a C++ constructor. I think CXXTemporaryObjectExpr is going to become a subclass of CXXConstructExpr, since CXXTemporaryObjectExpr represents a syntactic temporary, for example T()

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

15 years agoUse std::sort instead of qsort.
Daniel Dunbar [Thu, 23 Apr 2009 01:29:05 +0000 (01:29 +0000)]
Use std::sort instead of qsort.
 - Notably, there was a memory error here, SkipIvars does not have to
   be the same size as IvarsInfo.

 - Fariborz, please check.

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

15 years agoEliminate the three SmallVectors in ObjCImplDecl (for instance
Douglas Gregor [Thu, 23 Apr 2009 01:02:12 +0000 (01:02 +0000)]
Eliminate the three SmallVectors in ObjCImplDecl (for instance
methods, class methods, and property implementations) and instead
place all of these entities into the DeclContext.

This eliminates more linear walks when looking for class or instance
methods and should make PCH (de-)serialization of ObjCDecls trivial
(and lazy).

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

15 years agoPCH support for Objective-C property declarations (UNTESTED!)
Douglas Gregor [Wed, 22 Apr 2009 23:20:34 +0000 (23:20 +0000)]
PCH support for Objective-C property declarations (UNTESTED!)

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

15 years agoivar layout bitmap is alive!
Fariborz Jahanian [Wed, 22 Apr 2009 23:00:43 +0000 (23:00 +0000)]
ivar layout bitmap is alive!

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

15 years agoAdd PCH statistics for the number/percent of lexical/visible declcontexts read
Douglas Gregor [Wed, 22 Apr 2009 22:34:57 +0000 (22:34 +0000)]
Add PCH statistics for the number/percent of lexical/visible declcontexts read

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

15 years agoAdd PathDiagnosticRange to PathDiagnostics. These simply wrap SourceRange and
Ted Kremenek [Wed, 22 Apr 2009 22:26:10 +0000 (22:26 +0000)]
Add PathDiagnosticRange to PathDiagnostics. These simply wrap SourceRange and
indicate whether or not the range represents an absolute range or should be
extended by lexing to the end of the token.

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

15 years agoSupport locally-declared external declarations in PCH files
Douglas Gregor [Wed, 22 Apr 2009 22:18:58 +0000 (22:18 +0000)]
Support locally-declared external declarations in PCH files

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

15 years agoClean up and de-XFAIL-ify PCH test for external definitions
Douglas Gregor [Wed, 22 Apr 2009 22:09:39 +0000 (22:09 +0000)]
Clean up and de-XFAIL-ify PCH test for external definitions

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

15 years agoremove obsolete tests.
Chris Lattner [Wed, 22 Apr 2009 22:06:26 +0000 (22:06 +0000)]
remove obsolete tests.

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

15 years agoSupport tentative definitions in precompiled headers. This isn't likely
Douglas Gregor [Wed, 22 Apr 2009 22:02:47 +0000 (22:02 +0000)]
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.

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

15 years agoRemove the serialization code that predates precompiled
Douglas Gregor [Wed, 22 Apr 2009 21:45:53 +0000 (21:45 +0000)]
Remove the serialization code that predates precompiled
headers. Future approaches to (de-)serializing ASTs will be based on
the PCH infrastructure.

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

15 years agoEliminate some FIXMEs in the PCH reader that were either already fixed or aren't...
Douglas Gregor [Wed, 22 Apr 2009 21:15:06 +0000 (21:15 +0000)]
Eliminate some FIXMEs in the PCH reader that were either already fixed or aren't actually things to fix

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

15 years agoEliminate Sema::KnownFunctionIDs, so that Sema doesn't end up pulling
Douglas Gregor [Wed, 22 Apr 2009 20:56:09 +0000 (20:56 +0000)]
Eliminate Sema::KnownFunctionIDs, so that Sema doesn't end up pulling
in a bunch of declarations from the PCH file. We're down to loading
very few declarations in Carbon-prefixed "Hello, World!":

*** PCH Statistics:
  6/20693 types read (0.028995%)
  7/59230 declarations read (0.011818%)
  50/44914 identifiers read (0.111324%)
  0/32954 statements read (0.000000%)
  5/6187 macros read (0.080815%)

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

15 years agoBugReporter (extensive diagnostics): Use correct location for location contexts.
Ted Kremenek [Wed, 22 Apr 2009 20:51:59 +0000 (20:51 +0000)]
BugReporter (extensive diagnostics): Use correct location for location contexts.

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

15 years agoBugReporter (extensive diagnostics): always add an edge if there is no location
Ted Kremenek [Wed, 22 Apr 2009 20:36:26 +0000 (20:36 +0000)]
BugReporter (extensive diagnostics): always add an edge if there is no location
context.

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

15 years agoAdd handling for complex->int, int->complex float, and float->complex
Eli Friedman [Wed, 22 Apr 2009 19:23:09 +0000 (19:23 +0000)]
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.

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

15 years agoMinimize the number and kind of "external definitions" that the PCH
Douglas Gregor [Wed, 22 Apr 2009 19:09:20 +0000 (19:09 +0000)]
Minimize the number and kind of "external definitions" that the PCH
file needs to store. CodeGen needs to see these definitions (via
HandleTopLevelDecl), otherwise it won't be able to generate code for
them.

This patch notifies the consumer (e.g., CodeGen) about function
definitions and variable definitions when the corresponding
declarations are deserialized. Hence, we don't eagerly deserialize the
declarations for every variable or function that has a definition in
the PCH file. This gives another 5% speedup for the Carbon-prefixed
"Hello, World!", and brings our PCH statistics down to something far
more reasonable:

*** PCH Statistics:
  13/20693 types read (0.062823%)
  17/59230 declarations read (0.028702%)
  54/44914 identifiers read (0.120230%)
  0/32954 statements read (0.000000%)
  5/6187 macros read (0.080815%)

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

15 years agoAdd missing dependency, patch by Jason Haslam!
Chris Lattner [Wed, 22 Apr 2009 18:59:57 +0000 (18:59 +0000)]
Add missing dependency, patch by Jason Haslam!

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

15 years agoLazy loading of builtins for precompiled headers.
Douglas Gregor [Wed, 22 Apr 2009 18:49:13 +0000 (18:49 +0000)]
Lazy loading of builtins for precompiled headers.

PCH files now contain complete information about builtins, including
any declarations that have been synthesized as part of building the
PCH file. When using a PCH file, we do not initialize builtins at all;
when needed, they'll be found in the PCH file.

This optimization translations into a 9% speedup for "Hello, World!"
with Carbon.h as a prefix header and roughly a 5% speedup for 403.gcc
with its prefix header. We're also reading less of the PCH file for
"Hello, World!":

*** PCH Statistics:
  286/20693 types read (1.382110%)
  1630/59230 declarations read (2.751984%)
  764/44914 identifiers read (1.701029%)
  1/32954 statements read (0.003035%)
  5/6187 macros read (0.080815%)

down from

*** PCH Statistics:
  411/20693 types read (1.986179%)
  2553/59230 declarations read (4.310316%)
  1093/44646 identifiers read (2.448148%)
  1/32954 statements read (0.003035%)
  21/6187 macros read (0.339421%)

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