X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FSupport%2FAnnotation.cpp;h=e876bf4f38b27ccdf5363897880b835f5218059a;hb=448f4949dc686d22feb81281560f1c43bca15639;hp=fabf34b2db78da319788a3e1a56e9e096f55d752;hpb=c0f483d4ef432b42f6996dc46edddef46367ad20;p=oota-llvm.git diff --git a/lib/Support/Annotation.cpp b/lib/Support/Annotation.cpp index fabf34b2db7..e876bf4f38b 100644 --- a/lib/Support/Annotation.cpp +++ b/lib/Support/Annotation.cpp @@ -6,6 +6,10 @@ #include #include "llvm/Annotation.h" +using std::string; +using std::map; +using std::pair; +using std::make_pair; typedef map IDMapType; static unsigned IDCounter = 0; // Unique ID counter @@ -28,6 +32,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) { + 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. //