| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
but where we didn't warn about __attribute__.
llvm-svn: 39607
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
diag.c:1:9: error: invalid digit '8' in octal constant
int x = 000080;
^
diag.c:2:9: error: invalid digit 'A' in decimal constant
int z = 1000080ABC;
^
instead of:
diag.c:1:9: error: invalid suffix '80' on integer constant
int x = 000080;
^
diag.c:2:9: error: invalid suffix 'ABC' on integer constant
int z = 1000080ABC;
^
llvm-svn: 39605
|
|
|
|
|
|
| |
Removed #include <iostream>.
llvm-svn: 39554
|
|
|
|
|
|
|
|
|
| |
Submitted by: Bill Wendling
Reviewed by: Chris Lattner
- Removed unneeded <iostream> header.
llvm-svn: 39484
|
|
|
|
|
|
| |
and correctly in terms of C99 6.4.4.1p5.
llvm-svn: 39473
|
|
|
|
| |
llvm-svn: 39463
|
|
|
|
| |
llvm-svn: 39462
|
|
|
|
|
|
| |
etc.
llvm-svn: 39447
|
|
|
|
| |
llvm-svn: 39426
|
|
|
|
| |
llvm-svn: 39407
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
implements test/Preprocessor/expr_usual_conversions.c, which produces this
output:
expr_usual_conversions.c:5:10: warning: left side of operator converted from negative value to unsigned: -42 to 18446744073709551574
#if (-42 + 0U) / -2
^
expr_usual_conversions.c:5:16: warning: right side of operator converted from negative value to unsigned: -2 to 18446744073709551614
#if (-42 + 0U) / -2
^
llvm-svn: 39406
|
|
|
|
|
|
| |
arithmetic conversions'.
llvm-svn: 39405
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
t.c:2:17: warning: integer overflow in preprocessor expression
#if -(INTMAX_MAX+1)
^
t.c:2:5: warning: integer overflow in preprocessor expression
#if -(INTMAX_MAX+1)
^
GCC has some seriously confused source locations in this case:
t.c:2:19: warning: integer overflow in preprocessor expression
t.c:2:20: warning: integer overflow in preprocessor expression
column 19/20 are off the end of the line.
llvm-svn: 39404
|
|
|
|
| |
llvm-svn: 39403
|
|
|
|
| |
llvm-svn: 39402
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
t.c:6:7: warning: integer overflow in preprocessor expression
#if 1 << 63
^
t.c:8:7: warning: integer overflow in preprocessor expression
#if 4 << 62
^
t.c:10:7: warning: integer overflow in preprocessor expression
#if 4 << 66
^
but no diagnostic on:
#if 1U << 63
llvm-svn: 39400
|
|
|
|
|
|
| |
test/Preprocessor/cxx_true.cpp
llvm-svn: 39399
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
like this:
t3.c:5:10: error: 'vers2.h' file not found
#include xstr(INCFILE(2).h)
^
instead of:
t3.c:5:10: error: file not found
#include xstr(INCFILE(2).h)
^
which is useful if the #include name is generated through macro expansion.
llvm-svn: 39398
|
|
|
|
|
|
|
|
|
|
|
| |
expression is live. For example:
#if 0 ? 124/0 : 42
should cause no error.
This implements test/Preprocessor/expr_liveness.c
llvm-svn: 39397
|
|
|
|
|
|
| |
#if 'a'
llvm-svn: 39393
|
|
|
|
| |
llvm-svn: 39390
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
constant expressions. This allows us to emit this diagnostic:
t.c:5:5: warning: integer constant is so large that it is unsigned
#if 12345678901234567890
^
And makes constant evaluation fully correct, but we do not yet detect and
warn about integer overflow.
This patch requires cvs up'ing the main llvm tree to get the APSInt class,
but no libraries need to be rebuilt there.
llvm-svn: 39388
|
|
|
|
|
|
|
| |
* signedness of values
* overflow of intermediate computations.
llvm-svn: 39387
|
|
|
|
| |
llvm-svn: 39386
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
sized to the target's intmax_t. This also allows us to emit diagnostic like:
t.c:11:5: warning: integer constant is too large for its type
#if 18446744073709551616 // 2^64
^
t.c:15:5: warning: integer constant is too large for its type
#if 18446744073709551617 // 2^64-1
^
llvm-svn: 39385
|
|
|
|
|
|
|
| |
* Detect overflow correctly. When it occurs, return the truncated value.
* Add fixme for radix analysis.
llvm-svn: 39382
|
|
|
|
|
|
| |
improvement is needed!
llvm-svn: 39381
|
|
|
|
| |
llvm-svn: 39378
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Submitted by:
Reviewed by:
Type Checking...round 2. This checkin "breaks" parsing carbon.h. I imagine
that this will be true for the next week or so. Nevertheless, this round of
changes includes the following:
- Hacked various Expr classes to pass the appropriate TypeRef. Still have
a few more classes to touch.
- Implement type checking for ParseArraySubscriptExpr and ParseMemberReferenceExpr.
- Added a debug hook to derive the class name for Stmt/Expr nodes. Currently a
linear search...could easily optimize if important.
- Changed the name of TaggedType->TagType. Now we have TagType and TagDecl (which
are easier to remember).
- Fixed a bug in StringLiteral conversion I did a couple weeks ago. hadError was
not initialized (oops).
- changed Sema::Diag to return true. This streamlines the type checking code
considerably.
- Added many diagnositics.
This should be it!
llvm-svn: 39361
|
|
|
|
|
|
|
|
|
|
|
| |
Submitted by:
Reviewed by:
Move string literal parsing from Sema=>LiteralSupport. This consolidates
all the quirky parsing code within the Lexer subsystem (yeah!). This
simplifies Sema and (more importantly) allows future parsers
(i.e. subclasses of Action) to benefit from this code.
llvm-svn: 39354
|
|
|
|
|
|
|
|
|
| |
Submitted by:
Reviewed by:
Misc. cleanup/polish of NumericLiteralParser and it's two clients, the
C preprocessor and AST builder...
llvm-svn: 39353
|
|
|
|
|
|
|
|
|
|
| |
Submitted by:
Reviewed by:
-Converted the preprocessor to use NumericLiteralParser.
-Several minor changes to LiteralSupport interface/implementation.
-Added an error diagnostic for floating point usage in pp expr's.
llvm-svn: 39352
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Submitted by:
Reviewed by:
Moved numeric literal support from SemaExpr.cpp to LiteralSupport.[h,cpp]
in Lex. This will allow it to be used by both Sema and Preprocessor (and
should be the last major refactoring of this sub-system).. Over
time, it will be reused by anyone implementing an actions module (i.e.
any subclass of llvm::clang::Action. Minor changes to IntegerLiteral in Expr.h.
More to come...
llvm-svn: 39351
|
|
|
|
| |
llvm-svn: 39336
|
|
|
|
| |
llvm-svn: 39334
|
|
|
|
| |
llvm-svn: 39333
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
llvm-svn: 39245
|
|
|
|
| |
llvm-svn: 39218
|
|
|
|
| |
llvm-svn: 39216
|
|
|
|
| |
llvm-svn: 39214
|
|
|
|
|
|
| |
state, not aspects of the language standard being parsed.
llvm-svn: 39209
|
|
|
|
| |
llvm-svn: 39208
|
|
|
|
|
|
|
| |
of having a loose collection of function pointers. This also allows clients to
maintain state, and reduces the size of the Preprocessor.h interface.
llvm-svn: 39203
|
|
|
|
| |
llvm-svn: 39128
|
|
|
|
| |
llvm-svn: 39127
|
|
|
|
| |
llvm-svn: 39102
|
|
|
|
| |
llvm-svn: 39095
|
|
|
|
| |
llvm-svn: 39093
|
|
|
|
|
|
|
|
|
| |
filenames (and also '#pragma GCC dependency' of course). Now, assuming
no cleaning is needed, we can go all the way from lexing the filename to
doing filename lookups with no mallocs. This speeds up user PP time from
0.077 to 0.075s for Cocoa.h (2.6%).
llvm-svn: 39092
|