History log of /external/clang/lib/Lex/PreprocessingRecord.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
cd6b34b8cd5f99450e32a32b1f1024324f3566e7 22-Jun-2012 James Dennett <jdennett@google.com> Documentation cleanup:
* Use \p param for a parameter reference, not the (erroneous) form \arg param;
* Escape # characters in Doxygen comments as needed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158971 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
db81d38d9cd468a9eeffe8ab092be4d48e43888e 27-Mar-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [preprocessor] Handle correctly inclusion directives that have macro expansions, e.g
"#include MACRO(STUFF)".

-As an inclusion position for the included file, use the file location of the file where it
was included but *after* the macro expansions. We want the macro expansions to be considered
as before-in-translation-unit for everything in the included file.

-In the preprocessing record take into account that only inclusion directives can be encountered
as "out-of-order" (by comparing the start of the range which for inclusions is the hash location)
and use binary search if there is an extreme number of macro expansions in the include directive.

Fixes rdar://11111779

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153527 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
7e42392eb2ea29ddeb6d125417fb4c17d847b5e0 24-Mar-2012 Benjamin Kramer <benny.kra@googlemail.com> Simplify some users of DenseMap::erase.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153389 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
c6c54521f95760a5eaf29b668d4bf41fe2af49d7 05-Mar-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [preprocessor] Enhance PreprocessingRecord to keep track of locations of conditional directives.

Introduce PreprocessingRecord::rangeIntersectsConditionalDirective() which returns
true if a given range intersects with a conditional directive block.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152018 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
e1d4330adaaa7faf093e725c9c993207eb2d778a 25-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't record nested macro expansions in the preprocessing record,
it can only bring pain when dealing with preprocessor abuse (see: boost).

rdar://10898986

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151427 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
7530c034c0c71a64c5a9173206d9742ae847af8b 17-Jan-2012 David Blaikie <dblaikie@gmail.com> Remove unreachable code in Clang. (replace with llvm_unreachable where appropriate or when GCC requires it)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148292 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
f226ff9fe8c8db6c5b74a61ce649eda1491c3502 25-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [PCH] When visiting preprocessed entities, make it possible to avoid deserializing
preprocessed entities that are #included in the range that we are interested.

This is useful when we are interested in preprocessed entities of a specific file, e.g
when we are annotating tokens. There is also an optimization where we cache the last
result of PreprocessingRecord::getPreprocessedEntitiesInRange and we re-use it if
there is a call with the same range as before.

rdar://10313365

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142887 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
209dfbe638d8a2ea85eac255a919381962b80704 12-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Handle the case where preprocessor entities are not received in order,
fixes http://llvm.org/PR11120

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141788 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
4cd06348a8c7b3559e9f437439dfc75ff7a04e88 22-Sep-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Do manual binary search for preprocessing entities because their end locations
may be unordered and MSVC's debug-mode doesn't like it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140337 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
196e71e1357b14076c42f4a3458e6ea71714eb06 21-Sep-2011 Benjamin Kramer <benny.kra@googlemail.com> More MSVC9 unbreaking.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140256 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
2502efd26196d5bbc1f320181aea765d469309b4 21-Sep-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] When pointing at a macro expansion inside a macro argument,
return a cursor for the inner macro.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140207 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
de4e0a8e57e643bbe78ad37ad6023c45a8a9f7e2 21-Sep-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> The location of the name in MacroDefinition is the beginning of its range,
don't store an extra location for it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140190 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
0e322ffdae588aa479ae077ea569803b24bbe63b 20-Sep-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix gcc build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140073 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
b6441ef9b7285bd1aa77b05b10f473f7a3f413e7 19-Sep-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce local_begin()/local_end() methods in PreprocessingRecord which
return iterators for local, non-loaded, preprocessed entities.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140062 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
2dbaca748bc3eb6539f417bd8354c930bdf88fa4 19-Sep-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce PreprocessingRecord::getPreprocessedEntitiesInRange()
which will do a binary search and return a pair of iterators
for preprocessed entities in the given source range.

Source ranges of preprocessed entities are stored twice currently in
the PCH/Module file but this will be fixed in a subsequent commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140058 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
e24692b30adbe8144597678a0e3354912e99c747 15-Sep-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [PCH] Overhaul how preprocessed entities are [de]serialized.

-Use an array of offsets for all preprocessed entities
-Get rid of the separate array of offsets for just macro definitions;
for references to macro definitions use an index inside the preprocessed
entities array.
-Deserialize each preprocessed entity lazily, at first request; not in bulk.

Paves the way for binary searching of preprocessed entities that will offer
efficiency and will simplify things on the libclang side a lot.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139809 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
8f7c540ac42370c40ebcdc4b69018c938faf94ec 08-Sep-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Fix annotation and getting a "macro expansion" cursor
for a builtin macro expansion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139298 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
1b2d53647dda5e4a70cea54ec3bedbf167081120 18-Aug-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> For the MacroExpands preprocessor callback, also pass the SourceRange
of expansion (for function macros it includes the right paren).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137909 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
e3c20a8cf8b5fdbd88c416a25452179a5a9f3b56 27-Jul-2011 Ted Kremenek <kremenek@apple.com> Change PreprocessingRecord::getTotalMemory() to use llvm::capacity_in_bytes().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136238 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
91d1bd6ede1d101a2e49719250c33154b39e0016 26-Jul-2011 Ted Kremenek <kremenek@apple.com> Report more memory using in Preprocessor::getTotalMemory() and PreprocessingRecord::getTotalMemory().

Most of the memory was already reported; but now we report more memory from side data structures.

Fixes <rdar://problem/9379717>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136150 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
5f9e272e632e951b1efe824cd16acb4d96077930 23-Jul-2011 Chris Lattner <sabre@nondot.org> remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports
them into the clang namespace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135852 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
4c30bb148b53c8063e940ca3e049ba4d270dc9d5 21-Jul-2011 Douglas Gregor <dgregor@apple.com> Rework the detailed preprocessing record to separate preprocessing
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.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135646 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
9e5bb85ac899eeab7c21b5ff9030c3da6ff4837b 14-Jul-2011 Chandler Carruth <chandlerc@gmail.com> Move the rest of the preprocessor terminology from 'instantiate' and
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135139 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
dca8ee8b7bc86076916a3a80f553f7a4e98c14af 06-May-2011 Douglas Gregor <dgregor@apple.com> Introduce a new libclang parsing flag,
CXTranslationUnit_NestedMacroInstantiations, which indicates whether
we want to see "nested" macro instantiations (e.g., those that occur
inside other macro instantiations) within the detailed preprocessing
record. Many clients (e.g., those that only care about visible tokens)
don't care about this information, and in code that uses preprocessor
metaprogramming, this information can have a very high cost.

Addresses <rdar://problem/9389320>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130990 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
7412494982c8b50c90961302c3a718633b2c3ab7 26-Apr-2011 Manuel Klimek <klimek@google.com> To be able to replay compilations we need to accurately remodel how
includes get resolved, especially when they are found relatively to
another include file. We also try to get it working for framework
includes, but that part of the code is untested, as I don't have a code
base that uses it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130246 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
b5142bb7af5c70fffd09f05172a1379a35a9c29a 16-Mar-2011 Chandler Carruth <chandlerc@gmail.com> Add a 'RawPath' parameter to the PPCallbacks interface. This allows
clients to observe the exact path through which an #included file was
located. This is very useful when trying to record and replay inclusion
operations without it beind influenced by the aggressive caching done
inside the FileManager to avoid redundant system calls and filesystem
operations.

The work to compute and return this is only done in the presence of
callbacks, so it should have no effect on normal compilation.

Patch by Manuel Klimek.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127742 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
2aa9267cf193e5eceb9fd24a51b51c031b606fe9 19-Nov-2010 Craig Silverstein <csilvers2000@yahoo.com> Several PPCallbacks take an SourceLocation + IdentifierInfo, rather
than a Token that holds the same information all in one easy-to-use
package. There's no technical reason to prefer the former -- the
information comes from a Token originally -- and it's clumsier to use,
so I've changed the code to use tokens everywhere.

Approved by clattner


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119845 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
4ab829c2a229dc20ecb9f35e7337bbfa95bf4026 01-Nov-2010 Douglas Gregor <dgregor@apple.com> Plug a leak in the preprocessing record's handling of inclusion
directives. We had a std::string in an object that was allocated via a
BumpPtrAllocator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117912 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
ecdcb883cbc6bb4a2445dc6f02d58d9bdb54a0ed 21-Oct-2010 Douglas Gregor <dgregor@apple.com> Extend the preprocessing record and libclang with support for
inclusion directives, keeping track of every #include, #import,
etc. in the translation unit. We keep track of the source location and
kind of the inclusion, how the file name was spelled, and the
underlying file to which the inclusion resolved.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116952 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
2f05449fa1c9015a84b74c3308b856fc704662be 08-Aug-2010 Benjamin Kramer <benny.kra@googlemail.com> Push location through the MacroUndefined PPCallback and use it to print #undefs in -dD mode. (PR7818)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110523 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
1b058e8956ea29a7fb7649fdee2b80581dcbdf39 19-Mar-2010 Douglas Gregor <dgregor@apple.com> Robustify PreprocessingRecord slightly, by only creating macro
instantiations when we have the corresponding macro definition and by
removing macro definition information from our table when the macro is
undefined.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99004 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
6a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bc 19-Mar-2010 Douglas Gregor <dgregor@apple.com> Implement serialization and lazy deserialization of the preprocessing
record (which includes all macro instantiations and definitions). As
with all lay deserialization, this introduces a new external source
(here, an external preprocessing record source) that loads all of the
preprocessed entities prior to iterating over the entities.

The preprocessing record is an optional part of the precompiled header
that is disabled by default (enabled with
-detailed-preprocessing-record). When the preprocessor given to the
PCH writer has a preprocessing record, that record is written into the
PCH file. When the PCH reader is given a PCH file that contains a
preprocessing record, it will be lazily loaded (which, effectively,
implicitly adds -detailed-preprocessing-record). This is the first
case where we have sections of the precompiled header that are
added/removed based on a compilation flag, which is
unfortunate. However, this data consumes ~550k in the PCH file for
Cocoa.h (out of ~9.9MB), and there is a non-trivial cost to gathering
this detailed preprocessing information, so it's too expensive to turn
on by default. In the future, we should investigate a better encoding
of this information.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99002 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
b9e1b75772db2c7db566c6034ba90a07f22e35eb 19-Mar-2010 Douglas Gregor <dgregor@apple.com> Make the preprocessing record a PPCallbacks subclass itself,
eliminating the extra PopulatePreprocessingRecord object. This will
become useful once we start writing the preprocessing record to
precompiled headers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98966 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
94dc8f640ebea52241412512ed48601626edbc58 19-Mar-2010 Douglas Gregor <dgregor@apple.com> Optionally store a PreprocessingRecord in the preprocessor itself, and
tie its creation to a CC1 flag -detailed-preprocessing-record.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98963 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
bf7efa2742dc94363d3561d284c9d634fc5a780f 18-Mar-2010 Douglas Gregor <dgregor@apple.com> Explicitly link macro instantiations to macro definitions in the
preprocessing record. Use that link with clang_getCursorReferenced()
and clang_getCursorDefinition() to match instantiations of a macro to
the definition of the macro.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98842 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
4ae8f298b1ea51b4c2234f9148e2e4349c9bdd23 18-Mar-2010 Douglas Gregor <dgregor@apple.com> Introduce the notion of a "preprocessing record", which keeps track of
the macro definitions and macro instantiations that are found
during preprocessing. Preprocessing records are *not* generated by
default; rather, we provide a PPCallbacks subclass that hooks into the
existing callback mechanism to record this activity.

The only client of preprocessing records is CIndex, which keeps track
of macro definitions and instantations so that they can be exposed via
cursors. At present, only token annotation uses these facilities, and
only for macro instantiations; both will change in the near
future. However, with this change, token annotation properly annotates
macro instantiations that do not produce any tokens and instantiations
of macros that are later undef'd, improving our consistency.

Preprocessing directives that are not macro definitions are still
handled by clang_annotateTokens() via re-lexing, so that we don't have
to track every preprocessing directive in the preprocessing record.

Performance impact of preprocessing records is still TBD, although it
is limited to CIndex and therefore out of the path of the main compiler.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98836 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp