Commit Graph

37543 Commits

Author SHA1 Message Date
Anders Carlsson 18acd44514 Address Chris's comments.
llvm-svn: 43445
2007-10-29 06:33:42 +00:00
Chris Lattner 909a54ccd4 add a note.
llvm-svn: 43444
2007-10-29 06:19:48 +00:00
Anders Carlsson 0f1cacd049 Fix logic error.
llvm-svn: 43443
2007-10-29 05:58:43 +00:00
Chris Lattner c541c3ee15 Model stacksave and stackrestore as both writing memory, since we
don't model their dependences on allocas correctly.  This fixes
PR1745.

llvm-svn: 43442
2007-10-29 05:47:52 +00:00
Chris Lattner b104d31bd9 when checking for type equality, ignore typedefs.
llvm-svn: 43441
2007-10-29 05:15:40 +00:00
Chris Lattner 5c5808a9a3 improve error recovery handling broken 'then' or 'else' stmts in
if statements.  This implements Sema/if-empty-body.c:f3, silencing
a bogus secondary warning.  It also improve the location info for
the nullstmts created for recovery purposes.

llvm-svn: 43440
2007-10-29 05:08:52 +00:00
Anders Carlsson d849982e84 Add (partial) support for @encode.
llvm-svn: 43439
2007-10-29 05:01:08 +00:00
Owen Anderson 3692dbe492 Add a first attempt at dominator information for MBB's. Use with caution: this has been tested to compile. It has not yet been confirmed to generate correct analysis.
llvm-svn: 43438
2007-10-29 04:50:50 +00:00
Chris Lattner 70ae491e42 The callers of ParseStructDeclaration are not expecting it to
eat the terminating ;.  Fix one place where it did, allowing this
to compile without error:

struct x {
 int a;
 union {
  int b;
  float c;
 };

 int d;
};

This reduces diagnostics on PR1750 from 33 to 27.

llvm-svn: 43437
2007-10-29 04:42:53 +00:00
Chris Lattner 3bc4d20862 casting to void is ok for structs (C99 6.5.4p2), this fixes
one bogus error on PR1750.

llvm-svn: 43436
2007-10-29 04:26:44 +00:00
Chris Lattner cc779571b8 Add prototype info for __builtin_memcpy, reducing #diagnostics from 37 to 34 on
PR1750

llvm-svn: 43435
2007-10-29 04:18:06 +00:00
Chris Lattner 645ff3ff61 Fix a parser bug on labeled inline asm stmts, allowing us
to parse stuff like:

asm volatile("1:  rex64/fxrstor (%[fx])\n\t"
       "2:\n"
       ".section .fixup,\"ax\"\n"
       "3:  movl $-1,%[err]\n"
       "    jmp  2b\n"
       ".previous\n"
       ".section __ex_table,\"a\"\n"
       "   .align 8\n"
       "   .quad  1b,3b\n"
       ".previous"
       : [err] "=r" (err)
       : [fx] "cdaSDb" (fx), "m" (*fx), "0" (0));

This reduces # diagnostics on PR1750 from 49 to 37.

llvm-svn: 43434
2007-10-29 04:06:22 +00:00
Chris Lattner 73c56c0735 Implement *skeletal* support for representing GNU inline asm stmts in the AST,
resolving a crash on a .i file in PR1750.  We now generate 49 errors on the
.i file in that bug.

llvm-svn: 43433
2007-10-29 04:04:16 +00:00
Chris Lattner 1159f065be Fix a major bug in the Type::getAs*Type methods: they didn't strip off
typeof(type) and typeof(expr) correctly.  Now provide a single point of
contact (Type::getDesugaredType) for doing the shallow stripping we need.

llvm-svn: 43432
2007-10-29 03:41:11 +00:00
Chris Lattner b6fc40e60f I am not sure this is a good idea to be an option, but rename the option for
now.  It conflicts with clang's -pedantic flag.

llvm-svn: 43431
2007-10-29 03:14:55 +00:00
Chris Lattner 5e99fd8c0d Add support for the x86-64 'q' regigster modifier, and add support for the
b/h/w/k/q inline asm memory modifiers, which are just ignored.  This fixes
PR1748 and CodeGen/X86/2007-10-28-inlineasm-q-modifier.ll

llvm-svn: 43430
2007-10-29 03:09:07 +00:00
Anders Carlsson ceced4ca73 Generate code for __builtin_classify_type.
llvm-svn: 43429
2007-10-29 02:59:40 +00:00
Anders Carlsson 7080597adf Add BuiltinType::Char_S to Type::isCharType
llvm-svn: 43428
2007-10-29 02:52:18 +00:00
Chris Lattner 9a641510bd Fix PR1749 and InstCombine/2007-10-28-EmptyField.ll by handling
zero-length fields better.

llvm-svn: 43427
2007-10-29 02:40:02 +00:00
Chris Lattner 4a15e04aee Fix PR1752 and LoopSimplify/2007-10-28-InvokeCrash.ll: terminators
can have uses too.  Wouldn't it be nice if invoke didn't exist? :)

llvm-svn: 43426
2007-10-29 02:30:37 +00:00
Ted Kremenek 8be9bc64ce Fixed assertion in Deserializer::~Deserializer that checks for
pointers that were not backpatched (previously checked the wrong invariant).

llvm-svn: 43425
2007-10-28 23:38:38 +00:00
Anton Korobeynikov 9dced3f9ae Add 'pedantic' mode to verifier rejecting syntactically valid, but 'bad' due to other reasons code
llvm-svn: 43424
2007-10-28 22:50:32 +00:00
Ted Kremenek b6fafb6bf0 Implemented serialization for TypedefType.
llvm-svn: 43423
2007-10-28 21:21:04 +00:00
Ted Kremenek 387204749b Updated backpatching logic during object deserialization to perform
eager backpatching instead of waithing until all objects have been
deserialized.  This allows us to reduce the memory footprint needed
for backpatching.

llvm-svn: 43422
2007-10-28 21:17:59 +00:00
Duncan Sands 1826deda68 The guaranteed alignment of ptr+offset is only the minimum of
of offset and the alignment of ptr if these are both powers of
2.  While the ptr alignment is guaranteed to be a power of 2,
there is no reason to think that offset is.  For example, if
offset is 12 (the size of a long double on x86-32 linux) and
the alignment of ptr is 8, then the alignment of ptr+offset
will in general be 4, not 8.  Introduce a function MinAlign,
lifted from gcc, for computing the minimum guaranteed alignment.
I've tried to fix up everywhere under lib/CodeGen/SelectionDAG/.
I also changed some places that weren't wrong (because both values
were a power of 2), as a defensive change against people copying
and pasting the code.
Hopefully someone who cares about alignment will review the rest
of LLVM and fix up the remaining places.  Since I'm on x86 I'm
not very motivated to do this myself...

llvm-svn: 43421
2007-10-28 12:59:45 +00:00
Evan Cheng c826ac533b New entry.
llvm-svn: 43420
2007-10-28 04:01:09 +00:00
Ted Kremenek 3fd831fd14 Implemented serialization of FunctionTypeProto.
llvm-svn: 43419
2007-10-28 00:59:26 +00:00
Ted Kremenek d33b4adaed Implemented serialization of FunctionTypeNoProto.
llvm-svn: 43418
2007-10-27 19:58:08 +00:00
Ted Kremenek 3e6c227f97 Implemented serialization for VectorType.
llvm-svn: 43417
2007-10-27 19:05:09 +00:00
Ted Kremenek 8e8bf5d0bf More work on type serialization: added support for serializing BuiltinTypes.
llvm-svn: 43414
2007-10-26 23:52:52 +00:00
Ted Kremenek 9dd1e702fa Fixed bug where default SerializeTrait<>::Materialize would not return the materialized object pointer.
llvm-svn: 43413
2007-10-26 23:44:59 +00:00
Bill Wendling 2305de81a4 Test to make sure that if we have an unaligned memcpy, it will still compile.
llvm-svn: 43412
2007-10-26 23:43:35 +00:00
Fariborz Jahanian 801b63525d Path to synthesize 'instance' size field of _objc_class metadata.
llvm-svn: 43409
2007-10-26 23:09:28 +00:00
Evan Cheng 9dbe99dcd6 A number of LSR fixes:
- ChangeCompareStride only reuse stride that is larger than current stride. It
  will let the general reuse mechanism to try to reuse a smaller stride.
- Watch out for multiplication overflow in ChangeCompareStride.
- Replace std::set with SmallPtrSet.

llvm-svn: 43408
2007-10-26 23:08:19 +00:00
Ted Kremenek 6698b43389 Completed serialization of ConstantArrayTypes (now that APInt serialization is in place).
llvm-svn: 43407
2007-10-26 22:00:08 +00:00
Ted Kremenek 5e7133b090 Added SerializeAPInt.cpp and DeserializeAPInt.cpp to the XCode project.
llvm-svn: 43406
2007-10-26 21:53:37 +00:00
Ted Kremenek 2d95094bea Added serialization support for APInt.
llvm-svn: 43405
2007-10-26 21:50:10 +00:00
Steve Naroff 161a92b976 Start rewriting ObjC interfaces. As a start, we comment out all the methods. This involved refining how the parser/AST passes/manages SourceLocations for ObjcMethodDecl's.
llvm-svn: 43404
2007-10-26 20:53:56 +00:00
Fariborz Jahanian 3339d0d14e This patch allows synthesis generation of ivar offset for legacy objective-c @implementation
decl without an @interface decl.

llvm-svn: 43403
2007-10-26 20:50:24 +00:00
Ted Kremenek 18c1393ddb Fixed incorrect "path name" in preamble (comment) of header file.
llvm-svn: 43402
2007-10-26 20:44:02 +00:00
Ted Kremenek f8555a23ec Fixed incorrect "path name" in preamble (comment) of header file.
llvm-svn: 43401
2007-10-26 20:42:45 +00:00
Bill Wendling b0bfd69684 On second thought. Remove this as it should never be generated in the first
place.

llvm-svn: 43400
2007-10-26 20:34:37 +00:00
Bill Wendling 6d15b32c15 - Remove the hacky code that forces a memcpy. Alignment is taken care of in the
FE.
- Explicitly pass in the alignment of the load & store.
- XFAIL 2007-10-23-UnalignedMemcpy.ll because llc has a bug that crashes on
  unaligned pointers.

llvm-svn: 43398
2007-10-26 20:24:42 +00:00
Ted Kremenek 16c7d8ce5b Added skeleton implementation of serialization for types (not complete).
llvm-svn: 43397
2007-10-26 20:24:35 +00:00
Ted Kremenek fc88b1ddb8 Added default implementation of SerializeTrait<> that dispatches to
calling member functions of the target type to perform type-specific
serialization.
                         
Added version of ReadPtr that allows passing references to uintptr_t
(useful for smart pointers).

llvm-svn: 43396
2007-10-26 20:23:27 +00:00
Fariborz Jahanian 99e96b0f11 Patch to synthesize computation of Ivar offset in rewritten c file.
Thanks to Steve N. to point out using of offsetof for this.

llvm-svn: 43391
2007-10-26 19:46:17 +00:00
Devang Patel ed93c3c3b3 Codegen union member references.
llvm-svn: 43390
2007-10-26 19:42:18 +00:00
Devang Patel 7718d7a2eb Handle non LValue base expressions.
llvm-svn: 43387
2007-10-26 18:15:21 +00:00
Devang Patel ffdb07c939 Code gen static initializer.
llvm-svn: 43386
2007-10-26 17:50:58 +00:00
Devang Patel 8717417b3b Codegen array initializers.
llvm-svn: 43385
2007-10-26 17:44:44 +00:00