Commit Graph

82827 Commits

Author SHA1 Message Date
Evan Cheng e813690b7a - When legal, promote a load to zextload rather than ext load.
- Catch more further dag combine opportunities as result of operand promotion, e.g. (i32 anyext (i16 trunc (i32 x))) -> (i32 x)

llvm-svn: 102455
2010-04-27 19:48:13 +00:00
Devang Patel 6c74a872a8 Identify when a lexical scope is split in to multiple instruction ranges. Emit such ranges using DW_AT_ranges.
This patch fixes bug (PR6894) introduced by previous version of this patch.

llvm-svn: 102454
2010-04-27 19:46:33 +00:00
Evan Cheng eb828b6391 Do not count kill, implicit_def instructions as printed instructions.
llvm-svn: 102453
2010-04-27 19:38:45 +00:00
Douglas Gregor 7d8072e038 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. 

llvm-svn: 102452
2010-04-27 19:38:14 +00:00
Douglas Gregor 9262f4775d 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.

llvm-svn: 102448
2010-04-27 18:19:34 +00:00
Benjamin Kramer 0a3fe0456f More simplifications.
llvm-svn: 102447
2010-04-27 17:47:25 +00:00
Fariborz Jahanian 38b77a9d8e Move CollectIvarsToConstructOrDestruct to Sema
from AST, consider ivar array of objects
(per Doug's comment).

llvm-svn: 102446
2010-04-27 17:18:58 +00:00
Benjamin Kramer 2e3197e60b Simplify some code. No change in functionality.
llvm-svn: 102445
2010-04-27 17:12:11 +00:00
Douglas Gregor 4423926e66 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.

llvm-svn: 102437
2010-04-27 16:26:47 +00:00
Douglas Gregor 19defcd6f5 Don't look into incomplete types when trying to warn about unused
variables. Fixes PR6948.

llvm-svn: 102436
2010-04-27 16:20:13 +00:00
Douglas Gregor a9f7c3263e CMake: Fix DESTDIR-related installation problem on Windows, from the
mysterious Elrood on IRC.

llvm-svn: 102435
2010-04-27 16:14:06 +00:00
Douglas Gregor da7be08a0c When instantiating UnresolvedLookupExpr and UnresolvedMemberExpr
expressions, be sure to set the naming class of the LookupResult
structure. Fixes PR6947.

llvm-svn: 102434
2010-04-27 16:10:10 +00:00
Daniel Dunbar 2cb4e7a872 Simplify.
llvm-svn: 102432
2010-04-27 15:35:03 +00:00
Daniel Dunbar 34d7a99062 Add Driver support for -fno-constant-cfstrings.
llvm-svn: 102431
2010-04-27 15:34:57 +00:00
David Chisnall 75afda6c33 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).

llvm-svn: 102430
2010-04-27 15:08:48 +00:00
Daniel Dunbar 19d6355b77 Fix comments.
llvm-svn: 102429
2010-04-27 14:51:07 +00:00
Chris Lattner 64d43d80be round zero-byte .zerofill directives up to 1 byte. This
should fix some "g++.dg-struct-layout-1" failures, 
rdar://7886017

llvm-svn: 102421
2010-04-27 07:41:44 +00:00
Enea Zaffanella f205977e6f Wrap a couple of long lines. (Test commit.)
llvm-svn: 102420
2010-04-27 07:38:32 +00:00
Chris Lattner a3cc83bc82 fix wordo
llvm-svn: 102418
2010-04-27 07:28:11 +00:00
Chris Lattner 0260a975ba remove some comments.
llvm-svn: 102417
2010-04-27 06:57:10 +00:00
Dale Johannesen eb61a7d616 Revert a small part of 102372; this fixes at least one
of the dbg testsuite regressions.  I don't think this is
really the right fix; this change exposed an existing problem
upstream somewhere.

llvm-svn: 102410
2010-04-27 02:10:05 +00:00
John McCall 1e67dd6b2f Improve the diagnostic you get when making a qualified member access
with a qualifier referencing a different type.

llvm-svn: 102409
2010-04-27 01:43:38 +00:00
John McCall 2408e32096 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).

llvm-svn: 102407
2010-04-27 00:57:59 +00:00
Bill Wendling 633c48ec1d r98363 deleted a '!' when cleaning up whitespace. This caused globals which are
*not* declarations to *not* be placed in the "preserve" list.
<rdar://problem/7870735>

llvm-svn: 102405
2010-04-27 00:55:25 +00:00
Dale Johannesen 022e7b900f Un-XFAIL this on ppc. My enabling of dbg_declare handling
in ISel fixed it.

llvm-svn: 102404
2010-04-27 00:01:42 +00:00
Fariborz Jahanian b310259060 New method to construct/destruct ivars that have non-trivial default
constructors or destructors, not used yet.

llvm-svn: 102403
2010-04-26 23:51:25 +00:00
Chris Lattner 44a27efdf9 Fix a problem that lower invoke has with allocas (PR6694), and
add a version of createLowerInvokePass that allows the client
to specify whether it wants "expensive" or "cheap" lowering.

Patch by Alex Mac!

llvm-svn: 102402
2010-04-26 23:49:32 +00:00
Chris Lattner 3af635a296 add a comment in verbose-asm mode indicating why a noop is being generated.
llvm-svn: 102401
2010-04-26 23:41:43 +00:00
Chris Lattner 6a5e706e3c on darwin empty functions need to codegen into something of non-zero length,
otherwise labels get incorrectly merged.  We handled this by emitting a 
".byte 0", but this isn't correct on thumb/arm targets where the text segment
needs to be a multiple of 2/4 bytes.  Handle this by emitting a noop.  This
is more gross than it should be because arm/ppc are not fully mc'ized yet.

This fixes rdar://7908505

llvm-svn: 102400
2010-04-26 23:37:21 +00:00
Dan Gohman b8b85c1ddb Integrate Jeffery Yasskin's suggestions with respect to
traps flowing through memory references, add some text to
better cover phi nodes and externally-visible side effects,
add an example of instructions being control-dependent
on a trap value, and reword some of the existing trap rules.

llvm-svn: 102399
2010-04-26 23:36:52 +00:00
Devang Patel 42fb6f8b9a Enable debug info for local variables at -O1+.
llvm-svn: 102398
2010-04-26 23:28:46 +00:00
Bob Wilson 25f85947a3 Handle register-to-register copies within the tGPR class.
Radar 7896289

llvm-svn: 102396
2010-04-26 23:20:08 +00:00
Bob Wilson a1e343095f Avoid adding a null MD node operand, which crashes with "-debug" when trying
to print the operand.

llvm-svn: 102395
2010-04-26 22:56:56 +00:00
Devang Patel bd798ce8dd Use DW_AT_entry_pc instead of DW_AT_low_pc/DW_AT_high_pc pair. This simplifies debug range entries.
llvm-svn: 102394
2010-04-26 22:54:28 +00:00
Douglas Gregor 9da641912d 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.

llvm-svn: 102393
2010-04-26 22:37:10 +00:00
Chris Lattner 678eaa90ab 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.

llvm-svn: 102391
2010-04-26 22:08:10 +00:00
Fariborz Jahanian 0103d67f98 Diagnose declaration of reference typed ivars.
llvm-svn: 102390
2010-04-26 22:07:03 +00:00
Dan Gohman 58b0470592 When checking whether the special handling for an addrec increment which
doesn't dominate the header is needed, don't check whether the increment
expression has computable loop evolution. While the operands of an
addrec are required to be loop-invariant, they're not required to 
dominate any part of the loop. This fixes PR6914.

llvm-svn: 102389
2010-04-26 21:46:36 +00:00
Chris Lattner 8f68b777e2 wordsmith an objc warning, rdar://7900756
llvm-svn: 102388
2010-04-26 21:44:01 +00:00
Dan Gohman d07d2f9774 Add a comment to this test.
llvm-svn: 102387
2010-04-26 21:37:43 +00:00
Douglas Gregor 8385a06929 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.

llvm-svn: 102386
2010-04-26 21:31:17 +00:00
Jeffrey Yasskin 5d284ae8a0 Consolidate the description of volatile operations, now that some of the
intrinsics have volatile semantics in addition to the load and store
instructions.  

llvm-svn: 102384
2010-04-26 21:21:24 +00:00
Fariborz Jahanian 65654df92c Cleanup error recovery for a missing '-'|'+'
on a method declaration (radar 7822196).

llvm-svn: 102383
2010-04-26 21:18:08 +00:00
Douglas Gregor b7e20eb883 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! 

llvm-svn: 102382
2010-04-26 21:04:54 +00:00
Dan Gohman 48a2588be4 Branching or switching on trap transfers imminent undefined behavior
onto control-dependent instructions.

llvm-svn: 102381
2010-04-26 20:54:53 +00:00
Dale Johannesen 59a438560c Remove crufty comments.
llvm-svn: 102380
2010-04-26 20:48:54 +00:00
Douglas Gregor 9faee21f67 Implement template instantiation for ObjCPropertyRefExpr.
llvm-svn: 102379
2010-04-26 20:47:02 +00:00
Gabor Greif 137d90c763 add some typewriter tags
llvm-svn: 102378
2010-04-26 20:46:03 +00:00
Chris Lattner 5e8416a77f emit dtors with the right calling convention in -fno-use-cxa-atexit
mode.

llvm-svn: 102377
2010-04-26 20:35:54 +00:00
Dan Gohman b2a709be07 Fix HTML errors that Jeffery Yasskin noticed.
llvm-svn: 102376
2010-04-26 20:21:21 +00:00