/// \brief Retrieve the macro definition with the given ID.
MacroDefinition *getMacroDefinition(serialization::MacroID ID);
+ /// \brief Retrieve the global macro definition ID that corresponds to the
+ /// local macro definition ID within a given module.
+ serialization::MacroID getGlobalMacroDefinitionID(Module &M,
+ unsigned LocalID);
+
+ /// \brief Deserialize a macro definition that is local to the given
+ /// module.
+ MacroDefinition *getLocalMacroDefinition(Module &M, unsigned LocalID) {
+ return getMacroDefinition(getGlobalMacroDefinitionID(M, LocalID));
+ }
+
/// \brief Retrieve the AST context that this AST reader supplements.
ASTContext *getContext() { return Context; }
public:
/// \brief Pair of begin/end iterators for DeclIDs.
+ ///
+ /// Note that these declaration IDs are local to the module that contains this
+ /// particular lookup t
typedef std::pair<DeclID *, DeclID *> data_type;
/// \brief Special internal key for declaration names.
if (NextIndex + 1 == Record.size() && PP->getPreprocessingRecord()) {
// We have a macro definition. Load it now.
PP->getPreprocessingRecord()->RegisterMacroDefinition(Macro,
- getMacroDefinition(Record[NextIndex]));
+ getLocalMacroDefinition(F, Record[NextIndex]));
}
++NumMacrosRead;
new (PPRec) MacroExpansion(getLocalIdentifier(F, Record[3]),
SourceRange(ReadSourceLocation(F, Record[1]),
ReadSourceLocation(F, Record[2])),
- getMacroDefinition(Record[4]));
+ getLocalMacroDefinition(F, Record[4]));
PPRec.setLoadedPreallocatedEntity(Record[0], ME);
return ME;
}
return File;
}
+MacroID ASTReader::getGlobalMacroDefinitionID(Module &M, unsigned LocalID) {
+ // FIXME: Local-to-global mapping
+ return LocalID;
+}
+
/// \brief If we are loading a relocatable PCH file, and the filename is
/// not an absolute path, add the system root to the beginning of the file
/// name.