diff options
| author | Eric Liu <ioeric@google.com> | 2018-09-05 14:59:17 +0000 |
|---|---|---|
| committer | Eric Liu <ioeric@google.com> | 2018-09-05 14:59:17 +0000 |
| commit | d485df17d582f5134a5cfd3e13f4d02b4b7182bd (patch) | |
| tree | a7a76cf84085cee62d7edbbcea8308a71fe4c8a5 /clang/lib/Sema | |
| parent | fcc97daa8ae6f3e4899546f80f1f03f08cb0005b (diff) | |
| download | bcm5719-llvm-d485df17d582f5134a5cfd3e13f4d02b4b7182bd.tar.gz bcm5719-llvm-d485df17d582f5134a5cfd3e13f4d02b4b7182bd.zip | |
[Sema] Store MacroInfo in CodeCompletionResult for macro results.
Summary:
This provides information about the macro definition. For example, it
can be used to compute macro USRs.
Reviewers: sammccall
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D51675
llvm-svn: 341476
Diffstat (limited to 'clang/lib/Sema')
| -rw-r--r-- | clang/lib/Sema/SemaCodeComplete.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/clang/lib/Sema/SemaCodeComplete.cpp b/clang/lib/Sema/SemaCodeComplete.cpp index e0adf38f93e..7ba94c6e0e2 100644 --- a/clang/lib/Sema/SemaCodeComplete.cpp +++ b/clang/lib/Sema/SemaCodeComplete.cpp @@ -3313,14 +3313,14 @@ static void AddMacroResults(Preprocessor &PP, ResultBuilder &Results, M != MEnd; ++M) { auto MD = PP.getMacroDefinition(M->first); if (IncludeUndefined || MD) { - if (MacroInfo *MI = MD.getMacroInfo()) - if (MI->isUsedForHeaderGuard()) - continue; + MacroInfo *MI = MD.getMacroInfo(); + if (MI && MI->isUsedForHeaderGuard()) + continue; - Results.AddResult(Result(M->first, - getMacroUsagePriority(M->first->getName(), - PP.getLangOpts(), - TargetTypeIsPointer))); + Results.AddResult( + Result(M->first, MI, + getMacroUsagePriority(M->first->getName(), PP.getLangOpts(), + TargetTypeIsPointer))); } } |

