History log of /external/clang/lib/Lex/PreprocessingRecord.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
6bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89 29-May-2014 Stephen Hines <srhines@google.com> Update Clang for 3.5 rebase (r209713).

Change-Id: I8c9133b0f8f776dc915f270b60f94962e771bc83
/external/clang/lib/Lex/PreprocessingRecord.cpp
651f13cea278ec967336033dd032faef0e9fc2ec 24-Apr-2014 Stephen Hines <srhines@google.com> Updated to Clang 3.5a.

Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
/external/clang/lib/Lex/PreprocessingRecord.cpp
6fb63ab0c74bb777772a3c3ecec09799e275599a 19-Jul-2013 John Thompson <John.Thompson.JTSoftware@gmail.com> Add SourceRange to PPCallbacks::Defined callback.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186707 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
dd08a0c178329ec16cb9e494e6880f3991708b93 04-May-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> [Preprocessor] For the MacroExpands preprocessor callback, also pass the MacroArgs object that provides information about
the argument tokens for a function macro.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181065 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
c56fff7fd231aebf4b152f60f8f11ef91835c48a 26-Mar-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> [Preprocessor/Modules] Separate the macro directives kinds into their own MacroDirective's subclasses.

For each macro directive (define, undefine, visibility) have a separate object that gets chained
to the macro directive history. This has several benefits:

-No need to mutate a MacroDirective when there is a undefine/visibility directive. Stuff like
PPMutationListener become unnecessary.
-No need to keep extra source locations for the undef/visibility locations for the define directive object
(which is the majority of the directives)
-Much easier to hide/unhide a section in the macro directive history.
-Easier to track the effects of the directives across different submodules.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178037 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
c515978bd3a703aa733f846a0094ffa84d149074 24-Feb-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> [preprocessor] Use MacroDirective in the preprocessor callbacks to make available the
full information about the macro (e.g if it was imported and where).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175978 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
0b849d34b3a9574615e98e108db4e8099e9032e0 22-Feb-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> [preprocessing record] Have the MacroDefinitions map point to the MacroDefinition object instead
its index in the preprocessed entities vector.

This is because the order of the entities in the vector can change in some (uncommon) cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175907 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
dc84cd5efdd3430efb22546b4ac656aa0540b210 20-Feb-2013 David Blaikie <dblaikie@gmail.com> Include llvm::Optional in clang/Basic/LLVM.h

Post-commit CR feedback from Jordan Rose regarding r175594.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175679 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
064d88e0f9a3f1deca71b98931361f3f5c9ce192 12-Feb-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> [preprocessing record] Add some sanity checks for the preprocessed entity index
to make sure we don't crash on release if the index is not valid.

rdar://13089714

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175010 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
36845474e217b952c720f4f87923bc78059640c5 16-Jan-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> [preprocessor] Call the MacroUndefined callback even when the macro was not defined.

Patch by Enea Zaffanella!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172623 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
d017e42af00c2e7c380d0f9b27c81734f4b2844e 10-Jan-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> [PreprocessingRecord] A macro expansion can be reported out-of-order in cases when
there are macro expansions inside macro arguments where the arguments are
not expanded in the same order as listed; don't assert that all macro expansions
are in source order.

rdar://12397063

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172018 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
5f5250b140544436eb3c2fbd9f43e14019ef01f2 08-Dec-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Resolve a cursor that points to a macro name inside a #ifdef/#ifndef
directive as a macro expansion.

This is more of a "macro reference" than a macro expansion but it's close enough
for libclang's purposes. If it causes issues we can revisit and introduce a new
kind of cursor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169666 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
55fc873017f10f6f566b182b70f6fc22aefa3464 04-Dec-2012 Chandler Carruth <chandlerc@gmail.com> Sort all of Clang's files under 'lib', and fix up the broken headers
uncovered.

This required manually correcting all of the incorrect main-module
headers I could find, and running the new llvm/utils/sort_includes.py
script over the files.

I also manually added quite a few missing headers that were uncovered by
shuffling the order or moving headers up to be main-module-headers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169237 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
37ed12720a35b7bfa1c4de73ad6f1c6c1c88ee17 04-Dec-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Refactor recording the preprocessor conditional directive regions out of
PreprocessingRecord and into its own class, PPConditionalDirectiveRecord.

Decoupling allows a client to use the functionality of PPConditionalDirectiveRecord
without needing a PreprocessingRecord.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169229 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
df1059cac42d613547d86b4e44c5e364bfc03073 04-Dec-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> In the PreprocessingRecord, to identify the different conditional directive regions
use the SourceLocation at the start of the respective region, instead of a unique integer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169228 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
f03b888a12ccff7d54ddd8a79a0141cf23adbf67 05-Oct-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [preprocessing record] Have PPEntityID be independent of the size of the
loaded entities vector, otherwise its meaning will change when a module
is imported and the vector size changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165278 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
8dd927cf03e85b942f323eebb42e06c839887ebb 02-Oct-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add info in the preprocessing record whether an inclusion directive
resulted in an automatic module import.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165022 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
f8afcffe6a0213760b64c211812b1750e1e1e967 29-Sep-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> For PPCallbacks::InclusionDirective() add a parameter for the module, whenever
an inclusion directive was automatically turned into a module import, and
PPCallbacks::moduleImport() for an explicit module import.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164874 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
da313592441db36cf4b06be97c4bcc238ee6fa9c 27-Sep-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Per discussion in http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120917/064551.html
have PPCallbacks::InclusionDirective pass the character range for the filename quotes or brackets.

rdar://11113134 & http://llvm.org/PR13880

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164743 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/Lex/PreprocessingRecord.cpp
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