summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-09-09 21:02:38 +0000
committerChris Lattner <sabre@nondot.org>2001-09-09 21:02:38 +0000
commit81eb4c4e5cb59ce919c2b24ef4b9b1610a8483d9 (patch)
treec7c774c656a518193df6065fdce7f7c92107736d
parent61607ee88030fffff9d33cc719b3cb44dff0c215 (diff)
downloadbcm5719-llvm-81eb4c4e5cb59ce919c2b24ef4b9b1610a8483d9.tar.gz
bcm5719-llvm-81eb4c4e5cb59ce919c2b24ef4b9b1610a8483d9.zip
Clean up Type class by removing mutable ConstRules member and use annotations insead
llvm-svn: 516
-rw-r--r--llvm/lib/Support/Annotation.cpp10
-rw-r--r--llvm/lib/VMCore/Type.cpp1
-rw-r--r--llvm/support/lib/Support/Annotation.cpp10
3 files changed, 20 insertions, 1 deletions
diff --git a/llvm/lib/Support/Annotation.cpp b/llvm/lib/Support/Annotation.cpp
index fabf34b2db7..65a049d42dc 100644
--- a/llvm/lib/Support/Annotation.cpp
+++ b/llvm/lib/Support/Annotation.cpp
@@ -28,6 +28,16 @@ AnnotationID AnnotationManager::getID(const string &Name) { // Name -> ID
return I->second;
}
+// getID - Name -> ID + registration of a factory function for demand driven
+// annotation support.
+AnnotationID AnnotationManager::getID(const string &Name, Factory Fact,
+ void *Data=0) {
+ AnnotationID Result(getID(Name));
+ registerAnnotationFactory(Result, Fact, Data);
+ return Result;
+}
+
+
// getName - This function is especially slow, but that's okay because it should
// only be used for debugging.
//
diff --git a/llvm/lib/VMCore/Type.cpp b/llvm/lib/VMCore/Type.cpp
index 033ca952c4c..87fa581a573 100644
--- a/llvm/lib/VMCore/Type.cpp
+++ b/llvm/lib/VMCore/Type.cpp
@@ -29,7 +29,6 @@ Type::Type(const string &name, PrimitiveID id)
setDescription(name);
ID = id;
Abstract = false;
- ConstRulesImpl = 0;
UID = CurUID++; // Assign types UID's as they are created
UIDMappings.push_back(this);
}
diff --git a/llvm/support/lib/Support/Annotation.cpp b/llvm/support/lib/Support/Annotation.cpp
index fabf34b2db7..65a049d42dc 100644
--- a/llvm/support/lib/Support/Annotation.cpp
+++ b/llvm/support/lib/Support/Annotation.cpp
@@ -28,6 +28,16 @@ AnnotationID AnnotationManager::getID(const string &Name) { // Name -> ID
return I->second;
}
+// getID - Name -> ID + registration of a factory function for demand driven
+// annotation support.
+AnnotationID AnnotationManager::getID(const string &Name, Factory Fact,
+ void *Data=0) {
+ AnnotationID Result(getID(Name));
+ registerAnnotationFactory(Result, Fact, Data);
+ return Result;
+}
+
+
// getName - This function is especially slow, but that's okay because it should
// only be used for debugging.
//
OpenPOWER on IntegriCloud