typedef llvm::DenseMap<QualType, TypeIdx, UnsafeQualTypeDenseMapInfo>
TypeIdxMap;
- /// \brief An ID number that refers to an identifier in an AST
- /// file.
+ /// \brief An ID number that refers to an identifier in an AST file.
typedef uint32_t IdentID;
+ /// \brief An ID number that refers to a macro in an AST file.
+ typedef uint32_t MacroID;
+
+ /// \brief An ID number that refers to an ObjC selctor in an AST file.
typedef uint32_t SelectorID;
/// \brief Describes the various kinds of blocks that occur within
virtual void ReadDefinedMacros();
/// \brief Retrieve the macro definition with the given ID.
- MacroDefinition *getMacroDefinition(serialization::IdentID ID);
+ MacroDefinition *getMacroDefinition(serialization::MacroID ID);
/// \brief Retrieve the AST context that this AST reader supplements.
ASTContext *getContext() { return Context; }
llvm::DenseMap<const IdentifierInfo *, uint64_t> MacroOffsets;
/// \brief Mapping from macro definitions (as they occur in the preprocessing
- /// record) to the index into the macro definitions table.
- llvm::DenseMap<const MacroDefinition *, serialization::IdentID>
+ /// record) to the macro IDs.
+ llvm::DenseMap<const MacroDefinition *, serialization::MacroID>
MacroDefinitions;
/// \brief Mapping from the macro definition indices in \c MacroDefinitions
/// \brief Retrieve the ID number corresponding to the given macro
/// definition.
- serialization::IdentID getMacroDefinitionID(MacroDefinition *MD);
+ serialization::MacroID getMacroDefinitionID(MacroDefinition *MD);
/// \brief Emit a reference to a type.
void AddTypeRef(QualType T, RecordData &Record);
}
}
-MacroDefinition *ASTReader::getMacroDefinition(IdentID ID) {
+MacroDefinition *ASTReader::getMacroDefinition(MacroID ID) {
if (ID == 0 || ID >= MacroDefinitionsLoaded.size())
return 0;
if (MacroDefinition *MD = dyn_cast<MacroDefinition>(*E)) {
// Record this macro definition's location.
- IdentID ID = getMacroDefinitionID(MD);
+ MacroID ID = getMacroDefinitionID(MD);
if (ID != MacroDefinitionOffsets.size()) {
if (ID > MacroDefinitionOffsets.size())
MacroDefinitionOffsets.resize(ID + 1);
return ID;
}
-IdentID ASTWriter::getMacroDefinitionID(MacroDefinition *MD) {
+MacroID ASTWriter::getMacroDefinitionID(MacroDefinition *MD) {
if (MD == 0)
return 0;
-
- IdentID &ID = MacroDefinitions[MD];
+
+ MacroID &ID = MacroDefinitions[MD];
if (ID == 0)
ID = MacroDefinitions.size();
return ID;