| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
even whitespace, as tokens from the file. This is enabled with
L->SetKeepWhitespaceMode(true) on a raw lexer. In this mode, you too
can use clang as a really complex version of 'cat' with code like this:
Lexer RawLex(SourceLocation::getFileLoc(SM.getMainFileID(), 0),
PP.getLangOptions(), File.first, File.second);
RawLex.SetKeepWhitespaceMode(true);
Token RawTok;
RawLex.LexFromRawLexer(RawTok);
while (RawTok.isNot(tok::eof)) {
std::cout << PP.getSpelling(RawTok);
RawLex.LexFromRawLexer(RawTok);
}
This will emit exactly the input file, with no canonicalization or other
translation. Realistic clients actually do something with the tokens of
course :)
llvm-svn: 57401
|
| |
|
|
| |
llvm-svn: 57399
|
| |
|
|
| |
llvm-svn: 57398
|
| |
|
|
|
|
| |
ivar.
llvm-svn: 57397
|
| |
|
|
| |
llvm-svn: 57396
|
| |
|
|
|
|
|
|
| |
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
|
| |
|
|
| |
llvm-svn: 57394
|
| |
|
|
|
|
|
|
|
|
|
| |
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: 57391
|
| |
|
|
| |
llvm-svn: 57389
|
| |
|
|
|
|
| |
won't expand to the builtin. This fixes rdar://6248329
llvm-svn: 57164
|
| |
|
|
|
|
| |
target indep code.
llvm-svn: 57139
|
| |
|
|
| |
llvm-svn: 57137
|
| |
|
|
| |
llvm-svn: 57134
|
| |
|
|
|
|
|
|
|
|
| |
target indep code.
Note that this changes functionality on PIC16: it defines __INT_MAX__
correctly for it, and it changes sizeof(long) to 16-bits (to match
the size of pointer).
llvm-svn: 57132
|
| |
|
|
|
|
| |
integer size #defines over to the Preprocessor.
llvm-svn: 57130
|
| |
|
|
| |
llvm-svn: 57129
|
| |
|
|
|
|
| |
then target specific.
llvm-svn: 57128
|
| |
|
|
| |
llvm-svn: 57127
|
| |
|
|
|
|
| |
- No functionality change.
llvm-svn: 57065
|
| |
|
|
| |
llvm-svn: 56876
|
| |
|
|
| |
llvm-svn: 56824
|
| |
|
|
| |
llvm-svn: 56822
|
| |
|
|
|
|
|
|
|
|
|
|
| |
NumericLiteral parser is not careful about overrun because
it should never be possible. It implicitly expects that its
input matched the regex for pp-constant. Because of this, it
knows it can't be pointing to a prefix of something that
looks like a number. This is all fine, except that __LINE__
does not prevent implicit concatenation from happening. Fix
__LINE__ to not do this.
llvm-svn: 56818
|
| |
|
|
| |
llvm-svn: 56776
|
| |
|
|
|
|
| |
DirectoryLookup::DirType into SourceManager.h
llvm-svn: 56692
|
| |
|
|
|
|
|
|
|
|
|
| |
to whether the fileid is a 'extern c system header' in addition to whether it
is a system header, most of this is spreading plumbing around. Once we have that,
PPLexerChange bases its "file enter/exit" notifications to PPCallbacks to
base the system header state on FileIDInfo instead of HeaderSearch. Finally,
in Preprocessor::HandleIncludeDirective, mirror logic in GCC: the system headerness
of a file being entered can be set due to the #includer or the #includee.
llvm-svn: 56688
|
| |
|
|
|
|
| |
- This really needs to be automated and configurable.
llvm-svn: 56635
|
| |
|
|
| |
llvm-svn: 56503
|
| |
|
|
| |
llvm-svn: 55829
|
| |
|
|
|
|
| |
- Replace FIXME in Preprocessor::HandleIdentifier() with a check that avoids diagnosing extension tokens that originate from macro definitions.
llvm-svn: 55639
|
| |
|
|
| |
llvm-svn: 55637
|
| |
|
|
| |
llvm-svn: 55635
|
| |
|
|
|
|
|
|
| |
Note that this isn't really a complete fix; I think there are other
potential overrun situations. I don't really know what the best
systematic fix is, though.
llvm-svn: 55622
|
| |
|
|
| |
llvm-svn: 55281
|
| |
|
|
|
|
| |
Make sure there's no "dangling" backtrack position when Preprocessor is destroyed.
llvm-svn: 55236
|
| |
|
|
| |
llvm-svn: 55235
|
| |
|
|
| |
llvm-svn: 55204
|
| |
|
|
| |
llvm-svn: 54874
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Added as private members for each because it is not clear where to
put the common definition. Perhaps the IdentifierInfos all of these
"pseudo-keywords" should be collected into one place (this would
KnownFunctionIDs and Objective-C property IDs, for example).
Remove Token::isNamedIdentifier.
- There isn't a good reason to use strcmp when we have interned
strings, and there isn't a good reason to encourage clients to do
so.
llvm-svn: 54794
|
| |
|
|
|
|
|
| |
InitializePredefinedMacros().
- Also now properly wired to -fobjc-gc, -fnext-runtime.
llvm-svn: 54661
|
| |
|
|
| |
llvm-svn: 54652
|
| |
|
|
|
|
|
|
|
|
|
| |
- Kill unnecessary #includes in .cpp files. This is an automatic
sweep so some things removed are actually used, but happen to be
included by a previous header. I tried to get rid of the obvious
examples and this was the easiest way to trim the #includes in one
fell swoop.
- We now return to regularly scheduled development.
llvm-svn: 54632
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Move FormatError() from TextDiagnostic up to DiagClient, remove now
empty class TextDiagnostic
* Make DiagClient optional for Diagnostic
This fixes the following problems:
* -html-diags (and probably others) does now output the same set of
warnings as console clang does
* nothing crashes if one forgets to call setHeaderSearch() on
TextDiagnostic
* some code duplication is removed
llvm-svn: 54620
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
efficient lookahead and backtracking.
1) New public methods added:
-EnableBacktrackAtThisPos
-DisableBacktrack
-Backtrack
-isBacktrackEnabled
2) LookAhead() implementation is replaced with a more efficient one.
3) LookNext() is removed.
llvm-svn: 54611
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
t2.c:1:17: warning: hexadecimal floating constants are a C99 feature
long double d = 0x0.0000003ffffffff00000p-16357L;
^
instead of emitting a weird error message that doesn't make sense:
t2.c:1:41: error: hexadecimal floating constants require an exponent
long double d = 0x0.0000003ffffffff00000p-16357L;
^
rdar://6096838
llvm-svn: 54035
|
| |
|
|
|
|
|
| |
"When dumping the tokens (-dumptokens output type), the column numbers are not
correctly shown. This patch fixes that issue."
llvm-svn: 53796
|
| |
|
|
| |
llvm-svn: 53519
|
| |
|
|
|
|
| |
'take a peek' at the next token without consuming it.
llvm-svn: 53375
|
| |
|
|
|
|
| |
really belongs
llvm-svn: 53149
|