Commit Graph

39867 Commits

Author SHA1 Message Date
Duncan Sands fe3bef091f Initializing an unsigned with ~0UL causes the compiler
to complain on x86-64 (gcc 4.1).  Use ~0U instead.

llvm-svn: 46197
2008-01-20 10:49:23 +00:00
Lauro Ramos Venancio 71a9bb2b48 Fix the __SIZE_TYPE__ definition on x86_32. This fixes the alloca.c (wget 1.10.2) compilation.
llvm-svn: 46196
2008-01-20 04:02:16 +00:00
Dale Johannesen 949e5a2f8a Do not generate a FP_ROUND of f64 to f64.
llvm-svn: 46195
2008-01-20 01:18:38 +00:00
Ted Kremenek 7d2b746f08 Changed argument name for 'Profile' method to potentially fix a name conflict
reported in pr1929 (http://llvm.org/PR1929).

llvm-svn: 46193
2008-01-19 17:21:43 +00:00
Duncan Sands 3e95d963e9 Need to handle any 'nest' parameter before integer
parameters, since otherwise it won't be passed in
the right register.  With this change trampolines
work on x86-64 (thanks to Luke Guest for providing
access to an x86-64 box).

llvm-svn: 46192
2008-01-19 16:42:10 +00:00
Ted Kremenek bb80c7b800 Modified ImmutableSet/ImmutableMap to use FoldingSet profiling using
FoldingSetTrait instead of directly calling a 'Profile' method.

llvm-svn: 46190
2008-01-19 04:51:55 +00:00
Ted Kremenek 4875d2d997 Added FoldingSet style 'profiling' support for APSInt.
llvm-svn: 46189
2008-01-19 04:31:12 +00:00
Ted Kremenek 5c75d54c5b Added FoldingSet style 'profiling' support for APInt.
llvm-svn: 46188
2008-01-19 04:23:33 +00:00
Ted Kremenek c0259639ad Made 'FoldingSetNodeID' a proper class instead of a nested class in
'FoldingSetNodeImpl' (previously 'FoldingSetNodeID' was a typedef of
'FoldingSetNodeImpl::NodeID').

Why?  Clients can now easily forward declare 'FoldingSetNodeID' without having
to include FoldingSet.h.

llvm-svn: 46187
2008-01-19 04:22:50 +00:00
Ted Kremenek f1210f7c43 Made 'profiling' of objects in a FoldingSet trait-based using FoldingSetTrait
instead of always assuming that the stored objects had a method called
'Profile'. The default behavior is to dispatch to a 'Profile' method (as
before), but via template specialization this behavior can now be overridden by
clients.

Added templated class 'FoldingSetNodeWrapper', a generic wrapper class that
allows one to insert objects into a FoldingSet that do not directly inherit from
FoldingSetNode. This is useful for inserting objects that do not always need to
pay the overhead of inheriting from FoldingSetNode, or were designed with that
behavior in mind.

llvm-svn: 46186
2008-01-19 03:58:00 +00:00
Fariborz Jahanian 137d693e09 Fixed comment.
llvm-svn: 46185
2008-01-19 01:03:17 +00:00
Steve Naroff c7d2df23f8 Fix two bugs with an @throw that doesn't have a statement.
- ObjCAtThrowStmt::getSourceRange() needs to check if it has a statement (and not go "boom":-)
- RewriteTest::RewriteObjCThrowStmt() needs to generate refer to the current exception. 

llvm-svn: 46184
2008-01-19 00:42:38 +00:00
Fariborz Jahanian 802583656e Patch to replace #import with #include.
llvm-svn: 46183
2008-01-19 00:30:35 +00:00
Steve Naroff 31c89f2bb0 Add Basic/Targets.cpp to the Xcode project...
llvm-svn: 46182
2008-01-18 23:34:17 +00:00
Evan Cheng 26c33032fa Fix makefiles to enable Apply style debug build.
llvm-svn: 46180
2008-01-18 21:01:00 +00:00
Steve Naroff acb6fa6bea Sema::FinalizeDeclaratorGroup(): Tighten up the tentative definition rule when dealing with arrays.
Bug submitted by Eli.

llvm-svn: 46179
2008-01-18 20:40:52 +00:00
Dale Johannesen 5c94cb3596 Implement flt_rounds for PowerPC.
llvm-svn: 46174
2008-01-18 19:55:37 +00:00
Chris Lattner 1b35211fcc remove extraneous &&'s from tests, as Scott is apparently not going to.
llvm-svn: 46173
2008-01-18 19:53:43 +00:00
Dale Johannesen 4768c3c9b6 Test is correct again for the moment.
llvm-svn: 46172
2008-01-18 19:53:31 +00:00
Chris Lattner bc6cf9e810 remove extraneous &'s.
llvm-svn: 46171
2008-01-18 19:36:20 +00:00
Chris Lattner 6d4ee152ff don't form an std::string with a null pointer, it aborts.
llvm-svn: 46166
2008-01-18 18:54:31 +00:00
Chris Lattner 87757d38b3 get symbolic information for ppc ldbl nodes.
llvm-svn: 46165
2008-01-18 18:51:16 +00:00
Chris Lattner f0d396592a remove magic numbers.
llvm-svn: 46162
2008-01-18 17:13:03 +00:00
Chris Lattner f5b46f7dad Fix a latent bug exposed by my truncstore patch. We compiled stfiwx-2.ll to:
_test:
	fctiwz f0, f1
	stfiwx f0, 0, r4
	blr 

instead of:

_test:
	fctiwz f0, f1
	stfd f0, -8(r1)
	nop
	nop
	lwz r2, -4(r1)
	stb r2, 0(r4)
	blr 

The former is not correct (stores 4 bytes, not 1).

llvm-svn: 46161
2008-01-18 16:54:56 +00:00
Chris Lattner 7dc00e8021 make a method public
llvm-svn: 46159
2008-01-18 06:52:41 +00:00
Anders Carlsson 60bfc161a0 Assert that the type of the cast is equal to the _unqualified_ type of the subexpression. Fixes a problem spotted by Nuno Lopes.
llvm-svn: 46158
2008-01-18 02:25:57 +00:00
Fariborz Jahanian 159ee39f4d Insert #pragma once when rewriting a header file.
llvm-svn: 46155
2008-01-18 01:15:54 +00:00
Ted Kremenek 111ede6c00 Fixed bug in 'GetBinding' when doing the lookup of stored values. We now
use ImmutableMap::SlimFind(), which returns the correct value.

Added pruning of dead block-level expressions and Decls from our value map
using liveness information.

llvm-svn: 46154
2008-01-18 00:41:32 +00:00
Ted Kremenek 05ecfddfc3 Fixed bug in 'LiveVariables' analysis where we incorrectly marked a variable
dead at an assignment without taking into account if the variable was used in
the RHS of the assignment.

llvm-svn: 46153
2008-01-18 00:40:21 +00:00
Steve Naroff b716fbab44 Sema::FinalizeDeclaratorGroup()...make sure we emit an diagnostic for tentative definitions with incomplete types. Touch up all test cases that are effected.
llvm-svn: 46152
2008-01-18 00:39:39 +00:00
Ted Kremenek 1989d2569b Changed DataflowSolver to always associated recorded dataflow values with
the position *before* a statement, regardless of whether we are doing a
forward or backwards analysis.

llvm-svn: 46151
2008-01-18 00:38:55 +00:00
Ted Kremenek ab405774b6 Reverted implementation of ImmutableMap::find() to return a TreeTy* instead of
an iterator, since the implementation returned an iterator that pointed to a
different node! Renamed this implementation to SlimFind() so that users do not
expect it to return an iterator (it is a more efficient implementation than
returning an iterator if the user just wants to find the value of a key).

Added a FIXME to implement ImmutableMap::find() that returns an iterator.

llvm-svn: 46150
2008-01-18 00:38:04 +00:00
Dale Johannesen 8ef89eabc2 Revert the part of 45849 that treated weak globals
as weak globals rather than commons.  While not wrong,
this change tickled a latent bug in Darwin's strip,
so revert it for now as a workaround.

llvm-svn: 46147
2008-01-17 23:36:04 +00:00
Dale Johannesen 60a9855799 Revert the part of 45848 that treated weak globals
as weak globals rather than commons.  While not wrong,
this change tickled a latent bug in Darwin's strip,
so revert it for now as a workaround.

llvm-svn: 46144
2008-01-17 23:04:07 +00:00
Ted Kremenek 85be7cf8ca Modified the notion of "Block-level expressions" in CFGs to include Stmt*. This
is because GNU-style Statement-expressions cause the last statement in the
statement-expression to act like an expression.

We now have two notions: block-level statements and block-level expressions.

The former are all Stmt* that appear in the list of statements in CFGBlocks. The
latter is the subset of the former; these block-level statements are used as
subexpressions somewhere in the AST. CFG::isBlockExpr() returns true for the
latter, not the former (previously isBlockExpr() always returned true for
non-Expr Stmt*).

Modified the LiveVariables analysis to also track liveness state for block-level
expressions (using the updated definition of block-level expressions).

Modified the dataflow solver so that when it records values for block-level
statements, it records the dataflow value *before* the transfer function for a
Stmt* is evaluated (not after). This is more in sync in what clients will want.

Modified CFGStmtVisitor to record the current block-level statement.

llvm-svn: 46143
2008-01-17 20:48:37 +00:00
Scott Michel e4d3e3c0e7 Forward progress: crtbegin.c now compiles successfully!
Fixed CellSPU's A-form (local store) address mode, so that all globals,
externals, constant pool and jump table symbols are now wrapped within
a SPUISD::AFormAddr pseudo-instruction. This now identifies all local
store memory addresses, although it requires a bit of legerdemain during
instruction selection to properly select loads to and stores from local
store, properly generating "LQA" instructions.

Also added mul_ops.ll test harness for exercising integer multiplication.

llvm-svn: 46142
2008-01-17 20:38:41 +00:00
Fariborz Jahanian 9a5124a67e Don't ICE on missing interface declaration when declaring one of its protocols.
llvm-svn: 46141
2008-01-17 20:33:24 +00:00
Chris Lattner 1ea55cf816 This commit changes:
1. Legalize now always promotes truncstore of i1 to i8. 
2. Remove patterns and gunk related to truncstore i1 from targets.
3. Rename the StoreXAction stuff to TruncStoreAction in TLI.
4. Make the TLI TruncStoreAction table a 2d table to handle from/to conversions.
5. Mark a wide variety of invalid truncstores as such in various targets, e.g.
   X86 currently doesn't support truncstore of any of its integer types.
6. Add legalize support for truncstores with invalid value input types.
7. Add a dag combine transform to turn store(truncate) into truncstore when
   safe.

The later allows us to compile CodeGen/X86/storetrunc-fp.ll to:

_foo:
	fldt	20(%esp)
	fldt	4(%esp)
	faddp	%st(1)
	movl	36(%esp), %eax
	fstps	(%eax)
	ret

instead of:

_foo:
	subl	$4, %esp
	fldt	24(%esp)
	fldt	8(%esp)
	faddp	%st(1)
	fstps	(%esp)
	movl	40(%esp), %eax
	movss	(%esp), %xmm0
	movss	%xmm0, (%eax)
	addl	$4, %esp
	ret

llvm-svn: 46140
2008-01-17 19:59:44 +00:00
Chris Lattner 9f7fed1c1b new testcase.
llvm-svn: 46139
2008-01-17 19:47:23 +00:00
Steve Naroff e7ea2f43bf Improve diagnostic wording...
llvm-svn: 46138
2008-01-17 19:24:05 +00:00
Ted Kremenek b4b65e6319 Added support to dataflow solver to (when requested) also record dataflow
values for the block-level expressions.

Modified 'LiveVariables' to provide the option to clients to record
liveness information for block-level expressions (using the above feature).

Modified 'DeadStores' to conform to the new interface of 'LiveVariables'.

Modified 'GRConstants' to compute liveness information for block-level
expressions.

llvm-svn: 46137
2008-01-17 18:25:22 +00:00
Nate Begeman 1c075a1c9d Match change in EmitCallExpr
llvm-svn: 46136
2008-01-17 18:06:09 +00:00
Nate Begeman d5b534e16f Fix for EmitCallExpr changed in OverloadExpr patch
llvm-svn: 46135
2008-01-17 18:03:22 +00:00
Ted Kremenek 32a3358eab Fixed typo introduced by r46133 that caused -Wfloat-equal to break.
llvm-svn: 46134
2008-01-17 17:55:13 +00:00
Ted Kremenek f1dae23b68 Removed FindDeclRef, and used Expr::IgnoreParens instead (code refactoring).
llvm-svn: 46133
2008-01-17 17:50:49 +00:00
Nate Begeman 1e36a85f64 Implement basic overload support via a new builtin, __builtin_overload.
__builtin_overload takes 2 or more arguments:
0) a non-zero constant-expr for the number of arguments the overloaded 
   functions will take
1) the arguments to pass to the matching overloaded function
2) a list of functions to match.

The return type of __builtin_overload is inferred from the function whose args
match the types of the arguments passed to the builtin.  For example:

float a;
float sinf(float);
int   sini(int);

float b = __builtin_overload(1, a, sini, sinf);

Says that we are overloading functions that take one argument, and trying to 
pass an argument of the same type as 'a'.  sini() does not match since it takes
and argument of type int.  sinf does match, so at codegen time this will turn
into float b = sinf(a);

llvm-svn: 46132
2008-01-17 17:46:27 +00:00
Fariborz Jahanian ad134b987e Renamed getSynthesizedSelectorSize to getSynthesizedMethodSize. Compute method name
size in accordance with how rewriter synthesizes method name.

llvm-svn: 46131
2008-01-17 17:37:26 +00:00
Ted Kremenek 2b8b71c148 Implemented "FIXME" in ImutAVLTree: isEqual() now also compares the *data* value
and not just the key value when comparing trees. To do this we added data_type
and data_type_ref to the ImutContainerInfo trait classes. For values stored in
the tree that do not have separate key and data components, data_type is simply
a typedef of bool, and isDataEqual() always evaluates to true. This allows us to
support both ImmutableSet and ImmutableMap using the same underlying logic.

llvm-svn: 46130
2008-01-17 17:36:49 +00:00
Ted Kremenek fff70962bb Added method Expr::IgnoreParens(), which returns the first non-ParenExpr Expr*.
Refactored the use of this method into both the Sema module and Analysis module,
which were using their own static functions that did the same thing.

llvm-svn: 46129
2008-01-17 16:57:34 +00:00
Chris Lattner 686dfe829e add some helper methods.
llvm-svn: 46128
2008-01-17 07:30:38 +00:00