[cfe-commits] r114014 - in /cfe/trunk: include/clang/Serialization/ASTBitCodes.h include/clang/Serialization/ASTReader.h include/clang/Serialization/ASTWriter.h lib/Serialization/ASTReader.cpp lib/Serialization/ASTWriter.cpp
Sebastian Redl
sebastian.redl at getdesigned.at
Wed Sep 15 12:54:12 PDT 2010
Author: cornedbee
Date: Wed Sep 15 14:54:06 2010
New Revision: 114014
URL: http://llvm.org/viewvc/llvm-project?rev=114014&view=rev
Log:
Macro definitions in AST files have their own IDs.
Modified:
cfe/trunk/include/clang/Serialization/ASTBitCodes.h
cfe/trunk/include/clang/Serialization/ASTReader.h
cfe/trunk/include/clang/Serialization/ASTWriter.h
cfe/trunk/lib/Serialization/ASTReader.cpp
cfe/trunk/lib/Serialization/ASTWriter.cpp
Modified: cfe/trunk/include/clang/Serialization/ASTBitCodes.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ASTBitCodes.h?rev=114014&r1=114013&r2=114014&view=diff
==============================================================================
--- cfe/trunk/include/clang/Serialization/ASTBitCodes.h (original)
+++ cfe/trunk/include/clang/Serialization/ASTBitCodes.h Wed Sep 15 14:54:06 2010
@@ -112,10 +112,13 @@
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
Modified: cfe/trunk/include/clang/Serialization/ASTReader.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ASTReader.h?rev=114014&r1=114013&r2=114014&view=diff
==============================================================================
--- cfe/trunk/include/clang/Serialization/ASTReader.h (original)
+++ cfe/trunk/include/clang/Serialization/ASTReader.h Wed Sep 15 14:54:06 2010
@@ -1028,7 +1028,7 @@
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; }
Modified: cfe/trunk/include/clang/Serialization/ASTWriter.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ASTWriter.h?rev=114014&r1=114013&r2=114014&view=diff
==============================================================================
--- cfe/trunk/include/clang/Serialization/ASTWriter.h (original)
+++ cfe/trunk/include/clang/Serialization/ASTWriter.h Wed Sep 15 14:54:06 2010
@@ -173,8 +173,8 @@
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
@@ -353,7 +353,7 @@
/// \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);
Modified: cfe/trunk/lib/Serialization/ASTReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReader.cpp?rev=114014&r1=114013&r2=114014&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTReader.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTReader.cpp Wed Sep 15 14:54:06 2010
@@ -1545,7 +1545,7 @@
}
}
-MacroDefinition *ASTReader::getMacroDefinition(IdentID ID) {
+MacroDefinition *ASTReader::getMacroDefinition(MacroID ID) {
if (ID == 0 || ID >= MacroDefinitionsLoaded.size())
return 0;
Modified: cfe/trunk/lib/Serialization/ASTWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriter.cpp?rev=114014&r1=114013&r2=114014&view=diff
==============================================================================
--- cfe/trunk/lib/Serialization/ASTWriter.cpp (original)
+++ cfe/trunk/lib/Serialization/ASTWriter.cpp Wed Sep 15 14:54:06 2010
@@ -1349,7 +1349,7 @@
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);
@@ -2717,11 +2717,11 @@
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;
More information about the cfe-commits
mailing list