]> granicus.if.org Git - clang/log
clang
14 years agoNeXT/EH: Tidy up EH code a bit, don't emit the catch block EH handler if it is unreac...
Daniel Dunbar [Fri, 23 Apr 2010 19:12:24 +0000 (19:12 +0000)]
NeXT/EH: Tidy up EH code a bit, don't emit the catch block EH handler if it is unreachable.

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

14 years agoRecommit my change to how C++ does elaborated type lookups, now with
John McCall [Fri, 23 Apr 2010 18:46:30 +0000 (18:46 +0000)]
Recommit my change to how C++ does elaborated type lookups, now with
two bugfixes which fix selfhost and (hopefully) the nightly tests.

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

14 years agoImprove on my previous diagnostics: per Doug's comment.
Fariborz Jahanian [Fri, 23 Apr 2010 17:52:02 +0000 (17:52 +0000)]
Improve on my previous diagnostics: per Doug's comment.

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

14 years agoMore work toward implementing
Fariborz Jahanian [Fri, 23 Apr 2010 17:41:07 +0000 (17:41 +0000)]
More work toward implementing
NeXt's -fno-constant-cfstrings - wip.

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

14 years agoImplement PR6845. We allow matching constraints to have different
Chris Lattner [Fri, 23 Apr 2010 17:27:29 +0000 (17:27 +0000)]
Implement PR6845.  We allow matching constraints to have different
input and output types when the smaller value isn't mentioned in the
asm string.  Extend this support from integers to also allowing
fp values to be mismatched (if not mentioned in the asm string).

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

14 years agoTrying to improve on a diagnostics for properties.
Fariborz Jahanian [Fri, 23 Apr 2010 17:22:07 +0000 (17:22 +0000)]
Trying to improve on a diagnostics for properties.

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

14 years agoRequire a complete type for the lhs of member pointer dereference operations if the...
Sebastian Redl [Fri, 23 Apr 2010 17:18:26 +0000 (17:18 +0000)]
Require a complete type for the lhs of member pointer dereference operations if the type isn't exactly the same as the container class. Fixes PR6783.

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

14 years agofix typo
Chris Lattner [Fri, 23 Apr 2010 16:31:30 +0000 (16:31 +0000)]
fix typo

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

14 years agorename test
Chris Lattner [Fri, 23 Apr 2010 16:30:17 +0000 (16:30 +0000)]
rename test

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

14 years agodavid conrad points out that {|} in inline assembly on arm are not asm
Chris Lattner [Fri, 23 Apr 2010 16:29:58 +0000 (16:29 +0000)]
david conrad points out that {|} in inline assembly on arm are not asm
variants.  This fixes neon inline asm which my patch for PR6780 broke.

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

14 years agoWhen instantiating a typedef of an anonymous tag type, note in the tag
Douglas Gregor [Fri, 23 Apr 2010 16:25:07 +0000 (16:25 +0000)]
When instantiating a typedef of an anonymous tag type, note in the tag
declaration that this typedef gives the tag a name. Fixes a problem
uncovered by Boost.GIL (Generic Image Library).

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

14 years agoCleanup.
Anders Carlsson [Fri, 23 Apr 2010 16:24:12 +0000 (16:24 +0000)]
Cleanup.

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

14 years agoHandle copy initialization in BuildImplicitMemberInitializer. Not used yet.
Anders Carlsson [Fri, 23 Apr 2010 16:04:08 +0000 (16:04 +0000)]
Handle copy initialization in BuildImplicitMemberInitializer. Not used yet.

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

14 years agoadd GNU C++ include paths for Fedora 11,12 x86_64,
Chris Lattner [Fri, 23 Apr 2010 15:55:20 +0000 (15:55 +0000)]
add GNU C++ include paths for Fedora 11,12 x86_64,
patch by mikem!

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

14 years agoRevert "C++ doesn't really use "namespaces" for different kinds of names the same...
Daniel Dunbar [Fri, 23 Apr 2010 13:07:39 +0000 (13:07 +0000)]
Revert "C++ doesn't really use "namespaces" for different kinds of names the same", which seems to break most C++ nightly test apps.

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

14 years agoconcepts is not a keyword here and fix copy-pasto.
Nick Lewycky [Fri, 23 Apr 2010 06:09:40 +0000 (06:09 +0000)]
concepts is not a keyword here and fix copy-pasto.

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

14 years agoStrip cv-qualifiers when building C++ constructor and destructor
Douglas Gregor [Fri, 23 Apr 2010 04:51:46 +0000 (04:51 +0000)]
Strip cv-qualifiers when building C++ constructor and destructor
names.

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

14 years agoHandle compound assignment expressions (i += j) as lvalues, which is
Douglas Gregor [Fri, 23 Apr 2010 04:16:32 +0000 (04:16 +0000)]
Handle compound assignment expressions (i += j) as lvalues, which is
permitted in C++ but not in C. Fixes PR6900. Clang can now handle all
of Boost.Lambda's regression tests.

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

14 years agoAdd another 'catch all' access diagnostic.
Anders Carlsson [Fri, 23 Apr 2010 03:41:35 +0000 (03:41 +0000)]
Add another 'catch all' access diagnostic.

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

14 years agoEmit a lame diagnostic when we can't mangle operator names
Douglas Gregor [Fri, 23 Apr 2010 03:19:53 +0000 (03:19 +0000)]
Emit a lame diagnostic when we can't mangle operator names

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

14 years agoMangle dependent template names such as the nested-name-specifier in
Douglas Gregor [Fri, 23 Apr 2010 03:10:43 +0000 (03:10 +0000)]
Mangle dependent template names such as the nested-name-specifier in

  T::apply <U>::type

Fixes PR6899, although I want to dig a little deeper into the FIXME
for dependent template names that refer to operators.

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

14 years agoAdd an ImplicitInitializerKind enum and pass it to BuildImplicitBaseInitializer and...
Anders Carlsson [Fri, 23 Apr 2010 03:10:23 +0000 (03:10 +0000)]
Add an ImplicitInitializerKind enum and pass it to BuildImplicitBaseInitializer and BuildImplicitMemberInitializer.

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

14 years agoFix a think-o that broke self-host.
Anders Carlsson [Fri, 23 Apr 2010 03:07:47 +0000 (03:07 +0000)]
Fix a think-o that broke self-host.

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

14 years agoC++ doesn't really use "namespaces" for different kinds of names the same
John McCall [Fri, 23 Apr 2010 02:41:41 +0000 (02:41 +0000)]
C++ doesn't really use "namespaces" for different kinds of names the same
way that C does.  Among other differences, elaborated type specifiers
are defined to skip "non-types", which, as you might imagine, does not
include typedefs.  Rework our use of IDNS masks to capture the semantics
of different kinds of declarations better, and remove most current lookup
filters.  Removing the last remaining filter is more complicated and will
happen in a separate patch.

Fixes PR 6885 as well some spectrum of unfiled bugs.

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

14 years agoChange the 'declared at' diagnostic to say 'declared here'.
Anders Carlsson [Fri, 23 Apr 2010 02:20:12 +0000 (02:20 +0000)]
Change the 'declared at' diagnostic to say 'declared here'.

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

14 years agoFactor code to initialize an implicit member out into a separate function.
Anders Carlsson [Fri, 23 Apr 2010 02:15:47 +0000 (02:15 +0000)]
Factor code to initialize an implicit member out into a separate function.

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

14 years agoWhen parsing a cast-expression that starts with a scope annotation,
Douglas Gregor [Fri, 23 Apr 2010 02:08:13 +0000 (02:08 +0000)]
When parsing a cast-expression that starts with a scope annotation,
try to annotate as a type first to determine whether we have a
functional-style cast. Patch by Eli Friedman, fixes PR6830.

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

14 years agoI hate default statements. Fixes PR6874.
Douglas Gregor [Fri, 23 Apr 2010 02:02:43 +0000 (02:02 +0000)]
I hate default statements. Fixes PR6874.

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

14 years agoRemove calls to isDependentContext, since we handle that case earlier in the code...
Anders Carlsson [Fri, 23 Apr 2010 02:00:02 +0000 (02:00 +0000)]
Remove calls to isDependentContext, since we handle that case earlier in the code. Make BuildImplicitBaseInitializer return a boolean instead.

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

14 years agoTemplate instantiation for @try and @finally (but not @catch, yet).
Douglas Gregor [Thu, 22 Apr 2010 23:59:56 +0000 (23:59 +0000)]
Template instantiation for @try and @finally (but not @catch, yet).

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

14 years agoMake TemplateDecl and ObjCContainerDecl abstract
Douglas Gregor [Thu, 22 Apr 2010 23:35:25 +0000 (23:35 +0000)]
Make TemplateDecl and ObjCContainerDecl abstract

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

14 years agoKill off IDNS_ObjCImplementation and IDNS_ObjCCategoryName; they
Douglas Gregor [Thu, 22 Apr 2010 23:19:50 +0000 (23:19 +0000)]
Kill off IDNS_ObjCImplementation and IDNS_ObjCCategoryName; they
aren't and never were used. There's a gap in the bit pattern for IDNS
now, but I'm sure *someone* will fill it.

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

14 years agoTemplate instantiation for the Objective-C "fast enumeration"
Douglas Gregor [Thu, 22 Apr 2010 23:10:45 +0000 (23:10 +0000)]
Template instantiation for the Objective-C "fast enumeration"
statement, i.e.,

  for (element in collection) {
    // do something
  }

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

14 years agoTemplate instantiation for Objective-C++ @synchronized statements.
Douglas Gregor [Thu, 22 Apr 2010 22:01:21 +0000 (22:01 +0000)]
Template instantiation for Objective-C++ @synchronized statements.

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

14 years agoImplement template instantiation for Objective-C++ @throw statements.
Douglas Gregor [Thu, 22 Apr 2010 21:44:01 +0000 (21:44 +0000)]
Implement template instantiation for Objective-C++ @throw statements.

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

14 years agoCheck for -fno-constant-cfstrings consistency
Fariborz Jahanian [Thu, 22 Apr 2010 21:01:59 +0000 (21:01 +0000)]
Check for -fno-constant-cfstrings consistency
in pch.

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

14 years agoSupport for -fno-constant-cfstrings option - wip.
Fariborz Jahanian [Thu, 22 Apr 2010 20:26:39 +0000 (20:26 +0000)]
Support for -fno-constant-cfstrings option - wip.

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

14 years agoUse the naming class from the overloaded lookup when access-checking an
John McCall [Thu, 22 Apr 2010 18:44:12 +0000 (18:44 +0000)]
Use the naming class from the overloaded lookup when access-checking an
address of overloaded function, instead of assuming that a nested name
specifier was used.  A nested name specifier is not required for static
functions.

Fixes PR6886.

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

14 years agoanother tweak for haiku support, patch by Paul Davey!
Chris Lattner [Thu, 22 Apr 2010 17:48:00 +0000 (17:48 +0000)]
another tweak for haiku support, patch by Paul Davey!

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

14 years agoSome Objective-C++ types and expressions will never change during
Douglas Gregor [Thu, 22 Apr 2010 17:28:13 +0000 (17:28 +0000)]
Some Objective-C++ types and expressions will never change during
template instantiation, since they cannot be dependent or have
dependent parts. Handle them the simple way.

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

14 years agoWhen a dependent Objective-C++ message send was able to resolve the
Douglas Gregor [Thu, 22 Apr 2010 17:01:48 +0000 (17:01 +0000)]
When a dependent Objective-C++ message send was able to resolve the
method being called at template definition time, retain that method
and pass it through to type-checking. We will not perform any lookup
for the method during template instantiation.

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

14 years agoRemove the SelectorLoc argument to Sema::BuildInstanceMesssage and
Douglas Gregor [Thu, 22 Apr 2010 16:50:51 +0000 (16:50 +0000)]
Remove the SelectorLoc argument to Sema::BuildInstanceMesssage and
Sema::BuildClassMessage; we weren't using it, and template
instantiation was faking it anyway.

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

14 years agoExpand the one use of TransformPointerLikeType and eliminate this macro. No functiona...
Douglas Gregor [Thu, 22 Apr 2010 16:46:21 +0000 (16:46 +0000)]
Expand the one use of TransformPointerLikeType and eliminate this macro. No functionality change

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

14 years agoImplement template instantiation for Objective-C++ message sends. We
Douglas Gregor [Thu, 22 Apr 2010 16:44:27 +0000 (16:44 +0000)]
Implement template instantiation for Objective-C++ message sends. We
support dependent receivers for class and instance messages, along
with dependent message arguments (of course), and check as much as we
can at template definition time.

This commit also deals with a subtle aspect of template instantiation
in Objective-C++, where the type 'T *' can morph from a dependent
PointerType into a non-dependent ObjCObjectPointer type.

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

14 years agoARM/APCS: Don't respect bit-field types when laying out structures.
Daniel Dunbar [Thu, 22 Apr 2010 16:14:54 +0000 (16:14 +0000)]
ARM/APCS: Don't respect bit-field types when laying out structures.
 - This fixes the last known ABI issues with ARM/APCS.

 - I've run the first 1k ABITests with '--no-unsigned --no-vector --no-complex'
   on {armv6, armv7} x {-mno-thumb, -mthumb}, and the first 10k tests for armv7
   -mthumb, for both function return types and single argument calls. These all
   pass now (they failed horribly before without --no-bitfield).

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

14 years agoIRgen: Fix another case where we generated an invalid access component when we
Daniel Dunbar [Thu, 22 Apr 2010 15:22:33 +0000 (15:22 +0000)]
IRgen: Fix another case where we generated an invalid access component when we
immediately narrowed the access size. Fix this (and previous case) by just
choosing a better access size up-front.

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

14 years agoIRgen: Fix case where we might generate an access component with width == 0, if
Daniel Dunbar [Thu, 22 Apr 2010 14:56:10 +0000 (14:56 +0000)]
IRgen: Fix case where we might generate an access component with width == 0, if
we have to narrow the access side immediately (can happen with packed,
-fno-bitfield-type-align).

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

14 years agoWhen checking whether to diagnose an initialized "extern" variable,
Douglas Gregor [Thu, 22 Apr 2010 14:36:26 +0000 (14:36 +0000)]
When checking whether to diagnose an initialized "extern" variable,
look for the const on the base type rather than on the top-level
type. Fixes PR6495 properly.

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

14 years agoRecord nested-name-specifiers of when we create
Douglas Gregor [Thu, 22 Apr 2010 14:24:35 +0000 (14:24 +0000)]
Record nested-name-specifiers of when we create
elaborated-type-specifiers. Patch by Enea Zaffanella!

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

14 years agoRe-land the patch that merges two diagnostics into one now that it passes self-host :)
Anders Carlsson [Thu, 22 Apr 2010 05:40:53 +0000 (05:40 +0000)]
Re-land the patch that merges two diagnostics into one now that it passes self-host :)

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

14 years agoNeuter this testcase a little. The way LLVM writes labels for anonymous blocks
John McCall [Thu, 22 Apr 2010 03:27:09 +0000 (03:27 +0000)]
Neuter this testcase a little.  The way LLVM writes labels for anonymous blocks
makes it impossible to check labels.

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

14 years agoSuppress compiler warning.
Daniel Dunbar [Thu, 22 Apr 2010 03:17:06 +0000 (03:17 +0000)]
Suppress compiler warning.

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

14 years agoIRgen: Set alignment correctly on bit-field accesses.
Daniel Dunbar [Thu, 22 Apr 2010 03:17:04 +0000 (03:17 +0000)]
IRgen: Set alignment correctly on bit-field accesses.

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

14 years agoIRgen: Rewrite bit-field access policy to not access data beyond the bounds of the...
Daniel Dunbar [Thu, 22 Apr 2010 02:35:46 +0000 (02:35 +0000)]
IRgen: Rewrite bit-field access policy to not access data beyond the bounds of the structure, which we also now verify as part of the post-layout consistency checks.
 - This fixes some pedantic bugs with packed structures, as well as major problems with -fno-bitfield-type-align.

 - Fixes PR5591, PR5567, and all known -fno-bitfield-type-align issues.

 - Review appreciated.

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

14 years agoIRgen: Fix CGRecordLayout::print to print the bit-field infos in a consistent order.
Daniel Dunbar [Thu, 22 Apr 2010 02:35:36 +0000 (02:35 +0000)]
IRgen: Fix CGRecordLayout::print to print the bit-field infos in a consistent order.

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

14 years agoRevert "Unify two diagnostics into one.", it breaks with an assertion failure on...
Daniel Dunbar [Thu, 22 Apr 2010 02:35:33 +0000 (02:35 +0000)]
Revert "Unify two diagnostics into one.", it breaks with an assertion failure on bootstrap.

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

14 years agoUnify two diagnostics into one.
Anders Carlsson [Thu, 22 Apr 2010 01:17:32 +0000 (01:17 +0000)]
Unify two diagnostics into one.

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

14 years agoCall PerformCopyInitialization to properly initialize the exception temporary
John McCall [Thu, 22 Apr 2010 01:10:34 +0000 (01:10 +0000)]
Call PerformCopyInitialization to properly initialize the exception temporary
in a throw expression.  Use EmitAnyExprToMem to emit the throw expression,
which magically elides the final copy-constructor call (which raises a new
strict-compliance bug, but baby steps).  Give __cxa_throw a destructor pointer
if the exception type has a non-trivial destructor.

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

14 years agoWhenever we complain about a failed initialization of a function or
Douglas Gregor [Thu, 22 Apr 2010 00:20:18 +0000 (00:20 +0000)]
Whenever we complain about a failed initialization of a function or
method parameter, provide a note pointing at the parameter itself so
the user does not have to manually look for the function/method being
called and match up parameters to arguments. For example, we now get:

t.c:4:5: warning: incompatible pointer types passing 'long *' to
parameter of
      type 'int *' [-pedantic]
  f(long_ptr);
    ^~~~~~~~
t.c:1:13: note: passing argument to parameter 'x' here
void f(int *x);
            ^

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

14 years agoRemove an unused declaration.
Anders Carlsson [Wed, 21 Apr 2010 23:55:31 +0000 (23:55 +0000)]
Remove an unused declaration.

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

14 years agoWhen computing the alignof value for a vector type, ensure that
Dan Gohman [Wed, 21 Apr 2010 23:32:43 +0000 (23:32 +0000)]
When computing the alignof value for a vector type, ensure that
the alignment is a power of 2, even in the esoteric case of a
vector element which does not have a power-of-2 sizeof value.

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

14 years agoSwitch the initialization of Objective-C message parameters (as occurs
Douglas Gregor [Wed, 21 Apr 2010 23:24:10 +0000 (23:24 +0000)]
Switch the initialization of Objective-C message parameters (as occurs
during message sends) over to the new initialization code and away
from the C-only CheckSingleAssignmentConstraints. The enables the use
of C++ types in method parameters and message arguments, as well as
unifying more initialiation code overall.

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

14 years agoEncode field accessibility.
Devang Patel [Wed, 21 Apr 2010 23:12:37 +0000 (23:12 +0000)]
Encode field accessibility.

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

14 years agoImplement parsing for message sends in Objective-C++. Message sends in
Douglas Gregor [Wed, 21 Apr 2010 22:36:40 +0000 (22:36 +0000)]
Implement parsing for message sends in Objective-C++. Message sends in
Objective-C++ have a more complex grammar than in Objective-C
(surprise!), because

  (1) The receiver of an instance message can be a qualified name such
  as ::I or identity<I>::type.
  (2) Expressions in C++ can start with a type.

The receiver grammar isn't actually ambiguous; it just takes a bit of
work to parse past the type before deciding whether we have a type or
expression. We do this in two places within the grammar: once for
message sends and once when we're determining whether a []'d clause in
an initializer list is a message send or a C99 designated initializer.

This implementation of Objective-C++ message sends contains one known
extension beyond GCC's implementation, which is to permit a
typename-specifier as the receiver type for a class message, e.g.,

  [typename compute_receiver_type<T>::type method];

Note that the same effect can be achieved in GCC by way of a typedef,
e.g.,

  typedef typename computed_receiver_type<T>::type Computed;
  [Computed method];

so this is merely a convenience.

Note also that message sends still cannot involve dependent types or
values.

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

14 years agoMigrate the responsibility for turning the receiver name in an
Douglas Gregor [Wed, 21 Apr 2010 20:38:13 +0000 (20:38 +0000)]
Migrate the responsibility for turning the receiver name in an
Objective-C class message expression into a type from the parser
(which was doing so in two places) to Action::getObjCMessageKind()
which, in the case of Sema, reduces the number of name lookups we need
to perform.

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

14 years agoDiagnose access to fields with private constructors.
Anders Carlsson [Wed, 21 Apr 2010 20:28:29 +0000 (20:28 +0000)]
Diagnose access to fields with private constructors.

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

14 years agoEliminate unused code in Sema::ActOnSuperMessage and use early exits
Douglas Gregor [Wed, 21 Apr 2010 20:01:04 +0000 (20:01 +0000)]
Eliminate unused code in Sema::ActOnSuperMessage and use early exits
to reduce nesting. No functionality change.

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

14 years agoRework the Parser-Sema interaction for Objective-C message
Douglas Gregor [Wed, 21 Apr 2010 19:57:20 +0000 (19:57 +0000)]
Rework the Parser-Sema interaction for Objective-C message
sends. Major changes include:

  - Expanded the interface from two actions (ActOnInstanceMessage,
    ActOnClassMessage), where ActOnClassMessage also handled sends to
    "super" by checking whether the identifier was "super", to three
    actions (ActOnInstanceMessage, ActOnClassMessage,
    ActOnSuperMessage). Code completion has the same changes.
  - The parser now resolves the type to which we are sending a class
    message, so ActOnClassMessage now accepts a TypeTy* (rather than
    an IdentifierInfo *). This opens the door to more interesting
    types (for Objective-C++ support).
  - Split ActOnInstanceMessage and ActOnClassMessage into parser
    action functions (with their original names) and semantic
    functions (BuildInstanceMessage and BuildClassMessage,
    respectively). At present, this split is onyl used by
    ActOnSuperMessage, which decides which kind of super message it
    has and forwards to the appropriate Build*Message. In the future,
    Build*Message will be used by template instantiation.
  - Use getObjCMessageKind() within the disambiguation of Objective-C
    message sends vs. array designators.

Two notes about substandard bits in this patch:
  - There is some redundancy in the code in ParseObjCMessageExpr and
  ParseInitializerWithPotentialDesignator; this will be addressed
  shortly by centralizing the mapping from identifiers to type names
  for the message receiver.
  - There is some #if 0'd code that won't likely ever be used---it
  handles the use of 'super' in methods whose class does not have a
  superclass---but could be used to model GCC's behavior more
  closely. This code will die in my next check-in, but I want it in
  Subversion.

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

14 years agoKeep tack of whether a base in an InitializedEntity is an inherited virtual base...
Anders Carlsson [Wed, 21 Apr 2010 19:52:01 +0000 (19:52 +0000)]
Keep tack of whether a base in an InitializedEntity is an inherited virtual base or not. Use this in CheckConstructorAccess.

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

14 years agoABI/x86-32 & x86-64: Alignment on 'byval' must be set when when the alignment
Daniel Dunbar [Wed, 21 Apr 2010 19:49:55 +0000 (19:49 +0000)]
ABI/x86-32 & x86-64: Alignment on 'byval' must be set when when the alignment
exceeds the minimum ABI alignment.

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

14 years agoConvert test to FileCheck.
Daniel Dunbar [Wed, 21 Apr 2010 19:34:17 +0000 (19:34 +0000)]
Convert test to FileCheck.

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

14 years agoConvert test to FileCheck.
Daniel Dunbar [Wed, 21 Apr 2010 19:10:54 +0000 (19:10 +0000)]
Convert test to FileCheck.

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

14 years agoIRgen/x86-32: Factor out getIndirectResult(), to match x86-64 factoring.
Daniel Dunbar [Wed, 21 Apr 2010 19:10:51 +0000 (19:10 +0000)]
IRgen/x86-32: Factor out getIndirectResult(), to match x86-64 factoring.

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

14 years agoIRgen: Add checking that the LLVM and AST record layout offsets agree (for
Daniel Dunbar [Wed, 21 Apr 2010 19:10:49 +0000 (19:10 +0000)]
IRgen: Add checking that the LLVM and AST record layout offsets agree (for
non-bit-fields).

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

14 years agoImprove on source location of diagnostic when default
Fariborz Jahanian [Wed, 21 Apr 2010 18:57:20 +0000 (18:57 +0000)]
Improve on source location of diagnostic when default
property synthesis is using a super class ivar.

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

14 years agoPass the InitializedEntity to Sema::CheckConstructorAccess and use it to report diffe...
Anders Carlsson [Wed, 21 Apr 2010 18:47:17 +0000 (18:47 +0000)]
Pass the InitializedEntity to Sema::CheckConstructorAccess and use it to report different diagnostics depending on which entity is being initialized.

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

14 years agoComment out an assert for now.
Anders Carlsson [Wed, 21 Apr 2010 18:03:05 +0000 (18:03 +0000)]
Comment out an assert for now.

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

14 years agoFix typo.
Fariborz Jahanian [Wed, 21 Apr 2010 17:09:27 +0000 (17:09 +0000)]
Fix typo.

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

14 years agoAdd more const to ConstExprIterator.
Benjamin Kramer [Wed, 21 Apr 2010 12:21:20 +0000 (12:21 +0000)]
Add more const to ConstExprIterator.

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

14 years agoI failed to notice that my last patch wasn't doing as much as it could
John McCall [Wed, 21 Apr 2010 11:18:06 +0000 (11:18 +0000)]
I failed to notice that my last patch wasn't doing as much as it could
because EmitBranch actually clears the insert point.  This version
actually accomplishes what I initially wanted.

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

14 years agoTeach EmitBlock to put the target block immediately after the current block
John McCall [Wed, 21 Apr 2010 10:29:06 +0000 (10:29 +0000)]
Teach EmitBlock to put the target block immediately after the current block
(if there's a current block).  The chief advantage of doing this is that it
lets us pick blocks (e.g. EH blocks) to push to the end of the function so
that fallthrough happens consistently --- i.e. it gives us the flexibility
of ordering blocks as we please without having to change the order in which
we generate code.  There are standard (?) optimization passes which can do some
of that for us, but better to generate reasonable code to begin with.

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

14 years agoMiscellaneous codegen cleanups. Mostly, don't create new basic blocks
John McCall [Wed, 21 Apr 2010 10:05:39 +0000 (10:05 +0000)]
Miscellaneous codegen cleanups.  Mostly, don't create new basic blocks
just to save the current insertion state!  This change significantly
simplifies the IR CFG in exceptions code.

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

14 years agoCXXNamedCastExpr is actually an abstract expression.
Zhongxing Xu [Wed, 21 Apr 2010 06:32:25 +0000 (06:32 +0000)]
CXXNamedCastExpr is actually an abstract expression.

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

14 years agoSink the _GNU_SOURCE definition down into the target configuration,
Douglas Gregor [Wed, 21 Apr 2010 05:52:38 +0000 (05:52 +0000)]
Sink the _GNU_SOURCE definition down into the target configuration,
and only define it where we know we need it---Linux and Cygwin. Thanks
to Chris for the prodding.

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

14 years agoReword the note we emit when suppressing template instantiation contexts, per John...
Douglas Gregor [Wed, 21 Apr 2010 05:40:43 +0000 (05:40 +0000)]
Reword the note we emit when suppressing template instantiation contexts, per John's advice

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

14 years agoThe second check point in the old test case was invalid.
Zhongxing Xu [Wed, 21 Apr 2010 02:22:25 +0000 (02:22 +0000)]
The second check point in the old test case was invalid.

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

14 years agoUse const_cast instead of a C cast. Safer, plus it suppresses a gcc warning.
John McCall [Wed, 21 Apr 2010 02:20:33 +0000 (02:20 +0000)]
Use const_cast instead of a C cast.  Safer, plus it suppresses a gcc warning.

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

14 years agoUse the right predecessor.
Zhongxing Xu [Wed, 21 Apr 2010 02:20:10 +0000 (02:20 +0000)]
Use the right predecessor.

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

14 years agoAdd initial support for C++ delete expr.
Zhongxing Xu [Wed, 21 Apr 2010 02:17:31 +0000 (02:17 +0000)]
Add initial support for C++ delete expr.

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

14 years agoOverhaul the AST representation of Objective-C message send
Douglas Gregor [Wed, 21 Apr 2010 00:45:42 +0000 (00:45 +0000)]
Overhaul the AST representation of Objective-C message send
expressions, to improve source-location information, clarify the
actual receiver of the message, and pave the way for proper C++
support. The ObjCMessageExpr node represents four different kinds of
message sends in a single AST node:

  1) Send to a object instance described by an expression (e.g., [x method:5])
  2) Send to a class described by the class name (e.g., [NSString method:5])
  3) Send to a superclass class (e.g, [super method:5] in class method)
  4) Send to a superclass instance (e.g., [super method:5] in instance method)

Previously these four cases where tangled together. Now, they have
more distinct representations. Specific changes:

  1) Unchanged; the object instance is represented by an Expr*.

  2) Previously stored the ObjCInterfaceDecl* referring to the class
  receiving the message. Now stores a TypeSourceInfo* so that we know
  how the class was spelled. This both maintains typedef information
  and opens the door for more complicated C++ types (e.g., dependent
  types). There was an alternative, unused representation of these
  sends by naming the class via an IdentifierInfo *. In practice, we
  either had an ObjCInterfaceDecl *, from which we would get the
  IdentifierInfo *, or we fell into the case below...

  3) Previously represented by a class message whose IdentifierInfo *
  referred to "super". Sema and CodeGen would use isStr("super") to
  determine if they had a send to super. Now represented as a
  "class super" send, where we have both the location of the "super"
  keyword and the ObjCInterfaceDecl* of the superclass we're
  targetting (statically).

  4) Previously represented by an instance message whose receiver is a
  an ObjCSuperExpr, which Sema and CodeGen would check for via
  isa<ObjCSuperExpr>(). Now represented as an "instance super" send,
  where we have both the location of the "super" keyword and the
  ObjCInterfaceDecl* of the superclass we're targetting
  (statically). Note that ObjCSuperExpr only has one remaining use in
  the AST, which is for "super.prop" references.

The new representation of ObjCMessageExpr is 2 pointers smaller than
the old one, since it combines more storage. It also eliminates a leak
when we loaded message-send expressions from a precompiled header. The
representation also feels much cleaner to me; comments welcome!

This patch attempts to maintain the same semantics we previously had
with Objective-C message sends. In several places, there are massive
changes that boil down to simply replacing a nested-if structure such
as:

  if (message has a receiver expression) {
    // instance message
    if (isa<ObjCSuperExpr>(...)) {
     // send to super
    } else {
     // send to an object
   }
  } else {
    // class message
    if (name->isStr("super")) {
      // class send to super
    } else {
      // send to class
    }
  }

with a switch

  switch (E->getReceiverKind()) {
  case ObjCMessageExpr::SuperInstance: ...
  case ObjCMessageExpr::Instance: ...
  case ObjCMessageExpr::SuperClass: ...
  case ObjCMessageExpr::Class:...
  }

There are quite a few places (particularly in the checkers) where
send-to-super is effectively ignored. I've placed FIXMEs in most of
them, and attempted to address send-to-super in a reasonable way. This
could use some review.

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

14 years agoRemove an unused parameter from isImplicitlyDefined.
Anders Carlsson [Tue, 20 Apr 2010 23:32:58 +0000 (23:32 +0000)]
Remove an unused parameter from isImplicitlyDefined.

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

14 years agoFix comment to reflect recent code change.
John Thompson [Tue, 20 Apr 2010 23:21:17 +0000 (23:21 +0000)]
Fix comment to reflect recent code change.

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

14 years agoFix USRs for 'extern' variables declaration in functions/method bodies.
Ted Kremenek [Tue, 20 Apr 2010 23:15:40 +0000 (23:15 +0000)]
Fix USRs for 'extern' variables declaration in functions/method bodies.
Fix USRs for @synthesize.
Add more USR tests.

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

14 years agoSpecify linkage for Objective-C declarations.
Ted Kremenek [Tue, 20 Apr 2010 23:15:35 +0000 (23:15 +0000)]
Specify linkage for Objective-C declarations.

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

14 years agoFactor some common code out into a separate function.
Anders Carlsson [Tue, 20 Apr 2010 23:11:20 +0000 (23:11 +0000)]
Factor some common code out into a separate function.

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

14 years agoFixes a code gen. bug by removing an assert.
Fariborz Jahanian [Tue, 20 Apr 2010 22:02:31 +0000 (22:02 +0000)]
Fixes a code gen. bug by removing an assert.
It is ok to have c++-ness inside extern "C"
block. Fixes pr6644.

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

14 years agofix the ?: fixit that ted added to recover properly.
Chris Lattner [Tue, 20 Apr 2010 21:33:39 +0000 (21:33 +0000)]
fix the ?: fixit that ted added to recover properly.

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

14 years agoFix crash on invalid code where a @throw statement is not followed by a ';'
Ted Kremenek [Tue, 20 Apr 2010 21:21:51 +0000 (21:21 +0000)]
Fix crash on invalid code where a @throw statement is not followed by a ';'

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

14 years agochange FullSourceLoc to have a *const* SourceManager&, eliminating
Chris Lattner [Tue, 20 Apr 2010 20:49:23 +0000 (20:49 +0000)]
change FullSourceLoc to have a *const* SourceManager&, eliminating
a const_cast.

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

14 years agopush some source location information down through the compiler,
Chris Lattner [Tue, 20 Apr 2010 20:35:58 +0000 (20:35 +0000)]
push some source location information down through the compiler,
into ContentCache::getBuffer.  This allows it to produce
diagnostics on the broken #include line instead of without a
location.

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