From 7572be2e447b8b1762479a58b4dc3617db0ce120 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Mon, 7 Jan 2013 19:16:23 +0000 Subject: [PATCH] [PCH] (De)serialize the end location of MacroInfo. llvm-svn: 171772 --- clang/lib/Serialization/ASTReader.cpp | 1 + clang/lib/Serialization/ASTWriter.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index f415573db808..eca9918a7905 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/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/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index 887876f28427..ac2409833f37 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/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());