diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-05-06 16:33:08 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-05-06 16:33:08 +0000 |
commit | 998caead7041603154c67f23e65744bdfc88c479 (patch) | |
tree | 8eb34e493da0af222aa3185854078df486af051d /clang/lib/Lex/Preprocessor.cpp | |
parent | 705d25a1f408a0f59ff9f7657c2620d175f91911 (diff) | |
download | bcm5719-llvm-998caead7041603154c67f23e65744bdfc88c479.tar.gz bcm5719-llvm-998caead7041603154c67f23e65744bdfc88c479.zip |
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>.
llvm-svn: 130990
Diffstat (limited to 'clang/lib/Lex/Preprocessor.cpp')
-rw-r--r-- | clang/lib/Lex/Preprocessor.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp index 31fd667a651..fdc18f87818 100644 --- a/clang/lib/Lex/Preprocessor.cpp +++ b/clang/lib/Lex/Preprocessor.cpp @@ -527,10 +527,11 @@ CommentHandler::~CommentHandler() { } CodeCompletionHandler::~CodeCompletionHandler() { } -void Preprocessor::createPreprocessingRecord() { +void Preprocessor::createPreprocessingRecord( + bool IncludeNestedMacroInstantiations) { if (Record) return; - Record = new PreprocessingRecord; + Record = new PreprocessingRecord(IncludeNestedMacroInstantiations); addPPCallbacks(Record); } |