Steve Naroff
ad373bdcfe
Add parsing and AST support for GNU "typeof".
...
Many small changes to lot's of files.
Still some FIXME's, however the basic support is in place.
llvm-svn: 40631
2007-07-31 12:34:36 +00:00
Chris Lattner
02c0439a44
Fix a couple of bugs, add some new cool stuff.
...
1. Fix a todo in Parser::ParseTag, to recover better. On code like
that in test/Sema/decl-invalid.c it causes us to return a single
error instead of multiple.
2. Fix an error in Sema::ParseDeclarator, where it would crash if the
declarator didn't have an identifier. Instead, diagnose the problem.
3. Start adding infrastructure to track the range of locations covered
by a declspec or declarator. This is mostly implemented for declspec,
but could be improved, it is missing for declarator.
Thanks to Neil for pointing out this crash.
llvm-svn: 40482
2007-07-25 00:24:17 +00:00
Chris Lattner
23b7eb677d
Finally bite the bullet and make the major change: split the clang namespace
...
out of the llvm namespace. This makes the clang namespace be a sibling of
llvm instead of being a child.
The good thing about this is that it makes many things unambiguous. The
bad things is that many things in the llvm namespace (notably data structures
like smallvector) now require an llvm:: qualifier. IMO, libsystem and libsupport
should be split out of llvm into their own namespace in the future, which will fix
this issue.
llvm-svn: 39659
2007-06-15 23:05:46 +00:00
Chris Lattner
36982e4367
Add support for inserting up to 10 strings in a diagnostic, with %0, %1, %2,
...
etc.
llvm-svn: 39447
2007-05-16 17:49:37 +00:00
Chris Lattner
b9d572a0a8
Generalize DeclSpec::TypedefRep to allow it to hold any type representation.
...
Use it to hold the declaration object for a struct/union.
llvm-svn: 39282
2007-01-23 04:58:34 +00:00
Chris Lattner
7bd11febba
make file-static function be a static declspec method.
...
llvm-svn: 39280
2007-01-23 04:35:33 +00:00
Chris Lattner
69680eabc0
Make some file-static functions be static methods in the DeclSpec class.
...
llvm-svn: 39279
2007-01-23 04:34:43 +00:00
Chris Lattner
b20e89449f
capture sourcelocation info for type specifiers. This improves diagnostics
...
for things like 'short _Complex'.
llvm-svn: 39227
2006-11-28 05:30:29 +00:00
Chris Lattner
60809f5aaf
record location info for const/volatile/restrict
...
llvm-svn: 39226
2006-11-28 05:18:46 +00:00
Chris Lattner
1b22eed03c
add loc info for the inline specifier, fix some fixme's by using it.
...
llvm-svn: 39225
2006-11-28 05:12:07 +00:00
Chris Lattner
4d8f873b5b
record accurate sourceloc info for storage class specs, so we can report
...
things like:
t.c:4:10: error: invalid storage class specifier in function declarator
int foo2(auto int Aaslfkasdflkj, register B);
^
instead of:
t.c:4:19: error: invalid storage class specifier in function declarator
int foo2(auto int Aaslfkasdflkj, register B);
^
llvm-svn: 39224
2006-11-28 05:05:08 +00:00
Chris Lattner
353f5740b1
Finish converting DeclSpec to use accessors.
...
llvm-svn: 39223
2006-11-28 04:50:12 +00:00
Chris Lattner
a925dc66e4
Convert more code to use DeclSpec accessors
...
llvm-svn: 39222
2006-11-28 04:33:46 +00:00
Chris Lattner
f055d43211
add accessors to DeclSpec, start moving clients over to use them.
...
llvm-svn: 39221
2006-11-28 04:28:12 +00:00
Chris Lattner
2ebe4bb64d
when a typedef name is parsed as part of declspecs, remember the decl for the
...
typedef.
llvm-svn: 39188
2006-11-20 01:29:42 +00:00
Chris Lattner
288e86ff15
Rename SemaDeclSpec.{h|cpp} back to DeclSpec.{h|cpp} now that the distinction
...
between sema and parse is clear.
llvm-svn: 39167
2006-11-11 23:03:42 +00:00
Chris Lattner
289ab7bb1d
rename SemaDecl.cpp/h to SemaDeclSpec.cpp/h
...
llvm-svn: 39149
2006-11-08 06:54:53 +00:00
Chris Lattner
7ad0fbe1f2
rename a bunch of files for better consistency
...
llvm-svn: 39126
2006-11-05 07:46:30 +00:00
Chris Lattner
3b4fdda3d8
Fix the last remaining FIXME's in the parser by asking the actions module
...
whether or not an identifier is a typedef name.
llvm-svn: 38915
2006-08-14 00:45:39 +00:00
Chris Lattner
da72c82e8e
Recognize struct/union/enum as TypeSpecType's
...
llvm-svn: 38903
2006-08-13 22:16:42 +00:00
Chris Lattner
0e89462b08
Parse things like 'struct X;'
...
llvm-svn: 38898
2006-08-13 19:58:17 +00:00
Chris Lattner
eb8a28f7b7
Rename some files
...
llvm-svn: 38855
2006-08-10 18:43:39 +00:00
Chris Lattner
d9c3c59fc0
Continue work on declspecs and declarations
...
llvm-svn: 38818
2006-08-05 06:26:47 +00:00
Chris Lattner
8e90ef6ccc
add some notes
...
llvm-svn: 38817
2006-08-05 03:30:45 +00:00
Chris Lattner
f63f89acc2
Handle __thread and storage-class-specifiers
...
llvm-svn: 38816
2006-08-05 03:28:50 +00:00
Chris Lattner
158ede8e44
Add a citation
...
llvm-svn: 38814
2006-08-04 06:42:38 +00:00
Chris Lattner
1ae23294fb
C99 requires at least one type specifier.
...
llvm-svn: 38813
2006-08-04 06:42:31 +00:00
Chris Lattner
fef9d2bba7
Diagnose specifiers with invalid _Complex/_Imaginary components.
...
llvm-svn: 38812
2006-08-04 06:36:52 +00:00
Chris Lattner
839713c085
Emit diagnostics for things like 'signed _Bool' and 'short float'
...
llvm-svn: 38811
2006-08-04 06:15:52 +00:00
Chris Lattner
deb42f5a96
Add some missing assignments.
...
llvm-svn: 38808
2006-08-04 05:26:52 +00:00
Chris Lattner
da48a8e66b
Parse and validate cvr type-qualifiers
...
llvm-svn: 38807
2006-08-04 05:25:55 +00:00
Chris Lattner
b9093cd1d0
Add an initial cut at a datastructure for holding declspec's.
...
llvm-svn: 38805
2006-08-04 04:39:53 +00:00