]> granicus.if.org Git - clang/log
clang
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

15 years agoBugReporter (extensive diagnostics):
Ted Kremenek [Wed, 22 Apr 2009 18:37:42 +0000 (18:37 +0000)]
BugReporter (extensive diagnostics):
- Remove stale assertion that was breaking the test suite.
- When popping location contexts, only add a control-flow piece for fileID
  locations.

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

15 years agoBugReporter (extensive diagnostic algorithm): The initial control-flow edge now
Ted Kremenek [Wed, 22 Apr 2009 18:16:20 +0000 (18:16 +0000)]
BugReporter (extensive diagnostic algorithm): The initial control-flow edge now
starts from the first character of the first statement.

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

15 years agoPathDiagnosticLocation: ranges for terminators now only include the first
Ted Kremenek [Wed, 22 Apr 2009 18:03:00 +0000 (18:03 +0000)]
PathDiagnosticLocation: ranges for terminators now only include the first
character instead of the entire range for the IfStmt, ForStmt, etc. We may
gradually refine these ranges later, but basically terminator ranges just refer
to the first keyword.

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

15 years agoReapply r69771, with updates & fixes:
Daniel Dunbar [Wed, 22 Apr 2009 17:43:55 +0000 (17:43 +0000)]
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

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

15 years agoRemove some debugging output from the PCH reader
Douglas Gregor [Wed, 22 Apr 2009 14:18:52 +0000 (14:18 +0000)]
Remove some debugging output from the PCH reader

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

15 years agoccc-analyzer: Don't create preprocessed files about the ignored 'cdecl' attribute...
Ted Kremenek [Wed, 22 Apr 2009 13:42:27 +0000 (13:42 +0000)]
ccc-analyzer: Don't create preprocessed files about the ignored 'cdecl' attribute.  We know Clang doesn't support it yet.

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

15 years agoRemove lookupFieldDeclFromIvar from ObjCIvarDecl interface.
Daniel Dunbar [Wed, 22 Apr 2009 12:00:04 +0000 (12:00 +0000)]
Remove lookupFieldDeclFromIvar from ObjCIvarDecl interface.
 - This is only used by CGObjCRuntime now.

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

15 years agoSimplify addRecordToClass, it is not legal to call it on a forward
Daniel Dunbar [Wed, 22 Apr 2009 10:56:29 +0000 (10:56 +0000)]
Simplify addRecordToClass, it is not legal to call it on a forward
declaration now.

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

15 years agoDon't convert interface types (to structs) as part of CodeGenTypes.
Daniel Dunbar [Wed, 22 Apr 2009 10:28:39 +0000 (10:28 +0000)]
Don't convert interface types (to structs) as part of CodeGenTypes.
 - This has pros and cons, but for now the pros seem to significantly
   outway the con.

The con is that we will always need to cast in the runtime
implementation to a struct type, if we wish to access an interface
directly.

The pros are:
 - Avoid the cost of generating types which are used. Most
   manipulation of Objective-C objects is done through messages, and
   only the implementation of a class will directly access
   memory. Previously, we would convert the type even if it only
   appear as a function parameter, for example.

 - We don't need to worry about incomplete types, and
   UpdateCompletedType for interfaces is gone.

 - It becomes easier to narrow the interface to the shadow struct for
   Objective-C interfaces (so it can be eliminated).

Currently the runtimes still use the CodeGenTypes machinery to
generate the LLVM structure they need via ConvertTagDecl, but this can
eventually be replaced.

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

15 years agoAdd CGObjCRuntime::GetConcreteClassStruct to encapsulate access to the
Daniel Dunbar [Wed, 22 Apr 2009 09:39:34 +0000 (09:39 +0000)]
Add CGObjCRuntime::GetConcreteClassStruct to encapsulate access to the
underlying llvm::StructType for an interface.

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

15 years agoAdd another workaround for -include.
Daniel Dunbar [Wed, 22 Apr 2009 08:53:01 +0000 (08:53 +0000)]
Add another workaround for -include.
 - If we don't find a file looking relative to the current working
   directory, fall back to header search. This is closer to what would
   happen if the lookup was starting from right directory in the first
   place (except it will find files in the directory of the main
   source file, which I *think* should not be found).

 - PR3992.

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

15 years agoSimplify.
Daniel Dunbar [Wed, 22 Apr 2009 08:50:59 +0000 (08:50 +0000)]
Simplify.

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

15 years agoEmit meta data using the Ivar, not a looked up FieldDecl.
Daniel Dunbar [Wed, 22 Apr 2009 08:22:17 +0000 (08:22 +0000)]
Emit meta data using the Ivar, not a looked up FieldDecl.

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

15 years agoUse ComputeIvarBaseOffset instead of looking up by hand.
Daniel Dunbar [Wed, 22 Apr 2009 08:20:31 +0000 (08:20 +0000)]
Use ComputeIvarBaseOffset instead of looking up by hand.

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

15 years agoMerge ivar access amongst the three runtimes.
Daniel Dunbar [Wed, 22 Apr 2009 07:32:20 +0000 (07:32 +0000)]
Merge ivar access amongst the three runtimes.
 - For now, this means we are always doing the address computations by
   hand instead of constructing a proper GEP. Right now, however, this
   is less important than having fewer entry points to dealing with
   Objective-C interface layout.

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

15 years agoMake sure this test runs on all 3 Objective-C implementations.
Daniel Dunbar [Wed, 22 Apr 2009 07:28:06 +0000 (07:28 +0000)]
Make sure this test runs on all 3 Objective-C implementations.

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

15 years agoimplement debug info support for id<proto> and interface<proto>
Chris Lattner [Wed, 22 Apr 2009 06:58:56 +0000 (06:58 +0000)]
implement debug info support for id<proto> and interface<proto>

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

15 years agoObjCQualifiedClass is dead, remove it.
Chris Lattner [Wed, 22 Apr 2009 06:50:37 +0000 (06:50 +0000)]
ObjCQualifiedClass is dead, remove it.

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

15 years agodeserialization support for qualified interfaces
Chris Lattner [Wed, 22 Apr 2009 06:45:28 +0000 (06:45 +0000)]
deserialization support for qualified interfaces

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

15 years agopch support for protocol qualified id's.
Chris Lattner [Wed, 22 Apr 2009 06:40:03 +0000 (06:40 +0000)]
pch support for protocol qualified id's.

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

15 years agoadd three new objc expression types. @selector doesn't work because we have no
Chris Lattner [Wed, 22 Apr 2009 06:29:42 +0000 (06:29 +0000)]
add three new objc expression types.  @selector doesn't work because we have no
way to serialize selectors yet.

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