Commit Graph

58693 Commits

Author SHA1 Message Date
Chris Lattner 9c28af0cc5 rename GetStmt -> GetDeclStmt to make it clear that the stmt read
is part of a decl.

llvm-svn: 70189
2009-04-27 05:46:25 +00:00
Chris Lattner f4262539fa change the interface to ReadStmt to force clients to pass a cursor in to read from.
llvm-svn: 70188
2009-04-27 05:41:06 +00:00
Chris Lattner 487412d4db split decl reading out to its own PCHReaderDecl.cpp file.
llvm-svn: 70187
2009-04-27 05:27:42 +00:00
Chris Lattner 92ba5ffdfe split stmt/expr deserialization out to PCHReaderStmt.cpp
llvm-svn: 70186
2009-04-27 05:14:47 +00:00
Nick Lewycky f44a5bf158 Under unusual circumstances (jitting a function that causes the creation of
another stub, but then never calling the jitted function) can cause the JIT to
leave a stub in place. Judging by the comments this is a known deficiency, so
we're just not going to use AssertingVH for the StubToFunctionTy map.

Also shorten some lines longer than 80 columns.

This fixes the "make check" failure with ocaml on x86-64 linux.

llvm-svn: 70185
2009-04-27 05:09:44 +00:00
Sanjiv Gupta 1f8555a07f Now that any size of integer indices are allowed for sequential types, remove the unneccessary gyan about promoting them.
llvm-svn: 70181
2009-04-27 03:21:00 +00:00
Dan Gohman 58440cf305 Make this test slightly more strict.
llvm-svn: 70180
2009-04-27 03:05:26 +00:00
Dan Gohman be36f5ccda When transforming sext(trunc(load(x))) into sext(smaller load(x)),
the trunc is directly replaced with the smaller load, so don't
try to create a new sext node. This fixes PR4050.

llvm-svn: 70179
2009-04-27 02:00:55 +00:00
Chris Lattner 669e32f8c0 rdar://6827200 - [sema] reject statically allocated arrays of interface types
Upgrade "array of interface" warning to an error.  In addition to being a
terrible idea, this crashes codegen.

llvm-svn: 70178
2009-04-27 01:55:56 +00:00
Chris Lattner 9a84589671 Change our silencing of C typedef redefinition handling to what we had
before r69391: typedef redefinition is an error by default, but if
*either* the old or new definition are from a system header, we silence
it.

llvm-svn: 70177
2009-04-27 01:46:12 +00:00
Dan Gohman 05c1d372b7 Handle ands with ~0 correctly too. This fixes PR4052.
llvm-svn: 70176
2009-04-27 01:41:10 +00:00
Dan Gohman 6019e07b3b Improve bugpoint's error messages when it runs out of memory,
or when some other std::exception is thrown.

llvm-svn: 70175
2009-04-27 01:30:37 +00:00
Chris Lattner 6ab8142cb2 remove dead var
llvm-svn: 70174
2009-04-27 01:08:03 +00:00
Chris Lattner e78a6bec89 Set up DeclsCursor.
llvm-svn: 70173
2009-04-27 01:05:14 +00:00
Chris Lattner ccac3a611a add stmt/expr names to BlockInfo block.
llvm-svn: 70172
2009-04-27 00:49:53 +00:00
Chris Lattner 94b38c0ff2 fix a comment by starting stmts/exprs after types and decls.
llvm-svn: 70171
2009-04-27 00:44:11 +00:00
Chris Lattner 35cfb0544a make -Wtypedef-redefinition an extwarn instead of defaulting
to error, doing this breaks too many programs (e.g. Adium).

llvm-svn: 70170
2009-04-27 00:41:01 +00:00
Chris Lattner 6403198468 drop the _ID suffixes from block names.
llvm-svn: 70169
2009-04-27 00:40:25 +00:00
Douglas Gregor 060eaf6520 Turn PCH off by default, yet again. I'm happier about it this time, though
llvm-svn: 70168
2009-04-26 23:15:05 +00:00
Chris Lattner db397b6a32 add the decl names.
llvm-svn: 70167
2009-04-26 22:32:16 +00:00
Chris Lattner 28fa4e6055 make llvm-bcanalyzer dump out PCH files symbolically. We should probably
eventually get an option to turn this off, but it is nice for looking at 
statistics.  For example, the types block now prints:

  Block ID #11 (TYPES_BLOCK_ID):
      Num Instances: 1
         Total Size: 895100b/111888B/27971.9W
          % of file: 1.55801
      Num SubBlocks: 0
        Num Abbrevs: 0
        Num Records: 14899
      % Abbrev Recs: 0

        Code Histogram:
                5478    TYPE_FUNCTION_PROTO
                2683    TYPE_TYPEDEF
                2460    TYPE_POINTER
                2047    TYPE_ENUM
                1553    TYPE_RECORD
                283     TYPE_CONSTANT_ARRAY
                274     TYPE_OBJC_INTERFACE
                76      TYPE_INCOMPLETE_ARRAY
                10      TYPE_VECTOR
                9       TYPE_OBJC_QUALIFIED_ID
                5       TYPE_FUNCTION_NO_PROTO
                5       TYPE_EXT_QUAL
                3       TYPE_TYPEOF_EXPR

llvm-svn: 70166
2009-04-26 22:26:21 +00:00
Chris Lattner a6fdf5a8c9 Add two new record types to the blockinfo block:
BLOCKNAME and SETRECORDNAME.  This allows a bitcode
file to be self describing with pretty names for 
records and blocks in addition to numbers.  This
enhances llvm-bcanalyzer to use this to print prettily.

llvm-svn: 70165
2009-04-26 22:21:57 +00:00
Douglas Gregor 56930a4b81 Trying turning on PCH by default yet again. We might actually a chance at success now
llvm-svn: 70164
2009-04-26 22:21:26 +00:00
Douglas Gregor 70091b8f43 Some fixes for PCH (de-)serialization of Objective-C AST nodes:
- Deal with the Receiver/ClassInfo shared storage in ObjCMessageExpr
  - Implement PCH support for ImplicitParamDecl
  - Fix the handling of the body of an ObjCMethodDecl
  - Several cast -> cast_or_null fixes
  - Make Selector::getIdentifierInfoForSlot work for 1-argument, NULL
  selectors.
  - Make Selector::getAsString() work with NULL selectors.
  - Fix the names of VisitObjCAtCatchStmt and VisitObjCAtFinallyStmt
  in the PCH reader and writer; these were never getting called.

At this point, all of the pch-test tests pass for C and Objective-C.

llvm-svn: 70163
2009-04-26 22:20:50 +00:00
Eli Friedman 4e2ab55502 Add a bit more handling for declarations like "int a[*]".
llvm-svn: 70162
2009-04-26 21:57:51 +00:00
Sebastian Redl d98ecd615f The mysterious bug turns out to be an incredibly bone-headed mistake.
llvm-svn: 70160
2009-04-26 21:08:36 +00:00
Chris Lattner 0d0d3e56dd make BitstreamCursor's copyable and assignable.
llvm-svn: 70159
2009-04-26 21:07:02 +00:00
Chris Lattner 9356acecff Adjust to LLVM API changes that went into r70157.
llvm-svn: 70158
2009-04-26 20:59:20 +00:00
Chris Lattner 277800a643 Make a major API change to BitstreamReader: split all the reading
state out of the BitstreamReader class into a BitstreamCursor class.
Doing this allows the client to have multiple cursors into the same
file, each with potentially different live block stacks and
abbreviation records.

llvm-svn: 70157
2009-04-26 20:59:02 +00:00
Eli Friedman 64fc3c68e5 Fix for PR4079: make sure to construct the member expressions for
offsetof correctly in the presence of anonymous structs/unions.

This could definitely use some cleanup, but I don't really want to mess 
with the anonymous union/struct code.

llvm-svn: 70156
2009-04-26 20:50:44 +00:00
Sebastian Redl a7b98a772c Implement function-try-blocks. However, there's a very subtle bug that I can't track down.
llvm-svn: 70155
2009-04-26 20:35:05 +00:00
Bill Wendling 5bf1a6e986 I cast, therefore I think I know what I'm doing.
llvm-svn: 70151
2009-04-26 20:12:38 +00:00
Bill Wendling febab5d928 Use uint64_t instead of unsigned.
llvm-svn: 70148
2009-04-26 19:46:41 +00:00
Chris Lattner 0ba740892e revert an incorrect patch. This causes crashes all over the place on a
64-bit build.

llvm-svn: 70147
2009-04-26 19:44:20 +00:00
Eli Friedman 1c4a175aef Remove getIntegerConstantExprValue in favor of using EvaluateAsInt.
llvm-svn: 70145
2009-04-26 19:19:15 +00:00
Eli Friedman 5cdb8cc267 Minor code cleanup.
llvm-svn: 70144
2009-04-26 19:04:51 +00:00
Steve Naroff eda6d20792 Add PCH read/write support for ObjC statements.
llvm-svn: 70143
2009-04-26 18:52:16 +00:00
Chris Lattner 574428e4db implement PR4077: [Linux kernel] inscrutable error on inline asm input/output constraint mismatch
Before we emitted:

$ clang t.c -S -m64 
llvm: error: Unsupported asm: input constraint with a matching output constraint of incompatible type!

Now we produce:
$ clang t.c -S -m64 
t.c:5:40: error: unsupported inline asm: input with type 'unsigned long' matching output with type 'int'
  asm volatile("foo " : "=a" (a) :"0" (b));
                             ~~~      ~^~

llvm-svn: 70142
2009-04-26 18:22:24 +00:00
Bill Wendling 995f81c5ce Suppress warnings about conversion shortening 64-bit to 32-bit.
llvm-svn: 70138
2009-04-26 18:10:20 +00:00
Chris Lattner 4c92b51089 in a tied operand, don't copy over the name or constraint string, just the flags.
llvm-svn: 70137
2009-04-26 18:05:25 +00:00
Chris Lattner c16d476b30 pull operands names "[foo]" into ConstraintInfo.
llvm-svn: 70136
2009-04-26 17:57:12 +00:00
Chris Lattner c3f4c7b1c5 pull the constraint string into the ConstraintInfo struct
instead of passing it around in addition to it.

llvm-svn: 70135
2009-04-26 17:19:08 +00:00
Sanjiv Gupta 8d319047c5 Any size of integral indices are allowed in gep for indexing into sequential types. Also adding a test case to check the indices type allowed into struct.
llvm-svn: 70134
2009-04-26 17:14:35 +00:00
Steve Naroff 8d2b49aae3 Make sure we have a code in the node:-)
This fixes all the -emit-pch problems discovered by utils/pch-test.pl.

llvm-svn: 70125
2009-04-26 14:11:39 +00:00
Sebastian Redl 07d6f79f1b Update StmtNodes.def with the new base class of CXXTemporaryObjectExpr
llvm-svn: 70122
2009-04-26 11:30:47 +00:00
Sebastian Redl f79d397081 Make reference class unification in conditional expressions check for validity of the conversion.
llvm-svn: 70121
2009-04-26 11:21:02 +00:00
Torok Edwin c26ed54e06 Add missing include. This fixes the build with gcc 4.3.3.
llvm-svn: 70115
2009-04-26 07:50:14 +00:00
Chris Lattner d9725f7041 change TargetInfo::ConstraintInfo to be a struct that contains
the enum along with some other data.

llvm-svn: 70114
2009-04-26 07:16:29 +00:00
Douglas Gregor 8bdbf3628f Turn off PCH by default, again
llvm-svn: 70113
2009-04-26 05:09:50 +00:00
Douglas Gregor 5b21e96c56 One more crazy try with PCH-by-default
llvm-svn: 70112
2009-04-26 03:59:49 +00:00