aboutsummaryrefslogtreecommitdiff
path: root/lib/Support/Annotation.cpp
diff options
context:
space:
mode:
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 fabf34b2db..65a049d42d 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.
//