Commit Graph

313 Commits

Author SHA1 Message Date
Bill Wendling 4073ed5daa C++: Added support for bool types.
llvm-svn: 39338
2007-02-13 01:51:42 +00:00
Chris Lattner 9561a0b3e7 Add support for target-independent builtin functions (like __builtin_abs),
whose decl objects are lazily created the first time they are referenced.
Builtin functions are described by the clang/AST/Builtins.def file, which
makes it easy to add new ones.

This is missing two important pieces:
1. Support for the rest of the gcc builtins.
2. Support for target-specific builtins (e.g. __builtin_ia32_emms).

Just adding this builtins reduces the number of implicit function definitions
by 6, reducing the # diagnostics from 550 to 544 when parsing carbon.h.

I need to add all the i386-specific ones to eliminate several hundred more.
ugh.

llvm-svn: 39327
2007-01-28 08:20:04 +00:00
Chris Lattner 32d920b8dc rename some classes, no functionality changes.
llvm-svn: 39307
2007-01-26 02:01:53 +00:00
Chris Lattner 6531c1075c Diagnose invalid sizeof/alignof operands.
llvm-svn: 39291
2007-01-23 22:29:49 +00:00
Chris Lattner ac18be9ad2 Add support for C90 implicitly defined functions, e.g.:
int A() {
  return X();
}

llvm-svn: 39194
2006-11-20 06:49:47 +00:00
Chris Lattner 5efbb33a6b remember referenced decls in our AST's
llvm-svn: 39193
2006-11-20 05:01:40 +00:00
Chris Lattner 17ed487947 parse identifier expressions properly. This allows us diagnose this:
typedef int X;

int A() {
  return X;
}

int B() {
  return Y;
}

as:

/Users/sabre/test.c:5:10: error: unexpected type name 'X': expected expression
return X;
       ^
/Users/sabre/test.c:9:10: error: use of undeclared 'Y' value
return Y;
       ^

llvm-svn: 39192
2006-11-20 04:58:19 +00:00
Chris Lattner 0d8b1a1eff remember and pretty-print cast types
llvm-svn: 39191
2006-11-20 04:34:45 +00:00
Chris Lattner 33e8a55ed0 Parse and remember types enough that we can pretty print:
void foo(int X) {
  X = __alignof(int);
  X = sizeof(const int** restrict ** volatile*);
}

as:

x = __alignof(int)
x = sizeof(int const **restrict **volatile *)

llvm-svn: 39181
2006-11-19 01:48:02 +00:00
Chris Lattner ddc135e593 Let ASTContext hold target info, since it's useful
llvm-svn: 39162
2006-11-10 06:34:16 +00:00
Chris Lattner cb6a382b67 introduce a new ASTContext class to hold long-lived ast nodes.
llvm-svn: 39161
2006-11-10 06:20:45 +00:00
Chris Lattner e168f76c2d move the rest of the expr sema to SemaExpr.cpp and the decl processing stuff
to SemaDecl.cpp

llvm-svn: 39159
2006-11-10 05:29:30 +00:00
Chris Lattner 5b183d882b split semantic analysis of expressions out to its own file
llvm-svn: 39155
2006-11-10 05:03:26 +00:00