summaryrefslogtreecommitdiff
path: root/lib/Lex/PPLexerChange.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2014-04-09 18:21:23 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2014-04-09 18:21:23 +0000
commit99a20e0f3d818ad9993d304ae73f285c0c937a73 (patch)
treee041e41d0609d5049dce7bc28c315d14b3428787 /lib/Lex/PPLexerChange.cpp
parentcc18b95ae140feaee1387ebd06e962a4e066ecec (diff)
downloadclang-99a20e0f3d818ad9993d304ae73f285c0c937a73.tar.gz
clang-99a20e0f3d818ad9993d304ae73f285c0c937a73.tar.bz2
clang-99a20e0f3d818ad9993d304ae73f285c0c937a73.tar.xz
[Preprocessor/CodeComplete] Don't add include guard macros to code-completion results.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205917 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/PPLexerChange.cpp')
-rw-r--r--lib/Lex/PPLexerChange.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Lex/PPLexerChange.cpp b/lib/Lex/PPLexerChange.cpp
index 949cd63262..0b1be09d87 100644
--- a/lib/Lex/PPLexerChange.cpp
+++ b/lib/Lex/PPLexerChange.cpp
@@ -284,6 +284,10 @@ bool Preprocessor::HandleEndOfFile(Token &Result, bool isEndOfMacro) {
if (const FileEntry *FE =
SourceMgr.getFileEntryForID(CurPPLexer->getFileID())) {
HeaderInfo.SetFileControllingMacro(FE, ControllingMacro);
+ if (MacroInfo *MI =
+ getMacroInfo(const_cast<IdentifierInfo*>(ControllingMacro))) {
+ MI->UsedForHeaderGuard = true;
+ }
if (const IdentifierInfo *DefinedMacro =
CurPPLexer->MIOpt.GetDefinedMacro()) {
if (!ControllingMacro->hasMacroDefinition() &&