- Jul 20, 2007
-
-
Chris Lattner authored
fileid/offset pair, it now contains a bit discriminating between mapped locations and file locations. This separates the tables for macros and files in SourceManager, and allows better separation of concepts in the rest of the compiler. This allows us to have *many* macro instantiations before running out of 'addressing space'. This is also more efficient, because testing whether something is a macro expansion is now a bit test instead of a table lookup (which also used to require having a srcmgr around, now it doesn't). This is fully functional, but there are several refinements and optimizations left. llvm-svn: 40103
-
- Jul 16, 2007
-
-
Chris Lattner authored
llvm-svn: 39904
-
Chris Lattner authored
llvm-svn: 39897
-
- Jul 15, 2007
-
-
Chris Lattner authored
llvm-svn: 39865
-
- Jul 14, 2007
-
-
Chris Lattner authored
compute type alignment. This info is needed for struct layout. llvm-svn: 39850
-
- Jul 13, 2007
-
-
Chris Lattner authored
llvm-svn: 39795
-
- Jul 07, 2007
-
-
Steve Naroff authored
Submitted by: Reviewed by: - Finished semantic analysis for vectors, added some diagnostics. - Added AST for vectors (instantiation, installation into the decl). - Fixed bug in ParseArraySubscriptExpr()...this crasher was introduced by me when we added the range support. - Turned pedantic off by default. Since vectors are gcc extensions, having pedantic on by default was annoying. Turning it off by default is also consistent with gcc (but this wasn't my primary motivation). - Tweaked some comments and diagnostics. Note: The type checking code is still under construction (for vectors). This will be my next check-in. llvm-svn: 39715
-
- Jun 28, 2007
-
-
Chris Lattner authored
llvm-svn: 39707
-
Chris Lattner authored
llvm-svn: 39706
-
Chris Lattner authored
llvm-svn: 39705
-
Chris Lattner authored
llvm-svn: 39704
-
Chris Lattner authored
recent changes. carbon.h now preprocesses just fine. llvm-svn: 39701
-
- Jun 27, 2007
-
-
Chris Lattner authored
llvm-svn: 39692
-
Chris Lattner authored
llvm-svn: 39690
-
Bill Wendling authored
- Chris noticed that if there were multiple warnings/errors expected throughout the file and we were checking only one of them, then it would go ahead and say that the whole file was okay. Fixed this by adding a check for the line number as well as the string. llvm-svn: 39689
-
Bill Wendling authored
Removed unnecessary typedef. llvm-svn: 39686
-
Bill Wendling authored
- Shouldn't increment the iterator but a copy of it. llvm-svn: 39679
-
Bill Wendling authored
Reviewed by: Chris Lattner - Added a new diagnostic client, TextDiagnosticBuffer. It buffers all reported diagnostics. - Use the new diagnostic client to check that expected diagnostics are actually emitted. The way this is done is to put the expected diagnostic in a comment on the line you expect it to be emitted for. Like this: int X = A; // expected-warning {{blah}} - Use -parse-ast-check to use this feature. llvm-svn: 39678
-
- Jun 23, 2007
-
-
Bill Wendling authored
- Separate out the AST streamers from the clang.cpp file into their very own special files. llvm-svn: 39676
-
Bill Wendling authored
Submitted by: Bill Wendling - Convert std::cerr to using fprintf(stderr, ...) instead. llvm-svn: 39675
-
- Jun 16, 2007
-
-
Chris Lattner authored
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
-
- Jun 15, 2007
-
-
Bill Wendling authored
Reviewed by: Chris Lattner - Refactor some code from main() and ProcessInputFile() so that it helps to decouple the initialization of the Preprocessor object from the diagnostic client. llvm-svn: 39657
-
- Jun 13, 2007
-
-
Bill Wendling authored
Reviewed by: Chris Lattner - Created a base class (TextDiagnostics) for all text diagnostic classes. Moved the "IgnoreDiagnostic" method up there, and created a method that will format the diagnostic string, replacing %# with the appropriate string. This is in preparation for adding a text diagnostic checker. llvm-svn: 39650
-
- Jun 10, 2007
-
-
Bill Wendling authored
Reviewed by: Chris Lattner - Added a method "IgnoreDiagnostic" so that the diagnostic client can tell the diagnostic object that it doesn't want to handle a particular diagnostic message. In which case, it won't be counted as either a diagnostic or error. llvm-svn: 39641
-
- Jun 08, 2007
-
-
Bill Wendling authored
Reviewed by: Chris Lattner - Make the counting of errors and diagnostic messages sane. Place them into the Diagnostic class instead of in the DiagnosticClient class. llvm-svn: 39615
-
Chris Lattner authored
corresponding file buffer, don't dereference null pointers. This fixes a regression on test/Preprocessor/_Pragma-syshdr.c llvm-svn: 39611
-
- Jun 07, 2007
-
-
Bill Wendling authored
- Renamed file guard. llvm-svn: 39604
-
Bill Wendling authored
Reviewed by: Chris Lattner - Separated out the diagnostic client from the clang driver. This is in preparation for creating a diagnostic client that will be used to check error and warning messages. llvm-svn: 39603
-
- May 31, 2007
-
-
Chris Lattner authored
llvm-svn: 39534
-
- May 30, 2007
-
-
Bill Wendling authored
- Conjugate "diagnostic" correctly for 1 diagnostic. llvm-svn: 39525
-
- May 29, 2007
-
-
Chris Lattner authored
extern int pintFunc(int *, int *); int test() { pintFunc(0, 3); } We now print: t3.c:4:13: warning: passing argument 2 makes pointer from integer without a cast pintFunc(0, ~~~~~~~~ ^ instead of: t3.c:4:13: warning: passing argument 2 makes pointer from integer without a cast pintFunc(0, ~~~~~~~~ llvm-svn: 39516
-
- May 28, 2007
-
-
Chris Lattner authored
llvm-svn: 39503
-
- May 24, 2007
-
-
Chris Lattner authored
library to be built for the driver to link. llvm-svn: 39495
-
- May 23, 2007
-
-
Steve Naroff authored
Submitted by: Reviewed by: Added "global" statistics gathering for Decls/Stmts/Exprs. Very useful for working with a single file. When we start compiling multiple files, will need to enhance this to collect stats on a per-module basis. llvm-svn: 39485
-
- May 21, 2007
-
-
Chris Lattner authored
llvm-svn: 39478
-
Chris Lattner authored
llvm-svn: 39477
-
- May 20, 2007
-
-
Chris Lattner authored
#define friendlystruct fs struct A { int X; }; void test2(struct A friendlystruct, int C) { return friendlystruct + (C *40); } were getting diagnosed like this: t.c:7:27: error: invalid operands to binary expression ('struct A' and 'int') return friendlystruct + (C *40); ~~ ^ ~~~~~~~~~~~ The problem is that getCharacterData returns a pointer to the macro expansion, not to the macro instantiation. Instead, use getLogicalLoc to get a pointer to the instatiation location, so we relex the macro id. We now get: t.c:7:27: error: invalid operands to binary expression ('struct A' and 'int') return friendlystruct + (C *40); ~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~ oooh ahh. :) llvm-svn: 39465
-
- May 19, 2007
-
-
Chris Lattner authored
llvm-svn: 39460
-
Chris Lattner authored
of a subexpression when emitting a diagnostic. Consider this example: struct A { int X; }; void test1(void *P, int C) { return ((C*40) + *P) / 42+P; } void test2(struct A friendlystruct, int C) { return (C *40) + friendlystruct; } void test3(struct A friendlystruct, int C) { return friendlystruct + test2(friendlystruct , C); } clang now produces this output: t.c:4:18: error: invalid operands to binary expression ('int' and 'void') return ((C*40) + *P) / 42+P; ~~~~~~ ^ ~~ This shows the important pieces of a nested (and potentially very complex) expression. t.c:8:18: error: invalid operands to binary expression ('int' and 'struct A') return (C *40) + friendlystruct; ~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~ This shows that tabs in source files (after the 'C') and multichar tokens (friendlystruct) are handled correctly. t.c:12:25: error: invalid operands to binary expression ('struct A' and 'void') return friendlystruct + test2(friendlystruct ~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~ This shows how multiline ranges are printed. Any part of the range that is not on the same line as the carat is just ignored. This also shows that trailing spaces on the line aren't highlighted. llvm-svn: 39459
-
Chris Lattner authored
but there is no functionality change yet. llvm-svn: 39458
-