]> granicus.if.org Git - clang/log
clang
17 years agoRemove a couple FIXME's for rewriting ObjC interfaces (which are now being rewritten...
Steve Naroff [Tue, 30 Oct 2007 03:43:13 +0000 (03:43 +0000)]
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

17 years agoMore support for rewriting ObjC intefaces. Still some edge cases to handle...
Steve Naroff [Tue, 30 Oct 2007 02:23:23 +0000 (02:23 +0000)]
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

17 years agoHandle function types.
Anders Carlsson [Tue, 30 Oct 2007 00:06:20 +0000 (00:06 +0000)]
Handle function types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43485 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAssert if isObjcIdType is called before 'id' type is built.
Fariborz Jahanian [Tue, 30 Oct 2007 00:00:49 +0000 (00:00 +0000)]
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

17 years agoVariableArrayTypes (VLAs) without a size expression are now uniqued
Ted Kremenek [Mon, 29 Oct 2007 23:37:31 +0000 (23:37 +0000)]
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

17 years agoEncoding for objectiive-c methods.
Fariborz Jahanian [Mon, 29 Oct 2007 22:57:28 +0000 (22:57 +0000)]
Encoding for objectiive-c methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43481 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoUpdated VC++ build system
Hartmut Kaiser [Mon, 29 Oct 2007 21:54:46 +0000 (21:54 +0000)]
Updated VC++ build system

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43478 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdded a missing #include.
Hartmut Kaiser [Mon, 29 Oct 2007 21:54:12 +0000 (21:54 +0000)]
Added a missing #include.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43477 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoRemove a bunch of TODO's that have been done for quite some time...
Steve Naroff [Mon, 29 Oct 2007 21:39:29 +0000 (21:39 +0000)]
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

17 years agoThis commit contains lot's of small tweaks to how we pass around and store SourceLoca...
Steve Naroff [Mon, 29 Oct 2007 21:38:07 +0000 (21:38 +0000)]
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

17 years agoAdded support for StmtIterators to iterate over the size expressions
Ted Kremenek [Mon, 29 Oct 2007 21:38:03 +0000 (21:38 +0000)]
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

17 years agoFixed deadcode bug where check for NULL decl occured within a block
Ted Kremenek [Mon, 29 Oct 2007 21:23:58 +0000 (21:23 +0000)]
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

17 years agoAdd RecordOrganizer::layoutUnionFields()
Devang Patel [Mon, 29 Oct 2007 20:50:19 +0000 (20:50 +0000)]
Add RecordOrganizer::layoutUnionFields()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43472 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoModified StmtIterator to support iteration over the size expressions
Ted Kremenek [Mon, 29 Oct 2007 20:50:16 +0000 (20:50 +0000)]
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

17 years agoModified CFG pretty-printing to directly use the (reverse) body
Ted Kremenek [Mon, 29 Oct 2007 20:41:04 +0000 (20:41 +0000)]
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

17 years agoRenamed internal variables of StmtIteratorBase to make the code
Ted Kremenek [Mon, 29 Oct 2007 18:04:38 +0000 (18:04 +0000)]
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

17 years agoDo the encoding of ivar types in the ivar metadata.
Fariborz Jahanian [Mon, 29 Oct 2007 17:16:25 +0000 (17:16 +0000)]
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

17 years agoAdded some comments.
Ted Kremenek [Mon, 29 Oct 2007 17:13:39 +0000 (17:13 +0000)]
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

17 years agoAdded to test case for "self-comparison check" uses of relation operators: x < x...
Ted Kremenek [Mon, 29 Oct 2007 17:02:56 +0000 (17:02 +0000)]
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

17 years agoFor non-floating point types, added check for expressions of the form
Ted Kremenek [Mon, 29 Oct 2007 16:58:49 +0000 (16:58 +0000)]
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

17 years agoInsetead of assert() just emit an error message for
Devang Patel [Mon, 29 Oct 2007 16:56:27 +0000 (16:56 +0000)]
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

17 years agoFor floating point equality check, we now ignore parentheses. e.g.:
Ted Kremenek [Mon, 29 Oct 2007 16:45:23 +0000 (16:45 +0000)]
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

17 years agoFor checking for floating point comparison using == or !=, we now suppress
Ted Kremenek [Mon, 29 Oct 2007 16:40:01 +0000 (16:40 +0000)]
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

17 years agoAddress Chris's comments.
Anders Carlsson [Mon, 29 Oct 2007 06:33:42 +0000 (06:33 +0000)]
Address Chris's comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43445 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix logic error.
Anders Carlsson [Mon, 29 Oct 2007 05:58:43 +0000 (05:58 +0000)]
Fix logic error.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43443 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agowhen checking for type equality, ignore typedefs.
Chris Lattner [Mon, 29 Oct 2007 05:15:40 +0000 (05:15 +0000)]
when checking for type equality, ignore typedefs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43441 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoimprove error recovery handling broken 'then' or 'else' stmts in
Chris Lattner [Mon, 29 Oct 2007 05:08:52 +0000 (05:08 +0000)]
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

17 years agoAdd (partial) support for @encode.
Anders Carlsson [Mon, 29 Oct 2007 05:01:08 +0000 (05:01 +0000)]
Add (partial) support for @encode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43439 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoThe callers of ParseStructDeclaration are not expecting it to
Chris Lattner [Mon, 29 Oct 2007 04:42:53 +0000 (04:42 +0000)]
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

17 years agocasting to void is ok for structs (C99 6.5.4p2), this fixes
Chris Lattner [Mon, 29 Oct 2007 04:26:44 +0000 (04:26 +0000)]
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

17 years agoAdd prototype info for __builtin_memcpy, reducing #diagnostics from 37 to 34 on
Chris Lattner [Mon, 29 Oct 2007 04:18:06 +0000 (04:18 +0000)]
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

17 years agoFix a parser bug on labeled inline asm stmts, allowing us
Chris Lattner [Mon, 29 Oct 2007 04:06:22 +0000 (04:06 +0000)]
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

17 years agoImplement *skeletal* support for representing GNU inline asm stmts in the AST,
Chris Lattner [Mon, 29 Oct 2007 04:04:16 +0000 (04:04 +0000)]
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

17 years agoFix a major bug in the Type::getAs*Type methods: they didn't strip off
Chris Lattner [Mon, 29 Oct 2007 03:41:11 +0000 (03:41 +0000)]
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

17 years agoGenerate code for __builtin_classify_type.
Anders Carlsson [Mon, 29 Oct 2007 02:59:40 +0000 (02:59 +0000)]
Generate code for __builtin_classify_type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43429 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd BuiltinType::Char_S to Type::isCharType
Anders Carlsson [Mon, 29 Oct 2007 02:52:18 +0000 (02:52 +0000)]
Add BuiltinType::Char_S to Type::isCharType

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43428 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoImplemented serialization for TypedefType.
Ted Kremenek [Sun, 28 Oct 2007 21:21:04 +0000 (21:21 +0000)]
Implemented serialization for TypedefType.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43423 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoImplemented serialization of FunctionTypeProto.
Ted Kremenek [Sun, 28 Oct 2007 00:59:26 +0000 (00:59 +0000)]
Implemented serialization of FunctionTypeProto.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43419 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoImplemented serialization of FunctionTypeNoProto.
Ted Kremenek [Sat, 27 Oct 2007 19:58:08 +0000 (19:58 +0000)]
Implemented serialization of FunctionTypeNoProto.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43418 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoImplemented serialization for VectorType.
Ted Kremenek [Sat, 27 Oct 2007 19:05:09 +0000 (19:05 +0000)]
Implemented serialization for VectorType.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43417 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoMore work on type serialization: added support for serializing BuiltinTypes.
Ted Kremenek [Fri, 26 Oct 2007 23:52:52 +0000 (23:52 +0000)]
More work on type serialization: added support for serializing BuiltinTypes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43414 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoPath to synthesize 'instance' size field of _objc_class metadata.
Fariborz Jahanian [Fri, 26 Oct 2007 23:09:28 +0000 (23:09 +0000)]
Path to synthesize 'instance' size field of _objc_class metadata.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43409 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoCompleted serialization of ConstantArrayTypes (now that APInt serialization is in...
Ted Kremenek [Fri, 26 Oct 2007 22:00:08 +0000 (22:00 +0000)]
Completed serialization of ConstantArrayTypes (now that APInt serialization is in place).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43407 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoStart rewriting ObjC interfaces. As a start, we comment out all the methods. This...
Steve Naroff [Fri, 26 Oct 2007 20:53:56 +0000 (20:53 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43404 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoThis patch allows synthesis generation of ivar offset for legacy objective-c @impleme...
Fariborz Jahanian [Fri, 26 Oct 2007 20:50:24 +0000 (20:50 +0000)]
This patch allows synthesis generation of ivar offset for legacy objective-c @implementation
decl without an @interface decl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43403 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdded skeleton implementation of serialization for types (not complete).
Ted Kremenek [Fri, 26 Oct 2007 20:24:35 +0000 (20:24 +0000)]
Added skeleton implementation of serialization for types (not complete).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43397 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoPatch to synthesize computation of Ivar offset in rewritten c file.
Fariborz Jahanian [Fri, 26 Oct 2007 19:46:17 +0000 (19:46 +0000)]
Patch to synthesize computation of Ivar offset in rewritten c file.
Thanks to Steve N. to point out using of offsetof for this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43391 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoCodegen union member references.
Devang Patel [Fri, 26 Oct 2007 19:42:18 +0000 (19:42 +0000)]
Codegen union member references.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43390 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoHandle non LValue base expressions.
Devang Patel [Fri, 26 Oct 2007 18:15:21 +0000 (18:15 +0000)]
Handle non LValue base expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43387 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoCode gen static initializer.
Devang Patel [Fri, 26 Oct 2007 17:50:58 +0000 (17:50 +0000)]
Code gen static initializer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43386 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoCodegen array initializers.
Devang Patel [Fri, 26 Oct 2007 17:44:44 +0000 (17:44 +0000)]
Codegen array initializers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43385 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoCodegen global array initializers.
Devang Patel [Fri, 26 Oct 2007 16:31:40 +0000 (16:31 +0000)]
Codegen global array initializers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43383 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoPretty printing for ivar list of an interface block.
Fariborz Jahanian [Fri, 26 Oct 2007 16:29:12 +0000 (16:29 +0000)]
Pretty printing for ivar list of an interface block.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43382 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoDisambiguated variable name to comply with VC++'s archaic variable scoping rules.
Hartmut Kaiser [Thu, 25 Oct 2007 22:59:17 +0000 (22:59 +0000)]
Disambiguated variable name to comply with VC++'s archaic variable scoping rules.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43371 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoUpdated VC++ build system
Hartmut Kaiser [Thu, 25 Oct 2007 22:58:31 +0000 (22:58 +0000)]
Updated VC++ build system

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43370 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoModified StmtIterator to now include visiting the initialization expression for EnumC...
Ted Kremenek [Thu, 25 Oct 2007 22:24:19 +0000 (22:24 +0000)]
Modified StmtIterator to now include visiting the initialization expression for EnumConstantDecls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43366 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix "strbuf += stufflen;" crash.
Devang Patel [Thu, 25 Oct 2007 22:19:13 +0000 (22:19 +0000)]
Fix  "strbuf += stufflen;" crash.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43365 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoDocument ConvertNewType() method and make it a private method.
Devang Patel [Thu, 25 Oct 2007 21:40:12 +0000 (21:40 +0000)]
Document ConvertNewType() method and make it a private method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43363 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdded DeclSerialization.cpp to XCode project.
Ted Kremenek [Thu, 25 Oct 2007 21:39:10 +0000 (21:39 +0000)]
Added DeclSerialization.cpp to XCode project.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43362 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdded skeleton for Decl serialization.
Ted Kremenek [Thu, 25 Oct 2007 21:37:16 +0000 (21:37 +0000)]
Added skeleton for Decl serialization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43361 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoRefactored several meta data for reusability.
Fariborz Jahanian [Thu, 25 Oct 2007 20:55:25 +0000 (20:55 +0000)]
Refactored several meta data for reusability.
Changed the entire rewrite of metadata to write to std::string
object instead of stdout.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43360 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoCache llvm::Type through PATypeHolder.
Devang Patel [Thu, 25 Oct 2007 18:32:36 +0000 (18:32 +0000)]
Cache llvm::Type through PATypeHolder.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43355 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agochanged #include of Serialization.h to SerializationFwd.h to reduce
Ted Kremenek [Thu, 25 Oct 2007 18:27:10 +0000 (18:27 +0000)]
changed #include of Serialization.h to SerializationFwd.h to reduce
compilation time.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43354 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix a recovery bug Fariborz and I noticed yesterday. We were producing:
Chris Lattner [Thu, 25 Oct 2007 17:27:01 +0000 (17:27 +0000)]
Fix a recovery bug Fariborz and I noticed yesterday.  We were producing:

method.c:4:3: error: use of undeclared identifier 'BADIDENT'
        &BADIDENT, 0
         ^
method.c:5:2: error: expected '}'
};
 ^
method.c:3:14: error: to match this '{'
struct S A = {
             ^

now we only produce:

method.c:4:3: error: use of undeclared identifier 'BADIDENT'
        &BADIDENT, 0
         ^

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43349 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agosimplify change.
Chris Lattner [Thu, 25 Oct 2007 17:18:59 +0000 (17:18 +0000)]
simplify change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43348 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix a bug steve noticed when handling nested rewrites. We now turn this:
Chris Lattner [Thu, 25 Oct 2007 17:17:34 +0000 (17:17 +0000)]
Fix a bug steve noticed when handling nested rewrites.  We now turn this:

    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

into:

    NSAutoreleasePool * pool = objc_msgSend(objc_msgSend(objc_getClass("NSAutoreleasePool"), sel_getUid("alloc")), sel_getUid("init"));

instead of:

    NSAutoreleasePool * pool = objc_msgSend(objc_msgSend(objc_getClass("NSAutoreleasePool"), sel_getUid("alloc")), sel_getUid("init"))utoreleasePool"), sel_getUid("alloc")) init];

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43347 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoConvert one type of metadata to use std::string instead of
Chris Lattner [Thu, 25 Oct 2007 17:07:24 +0000 (17:07 +0000)]
Convert one type of metadata to use std::string instead of
printf as an example.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43346 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdded SourceLocation.cpp to XCode project.
Ted Kremenek [Thu, 25 Oct 2007 16:03:53 +0000 (16:03 +0000)]
Added SourceLocation.cpp to XCode project.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43344 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoImplemented serialization of SourceLocation and SourceRange objects.
Ted Kremenek [Thu, 25 Oct 2007 16:02:43 +0000 (16:02 +0000)]
Implemented serialization of SourceLocation and SourceRange objects.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43343 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdded constness to accessors in CompoundStmt.
Ted Kremenek [Thu, 25 Oct 2007 15:39:09 +0000 (15:39 +0000)]
Added constness to accessors in CompoundStmt.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43342 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd a new ChooseExpr::isConditionTrue method to unify
Chris Lattner [Thu, 25 Oct 2007 00:29:32 +0000 (00:29 +0000)]
Add a new ChooseExpr::isConditionTrue method to unify
some code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43322 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoRefactored RewriteObjcMethodsMetaData to better rewrite
Fariborz Jahanian [Thu, 25 Oct 2007 00:14:44 +0000 (00:14 +0000)]
Refactored RewriteObjcMethodsMetaData to better rewrite
instance/class methods metadata.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43320 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdded accessors to CompoundStmt to retrieve the source locations for the
Ted Kremenek [Thu, 25 Oct 2007 00:08:50 +0000 (00:08 +0000)]
Added accessors to CompoundStmt to retrieve the source locations for the
left and right bracket.  This is useful for serialization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43318 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoRemove unused #includes
Devang Patel [Wed, 24 Oct 2007 23:42:18 +0000 (23:42 +0000)]
Remove unused #includes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43317 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoMore work on translating message expressions.
Steve Naroff [Wed, 24 Oct 2007 22:48:43 +0000 (22:48 +0000)]
More work on translating message expressions.

Still to do:

- Chris will fix a bug in the rewriting engine for nested stmts. For example, the following:

    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

tranlates to:

    NSAutoreleasePool * pool = objc_msgSend(objc_msgSend(objc_getClass("NSAutoreleasePool"), sel_getUid("alloc")), sel_getUid("init"))utoreleasePool"), sel_getUid("alloc")) init];

...which is correct, except there is garbage after sel_getUid("init"). This is because the rewriter isn't updating the extent of the containing message expression.

- Do the crazy cast thang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43316 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoHandle
Devang Patel [Wed, 24 Oct 2007 22:26:28 +0000 (22:26 +0000)]
Handle
  foo()->a = 42;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43315 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoRemove explicit use of size of known structs in metadata generation.
Fariborz Jahanian [Wed, 24 Oct 2007 21:25:12 +0000 (21:25 +0000)]
Remove explicit use of size of known structs in metadata generation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43313 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoCouple of minor changes. 1) Metaclass metadata also has a reference to
Fariborz Jahanian [Wed, 24 Oct 2007 20:54:23 +0000 (20:54 +0000)]
Couple of minor changes. 1) Metaclass metadata also has a reference to
protocol meta-data (unlike what documentation says). 2) Include objc.h so,
we can compile the generated metadata with both gcc and clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43311 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoMove RecordOrganizer into CodeGenTypes.cpp
Devang Patel [Wed, 24 Oct 2007 20:38:06 +0000 (20:38 +0000)]
Move RecordOrganizer into CodeGenTypes.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43310 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoRefactord instance and class metadata emission. Refactored protocols metadata emission.
Fariborz Jahanian [Wed, 24 Oct 2007 19:23:36 +0000 (19:23 +0000)]
Refactord instance and class metadata emission. Refactored protocols metadata emission.
Implemented emission of category metadata,

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43308 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoModified current clients of Bitcode-Object serialization to use the
Ted Kremenek [Wed, 24 Oct 2007 19:06:02 +0000 (19:06 +0000)]
Modified current clients of Bitcode-Object serialization to use the
new split-header file configuration (Serialize.h and Deserialize.h)
now in place in the core LLVM repository.

Removed unneeded SerializeTrait specializations for enums in
TokenKinds.h

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43306 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoHandle non-constant initializers.
Devang Patel [Wed, 24 Oct 2007 18:05:48 +0000 (18:05 +0000)]
Handle non-constant initializers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43301 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoVisit CompoundLiteralExpr and InitListExpr
Devang Patel [Wed, 24 Oct 2007 17:18:43 +0000 (17:18 +0000)]
Visit CompoundLiteralExpr and InitListExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43300 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix some long lines, move code around into logical groups.
Chris Lattner [Wed, 24 Oct 2007 17:06:59 +0000 (17:06 +0000)]
Fix some long lines, move code around into logical groups.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43299 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoUse Ted's new mutable child iterators to update the tree as we rewrite it.
Chris Lattner [Wed, 24 Oct 2007 16:57:36 +0000 (16:57 +0000)]
Use Ted's new mutable child iterators to update the tree as we rewrite it.
This will make nested subexprs work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43296 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoModified operator* for StmtIterator to return Stmt*& instead of Stmt*.
Ted Kremenek [Wed, 24 Oct 2007 16:52:34 +0000 (16:52 +0000)]
Modified operator* for StmtIterator to return Stmt*& instead of Stmt*.
This permits in-place replacement of the original AST statements.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43295 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoIncorporate some feedback from Chris...
Steve Naroff [Wed, 24 Oct 2007 01:09:48 +0000 (01:09 +0000)]
Incorporate some feedback from Chris...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43285 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoConstify methods and reuse RecordOrganizer object.
Devang Patel [Wed, 24 Oct 2007 00:56:23 +0000 (00:56 +0000)]
Constify methods and reuse RecordOrganizer object.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43284 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agocheck base type.
Devang Patel [Wed, 24 Oct 2007 00:54:17 +0000 (00:54 +0000)]
check base type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43283 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd notes.
Devang Patel [Wed, 24 Oct 2007 00:32:16 +0000 (00:32 +0000)]
Add notes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43282 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoUse isUnionType() predicate.
Devang Patel [Wed, 24 Oct 2007 00:28:49 +0000 (00:28 +0000)]
Use isUnionType() predicate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43281 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agountabify
Devang Patel [Wed, 24 Oct 2007 00:26:24 +0000 (00:26 +0000)]
untabify

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43280 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFixed a strange construct, please review.
Hartmut Kaiser [Wed, 24 Oct 2007 00:07:36 +0000 (00:07 +0000)]
Fixed a strange construct, please review.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43278 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoSilenced a VC++ warning.
Hartmut Kaiser [Wed, 24 Oct 2007 00:06:59 +0000 (00:06 +0000)]
Silenced a VC++ warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43277 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoAdd some plumbing to rewrite message expressions (still under construction).
Steve Naroff [Tue, 23 Oct 2007 23:50:29 +0000 (23:50 +0000)]
Add some plumbing to rewrite message expressions (still under construction).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43274 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoFix typo.
Devang Patel [Tue, 23 Oct 2007 23:29:51 +0000 (23:29 +0000)]
Fix typo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43269 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoHandle nested structs.
Devang Patel [Tue, 23 Oct 2007 23:26:46 +0000 (23:26 +0000)]
Handle nested structs.
typdef struct A { int i; struct A *next; } A

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43268 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoImplemented serialization for IdentifierInfo and IdentifierTable.
Ted Kremenek [Tue, 23 Oct 2007 22:18:37 +0000 (22:18 +0000)]
Implemented serialization for IdentifierInfo and IdentifierTable.
Updated serialization test code in the driver to test serialization of
these types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43266 91177308-0d34-0410-b5e6-96231b3b80d8

17 years agoHandle simple struct member expr.
Devang Patel [Tue, 23 Oct 2007 20:28:39 +0000 (20:28 +0000)]
Handle simple struct member expr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43258 91177308-0d34-0410-b5e6-96231b3b80d8

17 years ago- Add rewrite rule for @class.
Steve Naroff [Tue, 23 Oct 2007 20:20:08 +0000 (20:20 +0000)]
- Add rewrite rule for @class.
- Add setter/getter to ObjcClassDecl.
- Predefined key runtime functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43257 91177308-0d34-0410-b5e6-96231b3b80d8