aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support/Annotation.cpp
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
commit82072d47436a8e150bad42c9c3bf230617d53608 (patch)
treeeab556439839c220ecd118085999aba32fd4eff4 /lib/Support/Annotation.cpp
parent14712a6abf2587666e8171cbb6ebe6ffab3ea514 (diff)
downloadexternal_llvm-82072d47436a8e150bad42c9c3bf230617d53608.zip
external_llvm-82072d47436a8e150bad42c9c3bf230617d53608.tar.gz
external_llvm-82072d47436a8e150bad42c9c3bf230617d53608.tar.bz2
Clean up Type class by removing mutable ConstRules member and use annotations insead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@516 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Annotation.cpp')
-rw-r--r--lib/Support/Annotation.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Support/Annotation.cpp b/lib/Support/Annotation.cpp
index fabf34b..65a049d 100644
--- a/lib/Support/Annotation.cpp
+++ b/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.
//