From 81eb4c4e5cb59ce919c2b24ef4b9b1610a8483d9 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 9 Sep 2001 21:02:38 +0000 Subject: Clean up Type class by removing mutable ConstRules member and use annotations insead llvm-svn: 516 --- llvm/lib/Support/Annotation.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'llvm/lib/Support/Annotation.cpp') 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. // -- cgit v1.2.3