| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
llvm-svn: 60136
|
| |
|
|
| |
llvm-svn: 59997
|
| |
|
|
| |
llvm-svn: 59921
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
with implicit quotes around them. This has a bunch of follow-on
effects and requires tweaking to a whole lot of code. This causes
a regression in two tests (xfailed) by causing it to emit things like:
Line 10: duplicate interface declaration for category 'MyClass1' ('Category1')
instead of:
Line 10: duplicate interface declaration for category 'MyClass1(Category1)'
I will fix this in a follow-up commit.
As part of this, I had to start switching stuff to use ->getDeclName() instead
of Decl::getName() for consistency. This is good, but I was planning to do this
as an independent patch. There will be several follow-on patches
to clean up some of the mess, but this patch is already too big.
llvm-svn: 59917
|
| |
|
|
|
|
|
|
|
| |
would not eat the "-1" in "0x0p-1", but LiteralSupport would accept
it when extensions are on. This caused strangeness and failures
when hexfloats were properly treated as an extension (not error)
in LiteralSupport.
llvm-svn: 59865
|
| |
|
|
|
|
|
|
| |
its call sites. This makes it more explicit when the hasError flag is
getting set and removes a confusing difference in behavior between
PP.Diag and Diag in this code.
llvm-svn: 59863
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(and carefully calculated) effect of allowing the compiler to reason
about the aliasing properties of DiagnosticBuilder object better,
allowing the whole thing to be promoted to registers instead of
resulting in a ton of stack traffic.
While I'm not very concerned about the performance of the Diag() method
invocations, I *am* more concerned about their code size and impact on the
non-diagnostic code. This patch shrinks the clang executable (in
release-asserts mode with gcc-4.2) from 14523980 to 14519816 bytes. This
isn't much, but it shrinks the lexer from 38192 to 37776, PPDirectives.o
from 31116 to 28868 bytes, etc.
llvm-svn: 59862
|
| |
|
|
| |
llvm-svn: 59860
|
| |
|
|
| |
llvm-svn: 59859
|
| |
|
|
| |
llvm-svn: 59858
|
| |
|
|
|
|
|
| |
force the caller to check instead. This eliminates the need (and the
risk!) of weird null DiagnosticBuilder's floating around.
llvm-svn: 59856
|
| |
|
|
|
|
|
|
|
|
| |
one for building up the diagnostic that is in flight (DiagnosticBuilder)
and one for pulling structured information out of the diagnostic when
formatting and presenting it.
There is no functionality change with this patch.
llvm-svn: 59849
|
| |
|
|
|
|
| |
handles transitions in the preprocessor state.
llvm-svn: 59845
|
| |
|
|
| |
llvm-svn: 59843
|
| |
|
|
|
|
| |
the file to include is checked for being an identifier.
llvm-svn: 59842
|
| |
|
|
|
|
| |
for #include directives.
llvm-svn: 59840
|
| |
|
|
|
|
| |
- Move out logic for handling the end-of-file to LexEndOfFile (to match the Lexer) class. The logic now mirrors the Lexer class more, which allows us to pass most of the Preprocessor test cases.
llvm-svn: 59768
|
| |
|
|
|
|
|
| |
- Move PTHLexer::GetToken() to be inside PTHLexer.cpp.
- When lexing in raw mode, null out identifiers.
llvm-svn: 59744
|
| |
|
|
|
|
| |
normal Lexer.
llvm-svn: 59736
|
| |
|
|
|
|
|
|
|
|
| |
- Rename 'CurToken' and 'LastToken' to 'CurTokenIdx' and 'LastTokenIdx'
respectively.
- Add helper methods GetToken(), AdvanceToken(), AtLastToken() to abstract away
details of the token stream. This also allows us to easily replace their
implementation later.
llvm-svn: 59733
|
| |
|
|
| |
llvm-svn: 59731
|
| |
|
|
|
|
| |
can do basic macro expansion using the PTHLexer.
llvm-svn: 59724
|
| |
|
|
|
|
|
|
|
|
| |
(temporary hack) to test the PTHLexer is that whenever we would create a Lexer
object we instead raw lex a memory buffer first and then use the PTHLexer. This
logic exists only to driver the PTHLexer and will be removed/changed in the
future. Note that the regular path using normal Lexer objects is what is used by
default.
llvm-svn: 59723
|
| |
|
|
| |
llvm-svn: 59695
|
| |
|
|
|
|
|
| |
a Lexer*. This means it will either return the current (normal) file Lexer or a
PTHLexer.
llvm-svn: 59694
|
| |
|
|
|
|
|
| |
information. A diff of the -E output for Cocoa.h shows that there is no change
in output.
llvm-svn: 59693
|
| |
|
|
|
|
| |
of Lexer* (narrower interface).
llvm-svn: 59691
|
| |
|
|
|
|
|
|
| |
LexingRawMode in the ctor of PreprocessorLexer.
- PTHLexer: Use "LastToken" instead of "NumToken"
llvm-svn: 59690
|
| |
|
|
|
|
| |
PTHLexer::DiscardToEndOfLine().
llvm-svn: 59687
|
| |
|
|
|
|
| |
an intermediate step to having getCurrentLexer() return a PreprocessorLexer* instead of a Lexer*.
llvm-svn: 59672
|
| |
|
|
|
|
| |
Use PTHLexer::isNextPPTokenLParen() when using the PTHLexer.
llvm-svn: 59671
|
| |
|
|
| |
llvm-svn: 59670
|
| |
|
|
| |
llvm-svn: 59668
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
- Add variants of IsNonPragmaNonMacroLexer to accept an IncludeMacroStack entry
(simplifies some uses).
- Use IsNonPragmaNonMacroLexer in Preprocessor::LookupFile.
- Add 'FileID' to PreprocessorLexer, and have Preprocessor query this fileid
when looking up the FileEntry for a file
Performance testing of -Eonly on Cocoa.h shows no performance regression because
of this patch.
llvm-svn: 59666
|
| |
|
|
|
|
| |
Patch contributed by Jay Foad!
llvm-svn: 59656
|
| |
|
|
|
|
| |
can be provided by using Preprocessor::isBacktrackEnabled().
llvm-svn: 59631
|
| |
|
|
| |
llvm-svn: 59602
|
| |
|
|
| |
llvm-svn: 59579
|
| |
|
|
|
|
|
|
|
|
|
| |
- Add variants of IsNonPragmaNonMacroLexer to accept an IncludeMacroStack entry
(simplifies some uses).
- Use IsNonPragmaNonMacroLexer in Preprocessor::LookupFile.
Performance testing of -Eonly on Cocoa.h shows no performance regression because
of this patch.
llvm-svn: 59574
|
| |
|
|
| |
llvm-svn: 59573
|
| |
|
|
| |
llvm-svn: 59554
|
| |
|
|
| |
llvm-svn: 59512
|
| |
|
|
|
|
| |
methods.
llvm-svn: 59511
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
are formed. In particular, a diagnostic with all its strings and ranges is now
packaged up and sent to DiagnosticClients as a DiagnosticInfo instead of as a
ton of random stuff. This has the benefit of simplifying the interface, making
it more extensible, and allowing us to do more checking for things like access
past the end of the various arrays passed in.
In addition to introducing DiagnosticInfo, this also substantially changes how
Diagnostic::Report works. Instead of being passed in all of the info required
to issue a diagnostic, Report now takes only the required info (a location and
ID) and returns a fresh DiagnosticInfo *by value*. The caller is then free to
stuff strings and ranges into the DiagnosticInfo with the << operator. When
the dtor runs on the DiagnosticInfo object (which should happen at the end of
the statement), the diagnostic is actually emitted with all of the accumulated
information. This is a somewhat tricky dance, but it means that the
accumulated DiagnosticInfo is allowed to keep pointers to other expression
temporaries without those pointers getting invalidated.
This is just the minimal change to get this stuff working, but this will allow
us to eliminate the zillions of variant "Diag" methods scattered throughout
(e.g.) sema. For example, instead of calling:
Diag(BuiltinLoc, diag::err_overload_no_match, typeNames,
SourceRange(BuiltinLoc, RParenLoc));
We will soon be able to just do:
Diag(BuiltinLoc, diag::err_overload_no_match)
<< typeNames << SourceRange(BuiltinLoc, RParenLoc));
This scales better to support arbitrary types being passed in (not just
strings) in a type-safe way. Go operator overloading?!
llvm-svn: 59502
|
| |
|
|
|
|
|
|
| |
strings instead of array of strings. This reduces string copying
in some not-very-important cases, but paves the way for future
improvements.
llvm-svn: 59494
|
| |
|
|
|
|
|
|
|
| |
- Add static method to test if the current lexer is a non-macro/non-pragma
lexer.
- Refactor some code in PPLexerChange to use this static method.
- No performance change.
llvm-svn: 59486
|
| |
|
|
| |
llvm-svn: 59482
|
| |
|
|
|
|
|
| |
Performance tests on Cocoa.h (using the regular Lexer) shows no performance
difference.
llvm-svn: 59479
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This is because the PTHLexer will not support this method. Performance testing
on preprocessing Cocoa.h shows that this results in a negligible performance
difference (less than 1%).
I tried making Lexer::SetCommentRetentionState() an out-of-line function (a
precursor to making it a virtual function in PreprocessorLexer) and noticed a 1%
decrease in speed (it is called in a hot part of the Preprocessor).
llvm-svn: 59477
|
| |
|
|
|
|
|
|
| |
alias for the current PreprocessorLexer. No functionality change. Performance
testing shows this results in no performance degradation when preprocessing
Cocoa.h.
llvm-svn: 59474
|