Граф коммитов

1235 Коммитов

Автор SHA1 Сообщение Дата
Devang Patel e9b8c0a385 Fix 80 col violations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43516 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 20:59:40 +00:00
Chris Lattner fb1051be45 minor tweaks
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43515 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 20:57:56 +00:00
Devang Patel 0ffe89ab1e Use
+  llvm::DenseMap<Type *, llvm::PATypeHolder> TypeHolderMap;
instead of
-  llvm::DenseMap<Type *, llvm::PATypeHolder *> TypeHolderMap;



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43514 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 20:46:47 +00:00
Fariborz Jahanian ca4e19e3d7 Fixed tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43513 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 20:41:57 +00:00
Chris Lattner 2d99833e8c minor code cleanup
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43512 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 20:27:44 +00:00
Chris Lattner e6889f961f shrinkify storage class to a bitfield, add a fixme about merging it in the future.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43509 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 18:54:50 +00:00
Devang Patel 03f7c03ecf Remove commented out line.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43508 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 18:31:12 +00:00
Fariborz Jahanian bb60846268 Revisited my last patch to be able to do encoding of ivar types with 'id'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43507 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 18:27:03 +00:00
Chris Lattner f17765d202 update some comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43506 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 17:46:51 +00:00
Chris Lattner d65d8eea9f Avoid using macro expansions, which causes these to come out in -E mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43505 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 17:45:43 +00:00
Fariborz Jahanian c2939bc82c Added type encoding for 'id' type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43504 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 17:06:23 +00:00
Steve Naroff 752d6ef8c8 Rewrite protocols.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43503 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 16:42:30 +00:00
Ted Kremenek 347b9f33b3 Added vector to ASTContext to store references to "complete" VLA types
(VLAs with a specified size expresssion).  This vector owns the
references to these type objects.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43502 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 16:41:53 +00:00
Steve Naroff 423cb565ab - Add location info to category/protocol AST's
- Rewrite categories.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43501 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 13:30:57 +00:00
Steve Naroff 2feac5e559 Remove a couple FIXME's for rewriting ObjC interfaces (which are now being rewritten properly).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43494 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 03:43:13 +00:00
Steve Naroff f908a87299 More support for rewriting ObjC intefaces. Still some edge cases to handle...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43493 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 02:23:23 +00:00
Anders Carlsson c0a87b7db0 Handle function types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43485 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 00:06:20 +00:00
Fariborz Jahanian 7ed0507196 Assert if isObjcIdType is called before 'id' type is built.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43484 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-30 00:00:49 +00:00
Ted Kremenek 2bd24ba6d1 VariableArrayTypes (VLAs) without a size expression are now uniqued
and inserted into a FoldingSet owned by ASTContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43482 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 23:37:31 +00:00
Fariborz Jahanian 33e1d64ab5 Encoding for objectiive-c methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43481 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 22:57:28 +00:00
Hartmut Kaiser 10b945c9ee Updated VC++ build system
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43478 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 21:54:46 +00:00
Hartmut Kaiser 481038b5f3 Added a missing #include.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43477 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 21:54:12 +00:00
Steve Naroff 91fa0b7759 Remove a bunch of TODO's that have been done for quite some time...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43476 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 21:39:29 +00:00
Steve Naroff 60fcceeedb This commit contains lot's of small tweaks to how we pass around and store SourceLocation's for interfaces/protocols/categories/implementations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43475 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 21:38:07 +00:00
Ted Kremenek 771fe16a5e Added support for StmtIterators to iterate over the size expressions
of VariableArrayTypes that appear in TypedefDecls.

for example:

  typedef int T[x][x];

the StmtIterator will iterate over "x" and "x" as subexpressions of
the DeclStmt for T.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43474 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 21:38:03 +00:00
Ted Kremenek 103a1b45a9 Fixed deadcode bug where check for NULL decl occured within a block
where the decl would always be non-NULL.  Moved the check to after the
block to properly tidy up the iterator's state.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43473 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 21:23:58 +00:00
Devang Patel 86522b9e84 Add RecordOrganizer::layoutUnionFields()
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43472 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 20:50:19 +00:00
Ted Kremenek 92866e2e90 Modified StmtIterator to support iteration over the size expressions
of VariableTypeArray types that appear in DeclStmts.

Removed operator-- from StmtIterator.  operator-- added undesired
complexity, and we have no consumers of it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43471 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 20:50:16 +00:00
Ted Kremenek 7a9d9d71fa Modified CFG pretty-printing to directly use the (reverse) body
iterator of a CompountStmt instead of relying on StmtIterators.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43469 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 20:41:04 +00:00
Ted Kremenek 65f31e451c Renamed internal variables of StmtIteratorBase to make the code
slightly more succinct.

Introduced VariableArrayType* within StmtIteratorBase to (soon)
support iteration over the size expressions of variable length arrays.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43455 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 18:04:38 +00:00
Fariborz Jahanian 160eb6538e Do the encoding of ivar types in the ivar metadata.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43454 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 17:16:25 +00:00
Ted Kremenek 72cb1aedb5 Added some comments.
Moved a dependent predicate in an if statement to be an assertion
within the if statement body.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43453 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 17:13:39 +00:00
Ted Kremenek a8335a9c35 Added to test case for "self-comparison check" uses of relation operators: x < x and x > x
should emit warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43451 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 17:02:56 +00:00
Ted Kremenek 3ca0bf2a0a For non-floating point types, added check for expressions of the form
"x == x" and "x != x".  We emit a warning for these since they always evaluate
to a constant value and often indicate a logical error.

Added test case for this check.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43450 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 16:58:49 +00:00
Devang Patel 6cb812e186 Insetead of assert() just emit an error message for
an unimplemented work  and continue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43449 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 16:56:27 +00:00
Ted Kremenek e780f0db9b For floating point equality check, we now ignore parentheses. e.g.:
(x) == x  is the treated the same as x == x.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43448 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 16:45:23 +00:00
Ted Kremenek 6a26155102 For checking for floating point comparison using == or !=, we now suppress
errors for cases such as "x == x".

Added test case to test this feature.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43447 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 16:40:01 +00:00
Anders Carlsson e8c4953352 Address Chris's comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43445 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 06:33:42 +00:00
Anders Carlsson 17df57d6d3 Fix logic error.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43443 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 05:58:43 +00:00
Chris Lattner 84d35ce5c3 when checking for type equality, ignore typedefs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43441 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 05:15:40 +00:00
Chris Lattner b96728d90a 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43440 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 05:08:52 +00:00
Anders Carlsson 85f9bceab1 Add (partial) support for @encode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43439 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 05:01:08 +00:00
Chris Lattner cd4b83cb4b 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43437 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 04:42:53 +00:00
Chris Lattner 3da2db468d casting to void is ok for structs (C99 6.5.4p2), this fixes
one bogus error on PR1750.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43436 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 04:26:44 +00:00
Chris Lattner 52735a0339 Add prototype info for __builtin_memcpy, reducing #diagnostics from 37 to 34 on
PR1750


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43435 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 04:18:06 +00:00
Chris Lattner 69efba74cf 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.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43434 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 04:06:22 +00:00
Chris Lattner fe79595619 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43433 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 04:04:16 +00:00
Chris Lattner dea6146dee 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43432 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 03:41:11 +00:00
Anders Carlsson 89799cf254 Generate code for __builtin_classify_type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43429 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 02:59:40 +00:00
Anders Carlsson c67ad5f299 Add BuiltinType::Char_S to Type::isCharType
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43428 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-29 02:52:18 +00:00