From: Argyrios Kyrtzidis Date: Mon, 7 Jan 2013 19:16:23 +0000 (+0000) Subject: [PCH] (De)serialize the end location of MacroInfo. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8169b671974fc15b6059b1e9532f7f3207d79786;p=clang [PCH] (De)serialize the end location of MacroInfo. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171772 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Serialization/ASTReader.cpp b/lib/Serialization/ASTReader.cpp index f415573db8..eca9918a79 100644 --- a/lib/Serialization/ASTReader.cpp +++ b/lib/Serialization/ASTReader.cpp @@ -1144,6 +1144,7 @@ void ASTReader::ReadMacroRecord(ModuleFile &F, uint64_t Offset, unsigned NextIndex = 3; SourceLocation Loc = ReadSourceLocation(F, Record, NextIndex); MacroInfo *MI = PP.AllocateMacroInfo(Loc); + MI->setDefinitionEndLoc(ReadSourceLocation(F, Record, NextIndex)); // Record this macro. MacrosLoaded[GlobalID - NUM_PREDEF_MACRO_IDS] = MI; diff --git a/lib/Serialization/ASTWriter.cpp b/lib/Serialization/ASTWriter.cpp index 887876f284..ac2409833f 100644 --- a/lib/Serialization/ASTWriter.cpp +++ b/lib/Serialization/ASTWriter.cpp @@ -1853,6 +1853,7 @@ void ASTWriter::WritePreprocessor(const Preprocessor &PP, bool IsModule) { addMacroRef(MI, Record); Record.push_back(inferSubmoduleIDFromLocation(MI->getDefinitionLoc())); AddSourceLocation(MI->getDefinitionLoc(), Record); + AddSourceLocation(MI->getDefinitionEndLoc(), Record); AddSourceLocation(MI->getUndefLoc(), Record); Record.push_back(MI->isUsed()); Record.push_back(MI->isPublic());