|  | Commit message (Collapse) | Author | Age | Files | Lines | 
|---|
| | 
| 
| 
| 
| 
| | using new/delete.  This speeds up -Eonly on Cocoa.h using the regular lexer by 1.8% and the PTHLexer by 3%.
llvm-svn: 61042 | 
| | 
| 
| 
| 
| 
| | use identifierinfo instead.  Patch by Chris Goller!
llvm-svn: 60992 | 
| | 
| 
| 
| 
| 
| | table used for fast preprocessor block skipping.  This has a minor performance improvement when preprocessing Cocoa.h, but can have some wins in pathologic cases.
llvm-svn: 60966 | 
| | 
| 
| 
| 
| 
| | skipped preprocessor blocks.  This improves PTH speed by 6%.  The code for this optimization itself is not very optimized, and will get cleaned up.
llvm-svn: 60956 | 
| | 
| 
| 
| | llvm-svn: 60942 | 
| | 
| 
| 
| | llvm-svn: 60937 | 
| | 
| 
| 
| 
| 
| 
| | - Added a side-table per each token-cached file with the preprocessor conditional stack.  This tracks what #if's are matched with what #endifs and where their respective tokens are in the PTH file.  This will allow for quick skipping of excluded conditional branches in the Preprocessor.
- Performance testing shows the addition of this information (without actually utilizing it) leads to no performance regressions.
llvm-svn: 60911 | 
| | 
| 
| 
| 
| 
| | means to jump ahead in the token stream.
llvm-svn: 60905 | 
| | 
| 
| 
| | llvm-svn: 60896 | 
| | 
| 
| 
| 
| 
| 
| 
| | - Added virtual method 'getSourceLocation()' (no arguments) that gets the location of the next "observable" location (e.g., next character, next token).
PPLexerChange.cpp:
- Implemented FIXME by using PreprocessorLexer::getSourceLocation() to get the location in the file we are returning to after lexing a #included file.  This appears to be slightly faster than having the branch (i.e., 'if(CurLexer)').  It's also not a really hot part of the Preprocessor.
llvm-svn: 60860 | 
| | 
| 
| 
| 
| 
| | cleaner.  No performance change.
llvm-svn: 60843 | 
| | 
| 
| 
| | llvm-svn: 60559 | 
| | 
| 
| 
| | llvm-svn: 60556 | 
| | 
| 
| 
| 
| 
| | Use an array instead of a DenseMap to cache persistent IDs -> IdentifierInfo*.  This leads to a 4% speedup at -fsyntax-only using PTH.
llvm-svn: 60452 | 
| | 
| 
| 
| 
| 
| 
| 
| | some of the internal methods are used by PTHLexer (their implementations are intertwined.)  This enables some important inlining opportunities at -O3.
- Don't construct an std::vector<Token> prior to feeding PTH tokens to the Preprocessor.  Stream them off the PTH file directly.
llvm-svn: 60447 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | - Added method "setPTHManager" that will be called by the driver to install
  a PTHManager for the Preprocessor.
- Fixed some comments.
- Added EnterSourceFileWithPTH to mirror EnterSourceFileWithLexer.
llvm-svn: 60437 | 
| | 
| 
| 
| 
| 
| | lazily create PTHLexer objects for pre-tokenized files.
llvm-svn: 60436 | 
| | 
| 
| 
| | llvm-svn: 60373 | 
| | 
| 
| 
| 
| 
| 
| | __ASSEMBLER__ properly. Patch from Roman Divacky (with minor
formatting changes). Thanks!
llvm-svn: 60362 | 
| | 
| 
| 
| | 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 |