| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
LookUpIdentifierInfo() will automatically do
llvm-svn: 98435
|
|
|
|
|
|
|
| |
not a token number. Fix the reserve logic to get the right
amount of space.
llvm-svn: 92202
|
|
|
|
| |
llvm-svn: 92055
|
|
|
|
|
|
|
| |
on 64-bit targets. Pass Preprocessor into create/destroy methods of MacroArgs
even though it isn't used yet.
llvm-svn: 91345
|
|
|
|
| |
llvm-svn: 90543
|
|
|
|
| |
llvm-svn: 81346
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
diagnostic to include the full instantiation location for the
invalid paste. For:
#define foo(a, b) a ## b
#define bar(x) foo(x, ])
bar(a)
bar(zdy)
Instead of:
t.c:3:22: error: pasting formed 'a]', an invalid preprocessing token
#define foo(a, b) a ## b
^
t.c:3:22: error: pasting formed 'zdy]', an invalid preprocessing token
we now produce:
t.c:7:1: error: pasting formed 'a]', an invalid preprocessing token
bar(a)
^
t.c:4:16: note: instantiated from:
#define bar(x) foo(x, ])
^
t.c:3:22: note: instantiated from:
#define foo(a, b) a ## b
^
t.c:8:1: error: pasting formed 'zdy]', an invalid preprocessing token
bar(zdy)
^
t.c:4:16: note: instantiated from:
#define bar(x) foo(x, ])
^
t.c:3:22: note: instantiated from:
#define foo(a, b) a ## b
^
llvm-svn: 72519
|
|
|
|
| |
llvm-svn: 72497
|
|
|
|
| |
llvm-svn: 72386
|
|
|
|
|
|
| |
the RHS. Fixes assembler-with-cpp issue reported on cfe-dev.
llvm-svn: 72370
|
|
|
|
|
|
|
|
| |
Preprocessor::EnterTokenStream.
So check for annotation before using the Token's IdentifierInfo.
llvm-svn: 72278
|
|
|
|
|
|
| |
pasted token.
llvm-svn: 70793
|
|
|
|
| |
llvm-svn: 70086
|
|
|
|
|
|
|
| |
for a token is set, this makes the diagnostic "expanded from stack" work
for this diagnostic. Add a testcase for PR3918.
llvm-svn: 69544
|
|
|
|
|
|
|
| |
by rejecting invalid poisoned tokens in the token
pasting path.
llvm-svn: 69536
|
|
|
|
|
|
|
| |
This matters in assembler mode, where this is silently allowed.
This fixes rdar://6709206.
llvm-svn: 67539
|
|
|
|
|
|
|
|
|
| |
#define Y X ## .
Y
are ok in .S files.
llvm-svn: 67231
|
|
|
|
|
|
|
| |
\0's to created tokens instead of making all clients do it. No functionality
change.
llvm-svn: 66373
|
|
|
|
|
|
|
| |
preexpanded macro arguments from the preprocessor's bump pointer.
This reduces # mallocs from 12444 to 11792.
llvm-svn: 66025
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now instead of just tracking the expansion history, also track the full
range of the macro that got replaced. For object-like macros, this doesn't
change anything. For _Pragma and function-like macros, this means we track
the locations of the ')'.
This is required for PR3579 because apparently GCC uses the line of the ')'
of a function-like macro as the location to expand __LINE__ to.
llvm-svn: 64601
|
|
|
|
|
|
| |
redundant #includes. Patch by Anders Johnsen!
llvm-svn: 63271
|
|
|
|
|
|
|
|
|
| |
.def file for each library. This means that adding a diagnostic
to sema doesn't require all the other libraries to be rebuilt.
Patch by Anders Johnsen!
llvm-svn: 63111
|
|
|
|
|
|
|
|
|
|
|
| |
instantiation history in an effort to speed up c99-intconst-1.c.
Now that multiple nested instantiations are allowed, we just
make them and don't pay the cost of lookups. With the other
changes that went in before this, reverting this is actually
a speedup for c99-intconst-1.c, speeding it up from 1.96s to 1.80s,
and preserves much better loc info.
llvm-svn: 63036
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Token now has a class of kinds for "literals", which include
numeric constants, strings, etc. These tokens can optionally have
a pointer to the start of the token in the lexer buffer. This
makes it faster to get spelling and do other gymnastics, because we
don't have to go through source locations.
This change is performance neutral, but will make other changes
more feasible down the road.
llvm-svn: 63028
|
|
|
|
|
|
|
|
| |
per token lexed from it. This speeds up clang on c99-intconst-1.c from
the GCC testsuite from 3.64s to 2.66s (36%). This reduces the number of
binary search FileID lookups from 251570522 to 114175649 on this testcase.
llvm-svn: 62992
|
|
|
|
|
|
|
|
|
|
| |
ground work for implementing #line, and fixes the "out of macro ID's"
problem.
There is nothing particularly tricky about the code, other than the
very performance sensitive SourceManager::getFileID() method.
llvm-svn: 62978
|
|
|
|
|
|
|
|
|
|
| |
Refactor how the preprocessor changes a token from being an tok::identifier to a
keyword (e.g. tok::kw_for). Instead of doing this in HandleIdentifier, hoist this
common case out into the caller, so that every keyword doesn't have to go through
HandleIdentifier. This drops time in HandleIdentifier from 1.25ms to .62ms, and
speeds up clang -Eonly with PTH by about 1%.
llvm-svn: 62855
|
|
|
|
|
|
|
|
|
| |
tells us whether Preprocessor::HandleIdentifier needs to be called.
Because this method is only rarely needed, this saves a call and a
bunch of random checks. This drops the time in HandleIdentifier
from 3.52ms to .98ms on cocoa.h on my machine.
llvm-svn: 62675
|
|
|
|
|
|
|
| |
SourceLocation. This requires making some cleanups to token pasting
and _Pragma expansion.
llvm-svn: 62490
|
|
|
|
|
|
| |
embedded magic.
llvm-svn: 62417
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
"FileID" a concept that is now enforced by the compiler's type checker
instead of yet-another-random-unsigned floating around.
This is an important distinction from the "FileID" currently tracked by
SourceLocation. *That* FileID may refer to the start of a file or to a
chunk within it. The new FileID *only* refers to the file (and its
#include stack and eventually #line data), it cannot refer to a chunk.
FileID is a completely opaque datatype to all clients, only SourceManager
is allowed to poke and prod it.
llvm-svn: 62407
|
|
|
|
| |
llvm-svn: 59554
|
|
|
|
|
|
|
|
| |
same we we do an unterminated string or character literal. This makes
it so we can guarantee that the lexer never calls into the
preprocessor (which would be suicide for a raw lexer).
llvm-svn: 57395
|
|
|
|
|
|
|
|
|
|
|
| |
using LexRawToken, create one and use LexFromRawLexer. This avoids
twiddling the RawLexer flag around and simplifies some code (even
speeding raw lexing up a tiny bit).
This change also improves the token paster to use a Lexer on the stack
instead of new/deleting it.
llvm-svn: 57393
|
|
|
|
| |
llvm-svn: 56776
|
|
lib dir and move all the libraries into it. This follows the main
llvm tree, and allows the libraries to be built in parallel. The
top level now enforces that all the libs are built before Driver,
but we don't care what order the libs are built in. This speeds
up parallel builds, particularly incremental ones.
llvm-svn: 48402
|