| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
llvm-svn: 138475
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
regression due
to increased calls to SourceManager::getFileID. (rdar://9992664)
Use a slightly different approach that is more efficient both in terms of speed
(no extra getFileID calls) and in SLocEntries reduction.
Comparing pre-r138129 and this patch we get:
For compiling SemaExpr.cpp reduction of SLocEntries by 26%.
For the boost enum library:
-SLocEntries -34% (note that this was -5% for r138129)
-Memory consumption -50%
-PCH size -31%
Reduced SLocEntries also benefit the hot function SourceManager::getFileID,
evident by the reduced "FileID scans".
llvm-svn: 138380
|
|
|
|
|
|
|
|
| |
of isInFileID
since it is a bit more efficient.
llvm-svn: 138379
|
|
|
|
| |
llvm-svn: 138378
|
|
|
|
|
|
| |
SourceLocation.
llvm-svn: 138377
|
|
|
|
|
|
| |
the extra SourceManager::getFileID call.
llvm-svn: 138376
|
|
|
|
| |
llvm-svn: 138257
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently getMacroArgExpandedLocation is very inefficient and for the case
of a location pointing at the main file it will end up checking almost all of
the SLocEntries. Make it faster:
-Use a map of macro argument chunks to their expanded source location. The map
is for a single source file, it's stored in the file's ContentCache and lazily
computed, like the source lines cache.
-In SLocEntry's FileInfo add an 'unsigned NumCreatedFIDs' field that keeps track
of the number of FileIDs (files and macros) that were created during preprocessing
of that particular file SLocEntry. This is useful when computing the macro argument
map in skipping included files while scanning for macro arg FileIDs that lexed from
a specific source file. Due to padding, the new field does not increase the size
of SLocEntry.
llvm-svn: 138225
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
for tokens that are lexed consecutively from the same FileID, instead of creating
a SLocEntry for each token. e.g for
assert(foo == bar);
there will be a single SLocEntry for the "foo == bar" chunk and locations
for the 'foo', '==', 'bar' tokens will point inside that chunk.
For parsing SemaExpr.cpp, this reduced the number of SLocEntries by 25%.
llvm-svn: 138129
|
|
|
|
|
|
| |
getExpansionLocForMacroDefLoc, no functionality change.
llvm-svn: 138128
|
|
|
|
| |
llvm-svn: 138031
|
|
|
|
| |
llvm-svn: 137973
|
|
|
|
|
|
| |
of expansion (for function macros it includes the right paren).
llvm-svn: 137909
|
|
|
|
| |
llvm-svn: 137795
|
|
|
|
| |
llvm-svn: 137430
|
|
|
|
| |
llvm-svn: 137301
|
|
|
|
| |
llvm-svn: 137298
|
|
|
|
| |
llvm-svn: 137039
|
|
|
|
|
|
| |
because we don't support them yet.
llvm-svn: 137027
|
|
|
|
| |
llvm-svn: 136788
|
|
|
|
|
|
|
|
|
|
|
| |
1. Be more tolerant of comments in -CC (comment-preserving) mode. We were missing a few cases.
2. Make sure to expand the second FOO in "#if defined FOO FOO". (See also
r97253, which addressed the case of "#if defined(FOO FOO".)
Fixes PR10286.
llvm-svn: 136748
|
|
|
|
| |
llvm-svn: 136561
|
|
|
|
|
|
|
| |
libstdc++ hack has reverted these type traits to keywords. Icky, but
fixes <rdar://problem/9836262>.
llvm-svn: 136560
|
|
|
|
|
|
|
| |
a fallback, if normal header search fails. Another attempt at
<rdar://problem/9824020>.
llvm-svn: 136557
|
|
|
|
|
|
|
| |
for quoted header lookup when dealing with not-yet-installed
frameworks. Fixes <rdar://problem/9824020>.
llvm-svn: 136331
|
|
|
|
|
|
| |
after the given location. (It is a generalized version of trans::findLocationAfterSemi from ArcMigrate, which will be changed to use the Lexer utility).
llvm-svn: 136268
|
|
|
|
| |
llvm-svn: 136239
|
|
|
|
| |
llvm-svn: 136238
|
|
|
|
| |
llvm-svn: 136237
|
|
|
|
| |
llvm-svn: 136210
|
|
|
|
|
|
|
| |
This required converting the StringMaps to use a BumpPtrAllocator. I measured the
compile time and saw no observable regression.
llvm-svn: 136190
|
|
|
|
|
|
|
|
|
|
| |
PreprocessingRecord::getTotalMemory().
Most of the memory was already reported; but now we report more memory from side data structures.
Fixes <rdar://problem/9379717>.
llvm-svn: 136150
|
|
|
|
|
|
|
|
| |
etc. With this I think essentially all of the SourceManager APIs are
converted. Comments and random other bits of cleanup should be all thats
left.
llvm-svn: 136057
|
|
|
|
|
|
|
|
|
| |
and various other 'expansion' based terms. I've tried to reformat where
appropriate and catch as many references in comments but I'm going to do
several more passes. Also I've tried to expand parameter names to be
more clear where appropriate.
llvm-svn: 136056
|
|
|
|
| |
llvm-svn: 136054
|
|
|
|
| |
llvm-svn: 135962
|
|
|
|
|
|
| |
getImmediateExpansionRange.
llvm-svn: 135960
|
|
|
|
| |
llvm-svn: 135915
|
|
|
|
|
|
|
|
| |
FullSourceLoc::getInstantiationLoc to ...::getExpansionLoc. This is part
of the API and documentation update from 'instantiation' as the term for
macros to 'expansion'.
llvm-svn: 135914
|
|
|
|
|
|
| |
Mulder!
llvm-svn: 135855
|
|
|
|
|
|
|
|
| |
LLVM.h imports
them into the clang namespace.
llvm-svn: 135852
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
entities generated directly by the preprocessor from those loaded from
the external source (e.g., the ASTReader). By separating these two
sets of entities into different vectors, we allow both to grow
independently, and eliminate the need for preallocating all of the
loaded preprocessing entities. This is similar to the way the recent
SourceManager refactoring treats FileIDs and the source location
address space.
As part of this, switch over to building a continuous range map to
track preprocessing entities.
llvm-svn: 135646
|
|
|
|
| |
llvm-svn: 135545
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
source locations from source locations loaded from an AST/PCH file.
Previously, loading an AST/PCH file involved carefully pre-allocating
space at the beginning of the source manager for the source locations
and FileIDs that correspond to the prefix, and then appending the
source locations/FileIDs used for parsing the remaining translation
unit. This design forced us into loading PCH files early, as a prefix,
whic has become a rather significant limitation.
This patch splits the SourceManager space into two parts: for source
location "addresses", the lower values (growing upward) are used to
describe parsed code, while upper values (growing downward) are used
for source locations loaded from AST/PCH files. Similarly, positive
FileIDs are used to describe parsed code while negative FileIDs are
used to file/macro locations loaded from AST/PCH files. As a result,
we can load PCH/AST files even during parsing, making various
improvemnts in the future possible, e.g., teaching #include <foo.h> to
look for and load <foo.h.gch> if it happens to be already available.
This patch was originally written by Sebastian Redl, then brought
forward to the modern age by Jonathan Turner, and finally
polished/finished by me to be committed.
llvm-svn: 135484
|
|
|
|
|
|
| |
correctly impelmented
llvm-svn: 135401
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
variants to 'expand'. This changed a couple of public APIs, including
one public type "MacroInstantiation" which is now "MacroExpansion". The
rest of the codebase was updated to reflect this, especially the
libclang code. Two of the C++ (and thus easily changed) libclang APIs
were updated as well because they pertained directly to the old
MacroInstantiation class.
No functionality changed.
llvm-svn: 135139
|
|
|
|
|
|
|
|
|
| |
'expand'. Also update the public API it provides to the new term, and
propagate that update to the various clients.
No functionality changed.
llvm-svn: 135138
|
|
|
|
|
|
|
|
|
| |
to 'expand' for macros. Only comments and uses local to the TokenLexer
are updated.
No functionality changed.
llvm-svn: 135137
|
|
|
|
| |
llvm-svn: 134996
|
|
|
|
|
|
| |
file. rdar://9745065
llvm-svn: 134919
|