Граф коммитов

21277 Коммитов

Автор SHA1 Сообщение Дата
Benjamin Kramer 68eebbb627 Reduce string trashing in getQualifiedNameAsString.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102498 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-28 14:33:51 +00:00
David Chisnall 8c757f9ea3 Emit the correct symbol name for the class (GNU runtime).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102497 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-28 14:29:56 +00:00
Abramo Bagnara b21b405325 Written storage class for declarations inside linkage specifications without braces is none.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102496 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-28 13:11:54 +00:00
Douglas Gregor e6ec5c4204 When the qualifier of a id-expression is non-dependent but not
complete, return an error rather than falling back to building a
dependent declaration reference, since we might not be in a dependent
context. Fixes a fiendish crash-on-invalid in Boost.FunctionTypes that
I wasn't able to reduce to anything useful.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102491 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-28 07:04:26 +00:00
Douglas Gregor 1e9268e297 Improve name mangling for dependent template names (e.g., typename
T::template apply<U>), handling a few cases where we previously failed
and performing substitutions on such dependent names. Fixes a crash in
Boost.PropertyTree.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102490 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-28 05:58:56 +00:00
Douglas Gregor d4598a2cc7 When instantiating a function template specialization following
template argument deduction, use the lexical declaration context as
the owner for friend function templates. Fixes 2 failures in
Boost.Graph.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102489 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-28 04:52:24 +00:00
John McCall 784f21121a 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
2010-04-28 00:00:30 +00:00
Douglas Gregor 15dedf067b 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
2010-04-27 21:10:04 +00:00
Abramo Bagnara 493ec51db3 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
2010-04-27 21:08:25 +00:00
Eli Friedman 24f2801e2c 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
2010-04-27 21:07:06 +00:00
Douglas Gregor 1c63b9c15d 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
2010-04-27 20:36:09 +00:00
David Chisnall 254e2d9e61 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
2010-04-27 20:33:30 +00:00
Douglas Gregor 138bb2366b 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
2010-04-27 19:38:14 +00:00
Douglas Gregor c96be1ea33 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
2010-04-27 18:19:34 +00:00
Benjamin Kramer b170ca5f4a More simplifications.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102447 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-27 17:47:25 +00:00
Fariborz Jahanian 786cd154f2 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
2010-04-27 17:18:58 +00:00
Benjamin Kramer 0237941e0b Simplify some code. No change in functionality.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102445 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-27 17:12:11 +00:00
Douglas Gregor c8fd2dae17 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
2010-04-27 16:26:47 +00:00
Douglas Gregor a6a292b4dc 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
2010-04-27 16:20:13 +00:00
Douglas Gregor 40e7192a17 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
2010-04-27 16:14:06 +00:00
Douglas Gregor 66c4515418 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
2010-04-27 16:10:10 +00:00
Daniel Dunbar 1744a3504a Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102432 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-27 15:35:03 +00:00
Daniel Dunbar f35f14d474 Add Driver support for -fno-constant-cfstrings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102431 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-27 15:34:57 +00:00
David Chisnall 664b7c74af 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
2010-04-27 15:08:48 +00:00
Daniel Dunbar 50810d355a Fix comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102429 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-27 14:51:07 +00:00
Enea Zaffanella 049c51eadc 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
2010-04-27 07:38:32 +00:00
John McCall 110acc1ae8 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
2010-04-27 01:43:38 +00:00
John McCall 31f17ecbef 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
2010-04-27 00:57:59 +00:00
Fariborz Jahanian 184d7900e0 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
2010-04-26 23:51:25 +00:00
Devang Patel 2b594b9b62 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
2010-04-26 23:28:46 +00:00
Douglas Gregor 57fdc8a438 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
2010-04-26 22:37:10 +00:00
Chris Lattner fcaa9e7870 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
2010-04-26 22:08:10 +00:00
Fariborz Jahanian 0b7bc8e937 Diagnose declaration of reference typed ivars.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102390 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-26 22:07:03 +00:00
Chris Lattner bc0b915148 wordsmith an objc warning, rdar://7900756
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102388 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-26 21:44:01 +00:00
Douglas Gregor fb87b89fc9 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
2010-04-26 21:31:17 +00:00
Fariborz Jahanian 5512ba538f 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
2010-04-26 21:18:08 +00:00
Douglas Gregor 9cbfdd212e 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
2010-04-26 21:04:54 +00:00
Douglas Gregor e330354c6b Implement template instantiation for ObjCPropertyRefExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102379 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-26 20:47:02 +00:00
Chris Lattner c9a85f9b4c 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
2010-04-26 20:35:54 +00:00
Douglas Gregor f9b9eab747 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
2010-04-26 20:11:03 +00:00
Chris Lattner fa3c9825dc 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
2010-04-26 19:47:56 +00:00
Fariborz Jahanian 36998f5659 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
2010-04-26 17:59:24 +00:00
Douglas Gregor be270a0fae 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
2010-04-26 17:57:08 +00:00
Douglas Gregor 160b5630aa 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
2010-04-26 17:32:49 +00:00
Douglas Gregor c00d8e18ad 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
2010-04-26 16:46:50 +00:00
Douglas Gregor 087fb7d0b5 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
2010-04-26 14:36:57 +00:00
Daniel Dunbar b19f0ac4b6 tests: Force a triple.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102332 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-26 10:58:19 +00:00
Douglas Gregor 2b147f072b 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
2010-04-25 21:15:30 +00:00
Douglas Gregor b0fd483ad6 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
2010-04-25 20:55:08 +00:00
Daniel Dunbar 4b429ae34d 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
2010-04-25 20:39:32 +00:00