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
Ted Kremenek
4f50ee3e6d
Implemented serialization for TypedefType.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43423 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-28 21:21:04 +00:00
Ted Kremenek
4340bfa9f4
Implemented serialization of FunctionTypeProto.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43419 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-28 00:59:26 +00:00
Ted Kremenek
e81e24c84b
Implemented serialization of FunctionTypeNoProto.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43418 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-27 19:58:08 +00:00
Ted Kremenek
71ac846a4e
Implemented serialization for VectorType.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43417 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-27 19:05:09 +00:00
Ted Kremenek
a4cb4525cf
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
2007-10-26 23:52:52 +00:00
Fariborz Jahanian
4d733d3288
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
2007-10-26 23:09:28 +00:00
Ted Kremenek
bc26c58f3d
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
2007-10-26 22:00:08 +00:00
Steve Naroff
bef1185418
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
2007-10-26 20:53:56 +00:00
Fariborz Jahanian
7780d2d52b
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
2007-10-26 20:50:24 +00:00
Ted Kremenek
73af669633
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
2007-10-26 20:24:35 +00:00
Fariborz Jahanian
26e4cd331c
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
2007-10-26 19:46:17 +00:00
Devang Patel
abad06cfd0
Codegen union member references.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43390 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26 19:42:18 +00:00
Devang Patel
0a96118bb8
Handle non LValue base expressions.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43387 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26 18:15:21 +00:00
Devang Patel
e40daa4e84
Code gen static initializer.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43386 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26 17:50:58 +00:00
Devang Patel
636c3d0467
Codegen array initializers.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43385 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26 17:44:44 +00:00
Devang Patel
8e53e720b3
Codegen global array initializers.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43383 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26 16:31:40 +00:00
Fariborz Jahanian
edcfb42e5e
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
2007-10-26 16:29:12 +00:00
Hartmut Kaiser
00a1ef57b6
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
2007-10-25 22:59:17 +00:00
Hartmut Kaiser
d22b492e28
Updated VC++ build system
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43370 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 22:58:31 +00:00
Ted Kremenek
b990f1834b
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
2007-10-25 22:24:19 +00:00
Devang Patel
f86206ffbf
Fix "strbuf += stufflen;" crash.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43365 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 22:19:13 +00:00
Devang Patel
5825ac2950
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
2007-10-25 21:40:12 +00:00
Ted Kremenek
f152b2ee87
Added DeclSerialization.cpp to XCode project.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43362 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 21:39:10 +00:00
Ted Kremenek
2f1f8cb1b8
Added skeleton for Decl serialization.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43361 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 21:37:16 +00:00
Fariborz Jahanian
ccd87b07a7
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
2007-10-25 20:55:25 +00:00
Devang Patel
30ec9972be
Cache llvm::Type through PATypeHolder.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43355 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 18:32:36 +00:00
Ted Kremenek
0a449eed1d
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
2007-10-25 18:27:10 +00:00
Chris Lattner
e61933ddb9
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
2007-10-25 17:27:01 +00:00
Chris Lattner
d6690b20b3
simplify change.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43348 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 17:18:59 +00:00