Commit Graph

37293 Commits

Author SHA1 Message Date
Chris Lattner fac7ac4130 UsualArithmeticConversions is crashing with an assert
when comparing "float" and "const float".  This "fixes" the
issue, but may not be the right fix.  Steve, please review.

Testcase here: test/Sema/usual-float.c

llvm-svn: 43113
2007-10-18 03:50:33 +00:00
Steve Naroff 8569d77349 Fix the following bug...
unsigned char asso_values[] = { 34 };
int legal2() { 
  return asso_values[0]; 
}

The code that creates the new constant array type was operating on the original type.

As a result, the constant type being generated was "unsigned char [1][]" (which is wrong).

The fix is to operate on the element type - in this case, the correct type is "unsigned char [1]"

I added this case to array-init.c, which clearly didn't catch this bogosity...

llvm-svn: 43112
2007-10-18 03:27:23 +00:00
Devang Patel 9497767458 XFAIL for now.
llvm-svn: 43111
2007-10-18 00:48:43 +00:00
Chris Lattner c7f3981b27 remove extraneous space in @selector()
llvm-svn: 43110
2007-10-18 00:39:29 +00:00
Chris Lattner 810c1db3f5 remove typedef.
llvm-svn: 43109
2007-10-18 00:38:23 +00:00
Ted Kremenek da9639d1a7 Changed the return type of type-specific Allocate() methods to return
void*.  This is hint that we are returning uninitialized memory rather
than a constructed object.

Patched ImutAVLTree to conform to this new interface.

llvm-svn: 43106
2007-10-18 00:30:14 +00:00
Ted Kremenek 336886a344 Implemented 90% functionality of new child_iterator for Stmt objects
that will (soon) allow iteration over the initializers in
declarations.  This new iterator mechanism is implemented by the
classes StmtIterator and ConstStmtIterator.

Patched a few files to use "operator++" instead of "operator+" on
child_iterators.

Friendship added in VarDecl to StmtIterator to allow returning a
reference to the initializer within the VarDecl.  We may not wish this
as a permanent solution.

llvm-svn: 43105
2007-10-18 00:24:38 +00:00
Chris Lattner 9c0f9fe151 Make control flow in Expr::isConstantExpr more simple and
local, making the code easier to read.

llvm-svn: 43104
2007-10-18 00:20:32 +00:00
Evan Cheng cdcc1d0444 Reverting r43070 for now. It's causing llc test failures.
llvm-svn: 43103
2007-10-17 23:51:13 +00:00
Bill Wendling 37f888e6e8 Test to make sure we don't generate unwind info for non-64-bit Objective-C.
llvm-svn: 43102
2007-10-17 23:14:56 +00:00
Chris Lattner c6d91c0f6d Add new API to rewrite one stmt/expr with another.
llvm-svn: 43101
2007-10-17 22:35:30 +00:00
Ted Kremenek 603fbbfcb7 ImutAVLTree now allocates tree nodes from the BumpPtrAllocator using
the new type-aligned Allocate() method.

llvm-svn: 43100
2007-10-17 22:17:01 +00:00
Ted Kremenek 3830606dee Removed inclusion of cassert, which is no longer needed.
llvm-svn: 43099
2007-10-17 22:12:14 +00:00
Ted Kremenek 27d207d2e7 Minor cosmetic cleanups in the calculation of alignments for
StringMapEntry objects.  No functionality change.

llvm-svn: 43097
2007-10-17 22:09:45 +00:00
Ted Kremenek 02c3267039 Added template function alignof() which provides a clean
function-based interface to getting the alignment of a type.

llvm-svn: 43096
2007-10-17 22:08:55 +00:00
Gordon Henriksen 0ab3d27641 Reverting unnecessary commit of generated files.
llvm-svn: 43095
2007-10-17 21:36:08 +00:00
Gordon Henriksen ef5d08f4ea Switching TargetMachineRegistry to use the new generic Registry.
llvm-svn: 43094
2007-10-17 21:28:48 +00:00
Chris Lattner 9515625d0c Add rewriter support for @encode expressions. For example,
we currently turn:

    c = @encode(char *)[2] + 4;

into:

    c = "foo"[2] + 4;

Right now the foo string is hard coded, but you can imagine a world
where it wouldn't be :)

llvm-svn: 43093
2007-10-17 21:28:00 +00:00
Chris Lattner 42ebe5c1e6 The size returned by Rewriter::getRangeSize should include
the size of the last token.

llvm-svn: 43092
2007-10-17 21:23:07 +00:00
Chris Lattner fd64ebd3e4 Fix assertion for raw lexer.
llvm-svn: 43091
2007-10-17 21:22:38 +00:00
Chris Lattner 8e129c23c8 Move token length calculation out of the diagnostics machinery into
the lexer, where it can be shared.

llvm-svn: 43090
2007-10-17 21:18:47 +00:00
Ted Kremenek dbc8e043c2 Updated StringMap to use llvm::AlignOf to compute the alignment of map
entries.

llvm-svn: 43089
2007-10-17 21:13:50 +00:00
Gordon Henriksen 9c750f6fd1 Ignoring test/Transforms/LoopIndexSplit/Output.
llvm-svn: 43088
2007-10-17 21:11:33 +00:00
Ted Kremenek a26294201f Added member template functions to MallocAllocator and
BumpPtrAllocator that implement allocations that return a properly
typed pointer.  For BumpPtrAllocator, the allocated memory is
automatically aligned to the minimum alignment of the type (as
calculated by llvm::AlignOf::Alignment).

llvm-svn: 43087
2007-10-17 21:10:21 +00:00
Ted Kremenek 391b728a99 Added llvm::AlignOf, a template class whose purpose is to portably
compute the minimum memory alignment of arbitrary types.

llvm-svn: 43086
2007-10-17 20:56:47 +00:00
Chris Lattner 4050f071e1 wean the diagnostics machinery off the preprocessor.
llvm-svn: 43085
2007-10-17 20:53:57 +00:00
Chris Lattner 02b436a05a Add a new type of lexer: a raw lexer, which does not require a preprocessor
object in order to do its thing.

llvm-svn: 43084
2007-10-17 20:41:00 +00:00
Devang Patel b3dac3f5d9 Do not raise free() call that is called through invoke instruction.
llvm-svn: 43083
2007-10-17 20:12:58 +00:00
Steve Naroff a3f1336e39 rename test file for builtin "id"...
llvm-svn: 43082
2007-10-17 18:39:04 +00:00
Hartmut Kaiser 2f842e613f Fixed linker errors (unresolved externals: split<>(...)) when compiling with VC++. Please review.
llvm-svn: 43081
2007-10-17 18:37:09 +00:00
Ted Kremenek 5c84c01c8b Fixed includes of "clang/AST/DeclObjC.h" to work on case-sensitive
filesystems (was "#include "clang/AST/DeclObjc.h", which worked fine
on a case-insensitive HFS+ volume on the Mac).

llvm-svn: 43080
2007-10-17 18:36:42 +00:00
Chris Lattner caecf03215 add some comments.
llvm-svn: 43079
2007-10-17 18:28:59 +00:00
Dan Gohman d0806a0508 Don't mention -enable-unsafe-fp-math in LangRef.html, as that option is
assumed to globally mutate the spec.

llvm-svn: 43078
2007-10-17 18:05:13 +00:00
Steve Naroff 0f7a2d2dd1 Predefine all the ObjC goodies from <objc/objc.h>. Removed all the ObjC goodies from the respective test files. Moving forward, it will be very nice to assume these builtin!
llvm-svn: 43077
2007-10-17 17:53:50 +00:00
Dan Gohman 07159205dd Define a helper function ConstantVector::getSplatValue for testing for
and working with broadcasted constants.

llvm-svn: 43076
2007-10-17 17:51:30 +00:00
Fariborz Jahanian a32aaefadc Implementation of AST for @protocol expression.
llvm-svn: 43075
2007-10-17 16:58:11 +00:00
Hartmut Kaiser 7078da8e58 Updated VC++ build system.
Silenced some VC++ warnings.
Had to rephrase a partial specialization of the IntrospectionTrait struct in SerializationTest.cpp, please review.
Added a compiler specific workaround in IdentifierTable.h. Is that the way to fix this kind of issues?

llvm-svn: 43074
2007-10-17 15:00:17 +00:00
Hartmut Kaiser ec8a8d1f51 Updated VC++ build system.
Silenced some VC warnings.

I'm getting linker errors, though: unresolved externals:

llvm::Split<class llvm::BasicBlock *,struct llvm::GraphTraits<class llvm::BasicBlock *> >(class llvm::DominatorTreeBase<class llvm::BasicBlock> &,class llvm::BasicBlock *)

and

llvm::Split<struct llvm::Inverse<class llvm::BasicBlock *>,struct llvm::GraphTraits<struct llvm::Inverse<class llvm::BasicBlock *> > >(class llvm::DominatorTreeBase<class llvm::BasicBlock> &,class llvm::BasicBlock *)

Where are these defined?

llvm-svn: 43073
2007-10-17 14:56:40 +00:00
Dan Gohman 8f518b9875 Add support for ISD::SELECT in SplitVectorOp.
llvm-svn: 43072
2007-10-17 14:48:28 +00:00
Duncan Sands d42c812f4a Return Expand from getOperationAction for all extended
types.  This is needed for SIGN_EXTEND_INREG at least.
It is not clear if this is correct for other operations.
On the other hand, for the various load/store actions
it seems to correct to return the type action, as is
currently done.
Also, it seems that SelectionDAG::getValueType can be
called for extended value types; introduce a map for
holding these, since we don't really want to extend
the vector to be 2^32 pointers long!
Generalize DAGTypeLegalizer::PromoteResult_TRUNCATE
and DAGTypeLegalizer::PromoteResult_INT_EXTEND to handle
the various funky possibilities that apints introduce,
for example that you can promote to a type that needs
to be expanded.

llvm-svn: 43071
2007-10-17 13:49:58 +00:00
Devang Patel 91ff13edcc Apply "Instead of loading small c string constant, use integer constant directly" transformation while processing load instruction.
llvm-svn: 43070
2007-10-17 07:24:40 +00:00
Evan Cheng 0dde6e5761 Apply Chris' suggestions.
llvm-svn: 43069
2007-10-17 06:53:44 +00:00
Chris Lattner 12d5da49d3 Change fp to sint legalization on x86-32 to do 2 x i32
loads instead of 1 x i64 loads.  This doesn't change any functionality yet.

llvm-svn: 43068
2007-10-17 06:17:29 +00:00
Chris Lattner 253023b25f fix problems with test/sema/Cocoa.m etc on non-apple machines.
llvm-svn: 43067
2007-10-17 06:04:46 +00:00
Chris Lattner 693cbeadff fix some funny indentation, add comments.
llvm-svn: 43066
2007-10-17 06:02:13 +00:00
Evan Cheng c8b5397000 One more extract_subreg coalescing bug fix.
llvm-svn: 43065
2007-10-17 05:29:37 +00:00
Evan Cheng 5cfc2c640f Update comments.
llvm-svn: 43064
2007-10-17 02:16:40 +00:00
Evan Cheng 7587d1bd19 Yet another test case for extract_subreg coalescing crash.
llvm-svn: 43063
2007-10-17 02:15:06 +00:00
Evan Cheng 9b0a44a2ce Fix MergeValueInAsValue(). It allows overlapping live ranges but should replace
their value numbers with the specified value number.

llvm-svn: 43062
2007-10-17 02:13:29 +00:00
Evan Cheng a6fd8bc97e Clean up code that calculate MBB live-in's.
llvm-svn: 43061
2007-10-17 02:12:22 +00:00