Annotations are const objects now
authorChris Lattner <sabre@nondot.org>
Fri, 7 Sep 2001 16:44:01 +0000 (16:44 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 7 Sep 2001 16:44:01 +0000 (16:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@458 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/Annotation.cpp
support/lib/Support/Annotation.cpp

index e98662078945590e59f7b337ad84b51af83b6b9e..fabf34b2db78da319788a3e1a56e9e096f55d752 100644 (file)
@@ -14,7 +14,7 @@ static unsigned IDCounter = 0;  // Unique ID counter
 static IDMapType &getIDMap() { static IDMapType TheMap; return TheMap; }
 
 // On demand annotation creation support...
-typedef Annotation *(*AnnFactory)(AnnotationID, Annotable *, void *);
+typedef Annotation *(*AnnFactory)(AnnotationID, const Annotable *, void *);
 typedef map<unsigned, pair<AnnFactory,void*> > FactMapType;
 static FactMapType &getFactMap() { static FactMapType FactMap; return FactMap; }
 
@@ -57,7 +57,7 @@ void AnnotationManager::registerAnnotationFactory(AnnotationID ID,
 // specified object, using a register annotation creation function.
 //
 Annotation *AnnotationManager::createAnnotation(AnnotationID ID, 
-                                               Annotable *Obj) {
+                                               const Annotable *Obj) {
   FactMapType::iterator I = getFactMap().find(ID.ID);
   if (I == getFactMap().end()) return 0;
   return I->second.first(ID, Obj, I->second.second);
index e98662078945590e59f7b337ad84b51af83b6b9e..fabf34b2db78da319788a3e1a56e9e096f55d752 100644 (file)
@@ -14,7 +14,7 @@ static unsigned IDCounter = 0;  // Unique ID counter
 static IDMapType &getIDMap() { static IDMapType TheMap; return TheMap; }
 
 // On demand annotation creation support...
-typedef Annotation *(*AnnFactory)(AnnotationID, Annotable *, void *);
+typedef Annotation *(*AnnFactory)(AnnotationID, const Annotable *, void *);
 typedef map<unsigned, pair<AnnFactory,void*> > FactMapType;
 static FactMapType &getFactMap() { static FactMapType FactMap; return FactMap; }
 
@@ -57,7 +57,7 @@ void AnnotationManager::registerAnnotationFactory(AnnotationID ID,
 // specified object, using a register annotation creation function.
 //
 Annotation *AnnotationManager::createAnnotation(AnnotationID ID, 
-                                               Annotable *Obj) {
+                                               const Annotable *Obj) {
   FactMapType::iterator I = getFactMap().find(ID.ID);
   if (I == getFactMap().end()) return 0;
   return I->second.first(ID, Obj, I->second.second);