]> granicus.if.org Git - clang/log
clang
14 years agoProperly pass the address of a lazily-generated function declaration with
John McCall [Wed, 28 Apr 2010 00:00:30 +0000 (00:00 +0000)]
Properly pass the address of a lazily-generated function declaration with
incomplete type.  Fixes PR6911.

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

14 years agoIt's okay to refer to non-type template parameters anywhere they are
Douglas Gregor [Tue, 27 Apr 2010 21:10:04 +0000 (21:10 +0000)]
It's okay to refer to non-type template parameters anywhere they are
visible. Fixes the remaining two failures in Boost.ScopeExit.

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

14 years agoRemoved spaces at end of line. (Test commit.)
Abramo Bagnara [Tue, 27 Apr 2010 21:08:25 +0000 (21:08 +0000)]
Removed spaces at end of line. (Test commit.)

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

14 years agoFix for PR6953: per gcc, regparm and noreturn affect the compatibility of
Eli Friedman [Tue, 27 Apr 2010 21:07:06 +0000 (21:07 +0000)]
Fix for PR6953: per gcc, regparm and noreturn affect the compatibility of
function types.

This could potentially have unexpected side-effects, so look here if there are
new regressions.

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

14 years agoWhen explicitly building a temporary object (CXXTemporaryObjectExpr),
Douglas Gregor [Tue, 27 Apr 2010 20:36:09 +0000 (20:36 +0000)]
When explicitly building a temporary object (CXXTemporaryObjectExpr),
keep track of whether we need to zero-initialize storage prior to
calling its constructor. Previously, we were only tracking this when
implicitly constructing the object (a CXXConstructExpr).

Fixes Boost's value-initialization tests, which means that the
Boost.Config library now passes all of its tests.

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

14 years agoFixed message send to void (broken by my last commit - GNU runtime).
David Chisnall [Tue, 27 Apr 2010 20:33:30 +0000 (20:33 +0000)]
Fixed message send to void (broken by my last commit - GNU runtime).

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

14 years agoDiagnose the use of abstract types as array element types. Previously,
Douglas Gregor [Tue, 27 Apr 2010 19:38:14 +0000 (19:38 +0000)]
Diagnose the use of abstract types as array element types. Previously,
we were relying on checking for abstract class types when an array
type was actually used to declare a variable, parameter, etc. However,
we need to check when the construct the array for, e.g., SFINAE
purposes (see DR337). Fixes problems with Boost's is_abstract type
trait.

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

14 years agoDuring template instantiation, set the naming class of
Douglas Gregor [Tue, 27 Apr 2010 18:19:34 +0000 (18:19 +0000)]
During template instantiation, set the naming class of
UnresolvedLookupExpr and UnresolvedMemberExpr by substituting the
naming class we computed when building the expression in the
template...

... which we didn't always do correctly. Teach
UnresolvedMemberExpr::getNamingClass() all about the new
representation of injected-class-names in templates, so that it can
return a naming class that is the current instantiation.

Also, when decomposing a template-id into its template name and its
arguments, be sure to set the naming class on the LookupResult
structure.

Fixes PR6947 the right way.

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

14 years agoMore simplifications.
Benjamin Kramer [Tue, 27 Apr 2010 17:47:25 +0000 (17:47 +0000)]
More simplifications.

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

14 years agoMove CollectIvarsToConstructOrDestruct to Sema
Fariborz Jahanian [Tue, 27 Apr 2010 17:18:58 +0000 (17:18 +0000)]
Move CollectIvarsToConstructOrDestruct to Sema
from AST, consider ivar array of objects
(per Doug's comment).

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

14 years agoSimplify some code. No change in functionality.
Benjamin Kramer [Tue, 27 Apr 2010 17:12:11 +0000 (17:12 +0000)]
Simplify some code. No change in functionality.

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

14 years agoWhen checking the redeclaration context of a typedef that refers to a
Douglas Gregor [Tue, 27 Apr 2010 16:26:47 +0000 (16:26 +0000)]
When checking the redeclaration context of a typedef that refers to a
tag of the same name, compare the lookup contexts rather than the
actual contexts. Fixes PR6923.

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

14 years agoDon't look into incomplete types when trying to warn about unused
Douglas Gregor [Tue, 27 Apr 2010 16:20:13 +0000 (16:20 +0000)]
Don't look into incomplete types when trying to warn about unused
variables. Fixes PR6948.

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

14 years agoCMake: Fix DESTDIR-related installation problem on Windows, from the
Douglas Gregor [Tue, 27 Apr 2010 16:14:06 +0000 (16:14 +0000)]
CMake: Fix DESTDIR-related installation problem on Windows, from the
mysterious Elrood on IRC.

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

14 years agoWhen instantiating UnresolvedLookupExpr and UnresolvedMemberExpr
Douglas Gregor [Tue, 27 Apr 2010 16:10:10 +0000 (16:10 +0000)]
When instantiating UnresolvedLookupExpr and UnresolvedMemberExpr
expressions, be sure to set the naming class of the LookupResult
structure. Fixes PR6947.

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

14 years agoSimplify.
Daniel Dunbar [Tue, 27 Apr 2010 15:35:03 +0000 (15:35 +0000)]
Simplify.

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

14 years agoAdd Driver support for -fno-constant-cfstrings.
Daniel Dunbar [Tue, 27 Apr 2010 15:34:57 +0000 (15:34 +0000)]
Add Driver support for -fno-constant-cfstrings.

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

14 years agoEnsure return from a message to nil is always 0 (GNU runtime).
David Chisnall [Tue, 27 Apr 2010 15:08:48 +0000 (15:08 +0000)]
Ensure return from a message to nil is always 0 (GNU runtime).

This works around stack corruption / crashes resulting from PR6944, and also
works around people who expect 'what works on my machine' to work everywhere
(GCC crashes in a number of cases on SPARC that should now work correctly with
clang).

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

14 years agoFix comments.
Daniel Dunbar [Tue, 27 Apr 2010 14:51:07 +0000 (14:51 +0000)]
Fix comments.

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

14 years agoWrap a couple of long lines. (Test commit.)
Enea Zaffanella [Tue, 27 Apr 2010 07:38:32 +0000 (07:38 +0000)]
Wrap a couple of long lines. (Test commit.)

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

14 years agoImprove the diagnostic you get when making a qualified member access
John McCall [Tue, 27 Apr 2010 01:43:38 +0000 (01:43 +0000)]
Improve the diagnostic you get when making a qualified member access
with a qualifier referencing a different type.

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

14 years agoMake the InjectedClassNameType the canonical type of the current instantiation
John McCall [Tue, 27 Apr 2010 00:57:59 +0000 (00:57 +0000)]
Make the InjectedClassNameType the canonical type of the current instantiation
of a class template or class template partial specialization.  That is to
say, in
  template <class T> class A { ... };
or
  template <class T> class B<const T*> { ... };
make 'A<T>' and 'B<const T*>' sugar for the corresponding InjectedClassNameType
when written inside the appropriate context.  This allows us to track the
current instantiation appropriately even inside AST routines.  It also allows
us to compute a DeclContext for a type much more efficiently, at some extra
cost every time we write a template specialization (which can be optimized,
but I've left it simple in this patch).

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

14 years agoNew method to construct/destruct ivars that have non-trivial default
Fariborz Jahanian [Mon, 26 Apr 2010 23:51:25 +0000 (23:51 +0000)]
New method to construct/destruct ivars that have non-trivial default
constructors or destructors, not used yet.

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

14 years agoEnable debug info for local variables at -O1+.
Devang Patel [Mon, 26 Apr 2010 23:28:46 +0000 (23:28 +0000)]
Enable debug info for local variables at -O1+.

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

14 years agoImprove source-location information in a C++ typeid (type) expression
Douglas Gregor [Mon, 26 Apr 2010 22:37:10 +0000 (22:37 +0000)]
Improve source-location information in a C++ typeid (type) expression
by using TypeSourceInfo, cleaning up the representation
somewhat. Teach getTypeOperand() to strip references and
cv-qualifiers, providing the semantic view of the type without
requiring any extra storage (the unmodified type remains within the
TypeSourceInfo). This fixes a bug found by Boost's call_traits test.

Finally, clean up semantic analysis, by splitting the ActOnCXXTypeid
routine into ActOnCXXTypeId (the parser action) and two BuildCXXTypeId
functions, which perform the semantic analysis for typeid(type) and
typeid(expression), respectively. We now perform less work at template
instantiation time (we don't look for std::type_info again) and can
give better diagnostics.

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

14 years agofix PR6936: don't generate line marker directives when preprocessing
Chris Lattner [Mon, 26 Apr 2010 22:08:10 +0000 (22:08 +0000)]
fix PR6936: don't generate line marker directives when preprocessing
.S files.  "# 123" is passed through as-is, not treated as a line
marker in this mode.  No testcase, because it would be nasty and isn't
worth it.

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

14 years agoDiagnose declaration of reference typed ivars.
Fariborz Jahanian [Mon, 26 Apr 2010 22:07:03 +0000 (22:07 +0000)]
Diagnose declaration of reference typed ivars.

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

14 years agowordsmith an objc warning, rdar://7900756
Chris Lattner [Mon, 26 Apr 2010 21:44:01 +0000 (21:44 +0000)]
wordsmith an objc warning, rdar://7900756

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

14 years agoIntroduce Type::isStructureOrClassType(), which does the obvious
Douglas Gregor [Mon, 26 Apr 2010 21:31:17 +0000 (21:31 +0000)]
Introduce Type::isStructureOrClassType(), which does the obvious
thing. Audit all uses of Type::isStructure(), changing those calls to
isStructureOrClassType() as needed (which is alsmost
everywhere). Fixes the remaining failure in Boost.Utility/Swap.

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

14 years agoCleanup error recovery for a missing '-'|'+'
Fariborz Jahanian [Mon, 26 Apr 2010 21:18:08 +0000 (21:18 +0000)]
Cleanup error recovery for a missing '-'|'+'
on a method declaration (radar 7822196).

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

14 years agoImplement template instantiation for implicit property references in
Douglas Gregor [Mon, 26 Apr 2010 21:04:54 +0000 (21:04 +0000)]
Implement template instantiation for implicit property references in
Objective-C++. This is the last bit of (non-blocks-related) template
instantiation logic for Objective-C++. Yay!

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

14 years agoImplement template instantiation for ObjCPropertyRefExpr.
Douglas Gregor [Mon, 26 Apr 2010 20:47:02 +0000 (20:47 +0000)]
Implement template instantiation for ObjCPropertyRefExpr.

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

14 years agoemit dtors with the right calling convention in -fno-use-cxa-atexit
Chris Lattner [Mon, 26 Apr 2010 20:35:54 +0000 (20:35 +0000)]
emit dtors with the right calling convention in -fno-use-cxa-atexit
mode.

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

14 years agoImplement template instantiation for value-dependent Objective-C ivar
Douglas Gregor [Mon, 26 Apr 2010 20:11:03 +0000 (20:11 +0000)]
Implement template instantiation for value-dependent Objective-C ivar
references and isa expressions. Also, test template instantiation of
unresolved member references to Objective-C ivar references and isa
expressions.

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

14 years agoremove alignment specifier on this. CAn't this test be removed yet? :)
Chris Lattner [Mon, 26 Apr 2010 19:47:56 +0000 (19:47 +0000)]
remove alignment specifier on this.  CAn't this test be removed yet? :)

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

14 years agoTest case for NeXt's -fno-constant-cfstrings option.
Fariborz Jahanian [Mon, 26 Apr 2010 17:59:24 +0000 (17:59 +0000)]
Test case for NeXt's -fno-constant-cfstrings option.

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

14 years agoImplement template instantiation for Objective-C @catch
Douglas Gregor [Mon, 26 Apr 2010 17:57:08 +0000 (17:57 +0000)]
Implement template instantiation for Objective-C @catch
statements. This is the last of the Objective-C statements.

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

14 years agoRefactor Objective-C @catch parameter checking by detangling it from
Douglas Gregor [Mon, 26 Apr 2010 17:32:49 +0000 (17:32 +0000)]
Refactor Objective-C @catch parameter checking by detangling it from
function-parameter checking and splitting it into the normal
ActOn*/Build* pair in Sema. We now use VarDecl to represent the @catch
parameter rather than the ill-fitting ParmVarDecl.

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

14 years agoMake the static type of the exception variable in an Objective-C
Douglas Gregor [Mon, 26 Apr 2010 16:46:50 +0000 (16:46 +0000)]
Make the static type of the exception variable in an Objective-C
@catch a VarDecl. The dynamic type is still a ParmVarDecl, but that
will change soon. No effective functionality change.

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

14 years agoEnsure that we have completed a type before attempting initialization
Douglas Gregor [Mon, 26 Apr 2010 14:36:57 +0000 (14:36 +0000)]
Ensure that we have completed a type before attempting initialization
on that type. Fixes several problems in Boost.Interprocess.

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

14 years agotests: Force a triple.
Daniel Dunbar [Mon, 26 Apr 2010 10:58:19 +0000 (10:58 +0000)]
tests: Force a triple.

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

14 years agoWhen name lookup finds a single declaration that was imported via a
Douglas Gregor [Sun, 25 Apr 2010 21:15:30 +0000 (21:15 +0000)]
When name lookup finds a single declaration that was imported via a
using declaration, look at its underlying declaration to determine the
lookup result kind (e.g., overloaded, unresolved). Fixes at least one
issue in Boost.Bimap.

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

14 years agoImprove the diagnostic when we find something we did not expect in a
Douglas Gregor [Sun, 25 Apr 2010 20:55:08 +0000 (20:55 +0000)]
Improve the diagnostic when we find something we did not expect in a
member expression (p-> or x.), by showing the type we looked into and
what we did actually find.

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

14 years agoIRgen/NeXT: Fix several alignment issues with Objective-C metadata symbols:
Daniel Dunbar [Sun, 25 Apr 2010 20:39:32 +0000 (20:39 +0000)]
IRgen/NeXT: Fix several alignment issues with Objective-C metadata symbols:
 - Fix some places that had the alignment hard coded.
 - Use ABI type alignment, not preferred type alignment -- neither of this is exactly right, as we really want the C type alignment as required by the runtime, but the ABI alignment is a more correct choice.

This should be equivalent for x86_64, but fixes the alignment for ARM.

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

14 years agotests: Convert test to FileCheck.
Daniel Dunbar [Sun, 25 Apr 2010 20:39:19 +0000 (20:39 +0000)]
tests: Convert test to FileCheck.

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

14 years agoIRgen/NeXT: Reuse EmitImageInfo for both fragile and non-fragile ABI. This fixes...
Daniel Dunbar [Sun, 25 Apr 2010 20:39:01 +0000 (20:39 +0000)]
IRgen/NeXT: Reuse EmitImageInfo for both fragile and non-fragile ABI. This fixes Clang to correctly emit the "CorrectedSynthesize" bit when using the non-fragile ABI.

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

14 years agoWhen performing name lookup for an operator name, be sure to look
Douglas Gregor [Sun, 25 Apr 2010 20:25:43 +0000 (20:25 +0000)]
When performing name lookup for an operator name, be sure to look
through using declarations. Fixes ~18 tests in Boost.Fusion.

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

14 years agoexclude cmake build directories from being installed
Chris Lattner [Sun, 25 Apr 2010 04:59:35 +0000 (04:59 +0000)]
exclude cmake build directories from being installed
with "make install".  Patch by Michael Forney!

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

14 years agoLand another cleanup patch.
Anders Carlsson [Sun, 25 Apr 2010 01:03:12 +0000 (01:03 +0000)]
Land another cleanup patch.

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

14 years agoLand this test.
Anders Carlsson [Sun, 25 Apr 2010 01:00:05 +0000 (01:00 +0000)]
Land this test.

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

14 years agoTweak test for destruction of copied temporary objects
Douglas Gregor [Sun, 25 Apr 2010 00:56:07 +0000 (00:56 +0000)]
Tweak test for destruction of copied temporary objects

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

14 years agoWhen copying a temporary object to initialize an entity for which the
Douglas Gregor [Sun, 25 Apr 2010 00:55:24 +0000 (00:55 +0000)]
When copying a temporary object to initialize an entity for which the
temporary needs to be bound, bind the copy object. Otherwise, we won't
end up calling the destructor for the copy. Fixes Boost.Optional.

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

14 years agoRevert enough of my patches to fix self-host again :(
Anders Carlsson [Sun, 25 Apr 2010 00:52:09 +0000 (00:52 +0000)]
Revert enough of my patches to fix self-host again :(

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

14 years agoWhen we create a temporary of class type that we don't immediately
Douglas Gregor [Sat, 24 Apr 2010 23:45:46 +0000 (23:45 +0000)]
When we create a temporary of class type that we don't immediately
bind, check accessibility of the destructor and mark the declaration
as referenced. Fixes a bunch of Boost.Regex failures.

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

14 years agoCleanup SynthesizeCXXCopyConstructor.
Anders Carlsson [Sat, 24 Apr 2010 23:11:18 +0000 (23:11 +0000)]
Cleanup SynthesizeCXXCopyConstructor.

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

14 years agoClean up SynthesizeCXXCopyAssignment a little.
Anders Carlsson [Sat, 24 Apr 2010 23:09:21 +0000 (23:09 +0000)]
Clean up SynthesizeCXXCopyAssignment a little.

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

14 years agoRenameGetAddressOfBaseOfCompleteClass to GetAddressOfDirectBaseInCompleteClass to...
Anders Carlsson [Sat, 24 Apr 2010 23:01:49 +0000 (23:01 +0000)]
RenameGetAddressOfBaseOfCompleteClass to GetAddressOfDirectBaseInCompleteClass to reflect that it only handles direct bases.

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

14 years agoAdd an explicit UsuallyTinyPtrVector that takes a single element.
Anders Carlsson [Sat, 24 Apr 2010 22:54:32 +0000 (22:54 +0000)]
Add an explicit UsuallyTinyPtrVector that takes a single element.

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

14 years agoMore cleanup.
Anders Carlsson [Sat, 24 Apr 2010 22:43:39 +0000 (22:43 +0000)]
More cleanup.

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

14 years agoSimplify EmitClassMemberwiseCopy now that it's only used for fields.
Anders Carlsson [Sat, 24 Apr 2010 22:36:50 +0000 (22:36 +0000)]
Simplify EmitClassMemberwiseCopy now that it's only used for fields.

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

14 years agoSwitch this to new API.
Nick Lewycky [Sat, 24 Apr 2010 22:31:36 +0000 (22:31 +0000)]
Switch this to new API.

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

14 years agoDefineImplicitCopyConstructor now uses SetBaseOrMemberInitializers to create implicit...
Anders Carlsson [Sat, 24 Apr 2010 22:25:18 +0000 (22:25 +0000)]
DefineImplicitCopyConstructor now uses SetBaseOrMemberInitializers to create implicit base initializers. (Member initializers are still handled by CodeGenFunction::SynthesizeCXXCopyConstructor for now).

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

14 years agoWhen building implicit base initializers, add a derived-to-base cast that points...
Anders Carlsson [Sat, 24 Apr 2010 22:02:54 +0000 (22:02 +0000)]
When building implicit base initializers, add a derived-to-base cast that points to the exact base specifier.

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

14 years agoRename GetAddressOfBaseClass to OldGetAddressOfBaseClass.
Anders Carlsson [Sat, 24 Apr 2010 21:51:08 +0000 (21:51 +0000)]
Rename GetAddressOfBaseClass to OldGetAddressOfBaseClass.

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

14 years agoGet rid of the old GetNonVirtualBaseClassOffset and change all call sites to use...
Anders Carlsson [Sat, 24 Apr 2010 21:27:51 +0000 (21:27 +0000)]
Get rid of the old GetNonVirtualBaseClassOffset and change all call sites to use the new version.

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

14 years agoChange CodeGenFunction::GetAddressOfDerivedClass to take a BasePath.
Anders Carlsson [Sat, 24 Apr 2010 21:23:59 +0000 (21:23 +0000)]
Change CodeGenFunction::GetAddressOfDerivedClass to take a BasePath.

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

14 years agoConvert more call sites over to the new GetAddressOfBaseClass.
Anders Carlsson [Sat, 24 Apr 2010 21:12:55 +0000 (21:12 +0000)]
Convert more call sites over to the new GetAddressOfBaseClass.

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

14 years agoWhen we attempt to create a temporary object of class type, be sure
Douglas Gregor [Sat, 24 Apr 2010 21:09:25 +0000 (21:09 +0000)]
When we attempt to create a temporary object of class type, be sure
that the type we're copying is complete.

Boost.Regex now builds, although it's failing its regression tests
with our favorite "Sema doesn't consider destructor as used."
assertion.

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

14 years agoAdd a new GetAddressOfBaseClass overload that takes a base path and. Use it for deriv...
Anders Carlsson [Sat, 24 Apr 2010 21:06:20 +0000 (21:06 +0000)]
Add a new GetAddressOfBaseClass overload that takes a base path and. Use it for derived-to-base casts.

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

14 years agoWhen we are performing copy initialization of a class type via its
Douglas Gregor [Sat, 24 Apr 2010 20:54:38 +0000 (20:54 +0000)]
When we are performing copy initialization of a class type via its
copy constructor, suppress user-defined conversions on the
argument. Otherwise, we can end up in a recursion loop where the
bind the argument of the copy constructor to another copy constructor call,
whose argument is then a copy constructor call...

Found by Boost.Regex which, alas, still isn't building.

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

14 years agoHeaders: Hide intptr_t and uintptr_t definitions behind _INTPTR_T and _UINTPTR_T
Daniel Dunbar [Sat, 24 Apr 2010 20:32:12 +0000 (20:32 +0000)]
Headers: Hide intptr_t and uintptr_t definitions behind _INTPTR_T and _UINTPTR_T
defines, for increased compatibility with Darwin gcc.
 - This is a bit of a hack, since platform compatibility issues don't belong
   here, but I don't think this hurts anyone either.

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

14 years agoFix pasto, add a comment.
Benjamin Kramer [Sat, 24 Apr 2010 20:26:20 +0000 (20:26 +0000)]
Fix pasto, add a comment.

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

14 years agoFactor code. No functionality change.
Benjamin Kramer [Sat, 24 Apr 2010 20:19:58 +0000 (20:19 +0000)]
Factor code. No functionality change.

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

14 years agoAdd base paths for CK_BaseToDerived and CK_BaseToDerivedMemberPointer.
Anders Carlsson [Sat, 24 Apr 2010 19:36:51 +0000 (19:36 +0000)]
Add base paths for CK_BaseToDerived and CK_BaseToDerivedMemberPointer.

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

14 years agoAdd base paths to CK_UncheckedDerivedToBase and CK_DerivedToBaseMemberPointer.
Anders Carlsson [Sat, 24 Apr 2010 19:22:20 +0000 (19:22 +0000)]
Add base paths to CK_UncheckedDerivedToBase and CK_DerivedToBaseMemberPointer.

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

14 years agoActually produce base paths for CastExprs of kind CK_DerivedToBase.
Anders Carlsson [Sat, 24 Apr 2010 19:06:50 +0000 (19:06 +0000)]
Actually produce base paths for CastExprs of kind CK_DerivedToBase.

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

14 years agoAdd BasePath arguments to all cast expr constructors.
Anders Carlsson [Sat, 24 Apr 2010 18:38:56 +0000 (18:38 +0000)]
Add BasePath arguments to all cast expr constructors.

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

14 years agoDriver/Darwin: Fix Objective-C non-fragile ABI and dispatch method defaults, which...
Daniel Dunbar [Sat, 24 Apr 2010 18:37:41 +0000 (18:37 +0000)]
Driver/Darwin: Fix Objective-C non-fragile ABI and dispatch method defaults, which were wrong in numerous places.
 - <rdar://problem/7903449>

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

14 years agoWhen we take the address of a declaration to bind it to a non-type
Douglas Gregor [Sat, 24 Apr 2010 18:20:53 +0000 (18:20 +0000)]
When we take the address of a declaration to bind it to a non-type
template parameter, by sure to mark that declaration as
"referenced". The Boost.Iterator library now passes all tests.

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

14 years agoNeXT: Clean up dispatch method policy selection.
Daniel Dunbar [Sat, 24 Apr 2010 17:56:46 +0000 (17:56 +0000)]
NeXT: Clean up dispatch method policy selection.
 - Replace -cc1 level -fobjc-legacy-dispatch with -fobjc-dispatch-method={legacy,non-legacy,mixed}.

 - Lift "mixed" vs "non-mixed" policy choice up to driver level, instead of being buried in CGObjCMac.cpp.

 - No intended functionality change.

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

14 years agoSimplify.
Daniel Dunbar [Sat, 24 Apr 2010 17:56:39 +0000 (17:56 +0000)]
Simplify.

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

14 years agoPass the base specifiers through to CheckDerivedToBaseConversion. No functionality...
Anders Carlsson [Sat, 24 Apr 2010 17:11:09 +0000 (17:11 +0000)]
Pass the base specifiers through to CheckDerivedToBaseConversion. No functionality change yet.

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

14 years agoCastExpr should not hold a pointer to the base path. More cleanup.
Anders Carlsson [Sat, 24 Apr 2010 16:57:13 +0000 (16:57 +0000)]
CastExpr should not hold a pointer to the base path. More cleanup.

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

14 years agoTweak test case slightly
Douglas Gregor [Sat, 24 Apr 2010 16:40:35 +0000 (16:40 +0000)]
Tweak test case slightly

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

14 years agoBe more careful around dependent nested-name-specifiers, complaining
Douglas Gregor [Sat, 24 Apr 2010 16:38:41 +0000 (16:38 +0000)]
Be more careful around dependent nested-name-specifiers, complaining
when they are not complete (since we could not match them up to
anything) and ensuring that enum parsing can cope with dependent
elaborated-type-specifiers. Fixes PR6915 and PR6649.

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

14 years agoisValue is set to false by default.
Anders Carlsson [Sat, 24 Apr 2010 16:36:20 +0000 (16:36 +0000)]
isValue is set to false by default.

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

14 years agoRename InheritancePath to BasePath, rename CastExpr::CXXBaseVector to CXXBaseSpecifie...
Anders Carlsson [Sat, 24 Apr 2010 16:34:21 +0000 (16:34 +0000)]
Rename InheritancePath to BasePath, rename CastExpr::CXXBaseVector to CXXBaseSpecifierArray. More to come.

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

14 years agoKeep track of when DependentNameTypes have no associated keyword
Douglas Gregor [Sat, 24 Apr 2010 15:35:55 +0000 (15:35 +0000)]
Keep track of when DependentNameTypes have no associated keyword
(e.g., no typename, enum, class, etc.), e.g., because the context is
one that is known to refer to a type. Patch from Enea Zaffanella!

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

14 years agoUpdate prototypes.
Benjamin Kramer [Sat, 24 Apr 2010 08:26:17 +0000 (08:26 +0000)]
Update prototypes.

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

14 years agoFix a place in inline asm lowering which was creating a TruncInst with a
Dan Gohman [Sat, 24 Apr 2010 04:55:02 +0000 (04:55 +0000)]
Fix a place in inline asm lowering which was creating a TruncInst with a
pointer operand. This fixes an abort on
MultiSource/Applications/ClamAV/libclamav_mbox.c.

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

14 years agoRecommit r102215, this time being more careful to only set the "principal
John McCall [Sat, 24 Apr 2010 01:30:58 +0000 (01:30 +0000)]
Recommit r102215, this time being more careful to only set the "principal
declaration" (i.e. the only which will actually be looked up) to have the
non-member-operator bit.

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

14 years agoTeach clang -fixit to modify files in-place, or -fixit=suffix to create new
Nick Lewycky [Sat, 24 Apr 2010 01:30:46 +0000 (01:30 +0000)]
Teach clang -fixit to modify files in-place, or -fixit=suffix to create new
files with the additional suffix in the middle.

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

14 years agoRevert accidental check-in.
Devang Patel [Sat, 24 Apr 2010 00:49:16 +0000 (00:49 +0000)]
Revert accidental check-in.

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

14 years agoRevert r102215. This causes clang crash while compiling a test case from gdb testsuite.
Devang Patel [Sat, 24 Apr 2010 00:40:35 +0000 (00:40 +0000)]
Revert r102215. This causes clang crash while compiling a test case from gdb testsuite.

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

14 years agoWith -fno-constant-cfstrrings, class NSConstantString
Fariborz Jahanian [Fri, 23 Apr 2010 23:19:04 +0000 (23:19 +0000)]
With -fno-constant-cfstrrings, class NSConstantString
must be there or it is error (Next runtime).

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

14 years agoRework Parser-Sema interface for Objective-C @catch exception object
Douglas Gregor [Fri, 23 Apr 2010 23:01:43 +0000 (23:01 +0000)]
Rework Parser-Sema interface for Objective-C @catch exception object
arguments. Rather than having the parser call ActOnParamDeclarator
(which is a bit of a hack), call a new ActOnObjCExceptionDecl
action. We'll be moving more functionality into this handler to
perform earlier checking of @catch.

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

14 years agoImprove the AST representation of Objective-C @try/@catch/@finally
Douglas Gregor [Fri, 23 Apr 2010 22:50:49 +0000 (22:50 +0000)]
Improve the AST representation of Objective-C @try/@catch/@finally
statements. Instead of the @try having a single @catch, where all of
the @catch's were chained (using an O(n^2) algorithm nonetheless),
@try just holds an array of its @catch blocks. The resulting AST is
slightly more compact (not important) and better represents the actual
language semantics (good).

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

14 years agoMore -fno-constant-cfstrings API work.
Fariborz Jahanian [Fri, 23 Apr 2010 22:33:39 +0000 (22:33 +0000)]
More -fno-constant-cfstrings API work.

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

14 years agoAdd an InheritancePath parameter to the ImplicitCastExpr constructor.
Anders Carlsson [Fri, 23 Apr 2010 22:18:37 +0000 (22:18 +0000)]
Add an InheritancePath parameter to the ImplicitCastExpr constructor.

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

14 years agoTransition the last acceptable-result filter kind in LookupResult over to use
John McCall [Fri, 23 Apr 2010 21:37:18 +0000 (21:37 +0000)]
Transition the last acceptable-result filter kind in LookupResult over to use
a simple IDNS mask by introducing a namespace for non-member operators.

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