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

15 years agoimplement serialization support for @encode,
Chris Lattner [Wed, 22 Apr 2009 05:57:30 +0000 (05:57 +0000)]
implement serialization support for @encode,
fix a couple of bugs in reader support for ObjCInterfaceDecl,
and add support for reading ObjCInterfaceType.

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

15 years agorename methods.* -> objc_methods.*
Chris Lattner [Wed, 22 Apr 2009 05:31:53 +0000 (05:31 +0000)]
rename methods.* -> objc_methods.*

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

15 years agochange implicit int warnings to point to the identifier, not the
Chris Lattner [Wed, 22 Apr 2009 05:27:59 +0000 (05:27 +0000)]
change implicit int warnings to point to the identifier, not the
start of the declspec.  The fixit still goes there, and we underline
the declspec.  This helps when the start of the declspec came from a
macro that expanded from a system header.  For example, we now produce:

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

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

15 years agoUpdate checker build.
Ted Kremenek [Wed, 22 Apr 2009 05:13:56 +0000 (05:13 +0000)]
Update checker build.

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

15 years agoMake ObjCInterfaceDecl's const in some more places.
Daniel Dunbar [Wed, 22 Apr 2009 05:08:15 +0000 (05:08 +0000)]
Make ObjCInterfaceDecl's const in some more places.

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

15 years agoReorganize built-in initialization to separate the creation of target builtins from...
Douglas Gregor [Wed, 22 Apr 2009 04:56:28 +0000 (04:56 +0000)]
Reorganize built-in initialization to separate the creation of target builtins from marking IdentifierInfos as builtins. No functionality change

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

15 years agoRevert r69771, I missed some (obvious) details. :/
Daniel Dunbar [Wed, 22 Apr 2009 04:39:47 +0000 (04:39 +0000)]
Revert r69771, I missed some (obvious) details. :/

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

15 years agoMark another TypeForDecl const and make getObjCInterfaceType's argument const.
Daniel Dunbar [Wed, 22 Apr 2009 04:34:53 +0000 (04:34 +0000)]
Mark another TypeForDecl const and make getObjCInterfaceType's argument const.

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

15 years agoRework the shadow struct that is layed out for Objective-C classes.
Daniel Dunbar [Wed, 22 Apr 2009 03:45:12 +0000 (03:45 +0000)]
Rework the shadow struct that is layed out for Objective-C classes.

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

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

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

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

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

15 years agoFix rdar://6814950 - stdint.h isn't "-pedantic -std=c89" clean,
Chris Lattner [Wed, 22 Apr 2009 03:42:19 +0000 (03:42 +0000)]
Fix rdar://6814950 - stdint.h isn't "-pedantic -std=c89" clean,
by marking the predefines buffer as a system header.  The problem
with stdint is that it was getting problems like this:

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

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

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

15 years agomove 64-bit abi functions to lazy model, everything is lazy now, yay.
Chris Lattner [Wed, 22 Apr 2009 02:53:24 +0000 (02:53 +0000)]
move 64-bit abi functions to lazy model, everything is lazy now, yay.

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

15 years agoremove the last of the non-lazy objc runtime functions for the 32-bit ABI,
Chris Lattner [Wed, 22 Apr 2009 02:44:54 +0000 (02:44 +0000)]
remove the last of the non-lazy objc runtime functions for the 32-bit ABI,
7 left for 64-bit ABI.

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

15 years agonumber of non-lazy runtime functions from 9 -> 4.
Chris Lattner [Wed, 22 Apr 2009 02:38:11 +0000 (02:38 +0000)]
number of non-lazy runtime functions from 9 -> 4.

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

15 years agomake message send functions lazy, we're down from 14 non-lazy functions to 9.
Chris Lattner [Wed, 22 Apr 2009 02:32:31 +0000 (02:32 +0000)]
make message send functions lazy, we're down from 14 non-lazy functions to 9.

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

15 years agomove more EH stuff to being lazily created. An empty .m file now
Chris Lattner [Wed, 22 Apr 2009 02:26:14 +0000 (02:26 +0000)]
move more EH stuff to being lazily created.  An empty .m file now
produces just 14 dead "declares" in llvm ir instead of 19.

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

15 years agomake try/catch objc runtime functions be lazily generated.
Chris Lattner [Wed, 22 Apr 2009 02:15:23 +0000 (02:15 +0000)]
make try/catch objc runtime functions be lazily generated.
rdar://6809612

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

15 years agorename test
Chris Lattner [Wed, 22 Apr 2009 00:59:27 +0000 (00:59 +0000)]
rename test

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

15 years agoFix a problem with objc foreach loop. It turns out that objc mode changes
Chris Lattner [Wed, 22 Apr 2009 00:54:41 +0000 (00:54 +0000)]
Fix a problem with objc foreach loop.  It turns out that objc mode changes
for scoping to match C99 even when in C89 mode.  This patch fixes this
(eliminating a "redefinition of thisKey" error), and also prevents non-sensical
diagnostics in -pedantic mode like this:

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

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

15 years agoTest PCH support for VLAs
Douglas Gregor [Wed, 22 Apr 2009 00:21:21 +0000 (00:21 +0000)]
Test PCH support for VLAs

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

15 years agoEliminate a FIXME in one of the PCH test cases
Douglas Gregor [Wed, 22 Apr 2009 00:17:41 +0000 (00:17 +0000)]
Eliminate a FIXME in one of the PCH test cases

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

15 years agoFix some mishandling of the attr(gnu_inline) mode when used with
Chris Lattner [Wed, 22 Apr 2009 00:03:30 +0000 (00:03 +0000)]
Fix some mishandling of the attr(gnu_inline) mode when used with
extern.  Previously we would warn about it and ignore the attribute.
This is incorrect, it should be handled as a c89 "extern inline"
function.  Many thanks to Matthieu Castet for pointing this out and
beating me over the head until I got it.

PR3988: extern inline function are not externally visible

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

15 years agoLazy deserialization of macro definitions for precompiled headers.
Douglas Gregor [Tue, 21 Apr 2009 23:56:24 +0000 (23:56 +0000)]
Lazy deserialization of macro definitions for precompiled headers.

This optimization improves performance on the Carbon-prefixed "Hello,
World!" example by 57%. For reference, we're now about 2.25x faster
than GCC PCH. We're also pulling in far less of the PCH file:

*** 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@69755 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix crash reported in PR 3991. The analyzer doesn't reason about ObjCKVCExpr.
Ted Kremenek [Tue, 21 Apr 2009 23:53:32 +0000 (23:53 +0000)]
Fix crash reported in PR 3991.  The analyzer doesn't reason about ObjCKVCExpr.

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

15 years agoUpdate Xcode project with recently added files.
Steve Naroff [Tue, 21 Apr 2009 23:46:12 +0000 (23:46 +0000)]
Update Xcode project with recently added files.

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

15 years agoThis patch is largely due to Zhongxing Xu. I've simply applied it because of
Ted Kremenek [Tue, 21 Apr 2009 23:31:46 +0000 (23:31 +0000)]
This patch is largely due to Zhongxing Xu. I've simply applied it because of
some refactoring I did recently to StoreManager.

StoreManager::CastRegion: Handle casts to void* by stripping TypedViewRegions.

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

15 years agoapply Eli's patch to fix PR4008, with a testcase. Thanks Eli!
Chris Lattner [Tue, 21 Apr 2009 23:28:41 +0000 (23:28 +0000)]
apply Eli's patch to fix PR4008, with a testcase.  Thanks Eli!

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

15 years agoResolve merge conflict better.
Mike Stump [Tue, 21 Apr 2009 23:03:34 +0000 (23:03 +0000)]
Resolve merge conflict better.

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

15 years agofix PR4026: Clang can't codegen __func__ without implicit cast
Chris Lattner [Tue, 21 Apr 2009 23:00:09 +0000 (23:00 +0000)]
fix PR4026: Clang can't codegen __func__ without implicit cast

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

15 years agoTighten up blocks type checking. This was discussed back in the
Mike Stump [Tue, 21 Apr 2009 22:51:42 +0000 (22:51 +0000)]
Tighten up blocks type checking.  This was discussed back in the
r56595 timeframe, but left undone.  Radar 6812711

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

15 years agoLazy deserialization of identifiers in PCH files fixed a problem with
Douglas Gregor [Tue, 21 Apr 2009 22:48:38 +0000 (22:48 +0000)]
Lazy deserialization of identifiers in PCH files fixed a problem with
name lookup of structures declared within other structures.

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

15 years agoFix rdar://6814047, a crash on invalid in blocks code I noticed when
Chris Lattner [Tue, 21 Apr 2009 22:38:46 +0000 (22:38 +0000)]
Fix rdar://6814047, a crash on invalid in blocks code I noticed when
working on the previous fix.

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

15 years agoFix: <rdar://problem/6777209> false Dereference of null pointer in loop: pointer...
Ted Kremenek [Tue, 21 Apr 2009 22:38:05 +0000 (22:38 +0000)]
Fix: <rdar://problem/6777209> false Dereference of null pointer in loop: pointer increment/decrement preserves non-nullness

When the StoreManager doesn't reason well about pointer-arithmetic, propagate
the non-nullness constraint on a pointer value when performing pointer
arithmetic uisng ++/--.

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

15 years agoTweak pretty-printing of constraints.
Ted Kremenek [Tue, 21 Apr 2009 22:37:11 +0000 (22:37 +0000)]
Tweak pretty-printing of constraints.

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

15 years agoDon't bother writing a visible-declarations record for the translation
Douglas Gregor [Tue, 21 Apr 2009 22:32:33 +0000 (22:32 +0000)]
Don't bother writing a visible-declarations record for the translation
unit into the PCH file, since we won't be performing name lookup into
it anyway. Reduces the size of the Carbon.h PCH file by ~200k.

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

15 years agofix marking of nested blocks with the "hasBlockDeclRefExprs" to
Chris Lattner [Tue, 21 Apr 2009 22:26:47 +0000 (22:26 +0000)]
fix marking of nested blocks with the "hasBlockDeclRefExprs" to
mark exactly the blocks which have references that are "live through".
This fixes a rejects valid:
rdar://6808730 - [sema] [blocks] block rejected at global scope

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

15 years agoLazy deserialization of the declaration chains associated with
Douglas Gregor [Tue, 21 Apr 2009 22:25:48 +0000 (22:25 +0000)]
Lazy deserialization of the declaration chains associated with
identifiers from a precompiled header.

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

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

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

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

15 years agothis is a warning now, return a well formed ast.
Chris Lattner [Tue, 21 Apr 2009 22:00:54 +0000 (22:00 +0000)]
this is a warning now, return a well formed ast.

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

15 years agoRefactor 'BasicStoreManager::CastRegion' and 'RegionStoreManager::CastRegion'
Ted Kremenek [Tue, 21 Apr 2009 21:51:34 +0000 (21:51 +0000)]
Refactor 'BasicStoreManager::CastRegion' and 'RegionStoreManager::CastRegion'
into StoreManager::CastRegion. Both methods were practically identical, and this
is core logic that is common to all StoreManagers since it defines the basic
invariants of the abstract memory model.

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

15 years agoforce a 32-bit triple.
Chris Lattner [Tue, 21 Apr 2009 21:42:41 +0000 (21:42 +0000)]
force a 32-bit triple.

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

15 years agoMake sure to mark the interface as completed when we see an
Daniel Dunbar [Tue, 21 Apr 2009 21:41:56 +0000 (21:41 +0000)]
Make sure to mark the interface as completed when we see an
@implementation that closes a @class delcaration.
 - I don't know how to make a test case for this, but this strengthens
   the invariants that hold internally. The functionality change here
   is the edit to SemaDeclObjC.cpp.

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

15 years agoForce triple (test case fails for platforms with the non-fragile ABI).
Daniel Dunbar [Tue, 21 Apr 2009 21:17:29 +0000 (21:17 +0000)]
Force triple (test case fails for platforms with the non-fragile ABI).

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

15 years agoWe no longer accept @defs with the non-fragile ABI.
Daniel Dunbar [Tue, 21 Apr 2009 21:16:23 +0000 (21:16 +0000)]
We no longer accept @defs with the non-fragile ABI.

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

15 years agotemporarily downgrade to a warning.
Chris Lattner [Tue, 21 Apr 2009 21:14:41 +0000 (21:14 +0000)]
temporarily downgrade to a warning.

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

15 years agoPlist diagnostics: Remove deprecated single-point locations in control-flow
Ted Kremenek [Tue, 21 Apr 2009 21:03:00 +0000 (21:03 +0000)]
Plist diagnostics: Remove deprecated single-point locations in control-flow
pieces.

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

15 years agoPatch to diagnose use of objc's @defs in nonfragile abi.
Fariborz Jahanian [Tue, 21 Apr 2009 20:28:41 +0000 (20:28 +0000)]
Patch to diagnose use of objc's @defs in nonfragile abi.

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

15 years agoAdded over-release test case.
Ted Kremenek [Tue, 21 Apr 2009 20:01:03 +0000 (20:01 +0000)]
Added over-release test case.

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

15 years agoRecommit 69694 but this time also include the header changes (sorry for breaking
Ted Kremenek [Tue, 21 Apr 2009 19:56:58 +0000 (19:56 +0000)]
Recommit 69694 but this time also include the header changes (sorry for breaking
the build).

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

15 years agoreject sizeof(itf) when itf is a forward declared interface, or when
Chris Lattner [Tue, 21 Apr 2009 19:55:16 +0000 (19:55 +0000)]
reject sizeof(itf) when itf is a forward declared interface, or when
in non-fragile abi mode.  rdar://6811884

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

15 years agoFix emission of static tentative definitions referenced from other static functions
Douglas Gregor [Tue, 21 Apr 2009 19:28:58 +0000 (19:28 +0000)]
Fix emission of static tentative definitions referenced from other static functions

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

15 years agoRevert 69694 (use of undefined getSymbol)
Daniel Dunbar [Tue, 21 Apr 2009 18:54:52 +0000 (18:54 +0000)]
Revert 69694 (use of undefined getSymbol)

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

15 years agoMore objc2's ivar layout bitmap. No change in functionality.
Fariborz Jahanian [Tue, 21 Apr 2009 18:33:06 +0000 (18:33 +0000)]
More objc2's ivar layout bitmap. No change in functionality.

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

15 years agoAdd pretty-printing for CodeTextRegions.
Ted Kremenek [Tue, 21 Apr 2009 18:31:19 +0000 (18:31 +0000)]
Add pretty-printing for CodeTextRegions.

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

15 years agoLexically order the implementation of MemRegion 'print' methods. No functionality...
Ted Kremenek [Tue, 21 Apr 2009 18:09:22 +0000 (18:09 +0000)]
Lexically order the implementation of MemRegion 'print' methods.  No functionality change.

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

15 years agodon't bother emitting a zero byte memset at all. We used to get them
Chris Lattner [Tue, 21 Apr 2009 17:59:23 +0000 (17:59 +0000)]
don't bother emitting a zero byte memset at all.  We used to get them
in cases like this:

typedef struct {
  short instance;
  char name[0];
} ATTR_LIST_ENTRY2;

void test() {
  ATTR_LIST_ENTRY2 X = (ATTR_LIST_ENTRY2) { .instance = 7, };
}

While it is safe to emit them, it is pretty silly.

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

15 years agoUse 'getAs<CodeTextRegion>' instead of 'dyn_cast<CodeTextRegion>' to handle any
Ted Kremenek [Tue, 21 Apr 2009 17:37:26 +0000 (17:37 +0000)]
Use 'getAs<CodeTextRegion>' instead of 'dyn_cast<CodeTextRegion>' to handle any
layered regions.

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

15 years agoGrammar fix.
Ted Kremenek [Tue, 21 Apr 2009 17:14:24 +0000 (17:14 +0000)]
Grammar fix.

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

15 years agoExplictly track tentative definitions within Sema, then hand those
Douglas Gregor [Tue, 21 Apr 2009 17:11:58 +0000 (17:11 +0000)]
Explictly track tentative definitions within Sema, then hand those
tentative definitions off to the ASTConsumer at the end of the
translation unit.

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

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

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

15 years agoFix test typo.
Daniel Dunbar [Tue, 21 Apr 2009 16:03:31 +0000 (16:03 +0000)]
Fix test typo.

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

15 years agoUse an ASTRecordLayout to compute the sizeof an interface, not
Daniel Dunbar [Tue, 21 Apr 2009 15:48:54 +0000 (15:48 +0000)]
Use an ASTRecordLayout to compute the sizeof an interface, not
addRecordToClass.
 - Among other things, this fixes a crash when applying sizeof to an
   interface with synthesized ivars, although things still aren't
   "correct" here.

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

15 years agoAdd pch reader/writer support for most of DeclObjC.h. Very close to reading/writing...
Steve Naroff [Tue, 21 Apr 2009 15:12:33 +0000 (15:12 +0000)]
Add pch reader/writer support for most of DeclObjC.h. Very close to reading/writing all ObjC AST nodes that we will encounter in header files (still a few FIXME's).

Once selector support is in place, we should be able to take this for a spin (and add test cases).

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

15 years agoimplement semantic analysis for @synchronized, fixing a crash on invalid
Chris Lattner [Tue, 21 Apr 2009 06:11:25 +0000 (06:11 +0000)]
implement semantic analysis for @synchronized, fixing a crash on invalid
rdar://6810940 - @synchronized has no sema checks

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

15 years agothis time with more workingness.
Chris Lattner [Tue, 21 Apr 2009 06:06:09 +0000 (06:06 +0000)]
this time with more workingness.

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

15 years agoPass and return aggregate types directly to function calls.
Sanjiv Gupta [Tue, 21 Apr 2009 06:01:16 +0000 (06:01 +0000)]
Pass and return aggregate types directly to function calls.

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

15 years agoadd support for goto checking and @synchronized blocks,
Chris Lattner [Tue, 21 Apr 2009 06:01:00 +0000 (06:01 +0000)]
add support for goto checking and @synchronized blocks,
rdar://6810106

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

15 years agofix massive testsuite failures from Alexei's patch due to inverted logic.
Chris Lattner [Tue, 21 Apr 2009 06:00:24 +0000 (06:00 +0000)]
fix massive testsuite failures from Alexei's patch due to inverted logic.

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

15 years agoSplit preprocessor initialization logic out of clang-cc into
Chris Lattner [Tue, 21 Apr 2009 05:40:52 +0000 (05:40 +0000)]
Split preprocessor initialization logic out of clang-cc into
libfrontend.  Patch by Alexei Svitkine!

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

15 years agodocument new form of -fdiagnostics-print-source-range-in
Chris Lattner [Tue, 21 Apr 2009 05:35:32 +0000 (05:35 +0000)]
document new form of -fdiagnostics-print-source-range-in

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

15 years agorename -fprint-source-range-info -> -fdiagnostics-print-source-range-info.
Chris Lattner [Tue, 21 Apr 2009 05:34:31 +0000 (05:34 +0000)]
rename -fprint-source-range-info -> -fdiagnostics-print-source-range-info.
Temporarily accept both of them, I'll rip out the old one after awhile.

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

15 years agoFix PR4027 + rdar://6808859, we were rejecting implicit casts of
Chris Lattner [Tue, 21 Apr 2009 05:19:11 +0000 (05:19 +0000)]
Fix PR4027 + rdar://6808859, we were rejecting implicit casts of
aggregates even though we already accept explicit ones.  Easy fix.

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

15 years agodowngrade from extwarn to warning.
Chris Lattner [Tue, 21 Apr 2009 04:54:03 +0000 (04:54 +0000)]
downgrade from extwarn to warning.

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

15 years agoimprove MacroInfo to track the source range of the macro definition,
Chris Lattner [Tue, 21 Apr 2009 04:46:33 +0000 (04:46 +0000)]
improve MacroInfo to track the source range of the macro definition,
patch by Alexei Svitkine!

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

15 years agouse of predefined identifiers like __func__ at global scope warn in sema,
Chris Lattner [Tue, 21 Apr 2009 04:41:23 +0000 (04:41 +0000)]
use of predefined identifiers like __func__ at global scope warn in sema,
but crashed codegen.  Fix this to report the name of the llvm function.
This fixes rdar://6808051

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

15 years agomake "in included from" and "in instatiation from" messages respect
Chris Lattner [Tue, 21 Apr 2009 03:57:54 +0000 (03:57 +0000)]
make "in included from" and "in instatiation from" messages respect
-fno-show-location, patch by Alexei Svitkine (PR4024)

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

15 years agoadd a preprocessor callback function for #undef, patch by
Chris Lattner [Tue, 21 Apr 2009 03:42:09 +0000 (03:42 +0000)]
add a preprocessor callback function for #undef, patch by
Alexei Svitkine!

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

15 years agoAdd a CXXDestroyExpr. Add classof member functions to CXXTempVarDecl.
Anders Carlsson [Tue, 21 Apr 2009 02:22:11 +0000 (02:22 +0000)]
Add a CXXDestroyExpr. Add classof member functions to CXXTempVarDecl.

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

15 years agoUse an APInt of target int size to detect overflow while parsing multichars.
Sanjiv Gupta [Tue, 21 Apr 2009 02:21:29 +0000 (02:21 +0000)]
Use an APInt of target int size to detect overflow while parsing multichars.
So 'abc' on i16 platforms will warn but not on i32 platforms.

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

15 years agoAdd the beginnings of a CXXTempVarDecl class.
Anders Carlsson [Tue, 21 Apr 2009 01:57:48 +0000 (01:57 +0000)]
Add the beginnings of a CXXTempVarDecl class.

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

15 years agoRemove unnused variable.
Daniel Dunbar [Tue, 21 Apr 2009 01:32:46 +0000 (01:32 +0000)]
Remove unnused variable.

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

15 years agoKill ASTContext::[gs]etFieldForDecl, instead we just lookup things
Daniel Dunbar [Tue, 21 Apr 2009 01:19:28 +0000 (01:19 +0000)]
Kill ASTContext::[gs]etFieldForDecl, instead we just lookup things
when we need them -- which is exactly what some code was already
doing!
 - No intended functionality change.

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

15 years agoRevert 69646, that was the precise inverse of what I wanted to commit.
Daniel Dunbar [Tue, 21 Apr 2009 01:19:10 +0000 (01:19 +0000)]
Revert 69646, that was the precise inverse of what I wanted to commit.

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

15 years agoKill ASTContext::[gs]etFieldForDecl, instead we just lookup things
Daniel Dunbar [Tue, 21 Apr 2009 01:18:01 +0000 (01:18 +0000)]
Kill ASTContext::[gs]etFieldForDecl, instead we just lookup things
when we need them -- which is exactly what some code was already
doing!
 - No intended functionality change.

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

15 years agoFixup codegen for write barriers for block variables. Radar 6786715
Mike Stump [Tue, 21 Apr 2009 00:51:43 +0000 (00:51 +0000)]
Fixup codegen for write barriers for block variables.  Radar 6786715

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

15 years agoRemove LateBoundIVars() runtime interface, it is unused.
Daniel Dunbar [Tue, 21 Apr 2009 00:49:20 +0000 (00:49 +0000)]
Remove LateBoundIVars() runtime interface, it is unused.

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

15 years agoAssert on a few conditions that (I believe) should hold
Daniel Dunbar [Tue, 21 Apr 2009 00:41:40 +0000 (00:41 +0000)]
Assert on a few conditions that (I believe) should hold
w.r.t. ASTContext::[gs]etFieldDecl, and the Field argument to
EmitObjCValueForIvar).

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

15 years agoLook at the TMP environment variable as well.
Daniel Dunbar [Tue, 21 Apr 2009 00:25:10 +0000 (00:25 +0000)]
Look at the TMP environment variable as well.

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

15 years agoUpdate this (non-default) test case.
Daniel Dunbar [Mon, 20 Apr 2009 23:53:56 +0000 (23:53 +0000)]
Update this (non-default) test case.

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

15 years agoObjC2's Ivar bitmap layout work. No change in functionality.
Fariborz Jahanian [Mon, 20 Apr 2009 22:03:45 +0000 (22:03 +0000)]
ObjC2's Ivar bitmap layout work. No change in functionality.

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

15 years agoMark TypeForDecl mutable.
Daniel Dunbar [Mon, 20 Apr 2009 21:52:34 +0000 (21:52 +0000)]
Mark TypeForDecl mutable.
 - Let the const propogation begin.

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