| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
translation-unit scope, so we only warn about each implicitly defined
function once. This cuts the number of errors parsing carbon.h from 616 to 550.
llvm-svn: 39325
|
|
|
|
|
|
|
| |
proto, then a function body, and they have the same type, don't emit an error.
This reduces #errors from 654->616
llvm-svn: 39324
|
|
|
|
|
|
|
| |
int foo;
int foo();
llvm-svn: 39323
|
|
|
|
| |
llvm-svn: 39322
|
|
|
|
|
|
|
| |
use the folding set. This eliminates 359 slow lookups from carbon.h (the
rest) but doesn't substantially speed up parse.
llvm-svn: 39320
|
|
|
|
|
|
|
| |
search. This reduces 'dumb' lookups from 1225 to 359, speeding up parse
of carbon.h from 0.173 to 0.156s (10%).
llvm-svn: 39319
|
|
|
|
| |
llvm-svn: 39316
|
|
|
|
| |
llvm-svn: 39313
|
|
|
|
|
|
|
|
| |
"obviously braindead" linear searches. reduces the number of slow
type lookups from 10K to 883 on carbon.h, speeding up parsing from 3.5 to
1.26s.
llvm-svn: 39312
|
|
|
|
|
|
|
| |
a foldingset instead. This reduces the number of slow type lookups from
32K to 10K, which speeds up parsing of carbon.h from 11s to 3.5s.
llvm-svn: 39311
|
|
|
|
|
|
|
| |
This speeds up parsing carbon.h from 16.0s to 11.3s, reducing slow
lookups from 63K to 32K.
llvm-svn: 39308
|
|
|
|
| |
llvm-svn: 39307
|
|
|
|
|
|
|
|
| |
ASTContext::getTagDeclType by not having to do a linear search. With this,
parse time for carbon.h drops from 21.8s to 16.0s and # slow lookups drop from
83K to 63K.
llvm-svn: 39306
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
*** AST Context Stats:
30594 types total.
19 builtin types
3929 pointer types
308 array types
18883 function types with proto
8 function types with no proto
2988 typename (typedef) types
4459 tagged types
1476 struct types
80 union types
0 class types
2903 enum types
83298 slow type lookups
Next up, making type canonicalization not trivially silly.
llvm-svn: 39305
|
|
|
|
| |
llvm-svn: 39304
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
struct q { int a, a; };
with:
t.c:3:19: error: duplicate member 'a'
struct q { int a, a; };
^
t.c:3:16: error: previous definition is here
struct q { int a, a; };
^
llvm-svn: 39303
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This emits these diagnostics:
t.c:4:14: error: redefinition of 'a'
enum foo22 { a, b };
^
t.c:3:5: error: previous definition is here
int a;
^
t.c:8:17: error: redefinition of enumerator 'b'
enum foo23 { c, b };
^
t.c:4:17: error: previous definition is here
enum foo22 { a, b };
^
4 diagnostics generated.
for:
int a;
enum foo22 { a, b };
enum foo23 { c, b };
llvm-svn: 39302
|
|
|
|
|
|
|
| |
the EnumDecl when the enum type is complete. This allows us to detect
redefinitions of enums.
llvm-svn: 39300
|
|
|
|
|
|
|
|
| |
t.c:2:6: warning: ISO C forbids forward references to 'enum' types
enum foo22* X;
^
llvm-svn: 39299
|
|
|
|
| |
llvm-svn: 39297
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
t.c:10:15: warning: 'bonk' may not be nested in a struct due to flexible array member
struct bink bonk;
^
t.c:13:14: error: 'struct bink' may not be used as an array element due to flexible array member
struct bink A[123];
^
for:
struct bink {
struct bink *a;
int X[]; // ok.
};
struct foo {
int A;
struct bink bonk;
};
struct bink A[123];
llvm-svn: 39296
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
struct bork {
int X[];
};
struct bink {
struct bink a;
int X[]; // ok.
};
to:
t.c:3:7: error: flexible array 'X' not allowed in otherwise empty struct
int X[];
^
t.c:7:15: error: field 'a' has incomplete type
struct bink a;
^
llvm-svn: 39295
|
|
|
|
|
|
|
|
| |
t.c:5:8: error: field 'foo' declared as a function
void foo();
^
llvm-svn: 39294
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
like:
struct S { struct S {} X; };
with:
t.c:2:19: error: nested redefinition of 'struct'
struct S { struct S {} X; };
^
t.c:2:1: error: previous definition is here
struct S { struct S {} X; };
^
llvm-svn: 39292
|
|
|
|
| |
llvm-svn: 39291
|
|
|
|
|
|
| |
C99 6.2.5.
llvm-svn: 39289
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Diagnose redefintion of tag types, e.g.:
t.c:7:8: error: redefinition of 'blah'
struct blah {};
^
t.c:1:8: error: previous definition is here
struct blah {
^
2 diagnostics generated.
llvm-svn: 39286
|
|
|
|
|
|
| |
converting a declspec with TST = struct/union. Pretty print as well.
llvm-svn: 39284
|
|
|
|
| |
llvm-svn: 39283
|
|
|
|
|
|
| |
Use it to hold the declaration object for a struct/union.
llvm-svn: 39282
|
|
|
|
| |
llvm-svn: 39278
|
|
|
|
|
|
| |
rename it to ParseTag.
llvm-svn: 39277
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
struct blah * P;
union blah *P2;
we now emit:
t.c:2:1: error: redefinition of 'blah' with tag that does not match previous use
union blah *P2;
^
t.c:1:8: error: previous use is here
struct blah * P;
^
llvm-svn: 39275
|
|
|
|
|
|
|
| |
or a definition/declaration of a tag. This is required to handle
C99 6.7.2.3p11 properly.
llvm-svn: 39274
|
|
|
|
|
|
|
|
|
| |
catch the bad
case and handle identifiers in the same namespace correctly. This implements
test/Parser/c-namespace.c
llvm-svn: 39272
|
|
|
|
|
|
| |
byeliminating the 'next' pointer from the ctor, and add initial support forparsing struct/union tags.
llvm-svn: 39266
|
|
|
|
|
|
|
| |
eliminating the 'next' pointer from the ctor, and add initial support for
parsing struct/union tags.
llvm-svn: 39265
|
|
|
|
| |
llvm-svn: 39260
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Detect and emit errors when names are redefined in the same scope, e.g.
test/Parser/argument_redef.c, which now emits:
argument_redef.c:4:22: error: redefinition of 'A'
int foo(int A) { int A; }
^
argument_redef.c:4:13: error: previous definition is here
int foo(int A) { int A; }
^
llvm-svn: 39257
|
|
|
|
| |
llvm-svn: 39256
|
|
|
|
| |
llvm-svn: 39255
|
|
|
|
|
|
|
| |
inserting them into the function body scope and registering them with the
corresponding FunctionDecl.
llvm-svn: 39253
|
|
|
|
|
|
| |
reinterpret_cast, and static_cast. Patch by Bill!
llvm-svn: 39247
|
|
|
|
| |
llvm-svn: 39242
|
|
|
|
|
|
| |
diagnosing malformed K&R function definitions.
llvm-svn: 39241
|
|
|
|
|
|
| |
void foo(void (*q)(a,b,c)) {}
llvm-svn: 39240
|
|
|
|
|
|
|
|
| |
void bar(int X, int X);
void blah(X, Y, X) int X, Y; {}
llvm-svn: 39239
|
|
|
|
| |
llvm-svn: 39238
|
|
|
|
|
|
| |
instead of having a string.
llvm-svn: 39237
|
|
|
|
|
|
|
| |
This allows us to handle typedefs of void correctly. This implements
clang/test/Sema/void_arg.c
llvm-svn: 39236
|