]> granicus.if.org Git - clang/log
clang
15 years agoFixup comment.
Steve Naroff [Sat, 25 Apr 2009 12:18:35 +0000 (12:18 +0000)]
Fixup comment.

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

15 years agoFix a major bug in PCHReader::ReadSelectorBlock().
Steve Naroff [Sat, 25 Apr 2009 12:07:12 +0000 (12:07 +0000)]
Fix a major bug in PCHReader::ReadSelectorBlock().

Also simplify some syntax in PCHWriter::WritePreprocessor(), suggested by Chris.

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

15 years agoChange SemaType's "GetTypeForDeclarator" and "ConvertDeclSpecToType" to
Chris Lattner [Sat, 25 Apr 2009 08:47:54 +0000 (08:47 +0000)]
Change SemaType's "GetTypeForDeclarator" and "ConvertDeclSpecToType" to
always return a non-null QualType + error bit.  This fixes a bunch of
cases that didn't check for null result (and could thus crash) and eliminates
some crappy code scattered throughout sema.

This also improves the diagnostics in the recursive struct case to eliminate
a bogus second error.  It also cleans up the case added to function.c by forming
a proper function type even though the declarator is erroneous, allowing the
parameter to be added to the function.  Before:

t.c:2:1: error: unknown type name 'unknown_type'
unknown_type f(void*P)
^
t.c:4:3: error: use of undeclared identifier 'P'
  P+1;
  ^

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

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

15 years agochange a couple more c++ sema methods to be based on isinvalid bits.
Chris Lattner [Sat, 25 Apr 2009 08:35:12 +0000 (08:35 +0000)]
change a couple more c++ sema methods to be based on isinvalid bits.

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

15 years agovarious "is invalid" cleanups for C++ ctors/dtors.
Chris Lattner [Sat, 25 Apr 2009 08:28:21 +0000 (08:28 +0000)]
various "is invalid" cleanups for C++ ctors/dtors.

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

15 years agoThis is a pretty big cleanup for how invalid decl/type are handle.
Chris Lattner [Sat, 25 Apr 2009 08:06:05 +0000 (08:06 +0000)]
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.

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

15 years agoRevert my PCH change. I'm happy now
Douglas Gregor [Sat, 25 Apr 2009 07:18:06 +0000 (07:18 +0000)]
Revert my PCH change. I'm happy now

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

15 years agoTemporarily try to build with PCH by default. Revert this change once
Douglas Gregor [Sat, 25 Apr 2009 06:28:32 +0000 (06:28 +0000)]
Temporarily try to build with PCH by default. Revert this change once
we see what trouble it causes.

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

15 years agofix PR4049, a crash on invalid, by making sema install the right number of
Chris Lattner [Sat, 25 Apr 2009 06:12:16 +0000 (06:12 +0000)]
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’

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

15 years agorename getNumParmVarDeclsFromType back to getNumParams(),
Chris Lattner [Sat, 25 Apr 2009 06:03:53 +0000 (06:03 +0000)]
rename getNumParmVarDeclsFromType back to getNumParams(),
remove a special case that was apparently for typeof() and
generalize the code in SemaDecl that handles typedefs to
handle any sugar type (including typedef, typeof, etc).
Improve comment to make it more clear what is going on.

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

15 years agoadd a new helper function to FunctionDecl instead of it being
Chris Lattner [Sat, 25 Apr 2009 05:56:45 +0000 (05:56 +0000)]
add a new helper function to FunctionDecl instead of it being
static in Decl.cpp.

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

15 years agoin:
Chris Lattner [Sat, 25 Apr 2009 05:51:56 +0000 (05:51 +0000)]
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.

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

15 years agoDriver: -mkernel disables default use of unwind tables (although I
Daniel Dunbar [Sat, 25 Apr 2009 05:49:54 +0000 (05:49 +0000)]
Driver: -mkernel disables default use of unwind tables (although I
don't yet understand where this is happening in llvm-gcc).

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

15 years agoset NewFD->setInvalidDecl() in one place, sharing code and ensuring that
Chris Lattner [Sat, 25 Apr 2009 05:44:12 +0000 (05:44 +0000)]
set NewFD->setInvalidDecl() in one place, sharing code and ensuring that
functions with prototypes get the bit.

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

15 years agoDriver: -mkernel and -fapple-kext imply -mno-red-zone.
Daniel Dunbar [Sat, 25 Apr 2009 05:33:23 +0000 (05:33 +0000)]
Driver: -mkernel and -fapple-kext imply -mno-red-zone.

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

15 years agoFix pointer addressing and array subscripting of Objective-C interface
Daniel Dunbar [Sat, 25 Apr 2009 05:08:32 +0000 (05:08 +0000)]
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

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

15 years agoHook up attribute 'objc_ownership_retain' to the analyzer. This attribute allows
Ted Kremenek [Sat, 25 Apr 2009 01:21:50 +0000 (01:21 +0000)]
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).

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

15 years agoMake sure that the consumer sees all interested decls. This fixes Preview
Douglas Gregor [Sat, 25 Apr 2009 00:41:30 +0000 (00:41 +0000)]
Make sure that the consumer sees all interested decls. This fixes Preview

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

15 years agoAdd new checker-specific attribute 'objc_ownership_retain'. This isn't hooked up
Ted Kremenek [Sat, 25 Apr 2009 00:17:17 +0000 (00:17 +0000)]
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.

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

15 years agoreject explicit pointer arithmetic on interface pointers in 64-bit objc ABI
Chris Lattner [Fri, 24 Apr 2009 23:50:08 +0000 (23:50 +0000)]
reject explicit pointer arithmetic on interface pointers in 64-bit objc ABI

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

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